diff options
Diffstat (limited to 'drivers/staging/rt2860/common/mlme.c')
-rw-r--r-- | drivers/staging/rt2860/common/mlme.c | 57 |
1 files changed, 10 insertions, 47 deletions
diff --git a/drivers/staging/rt2860/common/mlme.c b/drivers/staging/rt2860/common/mlme.c index 81332673437e..886dcbeb0bf3 100644 --- a/drivers/staging/rt2860/common/mlme.c +++ b/drivers/staging/rt2860/common/mlme.c @@ -477,7 +477,6 @@ NDIS_STATUS MlmeInit( pAd->Mlme.bRunning = FALSE; NdisAllocateSpinLock(&pAd->Mlme.TaskLock); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { BssTableInit(&pAd->ScanTab); @@ -505,7 +504,6 @@ NDIS_STATUS MlmeInit( // software-based RX Antenna diversity RTMPInitTimer(pAd, &pAd->Mlme.RxAntEvalTimer, GET_TIMER_FUNCTION(AsicRxAntEvalTimeout), pAd, FALSE); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) { @@ -647,7 +645,6 @@ VOID MlmeHalt( AsicDisableSync(pAd); } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Cancel pending timers RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &Cancelled); @@ -756,7 +753,6 @@ VOID MlmePeriodicExec( pAd->StaCfg.WpaSupplicantUP = 1; } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // If Hardware controlled Radio enabled, we have to check GPIO pin2 every 2 second. // Move code to here, because following code will return when radio is off @@ -805,7 +801,6 @@ VOID MlmePeriodicExec( fRTMP_ADAPTER_RESET_IN_PROGRESS)))) return; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if ((pAd->RalinkCounters.LastReceivedByteCount == pAd->RalinkCounters.ReceivedByteCount) && (pAd->StaCfg.bRadio == TRUE)) { @@ -846,7 +841,6 @@ VOID MlmePeriodicExec( RT28XX_MLME_PRE_SANITY_CHECK(pAd); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Do nothing if monitor mode is on if (MONITOR_ON(pAd)) @@ -881,7 +875,6 @@ VOID MlmePeriodicExec( if ((pAd->Mlme.PeriodicRound % 5 == 0) && RTMPAutoRateSwitchCheck(pAd)/*(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))*/) { // perform dynamic tx rate switching based on past TX history - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) ) @@ -952,12 +945,10 @@ VOID MlmePeriodicExec( } } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - STAMlmePeriodicExec(pAd); + STAMlmePeriodicExec(pAd); MlmeResetRalinkCounters(pAd); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->bPCIclkOff == FALSE)) { @@ -1516,7 +1507,6 @@ VOID MlmeSelectTxRateTable( break; } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0)) if ((pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)) @@ -2805,7 +2795,6 @@ VOID MlmeUpdateTxRates( //=========================================================================== //=========================================================================== - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pHtPhy = &pAd->StaCfg.HTPhyMode; pMaxHtPhy = &pAd->StaCfg.MaxHTPhyMode; @@ -2934,8 +2923,7 @@ VOID MlmeUpdateTxRates( { short dbm = 0; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - dbm = pAd->StaCfg.RssiSample.AvgRssi0 - pAd->BbpRssiToDbmDelta; + dbm = pAd->StaCfg.RssiSample.AvgRssi0 - pAd->BbpRssiToDbmDelta; if (bLinkUp == TRUE) pAd->CommonCfg.TxRate = RATE_24; @@ -3088,7 +3076,6 @@ VOID MlmeUpdateHtTxRates( auto_rate_cur_p = NULL; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pDesireHtPhy = &pAd->StaCfg.DesiredHtPhyInfo; pActiveHtPhy = &pAd->StaCfg.DesiredHtPhyInfo; @@ -3562,7 +3549,6 @@ VOID BssEntrySet( else pBss->QbssLoad.bValid = FALSE; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { PEID_STRUCT pEid; USHORT Length = 0; @@ -4357,8 +4343,7 @@ VOID MgtMacHeaderInit( pHdr80211->FC.ToDs = ToDs; COPY_MAC_ADDR(pHdr80211->Addr1, pDA); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress); + COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress); COPY_MAC_ADDR(pHdr80211->Addr3, pBssid); } @@ -4566,7 +4551,6 @@ BOOLEAN MlmeEnqueueForRecv( return FALSE; } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (!MsgTypeSubst(pAd, pFrame, &Machine, &MsgType)) { @@ -4674,7 +4658,6 @@ VOID MlmeRestartStateMachine( } } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Cancel all timer events // Be careful to cancel new added timer @@ -4693,7 +4676,6 @@ VOID MlmeRestartStateMachine( // Resume MSDU which is turned off durning scan RTMPResumeMsduTransmission(pAd); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Set all state machines back IDLE pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; @@ -6223,7 +6205,6 @@ VOID AsicEnableBssSync( RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU csr.field.bTsfTicking = 1; @@ -6427,7 +6408,6 @@ VOID AsicSetEdcaParm( Ac2Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_VI]; Ac2Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VI]; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Tuning for Wi-Fi WMM S06 if (pAd->CommonCfg.bWiFiTest && @@ -6485,8 +6465,7 @@ VOID AsicSetEdcaParm( CwminCsr.field.Cwmin1 = pEdcaParm->Cwmin[QID_AC_BK]; CwminCsr.field.Cwmin2 = pEdcaParm->Cwmin[QID_AC_VI]; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - CwminCsr.field.Cwmin3 = pEdcaParm->Cwmin[QID_AC_VO] - 1; //for TGn wifi test + CwminCsr.field.Cwmin3 = pEdcaParm->Cwmin[QID_AC_VO] - 1; //for TGn wifi test RTMP_IO_WRITE32(pAd, WMM_CWMIN_CFG, CwminCsr.word); @@ -6502,7 +6481,6 @@ VOID AsicSetEdcaParm( AifsnCsr.field.Aifsn1 = Ac1Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BK]; AifsnCsr.field.Aifsn2 = Ac2Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_VI]; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Tuning for Wi-Fi WMM S06 if (pAd->CommonCfg.bWiFiTest && @@ -6519,8 +6497,7 @@ VOID AsicSetEdcaParm( } } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test + AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word); @@ -6582,7 +6559,6 @@ VOID AsicSetSlotTime( SlotTime = (bUseShortSlotTime)? 9 : 20; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // force using short SLOT time for FAE to demo performance when TxBurst is ON if (((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))) @@ -6601,11 +6577,8 @@ VOID AsicSetSlotTime( // // ToDo: Should consider capability with 11B // - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - if (pAd->StaCfg.BssType == BSS_ADHOC) - SlotTime = 20; - } + if (pAd->StaCfg.BssType == BSS_ADHOC) + SlotTime = 20; RTMP_IO_READ32(pAd, BKOFF_SLOT_CFG, &RegValue); RegValue = RegValue & 0xFFFFFF00; @@ -7551,7 +7524,6 @@ VOID AsicEvaluateRxAnt( { UCHAR BBPR3 = 0; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS | @@ -7580,7 +7552,6 @@ VOID AsicEvaluateRxAnt( } RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) pAd->StaCfg.BBPR3 = BBPR3; if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) @@ -7626,7 +7597,6 @@ VOID AsicRxAntEvalTimeout( UCHAR BBPR3 = 0; CHAR larger = -127, rssi0, rssi1, rssi2; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS) || @@ -7752,7 +7722,6 @@ BOOLEAN RTMPCheckEntryEnableAutoRateSwitch( { BOOLEAN result = TRUE; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // only associated STA counts if (pEntry && (pEntry->ValidAsCLI) && (pEntry->Sst == SST_ASSOC)) @@ -7770,11 +7739,8 @@ BOOLEAN RTMPCheckEntryEnableAutoRateSwitch( BOOLEAN RTMPAutoRateSwitchCheck( IN PRTMP_ADAPTER pAd) { - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - if (pAd->StaCfg.bAutoTxRateSwitch) - return TRUE; - } + if (pAd->StaCfg.bAutoTxRateSwitch) + return TRUE; return FALSE; } @@ -7801,10 +7767,7 @@ UCHAR RTMPStaFixedTxMode( { UCHAR tx_mode = FIXED_TXMODE_HT; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - tx_mode = (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode; - } + tx_mode = (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode; return tx_mode; } |