96 static BOOL ChannelExceedZoneType(
104 s_MgrMakeAssocRequest(
109 WORD wListenInterval,
117 s_vMgrRxAssocRequest(
121 unsigned int uNodeIndex
126 s_MgrMakeReAssocRequest(
131 WORD wListenInterval,
139 s_vMgrRxAssocResponse(
148 s_vMgrRxDisassociation(
157 s_vMgrRxAuthenSequence_1(
165 s_vMgrRxAuthenSequence_2(
173 s_vMgrRxAuthenSequence_3(
181 s_vMgrRxAuthenSequence_4(
189 s_vMgrRxAuthentication(
197 s_vMgrRxDeauthentication(
207 s_vMgrRxProbeRequest(
215 s_vMgrRxProbeResponse(
244 WORD wCurrBeaconPeriod,
245 unsigned int uCurrChannel,
246 WORD wCurrATIMWinodw,
257 s_MgrMakeAssocResponse(
271 s_MgrMakeReAssocResponse(
285 s_MgrMakeProbeResponse(
289 WORD wCurrBeaconPeriod,
290 unsigned int uCurrChannel,
291 WORD wCurrATIMWinodw,
313 unsigned int uBSSMode,
327 static void Encyption_Rebuild(
441 pTxPacket = s_MgrMakeAssocRequest
453 if (pTxPacket !=
NULL ){
517 pTxPacket = s_MgrMakeReAssocRequest
529 if (pTxPacket !=
NULL ){
556 PBYTE abyDestAddress,
615 s_vMgrRxAssocRequest(
619 unsigned int uNodeIndex
625 WORD wAssocStatus = 0;
668 abyCurrExtSuppRates[1] = 0;
693 wAssocAID = (
WORD)uNodeIndex;
722 pTxPacket = s_MgrMakeAssocResponse
733 if (pTxPacket !=
NULL ){
735 if (pDevice->bEnableHostapd) {
771 s_vMgrRxReAssocRequest(
775 unsigned int uNodeIndex
781 WORD wAssocStatus = 0;
821 abyCurrExtSuppRates[1] = 0;
846 wAssocAID = (
WORD)uNodeIndex;
877 pTxPacket = s_MgrMakeReAssocResponse
889 if (pTxPacket !=
NULL ){
891 if (pDevice->bEnableHostapd) {
918 s_vMgrRxAssocResponse(
979 dev_kfree_skb(pDevice->
skb);
993 skb_reset_mac_header(pDevice->
skb);
1001 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1014 memset(&wrqu, 0,
sizeof (wrqu));
1015 wrqu.data.length = len;
1017 PRINT_K(
"wireless_send_event--->IWEVASSOCREQIE\n");
1025 memcpy(buf, pbyIEs, len);
1026 memset(&wrqu, 0,
sizeof (wrqu));
1027 wrqu.data.length = len;
1029 PRINT_K(
"wireless_send_event--->IWEVASSOCRESPIE\n");
1033 memset(&wrqu, 0,
sizeof (wrqu));
1036 PRINT_K(
"wireless_send_event--->SIOCGIWAP(associated)\n");
1040 #endif //#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1056 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1137 PBYTE abyDestAddress,
1190 s_vMgrRxAuthentication(
1211 s_vMgrRxAuthenSequence_1(pDevice,pMgmt, &sFrame);
1214 s_vMgrRxAuthenSequence_2(pDevice, pMgmt, &sFrame);
1218 s_vMgrRxAuthenSequence_3(pDevice, pMgmt, &sFrame);
1221 s_vMgrRxAuthenSequence_4(pDevice, pMgmt, &sFrame);
1248 s_vMgrRxAuthenSequence_1(
1255 unsigned int uNodeIndex;
1328 if (pDevice->bEnableHostapd) {
1354 s_vMgrRxAuthenSequence_2(
1455 s_vMgrRxAuthenSequence_3(
1462 unsigned int uStatusCode = 0 ;
1463 unsigned int uNodeIndex = 0;
1519 if (pDevice->bEnableHostapd) {
1543 s_vMgrRxAuthenSequence_4(
1581 s_vMgrRxDisassociation(
1588 unsigned int uNodeIndex = 0;
1618 skb_reset_mac_header(pDevice->
skb);
1641 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1645 memset(&wrqu, 0,
sizeof (wrqu));
1647 PRINT_K(
"wireless_send_event--->SIOCGIWAP(disassociated)\n");
1671 s_vMgrRxDeauthentication(
1678 unsigned int uNodeIndex = 0;
1703 if (!compare_ether_addr(sFrame.
pHdr->
sA3.abyAddr3,
1709 netif_stop_queue(pDevice->
dev);
1722 skb_reset_mac_header(pDevice->
skb);
1730 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1734 memset(&wrqu, 0,
sizeof (wrqu));
1736 PRINT_K(
"wireless_send_event--->SIOCGIWAP(disauthen)\n");
1760 ChannelExceedZoneType(
1769 if((byCurrChannel<1) ||(byCurrChannel>11))
1774 if((byCurrChannel<1) ||(byCurrChannel>13))
1815 unsigned int uLocateByteIndex;
1816 BYTE byTIMBitOn = 0;
1817 WORD wAIDNumber = 0;
1818 unsigned int uNodeIndex;
1821 WORD wStartIndex = 0;
1827 BYTE byOldPreambleType;
1862 if (byCurrChannel == sFrame.
pDSParms->byCurrChannel)
1864 byCurrChannel = sFrame.
pDSParms->byCurrChannel;
1870 if(ChannelExceedZoneType(pDevice,byCurrChannel)==
TRUE)
1885 if (pBSSList ==
NULL) {
1903 (
void *) pRxPacket);
1924 (
void *) pRxPacket);
1933 bIsChannelEqual =
TRUE;
1962 bIsBSSIDEqual =
TRUE;
1976 bIsSSIDEqual =
TRUE;
1981 (bIsBSSIDEqual ==
TRUE) &&
1982 (bIsSSIDEqual ==
TRUE) &&
1988 if (pBSSList !=
NULL) {
2016 BOOL bShortSlotTime;
2022 bShortSlotTime =
TRUE;
2025 bShortSlotTime =
FALSE;
2075 if (sFrame.
pCFParms->wCFPDurRemaining > 0) {
2088 bTSFOffsetPostive =
TRUE;
2091 bTSFOffsetPostive =
FALSE;
2095 bTSFOffsetPostive =
TRUE;
2098 bTSFOffsetPostive =
FALSE;
2101 if (bTSFOffsetPostive) {
2108 if (
HIDWORD(qwTSFOffset) != 0 ||
2110 bTSFLargeDiff =
TRUE;
2115 if (bIsAPBeacon ==
TRUE) {
2133 wAIDIndex = (wAIDNumber >> 3);
2134 if ((wAIDNumber > 0) && (wAIDIndex >= wStartIndex)) {
2135 uLocateByteIndex = wAIDIndex - wStartIndex;
2137 if (sFrame.
pTIM->len >= (uLocateByteIndex + 4)) {
2138 byTIMBitOn = (0x01) << ((wAIDNumber) % 8);
2178 if (bIsBSSIDEqual) {
2184 if (bTSFLargeDiff && bTSFOffsetPostive &&
2244 if (netif_queue_stopped(pDevice->
dev)){
2245 netif_wake_queue(pDevice->
dev);
2252 else if (bIsSSIDEqual) {
2256 if (bTSFLargeDiff && bTSFOffsetPostive) {
2330 BYTE byTopCCKBasicRate;
2331 BYTE byTopOFDMBasicRate;
2334 BYTE abyRATE[] = {0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, 0x0C, 0x12, 0x18, 0x60};
2335 BYTE abyCCK_RATE[] = {0x82, 0x84, 0x8B, 0x96};
2336 BYTE abyOFDM_RATE[] = {0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C};
2373 for (ii = 0; ii < 4; ii++)
2378 for (ii = 0; ii < 8; ii++)
2386 for (ii = 0; ii < 4; ii++)
2388 for (ii = 4; ii < 8; ii++)
2390 for (ii = 0; ii < 4; ii++)
2434 &wMaxBasicRate, &wMaxSuppRate, &wSuppRate,
2435 &byTopCCKBasicRate, &byTopOFDMBasicRate);
2583 unsigned int ii,
uu;
2601 if (ii == MAX_BSS_NUM) {
2648 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
2650 Encyption_Rebuild(pDevice, pCurr);
2654 s_vMgrSynchBSS(pDevice,
2687 if ((pItemExtRates->len > 0) && (pItemRates->len < 8)) {
2688 for (ii = 0; ii < (
unsigned int) (8 - pItemRates->len); ) {
2689 pItemRates->abyRates[pItemRates->len + ii] =
2690 pItemExtRates->abyRates[ii];
2692 if (pItemExtRates->len <= ii)
2695 pItemRates->len += (
BYTE)ii;
2696 if (pItemExtRates->len - ii > 0) {
2697 pItemExtRates->len -= (
BYTE)ii;
2698 for (uu = 0; uu < pItemExtRates->len; uu ++) {
2699 pItemExtRates->abyRates[uu] = pItemExtRates->abyRates[uu + ii];
2702 pItemExtRates->len = 0;
2707 &wMaxBasicRate, &wMaxSuppRate, &wSuppRate,
2708 &byTopCCKBasicRate, &byTopOFDMBasicRate);
2729 &pCurr->sRSNCapObj);
2731 if (bResult ==
FALSE) {
2734 KERN_INFO "vFlush_PMKID_Candidate: 4\n");
2737 &pCurr->sRSNCapObj);
2781 bShortSlotTime =
TRUE;
2784 bShortSlotTime =
FALSE;
2832 s_vMgrSynchBSS(pDevice,
2852 NULL,
TRUE, &wMaxBasicRate, &wMaxSuppRate, &wSuppRate,
2853 &byTopCCKBasicRate, &byTopOFDMBasicRate);
2909 unsigned int uBSSMode,
2925 if (s_bCipherMatch(pCurr,
2954 CARDvAdjustTSF(pDevice, pCurr->byRxRate, pCurr->qwBSSTimestamp, pCurr->qwLocalTSF);
3063 static void Encyption_Rebuild(
3074 if(pCurr->bWPAValid ==
TRUE) {
3076 if(pCurr->abyPKType[0] ==
WPA_TKIP) {
3078 PRINT_K(
"Encyption_Rebuild--->ssid reset config to [WPAPSK-TKIP]\n");
3082 PRINT_K(
"Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n");
3085 else if(pCurr->bWPA2Valid ==
TRUE) {
3089 PRINT_K(
"Encyption_Rebuild--->ssid reset config to [WPA2PSK-TKIP]\n");
3093 PRINT_K(
"Encyption_Rebuild--->ssid reset config to [WPA2PSK-AES]\n");
3120 BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
3122 unsigned int ii, jj;
3125 WORD wStartIndex = 0;
3134 bMulticast = (byMap & byMask[0]) != 0;
3143 wStartIndex = (
WORD)ii;
3145 wEndIndex = (
WORD)ii;
3151 wStartIndex &= ~
BIT0;
3154 wEndIndex = ((wEndIndex + 1) & ~
BIT0);
3158 pTIM->len = 3 + (wEndIndex - wStartIndex) + 1;
3168 for (ii = wStartIndex, jj =0 ; ii <= wEndIndex; ii++, jj++) {
3169 pTIM->byVirtBitMap[jj] = pMgmt->
abyPSTxMap[ii];
3173 pTIM->byVirtBitMap[0] &= ~
BIT0;
3194 WORD wCurrBeaconPeriod,
3195 unsigned int uCurrChannel,
3196 WORD wCurrATIMWinodw,
3205 BYTE abyBroadcastAddr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
3258 s_vMgrFormatTIM(pMgmt, sFrame.
pTIM);
3269 sFrame.
pIBSSParms->wATIMWindow = wCurrATIMWinodw;
3310 sFrame.
pERP->len = 1;
3311 sFrame.
pERP->byContext = 0;
3364 s_MgrMakeProbeResponse(
3368 WORD wCurrBeaconPeriod,
3369 unsigned int uCurrChannel,
3370 WORD wCurrATIMWinodw,
3444 sFrame.
pERP->len = 1;
3445 sFrame.
pERP->byContext = 0;
3496 s_MgrMakeAssocRequest(
3501 WORD wListenInterval,
3694 if (pMgmt->
pCurrBSS->sRSNCapObj.bRSNCapExist ==
TRUE) {
3705 pwPMKID = (
PWORD)pbyRSN;
3719 if (*pwPMKID != 0) {
3720 sFrame.
pRSN->
len += (2 + (*pwPMKID)*16);
3758 s_MgrMakeReAssocRequest(
3763 WORD wListenInterval,
3954 if (pMgmt->
pCurrBSS->sRSNCapObj.bRSNCapExist ==
TRUE) {
3965 pwPMKID = (
PWORD)pbyRSN;
3979 if (*pwPMKID != 0) {
3980 sFrame.
pRSN->
len += (2 + (*pwPMKID)*16);
4012 s_MgrMakeAssocResponse(
4086 s_MgrMakeReAssocResponse(
4160 s_vMgrRxProbeResponse(
4191 if(sFrame.
pSSID->len == 0)
4199 if (byCurrChannel ==
4209 if (byCurrChannel == sFrame.
pDSParms->byCurrChannel)
4211 byCurrChannel = sFrame.
pDSParms->byCurrChannel;
4218 if(ChannelExceedZoneType(pDevice,byCurrChannel)==
TRUE)
4253 (
void *) pRxPacket);
4272 (
void *) pRxPacket);
4292 s_vMgrRxProbeRequest(
4317 if (sFrame.
pSSID->len != 0) {
4332 pTxPacket = s_MgrMakeProbeResponse
4347 if (pTxPacket !=
NULL ){
4382 unsigned int uNodeIndex = 0;
4410 s_vMgrRxAssocRequest(pDevice, pMgmt, pRxPacket, uNodeIndex);
4417 s_vMgrRxAssocResponse(pDevice, pMgmt, pRxPacket,
FALSE);
4438 s_vMgrRxReAssocRequest(pDevice, pMgmt, pRxPacket, uNodeIndex);
4444 s_vMgrRxAssocResponse(pDevice, pMgmt, pRxPacket,
TRUE);
4450 s_vMgrRxProbeRequest(pDevice, pMgmt, pRxPacket);
4457 s_vMgrRxProbeResponse(pDevice, pMgmt, pRxPacket);
4466 s_vMgrRxBeacon(pDevice, pMgmt, pRxPacket, bInScan);
4489 s_vMgrRxDisassociation(pDevice, pMgmt, pRxPacket);
4495 s_vMgrRxAuthentication(pDevice, pMgmt, pRxPacket);
4501 s_vMgrRxDeauthentication(pDevice, pMgmt, pRxPacket);
4534 pTxPacket = s_MgrMakeBeacon
4649 unsigned int ii = 0;
4653 if ((pDevice ==
NULL) || (pbyBSSID ==
NULL) || (psRSNCapObj ==
NULL))
4667 pCandidateList->
Flags |=
4670 pCandidateList->
Flags &=