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.

~ r-----------------------------------------------------------------------------------------------,<br />

~<br />

N<br />

(I)<br />

tn<br />

Z<br />

~<br />

'"<br />

~<br />

(I)<br />

f c<br />

12.0 Loopback Diagnostics (Continued)<br />

<strong>Al</strong>ignment of the Received Packet in the FIFO<br />

Reception of the packet in the FIFO begins at location zero,<br />

after the FIFO pointer reaches the last location in the FIFO,<br />

the pointer wraps to the top of the FIFO overwriting the<br />

previously received data. This process continues until the<br />

last byte is received. The NIC then appends the received<br />

byte count in the next two locations of the FIFO. The contents<br />

of the Upper Byte Count are also copied to the next<br />

FIFO location. The number of bytes used in the loopback<br />

packet determines the alignment of the packet in the FIFO.<br />

The alignment for a 64-byte packet is shown below.<br />

FIFO<br />

FIFO<br />

LOCATION CONTENTS<br />

LOWER BYTE COUNT<br />

UPPER BYTE COUNT<br />

UPPER BYTE COUNT<br />

LAST BYTE<br />

CRCl<br />

CRC2<br />

CRC3<br />

CRC4<br />

-+ First Byte Read<br />

Second Byte Read<br />

Last Byte Read<br />

For the following alignment in the FIFO the packet length<br />

should be (N x 8) + 5 Bytes. Note that if the CRC bit in the<br />

TCR is set, CRC will not be appended by the transmitter. If<br />

the CRC is appended by the transmitter, the last four bytes,<br />

bytes N-3 to N, correspond to the CRC.<br />

FIFO<br />

LOCATION<br />

LOOPBACK TESTS<br />

TestlngCRC<br />

FIFO<br />

CONTENTS<br />

BYTEN-4<br />

BYTE N·3 (CRC1)<br />

BYTE N·2 (CRC2)<br />

BYTE N·l (CRC3)<br />

BYTE N (CRC4)<br />

LOWER BYTE COUNT<br />

UPPER BYTE COUNT<br />

UPPER BYTE COUNT<br />

AR<br />

First Byte Read<br />

Second Byte Read<br />

Las1 Byte Read<br />

If CRC = 0 in the TCR, the NIC computes and appends a<br />

4-byte FCS field to the packet as in normal operation. The<br />

CRC will not be verified during reception in loopback mode.<br />

The CRC must be read from the FIFO and verified by comparison<br />

to a previously computed value.<br />

If CRC = 1, the NIC will not append a 4-byte FCS field. The<br />

user must supply a pre-calculated CRC value and append it<br />

to the transmitted packet.<br />

NETWORK MANAGEMENT FUNCTIONS<br />

Network management capabilities are required for maintenance<br />

and planning of a local area network. The NIC supports<br />

the minimum requirement for network management in<br />

hardware, the remaining requirements can be met with software<br />

counts. There are three events that software alone<br />

cannot track during reception of packets: CRC errors,<br />

Frame <strong>Al</strong>ignment errors, and missed packets.<br />

Since errored packets can be rejected, the status associated<br />

with these packets is lost unless the CPU can access the<br />

Receive Status Register before the next packet arrives. In<br />

situations where another packet arrives very quickly, the<br />

CPU may have no opportunity to do this. The NIC counts<br />

the number of packets with CRC errors and Frame <strong>Al</strong>ignment<br />

errors. 8-bit counters have been selected to reduce<br />

overhead. The counters will generate interrupts whenever<br />

their MSBs are set so that a software routine can accumulate<br />

the network statistics and reset the counters before<br />

overflow occurs. The counters are sticky so that when they<br />

reach a count of 192 (COH) counting is halted. An additional<br />

counter is provided to count the number of packets NIC<br />

misses due to buffer overflow or being offline.<br />

The structure of the counters is shown below:<br />

CHTRO FRAME ALIGNMENT ERRORS COUNTER<br />

I-<br />

CNTRl CRe ERRORS COUNTER !.ISB<br />

I-<br />

CNTR2 MISSED PACKETS COUNTER<br />

I-<br />

WSBjD-<br />

"SB<br />

INTERRUPT<br />

TlIF/9345-23<br />

Additional information required for network management is<br />

available in the Receive and Transmit Status registers.<br />

Transmit status is available after each transmission for information<br />

regarding events during transmission.<br />

Typically, the following statistics might be gathered in software:<br />

Traffic:<br />

Errors:<br />

Frames Sent OK<br />

Frames Received OK<br />

Multicast Frames Received<br />

Packets Lost Due to Lack of Resources<br />

Retries/Packet<br />

CRC Errors<br />

<strong>Al</strong>ignment Errors<br />

Excessive Collisions<br />

Packet with Length Errors<br />

Heartbeat Failure<br />

1-80

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

Saved successfully!

Ooh no, something went wrong!