Technical information

8-18
AIC-6915 Ethernet LAN Controller Programmer’s Manual
of descriptor. These descriptors are outlined below. For a complete description, refer to
the Transmit Architecture section.
All hardware indices which reference a Transmit Buffer Descriptor are incremented by a
value which is dependent upon the size of the descriptor. The size of the descriptor will
vary, depending upon the descriptor type, skip field option, and number of buffers in the
descriptor for Type 0 and Type 4 descriptors. Transmit Buffer Descriptors are referenced
in two places in hardware - in the Transmit Completion Descriptor, and in the Transmit
Producer and Consumer indices (
T
X
D
ESC
Q
UEUE
P
RODUCER
I
NDEX
). However, in software,
typically the buffer descriptors are referenced by an index which changes by a value of
one for each new descriptor. Therefore, the driver must translate the hardware index to an
index suitable for use by the software.
To convert the hardware address index in the Transmit Completion Descriptor to a
software array index, divide the address index by the size of the Transmit Buffer
Descriptor. To convert the hardware Transmit Producer or Consumer index to a software
array index, multiply the hardware index by 8, and then divide by the size of the Transmit
Buffer Descriptor in bytes. The Producer and Consumer indices are essentially a count of
the number of 8-byte blocks in a Transmit Buffer Descriptor.
Transmit Buffer Descriptor Types
Type 0 descriptor
This descriptor is a frame descriptor for 32-bit transmit descriptors. It is programmed by
setting the
T
X
D
ESC
T
YPE
field in register
T
X
D
ESC
Q
UEUE
C
TRL
to 000b. An optional skip
field is available for use by the driver for storage of pertinent information. The skip field
size must be a multiple of 8 bytes. Since this descriptor type is a frame descriptor, it can
contain all of the buffers in a given packet. The driver must determine the size of each
descriptor to convert the Transmit Producer or Consumer index to a software array index.
When calculating the size of this descriptor, include each buffer and its length. The size of
a Type 0 descriptor in bytes is calculated using the formula:
((
N
UMBER
O
F
F
RAGMENTS
* 8) + 8 +
S
KIP
F
IELD
B
YTES
).
For example, assume that a Type 0 descriptor is in use, with an 8-byte skip field. If a
packet which contains two fragments is transmitted, the size of the descriptor is
(
N
UMBER
O
F
F
RAGMENTS
*8
) + 16 bytes, which is 32 bytes. This includes 8 bytes for the
skip field, 4 bytes for the ID header information, 4 bytes for the count of the number of
fragments and reserved field, and (
N
UMBER
O
F
F
RAGMENTS
* 8
) or 16 bytes for the buffer
addresses and length fields.
To convert the hardware Transmit Producer or Consumer index to a software index,
multiply the hardware index by 8, and then divide by the calculated size of the descriptor.
Refer to the Transmit DMA Buffer Descriptor Queue section in the Transmit Architecture
chapter for a description of all fields in this descriptor type.
Type 1 descriptor
This descriptor is a buffer descriptor for use with 32-bit transmit descriptors. It is
programmed by setting the
T
X
D
ESC
T
YPE
field in register
T
X
D
ESC
Q
UEUE
C
TRL
to 001b.
Each descriptor contains a single 4-byte buffer address. An optional skip field is available
for use by the driver for storage of pertinent information. The skip field size must be a
multiple of 8 bytes. The driver must determine the size of each descriptor to convert the