Skip to main content

Module virtio_net

Module virtio_net 

Source
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§

VirtioNetDevice
VirtIO Network Device driver
VirtioNetHeader
VirtIO net header (prepended to every packet)

Constants§

RX_FRAME_TRACK_CAPACITY 🔒

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.