118 PBYTE pbyDesireBSSID,
131 if (pbyDesireBSSID !=
NULL) {
133 "BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
134 if ((!is_broadcast_ether_addr(pbyDesireBSSID)) &&
135 (
memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){
136 pbyBSSID = pbyDesireBSSID;
139 if (pbyDesireSSID !=
NULL) {
150 pCurrBSS->bSelected =
FALSE;
152 if ((pCurrBSS->bActive) &&
153 (pCurrBSS->bSelected ==
FALSE)) {
154 if (!compare_ether_addr(pCurrBSS->abyBSSID, pbyBSSID)) {
157 if ( !
memcmp(pSSID->abySSID,
164 pCurrBSS->bSelected =
TRUE;
173 pCurrBSS->bSelected =
TRUE;
189 pCurrBSS->bSelected =
FALSE;
190 if (pCurrBSS->bActive) {
194 if (
memcmp(pSSID->abySSID,
219 pMgmt->
pSameBSS[jj].uChannel = pCurrBSS->uChannel;
221 "BSSpSearchBSSList pSelect1[%pM]\n",
226 if (pSelect ==
NULL) {
230 if (pCurrBSS->uRSSI < pSelect->uRSSI) {
239 if (pSelect !=
NULL) {
240 pSelect->bSelected =
TRUE;
273 if (bKeepCurrBSSID) {
275 !compare_ether_addr(pMgmt->
sBSSList[ii].abyBSSID,
313 if (pBSSList->bActive) {
314 if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) {
316 if (
memcmp(pSSID->abySSID,
356 void *pRxPacketContext)
372 if (!pBSSList->bActive)
376 if (ii == MAX_BSS_NUM){
381 pBSSList->bActive =
TRUE;
385 pBSSList->wBeaconInterval =
cpu_to_le16(wBeaconInterval);
387 pBSSList->uClearCount = 0;
399 if (pExtSuppRates !=
NULL) {
408 pBSSList->sERP.byERP = psERP->
byERP;
409 pBSSList->sERP.bERPExist = psERP->
bERPExist;
415 if (pBSSList->sERP.bERPExist ==
TRUE) {
422 pBSSList->byRxRate = pRxPacket->
byRxRate;
424 pBSSList->uRSSI = pRxPacket->
uRSSI;
425 pBSSList->bySQ = pRxPacket->
bySQ;
431 bParsingQuiet =
TRUE;
437 if (pRSNWPA !=
NULL) {
438 unsigned int uLen = pRSNWPA->
len + 2;
440 if (uLen <= (uIELength -
442 pBSSList->wWPALen = uLen;
443 memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
451 unsigned int uLen = pRSN->
len + 2;
453 if (uLen <= (uIELength -
455 pBSSList->wRSNLen = uLen;
456 memcpy(pBSSList->byRSNIE, pRSN, uLen);
466 for (ii = 0; ii < pBSSList->wAKMSSAuthCount; ii ++) {
477 &pBSSList->sRSNCapObj);
493 pBSSList->byRSSIStatCnt = 0;
495 pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
496 pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
498 pBSSList->ldBmAverage[ii] = 0;
504 memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
538 void *pRxPacketContext)
544 signed long ldBm, ldBmSum;
547 if (pBSSList ==
NULL)
553 pBSSList->wBeaconInterval =
cpu_to_le16(wBeaconInterval);
555 pBSSList->uClearCount = 0;
561 if ((pSSID->len != 0) && (pSSID->abySSID[0] != 0))
565 if (pExtSuppRates !=
NULL) {
570 pBSSList->sERP.byERP = psERP->
byERP;
571 pBSSList->sERP.bERPExist = psERP->
bERPExist;
577 if (pBSSList->sERP.bERPExist ==
TRUE) {
584 pBSSList->byRxRate = pRxPacket->
byRxRate;
587 pBSSList->uRSSI = pRxPacket->
uRSSI;
588 pBSSList->bySQ = pRxPacket->
bySQ;
594 bParsingQuiet =
TRUE;
600 if (pRSNWPA !=
NULL) {
601 unsigned int uLen = pRSNWPA->
len + 2;
602 if (uLen <= (uIELength -
604 pBSSList->wWPALen = uLen;
605 memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
613 unsigned int uLen = pRSN->
len + 2;
614 if (uLen <= (uIELength -
616 pBSSList->wRSNLen = uLen;
617 memcpy(pBSSList->byRSNIE, pRSN, uLen);
622 if (pRxPacket->
uRSSI != 0) {
625 pBSSList->byRSSIStatCnt++;
627 pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm;
630 if (pBSSList->ldBmAverage[ii] != 0) {
632 max(pBSSList->ldBmAverage[ii], ldBm);
634 pBSSList->ldBmAverage[ii];
638 pBSSList->ldBmAverRange = ldBmSum /jj;
644 memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
665 unsigned int *puNodeIndex)
674 if (!compare_ether_addr(abyDstAddr,
703 unsigned int BigestCount = 0;
704 unsigned int SelectIndex;
723 *puNodeIndex = SelectIndex;
763 BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
842 if (!pDevice->bEnableHostWEP)
882 unsigned int uSleepySTACnt = 0;
883 unsigned int uNonShortSlotSTACnt = 0;
884 unsigned int uLongPreambleSTACnt = 0;
887 spin_lock_irq(&pDevice->
lock);
914 printk(
"Re-association timeout!!!\n");
916 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
920 memset(&wrqu, 0,
sizeof (wrqu));
922 PRINT_K(
"wireless_send_event--->SIOCGIWAP(disassociated)\n");
935 memset(&wrqu, 0,
sizeof(wrqu));
965 uLongPreambleSTACnt ++;
972 uNonShortSlotSTACnt++;
1031 if (uNonShortSlotSTACnt > 0) {
1048 if (uLongPreambleSTACnt > 0) {
1066 if (uSleepySTACnt > 0)
1097 netif_stop_queue(pDevice->
dev);
1112 skb_reset_mac_header(pDevice->
skb);
1119 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1122 memset(&wrqu, 0,
sizeof (wrqu));
1124 PRINT_K(
"wireless_send_event--->SIOCGIWAP(disassociated)\n");
1130 else if (pItemSSID->len != 0) {
1154 skb_reset_mac_header(pDevice->
skb);
1172 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1222 netif_stop_queue(pDevice->
dev);
1230 if (netif_queue_stopped(pDevice->
dev))
1231 netif_wake_queue(pDevice->
dev);
1234 spin_unlock_irq(&pDevice->
lock);
1260 unsigned int uNodeIndex = 0;
1270 byPktNum = (byPktNO & 0x0F) >> 4;
1271 byTxRetry = (byTSR & 0xF0) >> 4;
1272 wRate = (
WORD) (byPktNO & 0xF0) >> 4;
1293 wFallBackRate = wRate;
1310 if (byTxRetry != 0) {
1316 for (ii = 0; ii < byTxRetry; ii++) {
1326 for (ii = 0; ii < byTxRetry; ii++) {
1351 wFallBackRate = wRate;
1368 if (byTxRetry != 0) {
1374 for (ii = 0; ii < byTxRetry; ii++) {
1384 for (ii = 0; ii < byTxRetry; ii++) {
1417 unsigned int uStartIndex)
1424 for (ii = uStartIndex; ii < (
MAX_NODE_NUM + 1); ii++) {
1448 if (pBSSList !=
NULL) {
1450 signed long LocalldBmAverage = 0;
1451 signed long uNumofdBm = 0;
1453 if (pBSSList->ldBmAverage[ii] != 0) {
1455 LocalldBmAverage += pBSSList->ldBmAverage[ii];
1458 if (uNumofdBm > 0) {
1459 LocalldBmAverage = LocalldBmAverage/uNumofdBm;
1462 if (LocalldBmAverage < pDevice->ldBmThreshold[ii]) {
1484 unsigned long TxOkRatio, TxCnt;
1485 unsigned long RxOkRatio, RxCnt;
1486 unsigned long RssiRatio;
1508 else if(-ldBm > 90) {
1512 RssiRatio = (40-(-ldBm-50))*4000/40;
1543 if (pBSSList !=
NULL) {