|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 16 – Device Model & DMA > 16.7 Network and Fibre Channel Devices |
Network interface emulation presents a PCI NIC to the guest OS with standard MMIO-mapped control registers, a DMA-based packet transmit/receive path, and interrupt-driven completion. The guest network driver (e.g., de for DEC Tulip-family NICs, tu for TURBOchannel Ethernet) interacts with the emulated NIC through the same register interface it would use on real hardware.
The NetworkManager handles adapter lifecycle, MAC address assignment (from configuration), and the host-side network backend binding. Network I/O operates asynchronously: packet transmit is queued from an MMIO doorbell write and performed by the device's I/O thread; packet receive is driven by the host network backend notifying the device thread, which writes packet data into GuestMemory via DMA and asserts a receive interrupt.
Endianness is a particular concern for network devices. Network protocol headers (Ethernet, IP, TCP/UDP) use big-endian (network byte order), while PCI control registers are little-endian. The NIC emulator must handle both byte orders: DMA packet buffers are transferred in network byte order (the guest driver handles ntohl/ntohs conversion), while register reads and writes use little-endian PCI conventions.
The FibreDeviceManager emulates Fibre Channel HBA controllers that present FC-attached storage LUNs to the guest OS. The FC emulation layer handles FLOGI (fabric login), PLOGI (port login), and PRLI (process login) sequences during guest-side fabric discovery. FCP (Fibre Channel Protocol) commands are the FC equivalent of SCSI CDBs — the guest SCSI driver submits commands through the FC transport, and the HBA translates them into FCP information units.
FC frame headers are big-endian per the FC-FS specification. The HBA controller emulator handles frame header byte swapping internally, presenting FCP command results through the standard DMA and interrupt path. Backing storage for FC LUNs uses the same RAW partition or file system container strategies described in 16.1.3.
Implementation Status: The FibreDeviceManager structure and FC port login sequences are scaffolded. FCP command dispatch to backing storage is functional for basic SCSI read/write operations. Extended FC operations (RSCN fabric notifications, LIP loop initialization, multi-path I/O) are not yet implemented.
See Also: Chapter 10 – Devices and Memory-Mapped I/O (MMIO) (device model overview); mmioLib/mmio_DMACoherencyManager.h (~579 lines) – DMA coherency for device data transfers.