8-26
AIC-6915 Ethernet LAN Controller Programmer’s Manual
Adapter->MapRegisterIndex,
TRUE,
PhysicalSegmentArray,
&BufferPhysicalSegments);
// Put each physical segment for this buffer into a Transmit Buffer
// Descriptor
for (ii = 0 ; ii < BufferPhysicalSegments; ii++)
{
PhysicalAddressUnit = PhysicalSegmentArray[ii] ;
// Get a local copy of this Transmit Buffer Descriptor
TxDesc = Adapter->TxDesc[CurrentTxDescIndex];
// We only fill in the NumberOfFragments field and the owning packet
// for the descriptor pointing to the first fragment of the first
// buffer for a Type 1 descriptor
TxDesc->DWORD0.NumFrags = 0;
if ( (ii == 0) && FirstBuffer )
{
// In the Skip Field portion of the Transmit Buffer (the Reserved
// field),save the address of the originating packet. This will be
// used later
// when we process the Transmit Complete interrupt.
TxDesc->Reserved.OwningPacket = Packet;
FirstBuffer = FALSE;
// Remember where this packet started
PacketStartIndex = CurrentTxDescIndex;
PacketStartTxDesc = Adapter->TxDesc[PacketStartIndex];
}
TxDesc->BufferAddress =
NdisGetPhysicalAddressLow(PhysicalAddressUnit.PhysicalAddress);
TxDesc->DWORD0.Length = PhysicalAddressUnit.Length;
TxDesc->DWORD0.End = 0;
// Keep track of the number of fragments in the first descriptor
PacketStartTxDesc->DWORD0.N+;
CurrentTxDe+;
// If we're approaching the end of the descriptor queue, roll
// over.
if (Rollover)
{
// Set the end bit - in the first descriptor for this packet
PacketStartTxDesc->DWORD0.End = 1;
CurrentTxDescIndex = 0;
Rollover = False;
}
// Get the next buffer in this packet
NdisGetNextBuffer(CurrentBuffer,