Texas Instruments TMS320C645x DSP Benutzerhandbuch

Seite von 148
www.ti.com
2.5.5.1
Next Descriptor Pointer
2.5.5.2
Buffer Pointer
2.5.5.3
Buffer Offset
2.5.5.4
Buffer Length
2.5.5.5
Packet Length
EMAC Functional Architecture
The next descriptor pointer indicates the 32-bit word aligned memory address of the next buffer descriptor
in the receive queue. The pointer creates a linked list of buffer descriptors. If the value of the pointer is
zero, then the current buffer is the last buffer in the queue. The software application must set this value
prior to adding the descriptor to the active receive list. This pointer is not altered by the EMAC.
The value of pNext should never be altered once the descriptor is in an active receive queue, unless its
current value is NULL. If the pNext pointer is initially NULL, and more empty buffers can be added to the
pool, the software application may alter this pointer to indicate a newly appended descriptor. The EMAC
will use the new pointer value and proceed to the next descriptor unless the pNext value has already been
read. If the pNext value has already been read, the receiver will halt the receive channel in question, and
the software application may restart it at that time. The software can detect this case by searching for an
end of queue (EOQ) condition flag on the updated packet descriptor when it is returned by the EMAC.
The buffer pointer is the byte-aligned memory address of the memory buffer associated with the buffer
descriptor. The software application must set this value prior to adding the descriptor to the active receive
list. This pointer is not altered by the EMAC.
This 16-bit field must be initialized to zero by the software application before adding the descriptor to a
receive queue.
This field will be updated depending on the RXBUFFEROFFSET register setting. When the offset register
is set to a non-zero value, the received packet is written to the packet buffer at an offset given by the
value of the register, and this value is also written to the buffer offset field of the descriptor.
When a packet is fragmented over multiple buffers because it does not fit in the first buffer supplied, the
buffer offset only applies to the first buffer in the list, which is where the start of packet (SOP) flag is set in
the corresponding buffer descriptor. In other words, the buffer offset field is only updated by the EMAC on
SOP descriptors.
The range of legal values for the BUFFEROFFSET register is 0 to (Buffer Length – 1) for the smallest
value of buffer length for all descriptors in the list.
This 16-bit field has two functions:
Before the descriptor is first placed on the receive queue by the application software, the software
initializes the buffer length field with the physical size of the empty data buffer specified by the buffer
pointer field.
After the empty buffer has been processed by the EMAC and filled with received data bytes, the EMAC
updates the buffer length field to reflect the actual number of valid data bytes written to the buffer.
This 16-bit field specifies the number of data bytes in the entire packet. The software application initializes
this value to zero for empty packet buffers. The EMAC fills in the value on the first buffer used for a given
packet, as signified by the EMAC setting a start of packet (SOP) flag. The EMAC sets the packet length
on all SOP buffer descriptors.
Ethernet Media Access Controller (EMAC)/Management Data Input/Output (MDIO)
34
SPRU975B – August 2006