8-16
AIC-6915 Ethernet LAN Controller Programmer’s Manual
// RxBufferRing structure contains pointers to physical and virtual
// buffer addresses, and flush buffer address
CurrentRxBuffer = Adapter->RxBufferRing[RxDescIndex];
// Indicate the packet to the protocol (operating system specific).
NdisMEthIndicateReceive(…CurrentRxBuffer…);
// For Windows NT
// We’ve finished with that receive buffer, increment the consumer index
RxComQConsum+;
// Roll over if necessary
RxComQConsumerIndex %= NUMBER_OF_RX_COMPLETION_DESC;
} // while ( RxComQConsumerIndex != RxComQProducerIndex
// We have processed all current entries in the Receive Completion Descriptor
// Queue
// Give the processed Rx completion descriptors back to the AIC-6915
AIC6915_WRITE_REG(Adapter->RegisterBaseVa->CompletionQueue1ConsumerIndex,
CompletionQueue1ConsumerValue);
// Clear the valid bit for the last descriptor we just indicated up (polling
// model)
Adapter->RxDesc[RxDescIndex]->Valid = 0;
// We need to keep track of the receive descriptors and update the end of the
// queue with the Valid bit
// Set the previous last descriptor to valid
Adapter->RxDesc[Adapter->RxDescQProducerIndex]->Valid = 1;
Adapter->RxDescQProducerIndex = RxDescIndex;
// We’re done with receives!
Transmit Process
The transmit process in the AIC-6915 utilizes the producer-consumer model. It is based
on a transmit completion queue and transmit buffers. The relationship between
Completion and Buffer Descriptors is discussed below.
Transmit Completion Descriptor Queue
When the AIC-6915 has finished a transmit operation, it places information about that
transmitted Buffer Descriptor in the Transmit Completion Descriptor Queue and
generates either a T
X
D
MA
D
ONE
interrupt, a T
X
F
RAME
C
OMPLETE
interrupt, or a
T
X
Q
UEUE
D
ONE
interrupt, depending on which interrupt has been enabled in the driver.
If dual transmit queues are implemented, a single Transmit Completion Descriptor Queue
is used by both queues.
The number of Transmit Completion Descriptors is fixed at 1024. There are two types of
Completion Descriptors. Both types may either be 4 bytes or 8 bytes in size. The
T
X
C
OMPLETION
S
IZE
field in register T
X
C
OMPLETION
Q
UEUE
C
TRL
is used to select the
descriptor size. The first descriptor type is a DMA complete entry, while the other type is
a transmit complete entry. The type which is implemented depends upon the type of