Interface virtio_net.h
This interface provides the ability to initalise a VMM virtio net driver. This creating a virtio PCI device in the VM’s virtual pci. This can subsequently be accessed as an ethernet interface in the guest.
Brief content:
Functions:
Structs:
Functions
The interface virtio_net.h defines the following functions.
Function common_make_virtio_net(vm, pci, ioport, ioport_range, port_type, interrupt_pin, interrupt_line, backend)
Initialise a new virtio_net device with Base Address Registers (BARs) starting at iobase and backend functions specified by the raw_iface_funcs struct. virtio_net_default_backend for default methods.
Parameters:
vm {vm_t *}: A handle to the VMpci {vmm_pci_space_t *}: PCI library instance to register virtio net deviceioport {vmm_io_port_list_t *}: IOPort library instance to register virtio net ioportioport_range {ioport_range_t}: BAR port for front end emulationport_type {ioport_type_t}: Type of ioport i.e. whether to alloc or use given rangeinterrupt_pin {unsigned int}: PCI interrupt pin e.g. INTA = 1, INTB = 2 ,…interrupt_line {unsigned int}: PCI interrupt line for virtio net IRQSbackend {struct raw_iface_funcs}: Function pointers to backend implementation. Can be initialised by
Returns:
- Pointer to an initialised virtio_net_t, NULL if error.
Back to interface description.
Function virtio_net_default_backend()
update these function pointers with its own custom backend.
Parameters:
No parameters
Returns:
- A struct with a default virtio_net backend. It is the responsibility of the caller to
Back to interface description.
Structs
The interface virtio_net.h defines the following structs.
Struct virtio_net
Virtio Net Driver Interface
Elements:
iobase {unsigned int}: IO Port base for Virtio Net deviceemul {virtio_emul_t *}: Virtio Ethernet emulation interface: VMM <-> Guestemul_driver {struct eth_driver *}: Backend Ethernet driver interface: VMM <-> Ethernet driveremul_driver_funcs {struct raw_iface_funcs}: Virtio Ethernet emulation functions: VMM <-> Guestioops {ps_io_ops_t}: Platform support ioops for dma management
Back to interface description.
Back to top.