59 {0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C};
61 #define AUTORATE_TXOK_CNT 0x0400
62 #define AUTORATE_TXFAIL_CNT 0x0064
63 #define AUTORATE_TIMEOUT 10
82 psNodeDBTable->
uTxOk[ii] = 0;
115 byRate = byRate & 0x7F;
117 for (ii = 0; ii <
MAX_RATE; ii ++) {
141 #define AUTORATE_TXCNT_THRESHOLD 20
142 #define AUTORATE_INC_THRESHOLD 30
169 byRate = byRate & 0x7F;
171 for (ii = 0; ii <
MAX_RATE; ii ++) {
199 void *pDeviceHandler,
202 bool bUpdateBasicRate,
203 unsigned short *pwMaxBasicRate,
204 unsigned short *pwMaxSuppRate,
205 unsigned short *pwSuppRate,
206 unsigned char *pbyTopCCKRate,
207 unsigned char *pbyTopOFDMRate
212 unsigned char byHighSuppRate = 0;
213 unsigned char byRate = 0;
214 unsigned short wOldBasicRate = pDevice->
wBasicRate;
215 unsigned int uRateLen;
218 if (pItemRates ==
NULL)
222 uRateLen = pItemRates->len;
233 for (ii = 0; ii < uRateLen; ii++) {
234 byRate = (
unsigned char)(pItemRates->abyRates[ii]);
236 (bUpdateBasicRate ==
true)) {
241 byRate = (
unsigned char)(pItemRates->abyRates[ii]&0x7F);
242 if (byHighSuppRate == 0)
243 byHighSuppRate = byRate;
244 if (byRate > byHighSuppRate)
245 byHighSuppRate = byRate;
251 unsigned int uExtRateLen = pItemExtRates->len;
256 for (ii = 0; ii < uExtRateLen ; ii++) {
257 byRate = (
unsigned char)(pItemExtRates->abyRates[ii]);
264 byRate = (
unsigned char)(pItemExtRates->abyRates[ii]&0x7F);
265 if (byHighSuppRate == 0)
266 byHighSuppRate = byRate;
267 if (byRate > byHighSuppRate)
268 byHighSuppRate = byRate;
307 #define AUTORATE_TXCNT_THRESHOLD 20
308 #define AUTORATE_INC_THRESHOLD 30
312 void *pDeviceHandler,
317 unsigned short wIdxDownRate = 0;
320 bool bAutoRate[
MAX_RATE] = {
true,
true,
true,
true,
false,
false,
true,
true,
true,
true,
true,
true};
321 unsigned long dwThroughputTbl[
MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540};
322 unsigned long dwThroughput = 0;
323 unsigned short wIdxUpRate = 0;
324 unsigned long dwTxDiff = 0;
348 if (psNodeDBTable->
wSuppRate & (0x0001<<ii)) {
349 if (bAutoRate[ii] ==
true) {
350 wIdxUpRate = (
unsigned short) ii;
353 bAutoRate[ii] =
false;
358 if ( (psNodeDBTable->
uTxOk[ii] != 0) ||
359 (psNodeDBTable->
uTxFail[ii] != 0) ) {
360 dwThroughputTbl[ii] *= psNodeDBTable->
uTxOk[ii];
362 psNodeDBTable->
uTxFail[ii] *= 4;
364 dwThroughputTbl[ii] /= (psNodeDBTable->
uTxOk[ii] + psNodeDBTable->
uTxFail[ii]);
369 dwThroughput = dwThroughputTbl[psNodeDBTable->
wTxDataRate];
374 if ( (dwThroughputTbl[ii] > dwThroughput) &&
375 (bAutoRate[ii]==
true) ) {
376 dwThroughput = dwThroughputTbl[ii];
377 wIdxDownRate = (
unsigned short) ii;
381 if (psNodeDBTable->
uTxOk[MAX_RATE]) {
382 if (psNodeDBTable->
uTxOk[MAX_RATE] >
383 (psNodeDBTable->
uTxFail[MAX_RATE] * 4) ) {
387 if (psNodeDBTable->
uTxFail[MAX_RATE] == 0)
416 unsigned int uRateLen
419 unsigned int ii,
uu, uRateCnt = 0;
421 if ((pSrcRates ==
NULL) || (pDstRates ==
NULL))
424 if (pSrcRates->len == 0)
427 for (ii = 0; ii < uRateLen; ii++) {
428 for (uu = 0; uu < pSrcRates->len; uu++) {
429 if ((pSrcRates->abyRates[uu] & 0x7F) ==
acbyIERate[ii]) {
430 pDstRates->abyRates[uRateCnt ++] = pSrcRates->abyRates[uu];
435 return (
unsigned char)uRateCnt;