diff options
-rw-r--r-- | drivers/staging/winbond/mds.c | 173 |
1 files changed, 82 insertions, 91 deletions
diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c index b6c09217230..9217762b181 100644 --- a/drivers/staging/winbond/mds.c +++ b/drivers/staging/winbond/mds.c | |||
@@ -14,7 +14,7 @@ Mds_initial(struct wbsoft_priv *adapter) | |||
14 | pMds->TxRTSThreshold = DEFAULT_RTSThreshold; | 14 | pMds->TxRTSThreshold = DEFAULT_RTSThreshold; |
15 | pMds->TxFragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; | 15 | pMds->TxFragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; |
16 | 16 | ||
17 | return hal_get_tx_buffer( &adapter->sHwData, &pMds->pTxBuffer ); | 17 | return hal_get_tx_buffer(&adapter->sHwData, &pMds->pTxBuffer); |
18 | } | 18 | } |
19 | 19 | ||
20 | void | 20 | void |
@@ -43,14 +43,13 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor | |||
43 | pT01 = (struct T01_descriptor *)(buffer+4); | 43 | pT01 = (struct T01_descriptor *)(buffer+4); |
44 | pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize); | 44 | pNextT00 = (struct T00_descriptor *)(buffer+OffsetSize); |
45 | 45 | ||
46 | if( buffer[ DOT_11_DA_OFFSET+8 ] & 0x1 ) /* +8 for USB hdr */ | 46 | if (buffer[DOT_11_DA_OFFSET+8] & 0x1) /* +8 for USB hdr */ |
47 | boGroupAddr = true; | 47 | boGroupAddr = true; |
48 | 48 | ||
49 | /****************************************** | 49 | /****************************************** |
50 | * Set RTS/CTS mechanism | 50 | * Set RTS/CTS mechanism |
51 | ******************************************/ | 51 | ******************************************/ |
52 | if (!boGroupAddr) | 52 | if (!boGroupAddr) { |
53 | { | ||
54 | /* NOTE : If the protection mode is enabled and the MSDU will be fragmented, | 53 | /* NOTE : If the protection mode is enabled and the MSDU will be fragmented, |
55 | * the tx rates of MPDUs will all be DSSS rates. So it will not use | 54 | * the tx rates of MPDUs will all be DSSS rates. So it will not use |
56 | * CTS-to-self in this case. CTS-To-self will only be used when without | 55 | * CTS-to-self in this case. CTS-To-self will only be used when without |
@@ -58,23 +57,19 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor | |||
58 | BodyLen = (u16)pT00->T00_frame_length; /* include 802.11 header */ | 57 | BodyLen = (u16)pT00->T00_frame_length; /* include 802.11 header */ |
59 | BodyLen += 4; /* CRC */ | 58 | BodyLen += 4; /* CRC */ |
60 | 59 | ||
61 | if( BodyLen >= CURRENT_RTS_THRESHOLD ) | 60 | if (BodyLen >= CURRENT_RTS_THRESHOLD) |
62 | RTS_on = true; /* Using RTS */ | 61 | RTS_on = true; /* Using RTS */ |
63 | else | 62 | else { |
64 | { | 63 | if (pT01->T01_modulation_type) { /* Is using OFDM */ |
65 | if( pT01->T01_modulation_type ) /* Is using OFDM */ | 64 | if (CURRENT_PROTECT_MECHANISM) /* Is using protect */ |
66 | { | ||
67 | if( CURRENT_PROTECT_MECHANISM ) /* Is using protect */ | ||
68 | CTS_on = true; /* Using CTS */ | 65 | CTS_on = true; /* Using CTS */ |
69 | } | 66 | } |
70 | } | 67 | } |
71 | } | 68 | } |
72 | 69 | ||
73 | if( RTS_on || CTS_on ) | 70 | if (RTS_on || CTS_on) { |
74 | { | 71 | if (pT01->T01_modulation_type) { /* Is using OFDM */ |
75 | if( pT01->T01_modulation_type) /* Is using OFDM */ | 72 | /* CTS duration |
76 | { | ||
77 | /* CTS duration | ||
78 | * 2 SIFS + DATA transmit time + 1 ACK | 73 | * 2 SIFS + DATA transmit time + 1 ACK |
79 | * ACK Rate : 24 Mega bps | 74 | * ACK Rate : 24 Mega bps |
80 | * ACK frame length = 14 bytes */ | 75 | * ACK frame length = 14 bytes */ |
@@ -82,44 +77,38 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor | |||
82 | 2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + | 77 | 2*PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + |
83 | ((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym + | 78 | ((BodyLen*8 + 22 + Rate*4 - 1)/(Rate*4))*Tsym + |
84 | ((112 + 22 + 95)/96)*Tsym; | 79 | ((112 + 22 + 95)/96)*Tsym; |
85 | } | 80 | } else { /* DSSS */ |
86 | else /* DSSS */ | ||
87 | { | ||
88 | /* CTS duration | 81 | /* CTS duration |
89 | * 2 SIFS + DATA transmit time + 1 ACK | 82 | * 2 SIFS + DATA transmit time + 1 ACK |
90 | * Rate : ?? Mega bps | 83 | * Rate : ?? Mega bps |
91 | * ACK frame length = 14 bytes */ | 84 | * ACK frame length = 14 bytes */ |
92 | if( pT01->T01_plcp_header_length ) /* long preamble */ | 85 | if (pT01->T01_plcp_header_length) /* long preamble */ |
93 | Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME*2; | 86 | Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME*2; |
94 | else | 87 | else |
95 | Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*2; | 88 | Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*2; |
96 | 89 | ||
97 | Duration += ( ((BodyLen + 14)*8 + Rate-1) / Rate + | 90 | Duration += (((BodyLen + 14)*8 + Rate-1) / Rate + |
98 | DEFAULT_SIFSTIME*2 ); | 91 | DEFAULT_SIFSTIME*2); |
99 | } | 92 | } |
100 | 93 | ||
101 | if( RTS_on ) | 94 | if (RTS_on) { |
102 | { | 95 | if (pT01->T01_modulation_type) { /* Is using OFDM */ |
103 | if( pT01->T01_modulation_type ) /* Is using OFDM */ | ||
104 | { | ||
105 | /* CTS + 1 SIFS + CTS duration | 96 | /* CTS + 1 SIFS + CTS duration |
106 | * CTS Rate : 24 Mega bps | 97 | * CTS Rate : 24 Mega bps |
107 | * CTS frame length = 14 bytes */ | 98 | * CTS frame length = 14 bytes */ |
108 | Duration += (DEFAULT_SIFSTIME + | 99 | Duration += (DEFAULT_SIFSTIME + |
109 | PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + | 100 | PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION + |
110 | ((112 + 22 + 95)/96)*Tsym); | 101 | ((112 + 22 + 95)/96)*Tsym); |
111 | } | 102 | } else { |
112 | else | ||
113 | { | ||
114 | /* CTS + 1 SIFS + CTS duration | 103 | /* CTS + 1 SIFS + CTS duration |
115 | * CTS Rate : ?? Mega bps | 104 | * CTS Rate : ?? Mega bps |
116 | * CTS frame length = 14 bytes */ | 105 | * CTS frame length = 14 bytes */ |
117 | if( pT01->T01_plcp_header_length ) /* long preamble */ | 106 | if (pT01->T01_plcp_header_length) /* long preamble */ |
118 | Duration += LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; | 107 | Duration += LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; |
119 | else | 108 | else |
120 | Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; | 109 | Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; |
121 | 110 | ||
122 | Duration += ( ((112 + Rate-1) / Rate) + DEFAULT_SIFSTIME ); | 111 | Duration += (((112 + Rate-1) / Rate) + DEFAULT_SIFSTIME); |
123 | } | 112 | } |
124 | } | 113 | } |
125 | 114 | ||
@@ -132,17 +121,14 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor | |||
132 | /****************************************** | 121 | /****************************************** |
133 | * Fill the more fragment descriptor | 122 | * Fill the more fragment descriptor |
134 | ******************************************/ | 123 | ******************************************/ |
135 | if( boGroupAddr ) | 124 | if (boGroupAddr) |
136 | Duration = 0; | 125 | Duration = 0; |
137 | else | 126 | else { |
138 | { | 127 | for (i = pDes->FragmentCount-1; i > 0; i--) { |
139 | for( i=pDes->FragmentCount-1; i>0; i-- ) | ||
140 | { | ||
141 | NextBodyLen = (u16)pNextT00->T00_frame_length; | 128 | NextBodyLen = (u16)pNextT00->T00_frame_length; |
142 | NextBodyLen += 4; /* CRC */ | 129 | NextBodyLen += 4; /* CRC */ |
143 | 130 | ||
144 | if( pT01->T01_modulation_type ) | 131 | if (pT01->T01_modulation_type) { |
145 | { | ||
146 | /* OFDM | 132 | /* OFDM |
147 | * data transmit time + 3 SIFS + 2 ACK | 133 | * data transmit time + 3 SIFS + 2 ACK |
148 | * Rate : ??Mega bps | 134 | * Rate : ??Mega bps |
@@ -151,28 +137,26 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor | |||
151 | Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym + | 137 | Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym + |
152 | (((2*14)*8 + 22 + 95)/96)*Tsym + | 138 | (((2*14)*8 + 22 + 95)/96)*Tsym + |
153 | DEFAULT_SIFSTIME*3); | 139 | DEFAULT_SIFSTIME*3); |
154 | } | 140 | } else { |
155 | else | ||
156 | { | ||
157 | /* DSSS | 141 | /* DSSS |
158 | * data transmit time + 2 ACK + 3 SIFS | 142 | * data transmit time + 2 ACK + 3 SIFS |
159 | * Rate : ??Mega bps | 143 | * Rate : ??Mega bps |
160 | * ACK frame length = 14 bytes | 144 | * ACK frame length = 14 bytes |
161 | * TODO : */ | 145 | * TODO : */ |
162 | if( pT01->T01_plcp_header_length ) /* long preamble */ | 146 | if (pT01->T01_plcp_header_length) /* long preamble */ |
163 | Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME*3; | 147 | Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME*3; |
164 | else | 148 | else |
165 | Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*3; | 149 | Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*3; |
166 | 150 | ||
167 | Duration += ( ((NextBodyLen + (2*14))*8 + Rate-1) / Rate + | 151 | Duration += (((NextBodyLen + (2*14))*8 + Rate-1) / Rate + |
168 | DEFAULT_SIFSTIME*3 ); | 152 | DEFAULT_SIFSTIME*3); |
169 | } | 153 | } |
170 | 154 | ||
171 | ((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */ | 155 | ((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */ |
172 | 156 | ||
173 | /* ----20061009 add by anson's endian */ | 157 | /* ----20061009 add by anson's endian */ |
174 | pNextT00->value = cpu_to_le32(pNextT00->value); | 158 | pNextT00->value = cpu_to_le32(pNextT00->value); |
175 | pT01->value = cpu_to_le32( pT01->value ); | 159 | pT01->value = cpu_to_le32(pT01->value); |
176 | /* ----end 20061009 add by anson's endian */ | 160 | /* ----end 20061009 add by anson's endian */ |
177 | 161 | ||
178 | buffer += OffsetSize; | 162 | buffer += OffsetSize; |
@@ -184,28 +168,25 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter, struct wb35_descriptor | |||
184 | /******************************************* | 168 | /******************************************* |
185 | * Fill the last fragment descriptor | 169 | * Fill the last fragment descriptor |
186 | *******************************************/ | 170 | *******************************************/ |
187 | if( pT01->T01_modulation_type ) | 171 | if (pT01->T01_modulation_type) { |
188 | { | ||
189 | /* OFDM | 172 | /* OFDM |
190 | * 1 SIFS + 1 ACK | 173 | * 1 SIFS + 1 ACK |
191 | * Rate : 24 Mega bps | 174 | * Rate : 24 Mega bps |
192 | * ACK frame length = 14 bytes */ | 175 | * ACK frame length = 14 bytes */ |
193 | Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION; | 176 | Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION; |
194 | /* The Tx rate of ACK use 24M */ | 177 | /* The Tx rate of ACK use 24M */ |
195 | Duration += (((112 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME ); | 178 | Duration += (((112 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME); |
196 | } | 179 | } else { |
197 | else | ||
198 | { | ||
199 | /* DSSS | 180 | /* DSSS |
200 | * 1 ACK + 1 SIFS | 181 | * 1 ACK + 1 SIFS |
201 | * Rate : ?? Mega bps | 182 | * Rate : ?? Mega bps |
202 | * ACK frame length = 14 bytes(112 bits) */ | 183 | * ACK frame length = 14 bytes(112 bits) */ |
203 | if( pT01->T01_plcp_header_length ) /* long preamble */ | 184 | if (pT01->T01_plcp_header_length) /* long preamble */ |
204 | Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; | 185 | Duration = LONG_PREAMBLE_PLUS_PLCPHEADER_TIME; |
205 | else | 186 | else |
206 | Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; | 187 | Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME; |
207 | 188 | ||
208 | Duration += ( (112 + Rate-1)/Rate + DEFAULT_SIFSTIME ); | 189 | Duration += ((112 + Rate-1)/Rate + DEFAULT_SIFSTIME); |
209 | } | 190 | } |
210 | } | 191 | } |
211 | 192 | ||
@@ -247,10 +228,10 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe | |||
247 | SizeLeft -= CopySize; | 228 | SizeLeft -= CopySize; |
248 | 229 | ||
249 | /* 1 Byte operation */ | 230 | /* 1 Byte operation */ |
250 | pctmp = (u8 *)( buffer + 8 + DOT_11_SEQUENCE_OFFSET ); | 231 | pctmp = (u8 *)(buffer + 8 + DOT_11_SEQUENCE_OFFSET); |
251 | *pctmp &= 0xf0; | 232 | *pctmp &= 0xf0; |
252 | *pctmp |= FragmentCount; /* 931130.5.m */ | 233 | *pctmp |= FragmentCount; /* 931130.5.m */ |
253 | if( !FragmentCount ) | 234 | if (!FragmentCount) |
254 | pT00->T00_first_mpdu = 1; | 235 | pT00->T00_first_mpdu = 1; |
255 | 236 | ||
256 | buffer += 32; /* 8B usb + 24B 802.11 header */ | 237 | buffer += 32; /* 8B usb + 24B 802.11 header */ |
@@ -286,15 +267,13 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe | |||
286 | /* 931130.5.n */ | 267 | /* 931130.5.n */ |
287 | if (pMds->MicAdd) { | 268 | if (pMds->MicAdd) { |
288 | if (!SizeLeft) { | 269 | if (!SizeLeft) { |
289 | pMds->MicWriteAddress[ pMds->MicWriteIndex ] = buffer - pMds->MicAdd; | 270 | pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - pMds->MicAdd; |
290 | pMds->MicWriteSize[ pMds->MicWriteIndex ] = pMds->MicAdd; | 271 | pMds->MicWriteSize[pMds->MicWriteIndex] = pMds->MicAdd; |
291 | pMds->MicAdd = 0; | 272 | pMds->MicAdd = 0; |
292 | } | 273 | } else if (SizeLeft < 8) { /* 931130.5.p */ |
293 | else if( SizeLeft < 8 ) /* 931130.5.p */ | ||
294 | { | ||
295 | pMds->MicAdd = SizeLeft; | 274 | pMds->MicAdd = SizeLeft; |
296 | pMds->MicWriteAddress[ pMds->MicWriteIndex ] = buffer - ( 8 - SizeLeft ); | 275 | pMds->MicWriteAddress[pMds->MicWriteIndex] = buffer - (8 - SizeLeft); |
297 | pMds->MicWriteSize[ pMds->MicWriteIndex ] = 8 - SizeLeft; | 276 | pMds->MicWriteSize[pMds->MicWriteIndex] = 8 - SizeLeft; |
298 | pMds->MicWriteIndex++; | 277 | pMds->MicWriteIndex++; |
299 | } | 278 | } |
300 | } | 279 | } |
@@ -302,7 +281,7 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe | |||
302 | /* Does it need to generate the new header for next mpdu? */ | 281 | /* Does it need to generate the new header for next mpdu? */ |
303 | if (SizeLeft) { | 282 | if (SizeLeft) { |
304 | buffer = TargetBuffer + Size; /* Get the next 4n start address */ | 283 | buffer = TargetBuffer + Size; /* Get the next 4n start address */ |
305 | memcpy( buffer, TargetBuffer, 32 ); /* Copy 8B USB +24B 802.11 */ | 284 | memcpy(buffer, TargetBuffer, 32); /* Copy 8B USB +24B 802.11 */ |
306 | pT00 = (struct T00_descriptor *)buffer; | 285 | pT00 = (struct T00_descriptor *)buffer; |
307 | pT00->T00_first_mpdu = 0; | 286 | pT00->T00_first_mpdu = 0; |
308 | } | 287 | } |
@@ -350,7 +329,7 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor * | |||
350 | 329 | ||
351 | FragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; /* Do not fragment */ | 330 | FragmentThreshold = DEFAULT_FRAGMENT_THRESHOLD; /* Do not fragment */ |
352 | /* Copy full data, the 1'st buffer contain all the data 931130.5.j */ | 331 | /* Copy full data, the 1'st buffer contain all the data 931130.5.j */ |
353 | memcpy( TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE ); /* Copy header */ | 332 | memcpy(TargetBuffer, src_buffer, DOT_11_MAC_HEADER_SIZE); /* Copy header */ |
354 | pDes->buffer_address[0] = src_buffer + DOT_11_MAC_HEADER_SIZE; | 333 | pDes->buffer_address[0] = src_buffer + DOT_11_MAC_HEADER_SIZE; |
355 | pDes->buffer_total_size -= DOT_11_MAC_HEADER_SIZE; | 334 | pDes->buffer_total_size -= DOT_11_MAC_HEADER_SIZE; |
356 | pDes->buffer_size[0] = pDes->buffer_total_size; | 335 | pDes->buffer_size[0] = pDes->buffer_total_size; |
@@ -377,26 +356,38 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor * | |||
377 | 356 | ||
378 | pT01->T01_modulation_type = (ctmp1%3) ? 0 : 1; | 357 | pT01->T01_modulation_type = (ctmp1%3) ? 0 : 1; |
379 | 358 | ||
380 | for( i=0; i<2; i++ ) { | 359 | for (i = 0; i < 2; i++) { |
381 | if( i == 1 ) | 360 | if (i == 1) |
382 | ctmp1 = ctmpf; | 361 | ctmp1 = ctmpf; |
383 | 362 | ||
384 | pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1; /* backup the ta rate and fall back rate */ | 363 | pMds->TxRate[pDes->Descriptor_ID][i] = ctmp1; /* backup the ta rate and fall back rate */ |
385 | 364 | ||
386 | if( ctmp1 == 108) ctmp2 = 7; | 365 | if (ctmp1 == 108) |
387 | else if( ctmp1 == 96 ) ctmp2 = 6; /* Rate convert for USB */ | 366 | ctmp2 = 7; |
388 | else if( ctmp1 == 72 ) ctmp2 = 5; | 367 | else if (ctmp1 == 96) |
389 | else if( ctmp1 == 48 ) ctmp2 = 4; | 368 | ctmp2 = 6; /* Rate convert for USB */ |
390 | else if( ctmp1 == 36 ) ctmp2 = 3; | 369 | else if (ctmp1 == 72) |
391 | else if( ctmp1 == 24 ) ctmp2 = 2; | 370 | ctmp2 = 5; |
392 | else if( ctmp1 == 18 ) ctmp2 = 1; | 371 | else if (ctmp1 == 48) |
393 | else if( ctmp1 == 12 ) ctmp2 = 0; | 372 | ctmp2 = 4; |
394 | else if( ctmp1 == 22 ) ctmp2 = 3; | 373 | else if (ctmp1 == 36) |
395 | else if( ctmp1 == 11 ) ctmp2 = 2; | 374 | ctmp2 = 3; |
396 | else if( ctmp1 == 4 ) ctmp2 = 1; | 375 | else if (ctmp1 == 24) |
397 | else ctmp2 = 0; /* if( ctmp1 == 2 ) or default */ | 376 | ctmp2 = 2; |
398 | 377 | else if (ctmp1 == 18) | |
399 | if( i == 0 ) | 378 | ctmp2 = 1; |
379 | else if (ctmp1 == 12) | ||
380 | ctmp2 = 0; | ||
381 | else if (ctmp1 == 22) | ||
382 | ctmp2 = 3; | ||
383 | else if (ctmp1 == 11) | ||
384 | ctmp2 = 2; | ||
385 | else if (ctmp1 == 4) | ||
386 | ctmp2 = 1; | ||
387 | else | ||
388 | ctmp2 = 0; /* if( ctmp1 == 2 ) or default */ | ||
389 | |||
390 | if (i == 0) | ||
400 | pT01->T01_transmit_rate = ctmp2; | 391 | pT01->T01_transmit_rate = ctmp2; |
401 | else | 392 | else |
402 | pT01->T01_fall_back_rate = ctmp2; | 393 | pT01->T01_fall_back_rate = ctmp2; |
@@ -474,14 +465,14 @@ Mds_Tx(struct wbsoft_priv *adapter) | |||
474 | 465 | ||
475 | TxDesIndex = pMds->TxDesIndex; /* Get the current ID */ | 466 | TxDesIndex = pMds->TxDesIndex; /* Get the current ID */ |
476 | pTxDes->Descriptor_ID = TxDesIndex; | 467 | pTxDes->Descriptor_ID = TxDesIndex; |
477 | pMds->TxDesFrom[ TxDesIndex ] = 2; /* Storing the information of source comming from */ | 468 | pMds->TxDesFrom[TxDesIndex] = 2; /* Storing the information of source comming from */ |
478 | pMds->TxDesIndex++; | 469 | pMds->TxDesIndex++; |
479 | pMds->TxDesIndex %= MAX_USB_TX_DESCRIPTOR; | 470 | pMds->TxDesIndex %= MAX_USB_TX_DESCRIPTOR; |
480 | 471 | ||
481 | MLME_GetNextPacket( adapter, pTxDes ); | 472 | MLME_GetNextPacket(adapter, pTxDes); |
482 | 473 | ||
483 | /* Copy header. 8byte USB + 24byte 802.11Hdr. Set TxRate, Preamble type */ | 474 | /* Copy header. 8byte USB + 24byte 802.11Hdr. Set TxRate, Preamble type */ |
484 | Mds_HeaderCopy( adapter, pTxDes, XmitBufAddress ); | 475 | Mds_HeaderCopy(adapter, pTxDes, XmitBufAddress); |
485 | 476 | ||
486 | /* For speed up Key setting */ | 477 | /* For speed up Key setting */ |
487 | if (pTxDes->EapFix) { | 478 | if (pTxDes->EapFix) { |
@@ -502,7 +493,7 @@ Mds_Tx(struct wbsoft_priv *adapter) | |||
502 | XmitBufAddress += CurrentSize; | 493 | XmitBufAddress += CurrentSize; |
503 | 494 | ||
504 | #ifdef _IBSS_BEACON_SEQ_STICK_ | 495 | #ifdef _IBSS_BEACON_SEQ_STICK_ |
505 | if ((XmitBufAddress[ DOT_11_DA_OFFSET+8 ] & 0xfc) != MAC_SUBTYPE_MNGMNT_PROBE_REQUEST) /* +8 for USB hdr */ | 496 | if ((XmitBufAddress[DOT_11_DA_OFFSET+8] & 0xfc) != MAC_SUBTYPE_MNGMNT_PROBE_REQUEST) /* +8 for USB hdr */ |
506 | #endif | 497 | #endif |
507 | pMds->TxToggle = true; | 498 | pMds->TxToggle = true; |
508 | 499 | ||
@@ -520,7 +511,7 @@ Mds_Tx(struct wbsoft_priv *adapter) | |||
520 | /* Move to the next one, if necessary */ | 511 | /* Move to the next one, if necessary */ |
521 | if (BufferFilled) { | 512 | if (BufferFilled) { |
522 | /* size setting */ | 513 | /* size setting */ |
523 | pMds->TxBufferSize[ FillIndex ] = XmitBufSize; | 514 | pMds->TxBufferSize[FillIndex] = XmitBufSize; |
524 | 515 | ||
525 | /* 20060928 set Tx count */ | 516 | /* 20060928 set Tx count */ |
526 | pMds->TxCountInBuffer[FillIndex] = FillCount; | 517 | pMds->TxCountInBuffer[FillIndex] = FillCount; |
@@ -537,7 +528,7 @@ Mds_Tx(struct wbsoft_priv *adapter) | |||
537 | if (!PacketSize) /* No more pk for transmitting */ | 528 | if (!PacketSize) /* No more pk for transmitting */ |
538 | break; | 529 | break; |
539 | 530 | ||
540 | } while(true); | 531 | } while (true); |
541 | 532 | ||
542 | /* | 533 | /* |
543 | * Start to send by lower module | 534 | * Start to send by lower module |
@@ -545,8 +536,8 @@ Mds_Tx(struct wbsoft_priv *adapter) | |||
545 | if (!pHwData->IsKeyPreSet) | 536 | if (!pHwData->IsKeyPreSet) |
546 | Wb35Tx_start(adapter); | 537 | Wb35Tx_start(adapter); |
547 | 538 | ||
548 | cleanup: | 539 | cleanup: |
549 | atomic_dec(&pMds->TxThreadCount); | 540 | atomic_dec(&pMds->TxThreadCount); |
550 | } | 541 | } |
551 | 542 | ||
552 | void | 543 | void |
@@ -563,7 +554,7 @@ Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pT02) | |||
563 | if (pT02->T02_IsLastMpdu) { | 554 | if (pT02->T02_IsLastMpdu) { |
564 | /* TODO: DTO -- get the retry count and fragment count */ | 555 | /* TODO: DTO -- get the retry count and fragment count */ |
565 | /* Tx rate */ | 556 | /* Tx rate */ |
566 | TxRate = pMds->TxRate[ PacketId ][ 0 ]; | 557 | TxRate = pMds->TxRate[PacketId][0]; |
567 | RetryCount = (u8)pT02->T02_MPDU_Cnt; | 558 | RetryCount = (u8)pT02->T02_MPDU_Cnt; |
568 | if (pT02->value & FLAG_ERROR_TX_MASK) { | 559 | if (pT02->value & FLAG_ERROR_TX_MASK) { |
569 | SendOK = false; | 560 | SendOK = false; |
@@ -572,7 +563,7 @@ Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pT02) | |||
572 | /* retry error */ | 563 | /* retry error */ |
573 | pHwData->dto_tx_retry_count += (RetryCount+1); | 564 | pHwData->dto_tx_retry_count += (RetryCount+1); |
574 | /* [for tx debug] */ | 565 | /* [for tx debug] */ |
575 | if (RetryCount<7) | 566 | if (RetryCount < 7) |
576 | pHwData->tx_retry_count[RetryCount] += RetryCount; | 567 | pHwData->tx_retry_count[RetryCount] += RetryCount; |
577 | else | 568 | else |
578 | pHwData->tx_retry_count[7] += RetryCount; | 569 | pHwData->tx_retry_count[7] += RetryCount; |
@@ -597,7 +588,7 @@ Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pT02) | |||
597 | } | 588 | } |
598 | 589 | ||
599 | /* Clear send result buffer */ | 590 | /* Clear send result buffer */ |
600 | pMds->TxResult[ PacketId ] = 0; | 591 | pMds->TxResult[PacketId] = 0; |
601 | } else | 592 | } else |
602 | pMds->TxResult[ PacketId ] |= ((u16)(pT02->value & 0x0ffff)); | 593 | pMds->TxResult[PacketId] |= ((u16)(pT02->value & 0x0ffff)); |
603 | } | 594 | } |