Expand description
VirtIO Network Device driver
Provides network I/O via VirtIO-net protocol for QEMU/KVM environments.
Implements the common crate::hardware::nic::NetworkDevice trait so
this driver plugs into the unified /dev/net/ scheme.
Reference: VirtIO spec v1.2, Section 5.1 (Network Device) https://docs.oasis-open.org/virtio/virtio/v1.4/cs01/virtio-v1.4-cs01.html#x1-2700001
Modulesยง
- features
- VirtIO net device features
- net_
status - VirtIO net status flags
Structsยง
- Virtio
NetDevice - VirtIO Network Device driver
- Virtio
NetHeader - VirtIO net header (prepended to every packet)
Constantsยง
Staticsยง
- NET_
HDR_ ๐SIZE - VirtIO net header size (12 bytes with MRG_RXBUF, 10 bytes without). Determined at runtime during feature negotiation.
- VIRTIO_
NET ๐ - Global VirtIO network device
Functionsยง
- get_
device - Get the VirtIO network device instance (if present).
- init
- Initialize VirtIO network device and register it in the global net registry.
- read_
plausible_ ๐mac - Read 6 bytes at
offsetin the device-config window and accept them only if they look like a unicast MAC (not an all-ones/all-zeros unmapped read).