128 void *hDeviceContext,
129 unsigned char *pbyDesireBSSID,
130 unsigned char *pbyDesireSSID,
136 unsigned char *pbyBSSID =
NULL;
140 unsigned char ZeroBSSID[
WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
143 if (pbyDesireBSSID !=
NULL) {
145 "BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
146 if ((!is_broadcast_ether_addr(pbyDesireBSSID)) &&
147 (
memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){
148 pbyBSSID = pbyDesireBSSID;
151 if (pbyDesireSSID !=
NULL) {
157 if (pbyBSSID !=
NULL) {
161 if(pDevice->
bLinkPass==
false) pCurrBSS->bSelected =
false;
162 if ((pCurrBSS->bActive) &&
163 (pCurrBSS->bSelected ==
false)) {
164 if (!compare_ether_addr(pCurrBSS->abyBSSID, pbyBSSID)) {
167 if ( !
memcmp(pSSID->abySSID,
174 pCurrBSS->bSelected =
true;
183 pCurrBSS->bSelected =
true;
195 pCurrBSS->bSelected =
false;
196 if (pCurrBSS->bActive) {
200 if (! !
memcmp(pSSID->abySSID,
244 if (pSelect ==
NULL) {
248 if (pCurrBSS->uRSSI < pSelect->uRSSI) {
254 if (pSelect !=
NULL) {
255 pSelect->bSelected =
true;
284 void *hDeviceContext,
293 if (bKeepCurrBSSID) {
306 pMgmt->
sBSSList[ii].bActive =
false;
327 void *hDeviceContext,
339 if (pBSSList->bActive) {
340 if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) {
344 if (
memcmp(pSSID->abySSID,
370 void *hDeviceContext,
371 unsigned char *abyBSSIDAddr,
385 unsigned char *pbyIEs,
386 void *pRxPacketContext
395 bool bParsingQuiet =
false;
404 if (!pBSSList->bActive)
408 if (ii == MAX_BSS_NUM){
413 pBSSList->bActive =
true;
417 pBSSList->wBeaconInterval =
cpu_to_le16(wBeaconInterval);
419 pBSSList->uClearCount = 0;
431 if (pExtSuppRates !=
NULL) {
440 pBSSList->sERP.byERP = psERP->
byERP;
441 pBSSList->sERP.bERPExist = psERP->
bERPExist;
447 if (pBSSList->sERP.bERPExist ==
true) {
454 pBSSList->byRxRate = pRxPacket->
byRxRate;
456 pBSSList->uRSSI = pRxPacket->
uRSSI;
457 pBSSList->bySQ = pRxPacket->
bySQ;
463 bParsingQuiet =
true;
469 if (pRSNWPA !=
NULL) {
470 unsigned int uLen = pRSNWPA->
len + 2;
472 if (uLen <= (uIELength - (
unsigned int)((
unsigned char *)pRSNWPA - pbyIEs))) {
473 pBSSList->wWPALen = uLen;
474 memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
482 unsigned int uLen = pRSN->
len + 2;
483 if (uLen <= (uIELength - (
unsigned int)((
unsigned char *)pRSN - pbyIEs))) {
484 pBSSList->wRSNLen = uLen;
485 memcpy(pBSSList->byRSNIE, pRSN, uLen);
493 bool bIs802_1x =
false;
495 for (ii = 0; ii < pBSSList->wAKMSSAuthCount; ii ++) {
520 pBSSList->byRSSIStatCnt = 0;
522 pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
524 pBSSList->ldBmAverage[ii] = 0;
527 if ((pIE_Country !=
NULL) &&
533 if ((bParsingQuiet ==
true) && (pIE_Quiet !=
NULL)) {
537 if (pQuiet ==
NULL) {
559 if ((bParsingQuiet ==
true) &&
567 memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
586 void *hDeviceContext,
602 unsigned char *pbyIEs,
603 void *pRxPacketContext
611 bool bParsingQuiet =
false;
616 if (pBSSList ==
NULL)
622 pBSSList->wBeaconInterval =
cpu_to_le16(wBeaconInterval);
624 pBSSList->uClearCount = 0;
631 if ((pSSID->len != 0) && (pSSID->abySSID[0] != 0))
635 if (pExtSuppRates !=
NULL) {
640 pBSSList->sERP.byERP = psERP->
byERP;
641 pBSSList->sERP.bERPExist = psERP->
bERPExist;
647 if (pBSSList->sERP.bERPExist ==
true) {
654 pBSSList->byRxRate = pRxPacket->
byRxRate;
657 pBSSList->uRSSI = pRxPacket->
uRSSI;
658 pBSSList->bySQ = pRxPacket->
bySQ;
664 bParsingQuiet =
true;
670 if (pRSNWPA !=
NULL) {
671 unsigned int uLen = pRSNWPA->
len + 2;
672 if (uLen <= (uIELength - (
unsigned int)((
unsigned char *)pRSNWPA - pbyIEs))) {
673 pBSSList->wWPALen = uLen;
674 memcpy(pBSSList->byWPAIE, pRSNWPA, uLen);
682 unsigned int uLen = pRSN->
len + 2;
683 if (uLen <= (uIELength - (
unsigned int)((
unsigned char *)pRSN - pbyIEs))) {
684 pBSSList->wRSNLen = uLen;
685 memcpy(pBSSList->byRSNIE, pRSN, uLen);
690 if (pRxPacket->
uRSSI != 0) {
693 pBSSList->byRSSIStatCnt++;
695 pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm;
697 if (pBSSList->ldBmAverage[ii] != 0) {
698 pBSSList->ldBmMAX =
max(pBSSList->ldBmAverage[ii], ldBm);
703 if ((pIE_Country !=
NULL) &&
709 if ((bParsingQuiet ==
true) && (pIE_Quiet !=
NULL)) {
713 if (pQuiet ==
NULL) {
735 if ((bParsingQuiet ==
true) &&
743 memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength);
764 unsigned int *puNodeIndex)
801 unsigned int BigestCount = 0;
802 unsigned int SelectIndex;
821 *puNodeIndex = SelectIndex;
858 void *hDeviceContext,
859 unsigned int uNodeIndex
865 unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
891 void *hDeviceContext,
892 unsigned short *pwCapInfo,
960 if (!pDevice->bEnableHostWEP)
1001 #ifdef FOR_LED_ON_NOTEBOOK
1007 void *hDeviceContext
1014 unsigned int uSleepySTACnt = 0;
1015 unsigned int uNonShortSlotSTACnt = 0;
1016 unsigned int uLongPreambleSTACnt = 0;
1019 spin_lock_irq(&pDevice->
lock);
1026 #ifdef FOR_LED_ON_NOTEBOOK
1087 printk(
"Re-association timeout!!!\n");
1089 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1093 memset(&wrqu, 0,
sizeof (wrqu));
1095 PRINT_K(
"wireless_send_event--->SIOCGIWAP(disassociated)\n");
1104 #ifdef Calcu_LinkQual
1130 uLongPreambleSTACnt ++;
1137 uNonShortSlotSTACnt++;
1205 if (uNonShortSlotSTACnt > 0) {
1222 if (uLongPreambleSTACnt > 0) {
1240 if (uSleepySTACnt > 0)
1273 netif_stop_queue(pDevice->
dev);
1284 skb_reset_mac_header(pDevice->
skb);
1291 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1295 memset(&wrqu, 0,
sizeof (wrqu));
1297 PRINT_K(
"wireless_send_event--->SIOCGIWAP(disassociated)\n");
1303 else if (pItemSSID->len != 0) {
1306 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1351 netif_stop_queue(pDevice->
dev);
1357 spin_unlock_irq(&pDevice->
lock);
1384 void *hDeviceContext,
1385 unsigned char byTsr0,
1386 unsigned char byTsr1,
1387 unsigned char *pbyBuffer,
1388 unsigned int uFIFOHeaderSize
1393 unsigned int uNodeIndex = 0;
1394 unsigned char byTxRetry = (byTsr0 &
TSR0_NCR);
1397 unsigned short wRate;
1398 unsigned short wFallBackRate =
RATE_1M;
1399 unsigned char byFallBack;
1415 wRate = pTxBufHead->wReserved;
1432 wFallBackRate = wRate;
1454 if (byTxRetry != 0) {
1461 for(ii=0;ii<byTxRetry;ii++)
1481 for(ii=0;ii<byTxRetry;ii++) {
1504 wFallBackRate = wRate;
1521 if (byTxRetry != 0) {
1527 for(ii=0;ii<byTxRetry;ii++) {
1535 for(ii=0;ii<byTxRetry;ii++) {
1577 void *hDeviceContext,
1578 unsigned int uStartIndex
1587 for (ii = uStartIndex; ii < (
MAX_NODE_NUM + 1); ii++) {
1605 void *hDeviceContext
1621 if (pBSSList !=
NULL) {
1623 long LocalldBmAverage = 0;
1626 if (pBSSList->ldBmAverage[ii] != 0) {
1628 LocalldBmAverage += pBSSList->ldBmAverage[ii];
1631 if (uNumofdBm > 0) {
1632 LocalldBmAverage = LocalldBmAverage/uNumofdBm;
1635 if (LocalldBmAverage < pDevice->ldBmThreshold[ii]) {
1655 void *hDeviceContext
1663 pMgmt->
sBSSList[ii].bSelected =
false;
1668 #ifdef Calcu_LinkQual
1670 void *hDeviceContext
1674 unsigned long TxOkRatio, TxCnt;
1675 unsigned long RxOkRatio,RxCnt;
1676 unsigned long RssiRatio;
1699 else if(-ldBm > 90) {
1703 RssiRatio = (40-(-ldBm-50))*4000/40;
1718 void *hDeviceContext
1728 if (pBSSList !=
NULL) {