diff options
Diffstat (limited to 'drivers/staging/rt2860/sta')
-rw-r--r-- | drivers/staging/rt2860/sta/assoc.c | 23 | ||||
-rw-r--r-- | drivers/staging/rt2860/sta/connect.c | 33 | ||||
-rw-r--r-- | drivers/staging/rt2860/sta/rtmp_data.c | 23 | ||||
-rw-r--r-- | drivers/staging/rt2860/sta/sync.c | 6 | ||||
-rw-r--r-- | drivers/staging/rt2860/sta/wpa.c | 10 |
5 files changed, 59 insertions, 36 deletions
diff --git a/drivers/staging/rt2860/sta/assoc.c b/drivers/staging/rt2860/sta/assoc.c index 42db753eed7..34f1c1490f4 100644 --- a/drivers/staging/rt2860/sta/assoc.c +++ b/drivers/staging/rt2860/sta/assoc.c @@ -473,12 +473,7 @@ VOID MlmeAssocReqAction( RSNIe = IE_WPA2; } -#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT -#ifdef SIOCSIWGENIE - if (pAd->StaCfg.WpaSupplicantUP != 1) -#endif // SIOCSIWGENIE // -#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // - RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0); + RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0); // Check for WPA PMK cache list if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) @@ -504,17 +499,6 @@ VOID MlmeAssocReqAction( } } -#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT -#ifdef SIOCSIWGENIE - if (pAd->StaCfg.WpaSupplicantUP == 1) - { - MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, - pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE, - END_OF_ARGS); - } - else -#endif -#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // { MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, 1, &RSNIe, @@ -525,11 +509,6 @@ VOID MlmeAssocReqAction( FrameLen += tmp; -#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT -#ifdef SIOCSIWGENIE - if (pAd->StaCfg.WpaSupplicantUP != 1) -#endif -#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // { // Append Variable IE NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &RSNIe, 1); diff --git a/drivers/staging/rt2860/sta/connect.c b/drivers/staging/rt2860/sta/connect.c index 36f28f8b4aa..bbe803312cc 100644 --- a/drivers/staging/rt2860/sta/connect.c +++ b/drivers/staging/rt2860/sta/connect.c @@ -337,6 +337,10 @@ VOID CntlOidSsidProc( MLME_DISASSOC_REQ_STRUCT DisassocReq; ULONG Now; + // BBP and RF are not accessible in PS mode, we has to wake them up first + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) + AsicForceWakeup(pAd, RTMP_HALT); + // Step 1. record the desired user settings to MlmeAux NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID); NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength); @@ -1240,6 +1244,13 @@ VOID LinkUp( UCHAR Value = 0, idx; MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry; + if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)) + { + RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT); + RTMPusecDelay(6000); + pAd->bPCIclkOff = FALSE; + } + pEntry = &pAd->MacTab.Content[BSSID_WCID]; // @@ -1598,6 +1609,8 @@ VOID LinkUp( IV = 0; IV |= (pAd->StaCfg.DefaultKeyId << 30); AsicUpdateWCIDIVEIV(pAd, BSSID_WCID, IV, 0); + + RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); } // NOTE: // the decision of using "short slot time" or not may change dynamically due to @@ -1919,6 +1932,7 @@ VOID LinkUp( } RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); + RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 @@ -1961,6 +1975,7 @@ VOID LinkDown( IN BOOLEAN IsReqFromAP) { UCHAR i, ByteValue = 0; + BOOLEAN Cancelled; // Do nothing if monitor mode is on if (MONITOR_ON(pAd)) @@ -1972,6 +1987,12 @@ VOID LinkDown( return; #endif // RALINK_ATE // + RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); + RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); + + // Not allow go to sleep within linkdown function. + RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); + if (pAd->CommonCfg.bWirelessEvent) { RTMPSendWirelessEvent(pAd, IW_STA_LINKDOWN_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0); @@ -1988,12 +2009,11 @@ VOID LinkDown( RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); } - if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) || + RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND) || + RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)) { - AUTO_WAKEUP_STRUC AutoWakeupCfg; - AsicForceWakeup(pAd, TRUE); - AutoWakeupCfg.word = 0; - RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word); + AsicForceWakeup(pAd, RTMP_HALT); OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); } @@ -2266,6 +2286,9 @@ VOID LinkDown( RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff); RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); + // Allow go to sleep after linkdown steps. + RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); + #ifdef WPA_SUPPLICANT_SUPPORT #ifndef NATIVE_WPA_SUPPLICANT_SUPPORT if (pAd->StaCfg.WpaSupplicantUP) { diff --git a/drivers/staging/rt2860/sta/rtmp_data.c b/drivers/staging/rt2860/sta/rtmp_data.c index 36aff247cd9..5b3fb2deee8 100644 --- a/drivers/staging/rt2860/sta/rtmp_data.c +++ b/drivers/staging/rt2860/sta/rtmp_data.c @@ -811,6 +811,13 @@ BOOLEAN STARxDoneInterruptHandle( } } + // fRTMP_PS_GO_TO_SLEEP_NOW is set if receiving beacon. + if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW) && (INFRA_ON(pAd))) + { + RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); + AsicSleepThenAutoWakeup(pAd, pAd->ThisTbttNumToNextWakeUp); + bReschedule = FALSE; + } return bReschedule; } @@ -828,7 +835,7 @@ BOOLEAN STARxDoneInterruptHandle( VOID RTMPHandleTwakeupInterrupt( IN PRTMP_ADAPTER pAd) { - AsicForceWakeup(pAd, FALSE); + AsicForceWakeup(pAd, DOT11POWERSAVE); } /* @@ -1889,7 +1896,8 @@ VOID STA_AMPDU_Frame_Tx( // // Kick out Tx // - HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) + HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); pAd->RalinkCounters.KickTxCount++; pAd->RalinkCounters.OneSecTxDoneCount++; @@ -2019,7 +2027,8 @@ VOID STA_AMSDU_Frame_Tx( // // Kick out Tx // - HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) + HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); } #endif // DOT11_N_SUPPORT // @@ -2139,7 +2148,8 @@ VOID STA_Legacy_Frame_Tx( // // Kick out Tx // - HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) + HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); } @@ -2249,7 +2259,8 @@ VOID STA_ARalink_Frame_Tx( // // Kick out Tx // - HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); + if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX)) + HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); } @@ -2526,7 +2537,7 @@ NDIS_STATUS STAHardTransmit( if ((pAd->StaCfg.Psm == PWR_SAVE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicForceWakeup At HardTx\n")); - AsicForceWakeup(pAd, TRUE); + AsicForceWakeup(pAd, FROM_TX); } // It should not change PSM bit, when APSD turn on. diff --git a/drivers/staging/rt2860/sta/sync.c b/drivers/staging/rt2860/sta/sync.c index d196f85395c..28bf929cba0 100644 --- a/drivers/staging/rt2860/sta/sync.c +++ b/drivers/staging/rt2860/sta/sync.c @@ -1536,7 +1536,6 @@ VOID PeerBeacon( if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) { RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3); - // Turn clk to 80Mhz. } #endif // RT2860 // if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable && @@ -1588,7 +1587,10 @@ VOID PeerBeacon( if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { - AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp); + // Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode. + RTMP_SET_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW); + pAd->ThisTbttNumToNextWakeUp = TbttNumToNextWakeUp; + //AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp); } } } diff --git a/drivers/staging/rt2860/sta/wpa.c b/drivers/staging/rt2860/sta/wpa.c index 774c6567ae5..2609d845fd5 100644 --- a/drivers/staging/rt2860/sta/wpa.c +++ b/drivers/staging/rt2860/sta/wpa.c @@ -1384,6 +1384,10 @@ VOID WpaGroupMsg1Action( pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP; else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled) pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES; + else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled) + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64; + else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled) + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128; //hex_dump("Group Key :", pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, LEN_TKIP_EK); } @@ -1760,7 +1764,7 @@ BOOLEAN ParseKeyData( // Get GTK length - refer to IEEE 802.11i-2004 p.82 GTKLEN = pKDE->Len -6; - if (GTKLEN < LEN_AES_KEY) + if (GTKLEN < MIN_LEN_OF_GTK) { DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key length is too short (%d) \n", GTKLEN)); return FALSE; @@ -1786,6 +1790,10 @@ BOOLEAN ParseKeyData( pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP; else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled) pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES; + else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled) + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64; + else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled) + pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128; return TRUE; |