Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Adapter Driver NCTU High Speed Network Lab.

Similar presentations


Presentation on theme: "Network Adapter Driver NCTU High Speed Network Lab."— Presentation transcript:

1 Network Adapter Driver NCTU High Speed Network Lab.

2 NCTU High Speed Network Lab2 System Architecture

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

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

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

6 NCTU High Speed Network Lab6 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

7 NCTU High Speed Network Lab7 Receive Buffer Ring 256 bytes n 1 2 3 4 Buffer #1 Buffer #2 Buffer #n Page start address

8 NCTU High Speed Network Lab8 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

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

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

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

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

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

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


Download ppt "Network Adapter Driver NCTU High Speed Network Lab."

Similar presentations


Ads by Google