LDD Final Project Background report
Outline Paper survey Overview of design NIC driver Code survey
Paper survey Writing Drivers for the DP8390 NIC Family of Ethernet Controllers Wireless LAN resources for Linux
Design NIC driver overview Driver overview NIC Card Driver CPU Interrupt & Receive packet Transmit packet Interrupt & Receive packet Interne t
Design NIC driver overview Driver 主要負責的事情: Hardware initialization Packet transmission Receive driver Driver 可區分為兩個元件: DriverSend DriverISR
Design NIC driver overview Hardware initialization data bus width (8 or 16 bits) physical address types of interrupts that may be serviced size of the Receive Buffer Ring FIFO threshold
Design NIC driver overview Packet transmission transfer data from the memory to the host's Local Buffer Ring. Partition into two parts : DriverSend DriverISR Receive driver transfer data from the Receive Buffer Ring to the host's memory. Use command “send packet” Use pointers : BOUNDARY and CURRENT
Design NIC driver overview DriverSend Initiate transmission Check NIC is ready If ready, transfer data If not, queues the packet in the transmit-pending queue
Design NIC driver overview DriverISR Receptions Transmissions Errored transmissions P.s. Errored receptions are ignored (usually collision fragments)
Design NIC driver overview Interrupt Service Routine Check interrupt type Packet receptions? Packet transsmition?
Design NIC driver overview NIC Ring buffer Driver Transmit receive DriverISR CPU Memory Pending queue While complete Interrupt Transfer until buffer is empty Device busy
Code survey DriverSend QueueIt() PCtoNIC() Busy? No Yes Return DriverSend
Code survey DriverISR Pkg_recv_rt() NICtoPC() recv? No Yes Return ISR routine Exit_isr() tx? No overflow? Yes No Ring_ovfl() Yes Pkg_tx_rt() Bad tx? No Chk_tx_queue() Bad_tx() Yes
End Any question?