1 / 14

Network Adapter Driver

Network Adapter Driver. NCTU High Speed Network Lab. System Architecture. BUS. Rx Buffer Ring. 16 byte FIFO. CRC. Addr. Filter. If my addr. DMA. Adapter Rx Process. Coax cable. HOST CPU. NIC Rx Procedure. Media. (3). Interrupt cup (307). Current page register(page1:307).

Download Presentation

Network Adapter Driver

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Adapter Driver NCTU High Speed Network Lab.

  2. System Architecture NCTU High Speed Network Lab

  3. BUS Rx Buffer Ring 16 byte FIFO CRC Addr. Filter If my addr DMA Adapter Rx Process Coax cable NCTU High Speed Network Lab

  4. HOST CPU NIC Rx Procedure Media (3) Interrupt cup (307) Current page register(page1:307) NIC (1) FIFO Romote start address(308,309) Romote byte count (30a,30b) Romote DMA write (300) Data port Data port (310) (2) (5) Local DMA (4) NIC memory Host Memory NCTU High Speed Network Lab

  5. HOST CPU NIC Tx Procedure Media (1) Romote start address(308,309) Romote byte count (30a,30b) NIC (6) Romote DMA write (300) FIFO Data port (310) (4) Remote DMA complete(307) Data port Romote start address(308,309) (5) (2) Local DMA (3) NIC memory Host Memory NCTU High Speed Network Lab

  6. Buffer Ring Control Points Set one times when initial: • Page Start Point (PSTART) : Set when Initial • Page Stop Point (PSTOP) : Set when Initial Update when received packet: • Current Page Point (CURR) : NIC auto update • Boundary Page Point (BNDRY) : manual update • Next Packet Page (next_pkt) : memory variable NCTU High Speed Network Lab

  7. 4 3 2 n 1 ReceiveBufferRing Page start address Buffer #1 Buffer #2 Buffer #n Page start address 256 bytes NCTU High Speed Network Lab

  8. Rx Buffer Ring Maintain • When initializing the NIC set : BNDRY = PSTART CURR = PSTART + 1 next_pkt = PSTART + 1 • After a packet is DMAed from Rx Buffer Ring next_pkt = Next Page Pointer BNDRY = Next Page Pointer if BNDRY < PSTART then BNDRY = PSTOP - 1 NCTU High Speed Network Lab

  9. Receive Buffer Ring Current Page Register Packet Ends 4 3 Status next page Length(L) Length(H) 2 n 1 Current Page Register Packet status NCTU High Speed Network Lab

  10. Driver ISR Disable interrupt Save PC Registers Read Interrupt Status Register Packet Reception? Packet Transmission? Reset PTX bit in Interrupt Status Register Reset PRX bit in Interrupt Status Register Driver ISR YES NO YES NO NCTU High Speed Network Lab

  11. Read Transmit Status Register Transmit Next Packet in Queue Update Queue Pointers DMA Packet from Local memory to PC Inform High Level Software Inform High Level Software Enable Interrupt Restore PC Registers Receive Buffer Ring Empty? IRET Send “EOI” to 8259 Empty Transmission Queue? NO YES NCTU High Speed Network Lab

  12. Driver Send NIC Ready to Transmit? DMA Packet from PC to Local Memory Queue Packet in PC Memory Program NIC to Transmit Packet (Command Reg = 26h) RETURN Driver Send NO YES NCTU High Speed Network Lab

  13. Note: Enter ISR Disable PC Interrupt Save PC Registers CLI PUSHA MOV AL,00H WR_NE INTERRUPTMASK Disable Adapter Interrupt MOV DX,20h MOV AL,63h OUT DX,AL Send EOI to 8259 Enable PC Interrupt STI NCTU High Speed Network Lab

  14. Note: Leave ISR Disable PC Interrupt CLI MOV AL,0FFH WR_NE INTERRUPTMASK Enable Adapter Interrupt Restore PC Registers Enable PC Interrupt POPA STI Return to Original Process IRET NCTU High Speed Network Lab

More Related