Adaptec 1737100 Programmer Manual - Page 186

In the Skip Field portion of the Transmit Buffer the Reserved

Page 186 highlights

AIC-6915 Ethernet LAN Controller Programmer's Manual 8-26 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.NumFrags++; CurrentTxDescIndex++; // 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,

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190

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.NumFrags++;
CurrentTxDescIndex++;
// 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,