
NXP Semiconductors
PNX15xx/952x Series
Volume 1 of 1
Chapter 23: LAN100 — Ethernet Media Access Controller
PNX15XX_PNX952X_SER_N_4
NXP B.V. 2007. All rights reserved.
Product data sheet
Rev. 4.0 — 03 December 2007
23-718
5.5.8
Device Driver Processes Receive Data
The device driver can be signaled to read the descriptors that have been handed over
to it by the hardware by observing status word ags (for example, RxDoneInt),
receiving interrupts, or polling for the case where RxProduceIndex –
RxConsumeIndex is not 0. The device driver should inspect the status words in the
status FIFO to check for multi-fragment packets and receive errors.
The device driver can forward receive data and status to higher-level software layers.
After data and status are processed, the descriptors, status words and data buffers
may be recycled and handed back to hardware by incrementing RxConsumeIndex.
5.5.9
Receive example
Figure
Figure 8 illustrates the receive process in an example receiving a packet of 16
bytes.
After reset, the values of the LAN100 DMA registers will be zero. During initialization,
the device driver must allocate the descriptor and status array in memory. In this
example, an array of four descriptors is allocated. The array is 4x2x4 bytes, and is
aligned on a 4-byte address boundary. Since the number of descriptors should match
the number of status words, the status array consists of four elements. The status
array is 4x2x4 bytes, and is aligned on an 8-byte address boundary. The device driver
writes the base address of the descriptor array (0xFEEDB0EC) to the RxDescriptor
register, and the base address of the status array (0xFEEDB1F8) to the RxStatus
Figure 8:
Receive example memory and registers
RxDescriptor
0xFEEDB0EC
RxStatus
0xFEEDB1F8
RxProduceIndex
RxConsumeIndex
RxDescriptorNumber 3
Packet
0xFEEDB409
Control
17
Descriptor
0
Packet
0xFEEDB4111
Control
17
Descriptor
1
Packet
0xFEEDB419
Control
17
Descriptor
2
Packet
0xFEEDB325
Control
17
Descriptor
3
0xFEEDB0EC
0xFEEDB0F0
0xFEEDB0F8
0xFEEDB0F4
0xFEEDB1FC
0xFEEDB200
0xFEEDB204
0xFEEDB208
Fragment 0 buffer (8 bytes)
0xFEEDB409
0xFEEDB411
Fragment 1 buffer (8 bytes)
0xFEEDB411
0xFEEDB418
Fragment 2 buffer (8 bytes)
0xFEEDB419
0xFEEDB420
Fragment 3 buffer (8 bytes)
0xFEEDB325
0xFEEDB32C
StatusInfo
7
StatusTimestamp
Status
0
0xFEEDB1F8
0xFEEDB200
0xFEEDB208
0xFEEDB210
StatusInfo
7
StatusTimestamp
Status
1
StatusInfo
3
StatusTimestamp
Status
2
StatusInfo
StatusTimestamp
Status
3
Descriptor
Arra
y
Status
Arra
y
Descriptor Array FIFO
Fragments
Status Array FIFO