23#define VIRTIO_PCI_QUEUE_SEL 0x0E
24#define VIRTIO_PCI_QUEUE_NUM 0x0C
25#define VIRTIO_PCI_QUEUE_PFN 0x08
26#define VIRTIO_PCI_QUEUE_NOTIFY 0x10
27#define VIRTQ_DESC_F_NEXT 1
28#define VIRTQ_DESC_F_WRITE 2
29#define VIRTIO_MAX_SAFE_QSIZE 16
30#define MAX_RX_DESCS VIRTIO_MAX_SAFE_QSIZE
31#define VIRTIO_PCI_HOST_FEATURES 0x00
32#define VIRTIO_PCI_GUEST_FEATURES 0x04
33#define VIRTIO_PCI_STATUS 0x12
35#define VIRTIO_STATUS_ACKNOWLEDGE 1
36#define VIRTIO_STATUS_DRIVER 2
37#define VIRTIO_STATUS_DRIVER_OK 4
#define PKG
Add attribute packed.
unsigned int u32
32-Bit Unsigned Int
unsigned short u16
16-Bit Unsigned Int
unsigned long uptr
Long Unsigned Int.
struct VirtqUsed::@206011101211064315020313161146252055034302123264 ring[]
struct VirtqUsed virtq_used
void VirtnetSetup()
Performs full setup of the VirtIO network device.
void NetStq(u32 iob)
Processes received packets from the VirtIO queue.
struct VirtqAvail virtq_avail
struct VirtqDesc virtq_desc
void VirtnetNegotiate(u32 iob)
Performs device negotiation with the VirtIO network device.
void VirtnetInit(u32 iob)
Initializes the VirtIO network queue and allocates RX buffers.