/** * struct virtio_pci_modern_device - info for modern PCI virtio * @pci_dev: Ptr to the PCI device struct * @common: Position of the common capability in the PCI config * @device: Device-specific data (non-legacy mode) * @notify_base: Base of vq notifications (non-legacy mode) * @notify_pa: Physical base of vq notifications * @isr: Where to read and clear interrupt * @notify_len: So we can sanity-check accesses * @device_len: So we can sanity-check accesses * @notify_map_cap: Capability for when we need to map notifications per-vq * @notify_offset_multiplier: Multiply queue_notify_off by this value * (non-legacy mode). * @modern_bars: Bitmask of BARs * @id: Device and vendor id * @device_id_check: Callback defined before vp_modern_probe() to be used to * verify the PCI device is a vendor's expected device rather * than the standard virtio PCI device * Returns the found device id or ERRNO * @dma_mask: Optional mask instead of the traditional DMA_BIT_MASK(64), * for vendor devices with DMA space address limitations
*/ struct virtio_pci_modern_device { struct pci_dev *pci_dev;
u32 notify_offset_multiplier; int modern_bars; struct virtio_device_id id;
int (*device_id_check)(struct pci_dev *pdev);
u64 dma_mask;
};
/* * Type-safe wrappers for io accesses. * Use these to enforce at compile time the following spec requirement: * * The driver MUST access each field using the “natural” access * method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses * for 16-bit fields and 8-bit accesses for 8-bit fields.
*/ staticinline u8 vp_ioread8(const u8 __iomem *addr)
{ return ioread8(addr);
} staticinline u16 vp_ioread16 (const __le16 __iomem *addr)
{ return ioread16(addr);
}
staticinline u64
vp_modern_get_driver_features(struct virtio_pci_modern_device *mdev)
{
u64 features_array[VIRTIO_FEATURES_DWORDS]; int i;
vp_modern_get_driver_extended_features(mdev, features_array); for (i = 1; i < VIRTIO_FEATURES_DWORDS; ++i)
WARN_ON_ONCE(features_array[i]); return features_array[0];
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.