17.05.2015 Views

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.0 Packet Reception (Continued)<br />

Received Packet Aborted If It Hits Boundary Pointer<br />

Buffer Ring Overflow<br />

TL/F/9345-12<br />

If the Buffer Ring has been filled and the DMA reaches the<br />

Boundary Pointer Address, reception of the incoming packet<br />

will be aborted by the NIC. Thus, the packets previously<br />

received and still contained in the Ring will not be destroyed.<br />

In a heavily loaded network environment the local DMA may<br />

be disabled, preventing the NIC from buffering packets from<br />

the network. To guarantee this will not happen, a software<br />

reset must be issued during all Receive Buffer Ring overflows<br />

(indicated by the OVW bit in the Interrupt Status Register).<br />

The following procedure is required to recover<br />

from a Receiver Buffer Ring Overflow.<br />

1. Issue the STOP mode command (Command Register =<br />

21 H). The NIC may not immediately enter the STOP<br />

mode. If it is currently processing a packet, the NIC will<br />

enter STOP mode only after finishing the packet. The NIC<br />

indicates that it has entered STOP mode by setting the<br />

RST bit in the Interrupt Status Register.<br />

2. Clear the Remote Byte Counter Registers (RBCRO,<br />

RBCR1). The NIC requires these registers to be cleared<br />

before it sets the RST bit.<br />

Note: If the STP is set when a transmission is in progress, the RST bit may<br />

not be set. In this case, the NIC is guaranteed to be reset after the<br />

longest packet time (1500 bytes ~ 1.2 ms). For the DP8390C (but not<br />

for the DP8390B), the NIC will be reset wtthin 2 microseconds after<br />

the STP bit is set and Loopback mode 1 is programmed.<br />

3. Poll the Interrupt Status Register for the RST bit. When<br />

set, the NIC is in STOP mode.<br />

4. Place the NIC in LOOPBACK (mode 1 or 2) by writing<br />

02H or 04H to the Transmit Configuration Register. This<br />

step is required to properly enable the NIC onto an active<br />

network.<br />

5. Issue the START mode command (Command Register =<br />

22H). The local receive DMA is still inactive since the NIC<br />

is in LOOPBACK.<br />

6. Remove at least one packet from the Receive Buffer<br />

Ring to accommodate additional incoming packets.<br />

7. Take the NIC out of LOOPBACK by programming the<br />

Transmit Configuration Register back to its original value<br />

and resume normal operation.<br />

Note: If the Remote DMA channel is not used, you may eliminate step 6 and<br />

remove packets from the Receive Buffer Ring after step 1. This will<br />

reduce or eliminate the polling time incurred in step 3.<br />

END OF PACKET OPERATIONS<br />

At the end of the packet the NIC determines whether the<br />

received packet is to be accepted or rejected. It either<br />

branches to a routine to store the Buffer Header or to another<br />

routine that recovers the buffers used to store the packet.<br />

SUCCESSFUL RECEPTION<br />

If the packet is successfully received as shown, the DMA is<br />

restored to the first buffer used to store the packet (pointed<br />

to by the Current Page Register). The DMA then stores the<br />

Receive Status, a Pointer to where the next packet will be<br />

stored (Buffer 4) and the number of received bytes. Note<br />

that the remaining bytes in the last buffer are discarded and<br />

reception of the next packet begins on the next empty 256-<br />

byte buffer boundary. The Current Page Register is then<br />

initialized to the next available buffer in the Buffer Ring. (The<br />

location of the next buffer had been previously calculated<br />

and temporarily stored in an internal scratchpad register.)<br />

Termination of Received Packet-Packet Accepted<br />

BUFFER RECOVERY FOR REJECTED PACKETS<br />

TL/F/9345-13<br />

If the packet is a runt packet or contains CRC or Frame<br />

<strong>Al</strong>ignment errors, it is rejected. The buffer management logic<br />

resets the DMA back to the first buffer page used to store<br />

the packet (pointed to by CURR), recovering all buffers that<br />

had been used to store the rejected packet. This operation<br />

will not be performed if the NIC is programmed to accept<br />

either runt packets or packets with CRC or Frame <strong>Al</strong>ignment<br />

errors. The received CRC is always stored in buffer memory<br />

after the last byte of received data for the packet.<br />

Termination of Received Packet-Packet Rejected<br />

TLlF/9345-14<br />

1-62

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!