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.
Functions:
Structs:
The interface virtio_net.h
defines the following functions.
common_make_virtio_net(vm, pci, ioport, ioport_range, port_type, interrupt_pin, interrupt_line, backend, emulate_bar_access)
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 byemulate_bar {bool}
: Emulate read and writes accesses to the PCI device Base Address Registers.Returns:
Back to interface description.
virtio_net_default_backend()
update these function pointers with its own custom backend.
Parameters:
No parameters
Returns:
Back to interface description.
The interface virtio_net.h
defines the following structs.
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 managementBack to interface description.
Back to top.