60 {0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C};
62 #define AUTORATE_TXOK_CNT 0x0400
63 #define AUTORATE_TXFAIL_CNT 0x0064
64 #define AUTORATE_TIMEOUT 10
76 psNodeDBTable->
uTxOk[ii] = 0;
109 byRate = byRate & 0x7F;
111 for (ii = 0; ii <
MAX_RATE; ii ++) {
135 #define AUTORATE_TXCNT_THRESHOLD 20
136 #define AUTORATE_INC_THRESHOLD 30
163 byRate = byRate & 0x7F;
165 for (ii = 0; ii <
MAX_RATE; ii ++) {
192 void *pDeviceHandler,
195 BOOL bUpdateBasicRate,
196 PWORD pwMaxBasicRate,
205 BYTE byHighSuppRate = 0;
208 unsigned int uRateLen;
211 if (pItemRates ==
NULL)
215 uRateLen = pItemRates->len;
226 for (ii = 0; ii < uRateLen; ii++) {
227 byRate = (
BYTE)(pItemRates->abyRates[ii]);
229 (bUpdateBasicRate ==
TRUE)) {
234 byRate = (
BYTE)(pItemRates->abyRates[ii]&0x7F);
235 if (byHighSuppRate == 0)
236 byHighSuppRate = byRate;
237 if (byRate > byHighSuppRate)
238 byHighSuppRate = byRate;
244 unsigned int uExtRateLen = pItemExtRates->len;
249 for (ii = 0; ii < uExtRateLen ; ii++) {
250 byRate = (
BYTE)(pItemExtRates->abyRates[ii]);
257 byRate = (
BYTE)(pItemExtRates->abyRates[ii]&0x7F);
258 if (byHighSuppRate == 0)
259 byHighSuppRate = byRate;
260 if (byRate > byHighSuppRate)
261 byHighSuppRate = byRate;
301 #define AUTORATE_TXCNT_THRESHOLD 20
302 #define AUTORATE_INC_THRESHOLD 30
306 void *pDeviceHandler,
312 WORD wIdxDownRate = 0;
314 BOOL bAutoRate[
MAX_RATE] = {
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,TRUE};
315 DWORD dwThroughputTbl[
MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540};
316 DWORD dwThroughput = 0;
340 if (psNodeDBTable->
wSuppRate & (0x0001<<ii)) {
341 if (bAutoRate[ii] ==
TRUE) {
342 wIdxUpRate = (
WORD) ii;
345 bAutoRate[ii] =
FALSE;
349 for (ii = 0; ii <= psNodeDBTable->
wTxDataRate; ii++) {
350 if ( (psNodeDBTable->
uTxOk[ii] != 0) ||
351 (psNodeDBTable->
uTxFail[ii] != 0) ) {
352 dwThroughputTbl[ii] *= psNodeDBTable->
uTxOk[ii];
354 psNodeDBTable->
uTxFail[ii] *= 4;
356 dwThroughputTbl[ii] /= (psNodeDBTable->
uTxOk[ii] + psNodeDBTable->
uTxFail[ii]);
359 ii, (
int)psNodeDBTable->
uTxOk[ii], (
int)psNodeDBTable->
uTxFail[ii], (
int)dwThroughputTbl[ii]);
361 dwThroughput = dwThroughputTbl[psNodeDBTable->
wTxDataRate];
366 if ( (dwThroughputTbl[ii] > dwThroughput) &&
367 (bAutoRate[ii]==
TRUE) ) {
368 dwThroughput = dwThroughputTbl[ii];
369 wIdxDownRate = (
WORD) ii;
373 if (psNodeDBTable->
uTxOk[MAX_RATE]) {
374 if (psNodeDBTable->
uTxOk[MAX_RATE] >
375 (psNodeDBTable->
uTxFail[MAX_RATE] * 4) ) {
379 if (psNodeDBTable->
uTxFail[MAX_RATE] == 0)
410 unsigned int uRateLen
413 unsigned int ii,
uu, uRateCnt = 0;
415 if ((pSrcRates ==
NULL) || (pDstRates ==
NULL))
418 if (pSrcRates->len == 0)
421 for (ii = 0; ii < uRateLen; ii++) {
422 for (uu = 0; uu < pSrcRates->len; uu++) {
423 if ((pSrcRates->abyRates[uu] & 0x7F) ==
acbyIERate[ii]) {
424 pDstRates->abyRates[uRateCnt ++] = pSrcRates->abyRates[uu];
429 return (
BYTE)uRateCnt;