Technical information

8-7
Sample Driver
// Specify which interrupts we want
InterruptEnValue.RxQ1DoneIntEn = 1;
// interrupt on receive DMA
InterruptEnValue.TxDmaDoneIntEn = 1;
// interrupt on transmit DMA
// The hardware is now ready to transmit and receive packets!
Receive Process
The receive process in the AIC-6915 is based on the use of a receive completion queue and
receive buffers. Their relationship is discussed below.
Receive Completion Descriptor Queue
When a packet has been received and DMA-transferred to host memory, the AIC-6915
adds a new entry to the Receive Completion Descriptor Queue. The memory for this
queue is allocated by the driver and is passed to AIC-6915 via the
R
X
C
OMPLETION
Q
UEUE
1C
TRL
register (offset BCh). The size of this queue is fixed at 1024
entries. There are four different descriptor format types available: the 4-byte short
descriptor (Type 0), the 8-byte basic descriptor (Type 1), the 8-byte checksum descriptor
(Type 2), and the 16-byte full descriptor (Type 3). Therefore, depending upon the
descriptor type, 4KByte, 8KByte, or 16KByte of memory is required to accommodate the
Receive Completion Descriptor Queue. These descriptors are discussed in more detail
below. The completion descriptor type is programmed using the
R
X
C
OMPLETION
Q1T
YPE
field in the
R
X
C
OMPLETION
Q
UEUE
1C
TRL
register. There is a corresponding field in
R
X
C
OMPLETION
Q
UEUE
2C
TRL
if two Receive Completion Queues are used. The developer
may choose to implement two receive completion queues if the protocol environment can
utilize packet sorting based on priority or size. The AIC-6915 controller offers the choices
of sorting based on address filtering priority, VLAN priority, or packet size. This option is
programmed in the
R
X
D
MA
Q
UEUE
M
ODE
field in register
R
X
D
MA
C
TRL
. For address
filtering and AIC-6915 ID sorting, refer to the description of register
R
X
A
DDRESS
F
ILTERING
C
TRL
.
Each entry in the Receive Completion Descriptor Queue points to one or more entries in
the Receive Buffer Descriptor Queue, depending upon the size of the received frame.
There is one Receive Completion Descriptor Queue entry for each received frame.
Receive Completion Descriptor Types
Type 0 Completion Descriptor
The Type 0 descriptor is known as the short completion descriptor. This descriptor
consists of a four byte entry (one word). It contains a descriptor ID, a status field, an end
index which points to the associated Receive Buffer Descriptor Queue entry, and a length
field indicating the length of the received packet. To program the AIC-6915 to use a Type
0 descriptor, the developer must set
R
X
C
OMPLETION
Q1T
YPE
in register
R
X
C
OMPLETION
Q
UEUE
1C
TRL
to 00b.
Type 1 Completion Descriptor
The Type 1 descriptor is also known as the basic completion descriptor. It consists of two
word entries. The first word is identical to the Type 0 descriptor. The second word
contains extended status information and a VLAN ID and priority. To program the
AIC-6915 to use a Type 1 descriptor, the developer must set
R
X
C
OMPLETION
Q1T
YPE
in
register
R
X
C
OMPLETION
Q
UEUE
1C
TRL
to 01b.