beautypg.com

9 add padding, 10 strip crc, 11 strip padding – Maxim Integrated 78Q8430 Software Driver User Manual

Page 15: Add padding, Strip crc, Strip padding

background image

UG_8430_004

78Q8430 Software Driver Development Guidelines

Rev. 1.0

15

3.9 Add

Padding

The transmit circuit has the ability to add padding to transmitted frames. The append CRC feature should
always be used when the add padding feature is used. The basic transmit procedure described in
Section

3.1

can be modified to use the hardware to add padding and append the CRC to transmitted

frames as follows.

STEP 1: Write to QUE 4 PCWR.
Make sure the Disable Padding bit is clear and the Append CRC bit is set in the value written to
QUE 4 PCWR.

STEP 2: Write to QUE 4 PSZR.
The size written to PSZR should NOT include the CRC because the CRC will not be part of the frame
transferred from the host.

STEP 3: Write the frame data to QUE 4 TDR.
Do not write the CRC bytes as part of the frame data.

STEP 4: Read the transmit status from TPSR.
Reading TPSR reads status words from the top of a 128 word deep FIFO. One status word is added
to the FIFO for each transmitted frame. If the status words for transmitted frames are not read from
the FIFO, it eventually fills to capacity at which time any new status words are dropped while the
FIFO retains the oldest ones.


To disable the Add Padding feature, make sure the PCWR Disable Padding bit is set during the transmit
procedure.

3.10 Strip CRC

The receive circuit has the ability to verify and remove the CRC from the end of a receive frame on the fly.
Using this feature saves the host some compute cycles in not having to calculate the CRC itself as well
as bus cycles in not having to retrieve the CRC with the frame data. Setting the MCR No Rx CRC bit
causes the CRC to be removed from all received frames. When the Strip CRC feature is used, the basic
receive procedure described in Section

3.2

can still be used to receive the frame. However, the driver

must be sure to discard frames in STEP 3 when the status indicates a bad CRC.

3.11 Strip Padding

The receive circuit has the ability to use the Len/Typ field of the Ethernet frame to determine the presence
of padding at the end of a frame and remove it. Frames that have the padding removed will also have the
CRC removed. To maintain a consistent behavior across all frames, the Strip CRC feature must always
be used in conjunction with the Strip Padding feature. Setting the MCR No Rx CRC and No Rx PAD bits
causes the CRC and the padding, if any, to be removed from all frames. When this feature is used, the
basic receive procedure described in Section

3.2

is still used to receive the frame. However, the driver

must be sure to discard frames in STEP 3 when the status indicates a bad CRC.