Adaptec 1737100 Programmer Manual - Page 187
Transmit Completion Interrupt Handling
UPC - 760884136362
View all Adaptec 1737100 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 187 highlights
Sample Driver &CurrentBuffer); } // while (CurrentBuffer) // We've placed all the buffers in this packet into Transmit Buffer // Descriptors. // We're ready to tell the chip to transmit the packet. // Advance the Tx Producer Index causing the chip to transmit the packet out. // The Producer index is incremented by units of 8 bytes. For this example, // we are using a Type 1 descriptor (8 bytes) with an 8 byte skip field. // Therefore, we must increment the producer index by 2 for each buffer // transmitted TxDescQProducerIndexValue.LoPrTxProducerIndex = (CurrentTxDescIndex * sizeof(TransmitBufferDescriptor) / 8; // and write the updated register value back to the chip AIC6915_WRITE_REG(Adapter->RegisterbaseVa->TxDescQueueProducerIndex, TxDescQProducerIndexValue); // Our transmit is complete! Transmit Completion Interrupt Handling After the AIC-6915 has transmitted a packet, it places that packet in the Transmit Completion Descriptor Queue and initiates a TXFRAMECOMPLETE interrupt or a TXDMADONE interrupt. The driver must process this interrupt and return the transmitted packet resource to the operating system. In the code fragment below, we have received a transmit complete interrupt. Example: // Windows NT example // Single Transmit Completion and Buffer Descriptor Queue // 32-bit addressing, 8-byte skip field // Read the Completion QueueProducer and Consumer indices AIC6915_READ_REG(CompletionQueue1ProducerIndex, &CompletionQueue1ProducerReg); AIC6915_READ_REG(CompletionQueue1ConsumerIndex, &CompletionQueue1ConsumerReg); TxComQProducerIndex = CompletionQueue1ProducerReg.b.TxCompletionProducerIndex; TxComQConsumerIndex = CompletionQueue1ConsumerReg.b.TxCompletionConsumerIndex; // Repeat until we've processed all transmit complete entries while ( TxComQConsumerIndex != TxComQProducerIndex ) { // Get the TX Complete entry TxCompletionDesc = Adapter->TxCompletionDesc[TxComQConsumerIndex]; // Get the TX buffer descriptor index from the completion descriptor. 8-27