55
66/**
77 * @def VIRTIO_DEVICE_NET_MODERN
8- * @brief PCI device ID for modern (non-transitional) virtio-net.
8+ * @brief PCI device ID for modern (non-transitional) virtio-net
99 *
10- * Transitional virtio-net typically reports 0x1000; modern devices use 0x1041.
10+ * Transitional virtio-net typically reports 0x1000; modern devices use 0x1041
1111 */
1212#define VIRTIO_DEVICE_NET_MODERN 0x1041
1313
1414/**
1515 * @def VIRTIO_PCI_CAP_COMMON_CFG
16- * @brief Vendor capability: common configuration MMIO window selector.
16+ * @brief Vendor capability: common configuration MMIO window selector
1717 */
1818#define VIRTIO_PCI_CAP_COMMON_CFG 1
1919/**
2020 * @def VIRTIO_PCI_CAP_NOTIFY_CFG
21- * @brief Vendor capability: notify (doorbell) MMIO window selector.
21+ * @brief Vendor capability: notify (doorbell) MMIO window selector
2222 */
2323#define VIRTIO_PCI_CAP_NOTIFY_CFG 2
2424/**
2525 * @def VIRTIO_PCI_CAP_ISR_CFG
26- * @brief Vendor capability: ISR byte MMIO window selector (legacy/INTx paths).
26+ * @brief Vendor capability: ISR byte MMIO window selector (legacy/INTx paths)
2727 */
2828#define VIRTIO_PCI_CAP_ISR_CFG 3
2929/**
3030 * @def VIRTIO_PCI_CAP_DEVICE_CFG
31- * @brief Vendor capability: device-specific configuration MMIO window selector.
31+ * @brief Vendor capability: device-specific configuration MMIO window selector
3232 */
3333#define VIRTIO_PCI_CAP_DEVICE_CFG 4
3434
3535/**
3636 * @def VIRTIO_F_VERSION_1
37- * @brief Feature bit indicating the device speaks modern virtio 1.x.
37+ * @brief Feature bit indicating the device speaks modern virtio 1.x
3838 *
39- * This lives in the upper 32-bit feature word; keep the constant 64-bit.
39+ * This lives in the upper 32-bit feature word; keep the constant 64-bit
4040 */
4141#define VIRTIO_F_VERSION_1 (1ULL << 32)
4242/**
4343 * @def VIRTIO_NET_F_MAC
44- * @brief Feature bit: device exposes a fixed MAC address in its config space.
44+ * @brief Feature bit: device exposes a fixed MAC address in its config space
4545 */
4646#define VIRTIO_NET_F_MAC (1 << 5)
4747
4848/**
4949 * @def VIRTQ_DESC_F_NEXT
50- * @brief Virtqueue descriptor flag: this entry chains to `next`.
50+ * @brief Virtqueue descriptor flag: this entry chains to `next`
5151 */
5252#define VIRTQ_DESC_F_NEXT 1
5353/**
5454 * @def VIRTQ_DESC_F_WRITE
55- * @brief Virtqueue descriptor flag: device may write to this buffer.
55+ * @brief Virtqueue descriptor flag: device may write to this buffer
5656 */
5757#define VIRTQ_DESC_F_WRITE 2
5858
5959/**
6060 * @def VNET_QSIZE
61- * @brief Driver’s requested queue size (clamped to device’s `queue_size`).
61+ * @brief Driver’s requested queue size (clamped to device’s `queue_size`)
6262 */
6363#define VNET_QSIZE 256
6464/**
6565 * @def VNET_RX_BUF_SIZE
66- * @brief Size of each posted RX buffer (must cover virtio header + frame).
66+ * @brief Size of each posted RX buffer (must cover virtio header + frame)
6767 */
6868#define VNET_RX_BUF_SIZE 2048
6969/**
7070 * @def VNET_HDR_SIZE
71- * @brief Size of the mandatory virtio-net header prepended to each packet.
71+ * @brief Size of the mandatory virtio-net header prepended to each packet
7272 */
7373#define VNET_HDR_SIZE (sizeof(virtio_net_hdr_t))
7474
7575/**
76- * @brief Device-specific configuration for virtio-net.
76+ * @brief Device-specific configuration for virtio-net
7777 *
78- * Only the fixed MAC and a status word are consumed by this driver.
78+ * Only the fixed MAC and a status word are consumed by this driver
7979 */
8080typedef struct {
8181 /** Station MAC address provided by the device when @ref VIRTIO_NET_F_MAC is set */
@@ -85,11 +85,11 @@ typedef struct {
8585} __attribute__((packed )) virtio_net_config_t ;
8686
8787/**
88- * @brief Minimal virtio-net per-packet header (no offloads negotiated).
88+ * @brief Minimal virtio-net per-packet header (no offloads negotiated)
8989 *
90- * This header precedes every TX and RX payload. All fields are little-endian.
90+ * This header precedes every TX and RX payload. All fields are little-endian
9191 * The driver zero-initialises it; the device may fill some fields on RX when
92- * certain features are negotiated (not used here).
92+ * certain features are negotiated (not used here)
9393 */
9494typedef struct {
9595 /** Flags (eg. checksum present); unused in this minimal driver */
@@ -109,15 +109,15 @@ typedef struct {
109109} __attribute__((packed )) virtio_net_hdr_t ;
110110
111111/**
112- * @brief One-byte ISR window (legacy/INTx ack by read-to-clear).
112+ * @brief One-byte ISR window (legacy/INTx ack by read-to-clear)
113113 */
114114typedef struct {
115115 /** Interrupt cause byte; reading acknowledges in legacy paths */
116116 volatile uint8_t isr ;
117117} virtio_pci_isr_t ;
118118
119119/**
120- * @brief In-memory representation of a single virtqueue.
120+ * @brief In-memory representation of a single virtqueue
121121 */
122122typedef struct virtq {
123123 /** Queue size (power-of-two), negotiated from device `queue_size` */
@@ -139,7 +139,7 @@ typedef struct virtq {
139139} virtq_t ;
140140
141141/**
142- * @brief Driver static state for a single virtio-net instance.
142+ * @brief Driver static state for a single virtio-net instance
143143 */
144144static struct {
145145 /** Pointer to the common configuration MMIO window (from caps) */
0 commit comments