Am79C972 55
mediately request the bus in order to access the next
TDTE location in the r i ng .
If the OWN bit is set and the buffer length is 0, the OWN
bit will be cleared. In the C-LANCE device, the buffer
length of 0 is int er pret ed as a 409 6-byte buffer. A zero
length buffer is acceptable as l ong as i t is not the last
buffer in a chain (STP = 0 and ENP = 1).
If the O WN bit and STP are set, then microcode control
proceeds to a routine that will enable transmit data
transfers to the FIFO. The Am79C972 controller will
look ahead to the next transmit descriptor after it has
performe d at least one transm it data transfe r from the
first buffer.
If the Am79C972 controller does not own the next
TDTE (i.e., the second TDTE for this frame), it will com-
plete transm is sion of the cur rent buffer a nd upd ate the
status of the current (first) TDTE with the BUFF and
UFLO bits being set. If DXSUFLO (CSR3, bit 6) is
cleared to 0, the underflow error will cause the transmit-
ter to be disabled (CSR0, TXON = 0). The Am79C972
controller will have to be re-initialized to restore the
transmit function. Setting DXSUFLO to 1 enables the
Am79C972 controller to gracefully recover from an un-
derflow error . The de vice will scan the transmit descrip-
tor ring until it finds either the start of a new frame or a
TDTE it does not own. To avoid an un derfl ow situatio n
in a chained buffer transmission, the system should al-
ways set the transmit chain descriptor own bits in re-
verse order.
If the Am79C972 controller does own the second TDTE
in a chain, it will gradually empty the contents of the first
buffer (a s the bytes are needed by the transmit op era-
tion), perform a single-cycle DMA transfer to update the
status of the first descriptor (clear the OWN bit in
TMD1), and then it may perform one data DMA access
on the se co nd buffe r in the ch ain before executi ng an-
other lookahead operation. (i.e., a lookahead to the
third descriptor.)
It is imperative that the host system never reads the
TDTE OWN bits out of order . The Am79C972 controller
normally clears OWN bits in strict FIFO order. However ,
the Am79 C972 con troller can queue u p to two frames
in the transmit FIFO. When the second frame uses
buffer c haining, t he Am79C9 72 controll er might r etur n
ownership out of nor mal FIFO order. The OWN bit for
last (and maybe only) buffer of the first frame is not
cleared until transmission is completed. During the
transmission the Am79C972 controller will read in buff-
ers for the next frame and clear their OWN bits for all
but the last one. The first and all intermediate buffers of
the se co n d fr a m e ca n have th ei r OWN bits cle a r ed be -
f ore the Am79C972 controller returns ownership f or the
last buff er of the first frame.
If an error occurs in the transmission before all of the
bytes of the current buff er have been transf erred, trans-
mit sta tus of th e current buffer wil l be im mediately up-
dated. If the buffer doe s not c on tain the end of packet,
the Am79C972 controller will skip over the rest of the
frame whic h experien ce d t he error. T his i s do ne by re-
tur ning to the polling mi crocod e where the Am79C97 2
controlle r will clea r the OW N bit for all descrip tors wit h
O WN = 1 and STP = 0 and continue in like manner until
a descriptor with OWN = 0 (no more transmit frames in
the ri ng) or OWN = 1 and STP = 1 (t he first buffer o f a
new frame) is reached.
At the end of any transmit operation, whether success-
ful or with err ors, imme dia tel y following the com ple tio n
of the descriptor updates, the Am79C972 controller will
always perform another polling operation. As described
earl ier, th is pollin g operation will be gin with a check of
the current RDTE, unless the Am79C972 controller al-
ready owns tha t descripto r. Then the Am79C972 con-
troller will poll the next TDTE. If the transmit descriptor
OWN bit has a 0 value, the Am79C972 controller will
resume incrementing the poll time counter . If the trans-
mit descriptor OWN bit has a value of 1, the Am79C972
controller will begin filling the FIFO with transmit data
and initiate a transmission. This end-of-operation poll
coupled with the TDTE lookahead operation allows the
Am79C972 controller to avoid inserting poll time counts
between successive transmit frames.
By default, whenever the Am79C972 controller com-
pletes a transmit frame (either with or without error) and
writes the status information to the current de scriptor,
then the TINT bit of CSR0 is set to indicate the comple-
tion of a transmission. This causes an interrupt signal if
the IENA bit of CSR0 has been set a nd the TINTM bit
of CSR3 is cleared. The Am79C972 controller provides
two modes to reduce the number of transmit interrupts.
The interrupt of a successfully transmitted frame can
be suppressed by setting TINTOKD (CSR5, bit 15) to
1. Another mode, which is enabled by setting LTINTEN
(CSR5, bit 14) to 1, allows suppression of interrupts for
succes sful transmiss ions for al l but the l ast frame in a
sequence.
Receive Descriptor Table Entry
If the Am79C972 controller does not own both the cur-
rent and the next Receive Descriptor Table Entry
(RDTE), then the Am79C972 controller will continue to
poll according to the polling sequence described
above. If the receive descriptor ring length is one, then
there is no next descriptor to be polled.
If a poll operation has re vealed that the current and the
next RDTE belong to the Am79C972 controller, then
additional poll accesses are not necessary. Future poll
operations wil l not inc lude RDTE acce sses as lon g as
the Am79C97 2 control ler r eta ins owne rshi p of the cur-
rent and the next RDTE.
When receive activity is present on the channel, the
Am79C972 controller waits for the complete address of