beautypg.com

2 basic receive, Basic receive, Hardware jabber protection – Maxim Integrated 78Q8430 Software Driver User Manual

Page 9

background image

UG_8430_004

78Q8430 Software Driver Development Guidelines

Rev. 1.0

9

3.2 Basic

Receive

The basic receive operation is achieved using the QUE0 registers. Use the following procedure to read a
received frame from QUE 0:

STEP 1: Read the receive status from RPSR.
When the RPSR Done bit is set, the entire frame has been received into QUE 0 and the RPSR Count
field contains the number of bytes in the frame.

STEP 2: Read the frame data from QUE 0 RDR.
Each successive read from QUE 0 RDR removes data from QUE 0. The driver must be careful to
read all the frame data and not to read extra data.

STEP 3: Discard the frame if the status was bad.


The driver can also use the Host Drop feature described in Section

3.7

to drop frames with bad status

without reading the data.

The procedure above assumes that the MAC receiver is enabled and is not halted and that the MAC has
been properly configured via the MCR.

The Receive Jumbo procedure described in Section

5.2.1

must be used instead of the basic receive

procedure if the frames are too large to fit into the receive buffer (Jumbo frames).

The driver must not loose track of which status goes with the next data in QUE 0. If the driver reads
QUE 0 RDR after the current frame data is exhausted, it either reads the first data word from the
next frame which causes the next frame to be short, or if there is no data in the QUE, it triggers a

QUE 0 under-run interrupt. An under-run interrupt on QUE 0 indicates that the driver is confused. In this
event issuing a software reset will realign the system.

If the driver is unsure about the length of the current frame being read from QUE 0, the RDSR EOF bit
can be used. When this bit is set, the next read from QUE 0 RDR contains the last data in the frame and
the RDSR Data Size field indicates how many valid bytes it contains.

3.2.1 Hardware Jabber Protection

If the Hardware Jabber feature is enabled (the MCR Jumbo OK bit is not set) and certain conditions are
met, the hardware flags the length error and truncates the frame being received. This prevents an
illegally long frame, or jabber frame, from filling the buffer.

Once the classification engine has identified the Len/Typ field, the hardware performs some frame length
sanity checking.

• If the frame size exceeds the maximum VLAN allowed size, the frame is truncated at that point.
• Then, if the field is a len and not a type (Len/Type < 0x0600) and the actual frame length exceeds the

length specified in the Len/Type field, the frame will be truncated.


The hardware truncates the frame by automatically dropping the bytes of the frame in excess of the
maximum allowed length.

Enabling Hardware Jabber Protection

Use the following procedure to enable hardware jabber protection:

STEP 1: Clear the MCR Jumbo OK bit.