beautypg.com

Transmit dma actions – Rainbow Electronics DS3134 User Manual

Page 128

background image

DS3134

128 of 203

forcing the CHEN bit to a one. The DMA will not re-enable the channel until it has finished writing all of
the previously queued descriptors to the Done Queue. Then the Host can collect the errored descriptors as
they arrive in the Done Queue and then re-queue them for transmission by writing descriptors to the
Pending Queue so the transmit DMA knows where to find the packets that did not get transmitted
(software housekeeping note: the Host must set the Next Pending Descriptor Pointer and PV fields in the
Packet Descriptor to zero to ready them for transmission). The second option allows the software a
cleaner error recovery technique. See Figure 8.2.1E for more details.

Transmit DMA Error Recovery Algorithm Figure 8.2.1E

Host Actions

The Host will typically handle the Transmit DMA as follows:
1. The Host will place readied packets into the Pending Queue.
2. The Host will either poll or be interrupted that some outgoing packets have completed transmission

and that it should read the Done Queue.

3. If Done Queue reports that an error was incurred and that a packet was not transmitted, then the Host

must re-queue the packet for transmission.

Transmit DMA Actions

A typical scenario for the Transmit DMA is as follows:
1. The transmit DMA constantly reads the Pending Queue looking for packets that are queued for

transmission.

2. The transmit DMA will update the Done Queue as packets or data buffers complete transmission.
3. If an error occurs, then the transmit DMA will disable the channel and wait for the Host to request that

the channel be enabled.

Read Done Queue

Status = 1xx?

No

Data Buffers &
Packet Descriptor
Space Available
for Reuse

Yes

Set CHRST = 1
for the Next
Descriptor
Written to the
Pending Queue

Set the PV & the Next
Pending Descriptor Pointer
Fields to zero in the Errored
Packet Descriptor

Place the Errored Packet
Descriptor back into the
Pending Queue for
Re-transmission

dmaerror