@@ -12,37 +12,47 @@ struct virtio_pci_modern_common_cfg {
12
12
__le16 queue_reset ; /* read-write */
13
13
};
14
14
15
+ /**
16
+ * struct virtio_pci_modern_device - info for modern PCI virtio
17
+ * @pci_dev: Ptr to the PCI device struct
18
+ * @common: Position of the common capability in the PCI config
19
+ * @device: Device-specific data (non-legacy mode)
20
+ * @notify_base: Base of vq notifications (non-legacy mode)
21
+ * @notify_pa: Physical base of vq notifications
22
+ * @isr: Where to read and clear interrupt
23
+ * @notify_len: So we can sanity-check accesses
24
+ * @device_len: So we can sanity-check accesses
25
+ * @notify_map_cap: Capability for when we need to map notifications per-vq
26
+ * @notify_offset_multiplier: Multiply queue_notify_off by this value
27
+ * (non-legacy mode).
28
+ * @modern_bars: Bitmask of BARs
29
+ * @id: Device and vendor id
30
+ * @device_id_check: Callback defined before vp_modern_probe() to be used to
31
+ * verify the PCI device is a vendor's expected device rather
32
+ * than the standard virtio PCI device
33
+ * Returns the found device id or ERRNO
34
+ * @dma_mask: Optional mask instead of the traditional DMA_BIT_MASK(64),
35
+ * for vendor devices with DMA space address limitations
36
+ */
15
37
struct virtio_pci_modern_device {
16
38
struct pci_dev * pci_dev ;
17
39
18
40
struct virtio_pci_common_cfg __iomem * common ;
19
- /* Device-specific data (non-legacy mode) */
20
41
void __iomem * device ;
21
- /* Base of vq notifications (non-legacy mode). */
22
42
void __iomem * notify_base ;
23
- /* Physical base of vq notifications */
24
43
resource_size_t notify_pa ;
25
- /* Where to read and clear interrupt */
26
44
u8 __iomem * isr ;
27
45
28
- /* So we can sanity-check accesses. */
29
46
size_t notify_len ;
30
47
size_t device_len ;
31
48
32
- /* Capability for when we need to map notifications per-vq. */
33
49
int notify_map_cap ;
34
50
35
- /* Multiply queue_notify_off by this value. (non-legacy mode). */
36
51
u32 notify_offset_multiplier ;
37
-
38
52
int modern_bars ;
39
-
40
53
struct virtio_device_id id ;
41
54
42
- /* optional check for vendor virtio device, returns dev_id or -ERRNO */
43
55
int (* device_id_check )(struct pci_dev * pdev );
44
-
45
- /* optional mask for devices with limited DMA space */
46
56
u64 dma_mask ;
47
57
};
48
58
0 commit comments