Skip to content

Commit a5d7df8

Browse files
emuslnmstsirkin
authored andcommitted
virtio: kdoc for struct virtio_pci_modern_device
Finally following up to Simon's suggestion for some kdoc attention on struct virtio_pci_modern_device. Link: https://lore.kernel.org/netdev/ZE%2FQS0lnUvxFacjf@corigine.com/ Cc: Simon Horman <simon.horman@corigine.com> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Eugenio Pérez <eperezma@redhat.com> Message-Id: <20230911213104.14391-1-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent fbe2993 commit a5d7df8

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

include/linux/virtio_pci_modern.h

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,47 @@ struct virtio_pci_modern_common_cfg {
1212
__le16 queue_reset; /* read-write */
1313
};
1414

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+
*/
1537
struct virtio_pci_modern_device {
1638
struct pci_dev *pci_dev;
1739

1840
struct virtio_pci_common_cfg __iomem *common;
19-
/* Device-specific data (non-legacy mode) */
2041
void __iomem *device;
21-
/* Base of vq notifications (non-legacy mode). */
2242
void __iomem *notify_base;
23-
/* Physical base of vq notifications */
2443
resource_size_t notify_pa;
25-
/* Where to read and clear interrupt */
2644
u8 __iomem *isr;
2745

28-
/* So we can sanity-check accesses. */
2946
size_t notify_len;
3047
size_t device_len;
3148

32-
/* Capability for when we need to map notifications per-vq. */
3349
int notify_map_cap;
3450

35-
/* Multiply queue_notify_off by this value. (non-legacy mode). */
3651
u32 notify_offset_multiplier;
37-
3852
int modern_bars;
39-
4053
struct virtio_device_id id;
4154

42-
/* optional check for vendor virtio device, returns dev_id or -ERRNO */
4355
int (*device_id_check)(struct pci_dev *pdev);
44-
45-
/* optional mask for devices with limited DMA space */
4656
u64 dma_mask;
4757
};
4858

0 commit comments

Comments
 (0)