8-19
Sample Driver
Transmit Producer or Consumer index to a software array index. The size of a Type 1
descriptor in bytes is calculated using the formula:
(8
+
S
KIP
F
IELD
B
YTES
).
For example, assume that a Type 1 descriptor is in use, with a 16-byte skip field. The size
of the descriptor is then 24 bytes. This includes 16 bytes for the skip field, 4 bytes for the
ID header and 4 bytes for the buffer address.
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 2 descriptor
The Type 2 descriptor is a buffer descriptor for use with 64-bit 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 010b. It is
equivalent to the Type 1 descriptor, but with an 8-byte buffer address field instead of a 4-
byte address. In order to preserve the descriptor size in multiples of 8 bytes, there is a 4-
byte reserved field. The size of this descriptor in bytes is calculated by:
(16 + S
KIP
F
IELD
B
YTES
).
The ID header consumes 4 bytes, the reserved field is 4 bytes, and the buffer address is 8
bytes.
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 3 descriptor
This descriptor type is reserved and is currently not available for use. The developer must
not select this descriptor type.
Type 4 descriptor
This descriptor is a frame descriptor for use with 32-bit Transmit Buffer 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 100b. It is
similar to the Type 0 descriptor. However, the buffer length and buffer address fields are
reversed. This buffer descriptor is for use with DOS or OS/2 drivers, to take advantage of
the frame descriptor format for these operating systems. 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 three fragments is transmitted, the size of the descriptor is
(N
UMBER
O
F
F
RAGMENTS
*8) + 16 bytes, which is 40 bytes. This includes 8 bytes for the
skip field, 8 bytes for the ID header and the count of the number of fragments, and
(N
UMBER
O
F
F
RAGMENTS
* 8) or 24 bytes for the buffer addresses and length fields.