Software Operation
14.4 Software Operation
14.4.1 Transmit Operation
After reset the host must write zeroes to all Tx DMA State head descriptor pointers. The Tx port may then
be enabled. To initiate packet transmission the host constructs transmit queues in memory (one or more
packets for transmission) and then writes the appropriate Tx DMA state head descriptor pointers. For each
buffer added to a transmit queue, the host must initialize the Tx buffer descriptor values as follows:
1. Write the Next Descriptor Pointer with the 32-bit aligned address of the next descriptor in the queue
(zero if last descriptor).
2. Write the Buffer Pointer with the byte aligned address of the buffer data.
3. Write the Buffer Length with the number of bytes in the buffer.
4. Write the Buffer Offset with the number of bytes in the offset to the data (nonzero with SOP only).
5. Set the SOP, EOP, and Ownership bits as appropriate.
6. Clear the End Of Queue bit.
The port begins Tx packet transmission on a given channel when the host writes the channel’s Tx queue
head descriptor pointer with the address of the first buffer descriptor in the queue (nonzero value). Each
channel may have one or more queues, so each channel may have one or more head descriptor pointers.
The first buffer descriptor for each Tx packet must have the Start of Packet (SOP) bit and the Ownership
bit set to one by the host. The last buffer descriptor for each Tx packet must have the End of Packet
(EOP) bit set to one by the host.
The port will transmit packets until all queued packets have been transmitted and the queue(s) are empty.
When each packet transmission is complete, the port will clear the Ownership bit in the packet’s SOP
buffer descriptor and issue an interrupt to the host by writing the packet’s last buffer descriptor address to
the queue’s Tx DMA State Completion Pointer. The interrupt is generated by the write, regardless of the
value written.
When the last packet in a queue has been transmitted, the port sets the End Of Queue bit in the EOP
buffer descriptor, clears the Ownership bit in the SOP Descriptor, zeroes the appropriate DMA state head
descriptor pointer, and then issues a Tx interrupt to the host by writing to the queue’s associated Tx
completion pointer (address of the last buffer descriptor processed by the port). The port issues a
maskable level interrupt (which may then be routed through external interrupt control logic to the host).
On interrupt from the port, the host processes the buffer queue, detecting transmitted packets by the
status of the Ownership bit in the SOP buffer descriptor. If the Ownership bit is cleared to zero, then the
packet has been transmitted and the host may reclaim the buffers associated with the packet. The host
continues queue processing until the end of the queue or until a SOP buffer descriptor is read that
contains a set Ownership bit indicating that the packet transmission is not complete.
The host determines that all packets in the queue have been transmitted when the last packet in the
queue has a cleared Ownership bit in the SOP buffer descriptor, the End of Queue bit is set in the last
packet EOP buffer descriptor, and the Next Descriptor Pointer of the last packet EOP buffer descriptor is
zero. The host acknowledges an interrupt by writing the address of the last buffer descriptor to the queue’s
associated Tx Completion Pointer in the Tx DMA State.
If the host written buffer address value is different from the buffer address written by the port, then the
level interrupt remains asserted. If the host written buffer address value is equal to the port written value,
then the level interrupt is deasserted. The port write to the completion pointer actually stores the value in
the state register (ram). The host written value is actually not written to the register location. The host
written value is compared to the register contents (which was written by the port) and if the two values are
equal, the interrupt is removed, otherwise the interrupt remains asserted. The host may process multiple
packets previous to acknowledging an interrupt, or the host may acknowledge interrupts for every packet.
A misqueued packet condition may occur when the host adds a packet to a queue for transmission as the
port finishes transmitting the previous last packet in the queue. The misqueued packet is detected by the
host when queue processing detects a cleared Ownership bit in the SOP buffer descriptor, a set End of
Queue bit in the EOP buffer descriptor, and a nonzero Next Descriptor Pointer in the EOP buffer
descriptor.
1235
SPRUH73H – October 2011 – Revised April 2013
Ethernet Subsystem
Copyright © 2011–2013, Texas Instruments Incorporated