diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-04-26 16:05:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-19 11:00:46 -0700 |
commit | 6a28a69ae8c51069c05f0a479be609fabef11790 (patch) | |
tree | a31d5086715ecc08ff1b7059f8038e8a8e1b76f0 /drivers/staging/rt2860/common | |
parent | 2bc1c810c3dd295d8f1f65b4d68077b58f435c4b (diff) |
Staging: rt2860: remove CONFIG_STA_SUPPORT ifdefs
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/common')
-rw-r--r-- | drivers/staging/rt2860/common/action.c | 17 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/ba_action.c | 21 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_data.c | 62 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_data_2860.c | 8 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_info.c | 79 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_sanity.c | 23 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_sync.c | 21 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_wpa.c | 11 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/mlme.c | 123 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/rtmp_init.c | 27 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/rtmp_wep.c | 2 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/spectrum.c | 5 |
12 files changed, 39 insertions, 360 deletions
diff --git a/drivers/staging/rt2860/common/action.c b/drivers/staging/rt2860/common/action.c index 1cd4fc89ef0..419327fb690 100644 --- a/drivers/staging/rt2860/common/action.c +++ b/drivers/staging/rt2860/common/action.c @@ -128,7 +128,6 @@ VOID MlmeADDBAAction( pBAEntry =&pAd->BATable.BAOriEntry[Idx]; } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (ADHOC_ON(pAd)) @@ -136,7 +135,6 @@ VOID MlmeADDBAAction( else ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pInfo->pAddr); } -#endif // CONFIG_STA_SUPPORT // Frame.Category = CATEGORY_BA; Frame.Action = ADDBA_REQ; @@ -211,10 +209,9 @@ VOID MlmeDELBAAction( // SEND BAR (Send BAR to refresh peer reordering buffer.) Idx = pAd->MacTab.Content[pInfo->Wcid].BAOriWcidArray[pInfo->TID]; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) BarHeaderInit(pAd, &FrameBar, pAd->MacTab.Content[pInfo->Wcid].Addr, pAd->CurrentAddress); -#endif // CONFIG_STA_SUPPORT // FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL funciton. FrameBar.StartingSeq.field.StartSeq = pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID]; // make sure sequence not clear in DEL funciton. @@ -232,7 +229,7 @@ VOID MlmeDELBAAction( // SEND DELBA FRAME FrameLen = 0; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (ADHOC_ON(pAd)) @@ -240,7 +237,7 @@ VOID MlmeDELBAAction( else ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[pInfo->Wcid].Addr); } -#endif // CONFIG_STA_SUPPORT // + Frame.Category = CATEGORY_BA; Frame.Action = DELBA; Frame.DelbaParm.Initiator = pInfo->Initiator; @@ -367,7 +364,6 @@ static VOID respond_ht_information_exchange_action( NdisZeroMemory(&HTINFOframe, sizeof(FRAME_HT_INFO)); // 2-1. Prepare ADDBA Response frame. -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (ADHOC_ON(pAd)) @@ -375,7 +371,6 @@ static VOID respond_ht_information_exchange_action( else ActHeaderInit(pAd, &HTINFOframe.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAddr); } -#endif // CONFIG_STA_SUPPORT // HTINFOframe.Category = CATEGORY_HT; HTINFOframe.Action = HT_INFO_EXCHANGE; @@ -404,7 +399,7 @@ VOID PeerHTAction( { case NOTIFY_BW_ACTION: DBGPRINT(RT_DEBUG_TRACE,("ACTION - HT Notify Channel bandwidth action----> \n")); -#ifdef CONFIG_STA_SUPPORT + if(pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) { // Note, this is to patch DIR-1353 AP. When the AP set to Wep, it will use legacy mode. But AP still keeps @@ -414,7 +409,6 @@ VOID PeerHTAction( Elem->Msg[LENGTH_802_11+2] )); break; } -#endif // CONFIG_STA_SUPPORT // if (Elem->Msg[LENGTH_802_11+2] == 0) // 7.4.8.2. if value is 1, keep the same as supported channel bandwidth. pAd->MacTab.Content[Elem->Wcid].HTPhyMode.field.BW = 0; @@ -534,10 +528,9 @@ VOID SendRefreshBAR( } Sequence = pEntry->TxSeq[TID]; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) BarHeaderInit(pAd, &FrameBar, pEntry->Addr, pAd->CurrentAddress); -#endif // CONFIG_STA_SUPPORT // FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL function. FrameBar.StartingSeq.field.StartSeq = Sequence; // make sure sequence not clear in DEL funciton. diff --git a/drivers/staging/rt2860/common/ba_action.c b/drivers/staging/rt2860/common/ba_action.c index 9f0b501db85..41361a3dca7 100644 --- a/drivers/staging/rt2860/common/ba_action.c +++ b/drivers/staging/rt2860/common/ba_action.c @@ -132,10 +132,8 @@ void Announce_Reordering_Packet(IN PRTMP_ADAPTER pAd, // pass this 802.3 packet to upper layer or forward this packet to WM directly // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pPacket, RTMP_GET_PACKET_IF(pPacket)); -#endif // CONFIG_STA_SUPPORT // } } @@ -610,11 +608,8 @@ VOID BAOriSessionAdd( return; } - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) BarHeaderInit(pAd, &FrameBar, pAd->MacTab.Content[pBAEntry->Wcid].Addr, pAd->CurrentAddress); -#endif // CONFIG_STA_SUPPORT // FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL function. FrameBar.StartingSeq.field.StartSeq = pBAEntry->Sequence; // make sure sequence not clear in DEL funciton. @@ -1083,14 +1078,12 @@ VOID BAOriSessionSetupTimeout( pAd = pBAEntry->pAdapter; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Do nothing if monitor mode is on if (MONITOR_ON(pAd)) return; } -#endif // CONFIG_STA_SUPPORT // pEntry = &pAd->MacTab.Content[pBAEntry->Wcid]; @@ -1223,8 +1216,8 @@ VOID PeerAddBAReqAction( } NdisZeroMemory(&ADDframe, sizeof(FRAME_ADDBA_RSP)); + // 2-1. Prepare ADDBA Response frame. -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (ADHOC_ON(pAd)) @@ -1232,7 +1225,7 @@ VOID PeerAddBAReqAction( else ActHeaderInit(pAd, &ADDframe.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAddr); } -#endif // CONFIG_STA_SUPPORT // + ADDframe.Category = CATEGORY_BA; ADDframe.Action = ADDBA_RESP; ADDframe.Token = pAddreqFrame->Token; @@ -1299,9 +1292,7 @@ VOID PeerAddBARspAction( } // Rcv Decline StatusCode if ((pFrame->StatusCode == 37) -#ifdef CONFIG_STA_SUPPORT || ((pAd->OpMode == OPMODE_STA) && STA_TGN_WIFI_ON(pAd) && (pFrame->StatusCode != 0)) -#endif // CONFIG_STA_SUPPORT // ) { pAd->MacTab.Content[Elem->Wcid].BADeclineBitmap |= 1<<pFrame->BaParm.TID; @@ -1422,10 +1413,9 @@ VOID SendPSMPAction( DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeADDBAAction() allocate memory failed \n")); return; } -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[Wcid].Addr); -#endif // CONFIG_STA_SUPPORT // Frame.Category = CATEGORY_HT; Frame.Action = SMPS_ACTION; @@ -1490,10 +1480,8 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet( // a. pointer pRxBlk->pData to payload // b. modify pRxBlk->DataSize -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3); -#endif // CONFIG_STA_SUPPORT // ASSERT(pRxBlk->pRxPacket); pRxPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket); @@ -1508,15 +1496,12 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet( // if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU)) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { #ifdef LINUX NdisMoveMemory(skb_push(pRxPkt, LENGTH_802_3), Header802_3, LENGTH_802_3); #endif } -#endif // CONFIG_STA_SUPPORT // } } diff --git a/drivers/staging/rt2860/common/cmm_data.c b/drivers/staging/rt2860/common/cmm_data.c index 6ba0693846c..da16b821861 100644 --- a/drivers/staging/rt2860/common/cmm_data.c +++ b/drivers/staging/rt2860/common/cmm_data.c @@ -339,15 +339,13 @@ NDIS_STATUS MlmeHardTransmitTxRing( return NDIS_STATUS_FAILURE; } - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // outgoing frame always wakeup PHY to prevent frame lost if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) AsicForceWakeup(pAd, FROM_TX); } -#endif // CONFIG_STA_SUPPORT // + pFirstTxWI =(PTXWI_STRUC)pSrcBufVA; pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXWI_SIZE); @@ -377,7 +375,7 @@ NDIS_STATUS MlmeHardTransmitTxRing( // // // In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame -#ifdef CONFIG_STA_SUPPORT + // Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD if (pHeader_802_11->FC.Type != BTYPE_DATA) { @@ -390,7 +388,6 @@ NDIS_STATUS MlmeHardTransmitTxRing( pHeader_802_11->FC.PwrMgmt = pAd->CommonCfg.bAPSDForcePowerSave; } } -#endif // CONFIG_STA_SUPPORT // bInsertTimestamp = FALSE; if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL @@ -504,14 +501,12 @@ NDIS_STATUS MlmeHardTransmitMgmtRing( return NDIS_STATUS_FAILURE; } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // outgoing frame always wakeup PHY to prevent frame lost if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) AsicForceWakeup(pAd, FROM_TX); } -#endif // CONFIG_STA_SUPPORT // pFirstTxWI = (PTXWI_STRUC)(pSrcBufVA + TXINFO_SIZE); pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE); //TXWI_SIZE); @@ -535,7 +530,6 @@ NDIS_STATUS MlmeHardTransmitMgmtRing( pMacEntry = MacTableLookup(pAd, pHeader_802_11->Addr1); } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Fixed W52 with Activity scan issue in ABG_MIXED and ABGN_MIXED mode. @@ -551,7 +545,6 @@ NDIS_STATUS MlmeHardTransmitMgmtRing( pAd->CommonCfg.MlmeTransmit.field.MODE = 0; } } -#endif // CONFIG_STA_SUPPORT // // // Should not be hard code to set PwrMgmt to 0 (PWR_ACTIVE) @@ -561,7 +554,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing( // pHeader_802_11->FC.PwrMgmt = 0; // (pAd->StaCfg.Psm == PWR_SAVE); // // In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame -#ifdef CONFIG_STA_SUPPORT + // Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD if ((pHeader_802_11->FC.Type != BTYPE_DATA) && (pHeader_802_11->FC.Type != BTYPE_CNTL)) { @@ -571,18 +564,15 @@ NDIS_STATUS MlmeHardTransmitMgmtRing( else pHeader_802_11->FC.PwrMgmt = PWR_ACTIVE; } -#endif // CONFIG_STA_SUPPORT // bInsertTimestamp = FALSE; if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL { -#ifdef CONFIG_STA_SUPPORT //Set PM bit in ps-poll, to fix WLK 1.2 PowerSaveMode_ext failure issue. if ((pAd->OpMode == OPMODE_STA) && (pHeader_802_11->FC.SubType == SUBTYPE_PS_POLL)) { pHeader_802_11->FC.PwrMgmt = PWR_SAVE; } -#endif // CONFIG_STA_SUPPORT // bAckRequired = FALSE; } else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame) @@ -845,8 +835,6 @@ BOOLEAN RTMP_FillTxBlkInfo( TX_BLK_SET_FLAG(pTxBlk, fTX_bAckRequired); { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { @@ -854,7 +842,6 @@ BOOLEAN RTMP_FillTxBlkInfo( if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED)) TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM); } -#endif // CONFIG_STA_SUPPORT // } if (pTxBlk->TxFrameType == TX_LEGACY_FRAME) @@ -934,13 +921,10 @@ BOOLEAN CanDoAggregateTransmit( return FALSE; } -#ifdef CONFIG_STA_SUPPORT if ((INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA)) // must be unicast to AP return TRUE; else -#endif // CONFIG_STA_SUPPORT // return FALSE; - } @@ -1133,10 +1117,8 @@ VOID RTMPDeQueuePacket( Count += pTxBlk->TxPacketList.Number; // Do HardTransmit now. -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) Status = STAHardTransmit(pAd, pTxBlk, QueIdx); -#endif // CONFIG_STA_SUPPORT // DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags); // static rate also need NICUpdateFifoStaCounters() function. @@ -2178,7 +2160,6 @@ UINT deaggregate_AMSDU_announce( // convert to 802.3 header CONVERT_TO_802_3(Header802_3, pDA, pSA, pPayload, PayloadSize, pRemovedLLCSNAP); -#ifdef CONFIG_STA_SUPPORT if ((Header802_3[12] == 0x88) && (Header802_3[13] == 0x8E) ) { // avoid local heap overflow, use dyanamic allocation @@ -2188,9 +2169,7 @@ UINT deaggregate_AMSDU_announce( WpaEAPOLKeyAction(pAd, Elem); kfree(Elem); } -#endif // CONFIG_STA_SUPPORT // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pRemovedLLCSNAP) @@ -2200,15 +2179,12 @@ UINT deaggregate_AMSDU_announce( NdisMoveMemory(pPayload, &Header802_3[0], LENGTH_802_3); } } -#endif // CONFIG_STA_SUPPORT // pClonePacket = ClonePacket(pAd, pPacket, pPayload, PayloadSize); if (pClonePacket) { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pClonePacket, RTMP_GET_PACKET_IF(pPacket)); -#endif // CONFIG_STA_SUPPORT // } @@ -2304,11 +2280,11 @@ MAC_TABLE_ENTRY *MacTableInsertEntry( return NULL; FirstWcid = 1; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) + if (pAd->StaCfg.BssType == BSS_INFRA) FirstWcid = 2; -#endif // CONFIG_STA_SUPPORT // // allocate one MAC entry NdisAcquireSpinLock(&pAd->MacTabLock); @@ -2331,8 +2307,6 @@ MAC_TABLE_ENTRY *MacTableInsertEntry( pEntry->PairwiseKey.CipherAlg = CIPHER_NONE; } { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pEntry->ValidAsCLI = TRUE; @@ -2341,7 +2315,6 @@ MAC_TABLE_ENTRY *MacTableInsertEntry( pEntry->ValidAsMesh = FALSE; pEntry->ValidAsDls = FALSE; } -#endif // CONFIG_STA_SUPPORT // } pEntry->bIAmBadAtheros = FALSE; @@ -2362,8 +2335,6 @@ MAC_TABLE_ENTRY *MacTableInsertEntry( pEntry->apidx = apidx; { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pEntry->AuthMode = pAd->StaCfg.AuthMode; @@ -2371,19 +2342,18 @@ MAC_TABLE_ENTRY *MacTableInsertEntry( pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll; AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)i); } -#endif // CONFIG_STA_SUPPORT // } pEntry->GTKState = REKEY_NEGOTIATING; pEntry->PairwiseKey.KeyLen = 0; pEntry->PairwiseKey.CipherAlg = CIPHER_NONE; -#ifdef CONFIG_STA_SUPPORT + if ((pAd->OpMode == OPMODE_STA) && (pAd->StaCfg.BssType == BSS_ADHOC)) pEntry->PortSecured = WPA_802_1X_PORT_SECURED; else -#endif // CONFIG_STA_SUPPORT // pEntry->PortSecured = WPA_802_1X_PORT_NOT_SECURED; + pEntry->PMKID_CacheIdx = ENTRY_NOT_FOUND; COPY_MAC_ADDR(pEntry->Addr, pAddr); pEntry->Sst = SST_NOT_AUTH; @@ -2858,10 +2828,8 @@ VOID Indicate_Legacy_Packet( // 2. remove LLC // a. pointer pRxBlk->pData to payload // b. modify pRxBlk->DataSize -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3); -#endif // CONFIG_STA_SUPPORT // if (pRxBlk->DataSize > MAX_RX_PKT_LEN) { @@ -2880,11 +2848,8 @@ VOID Indicate_Legacy_Packet( // // pass this 802.3 packet to upper layer or forward this packet to WM directly // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pRxPacket, FromWhichBSSID); -#endif // CONFIG_STA_SUPPORT // - } @@ -2947,11 +2912,8 @@ VOID CmmRxRalinkFrameIndicate( } // get 802.3 Header and remove LLC -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3); -#endif // CONFIG_STA_SUPPORT // - ASSERT(pRxBlk->pRxPacket); @@ -2961,10 +2923,9 @@ VOID CmmRxRalinkFrameIndicate( Payload2Size = Msdu2Size - LENGTH_802_3; pData2 = pRxBlk->pData + Payload1Size + LENGTH_802_3; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) pPacket2 = duplicate_pkt(pAd, (pData2-LENGTH_802_3), LENGTH_802_3, pData2, Payload2Size, FromWhichBSSID); -#endif // CONFIG_STA_SUPPORT // if (!pPacket2) { @@ -2977,17 +2938,13 @@ VOID CmmRxRalinkFrameIndicate( pRxBlk->DataSize = Payload1Size; wlan_802_11_to_802_3_packet(pAd, pRxBlk, Header802_3, FromWhichBSSID); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pRxBlk->pRxPacket, FromWhichBSSID); -#endif // CONFIG_STA_SUPPORT // if (pPacket2) { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pPacket2, FromWhichBSSID); -#endif // CONFIG_STA_SUPPORT // } } @@ -3130,15 +3087,12 @@ VOID Indicate_EAPOL_Packet( { MAC_TABLE_ENTRY *pEntry = NULL; - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pEntry = &pAd->MacTab.Content[BSSID_WCID]; STARxEAPOLFrameIndicate(pAd, pEntry, pRxBlk, FromWhichBSSID); return; } -#endif // CONFIG_STA_SUPPORT // if (pEntry == NULL) { diff --git a/drivers/staging/rt2860/common/cmm_data_2860.c b/drivers/staging/rt2860/common/cmm_data_2860.c index 5f0152a9e12..f2749bec22d 100644 --- a/drivers/staging/rt2860/common/cmm_data_2860.c +++ b/drivers/staging/rt2860/common/cmm_data_2860.c @@ -386,8 +386,6 @@ int RtmpPCIMgmtKickOut( return 0; } - -#ifdef CONFIG_STA_SUPPORT /* ======================================================================== @@ -1041,8 +1039,6 @@ VOID RadioOnExec( } } -#endif // CONFIG_STA_SUPPORT // - VOID RT28xxPciMlmeRadioOn( IN PRTMP_ADAPTER pAd) { @@ -1076,7 +1072,6 @@ VOID RT28xxPciMlmeRadioOn( RTMPSetLED(pAd, LED_RADIO_ON); } -#ifdef CONFIG_STA_SUPPORT if ((pAd->OpMode == OPMODE_STA) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))) { @@ -1089,7 +1084,6 @@ VOID RT28xxPciMlmeRadioOn( RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled); RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 10); } -#endif // CONFIG_STA_SUPPORT // } VOID RT28xxPciMlmeRadioOFF( @@ -1112,7 +1106,6 @@ VOID RT28xxPciMlmeRadioOFF( // Set LED RTMPSetLED(pAd, LED_RADIO_OFF); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { BOOLEAN Cancelled; @@ -1162,7 +1155,6 @@ VOID RT28xxPciMlmeRadioOFF( return; } } -#endif // CONFIG_STA_SUPPORT // // Set Radio off flag RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF); diff --git a/drivers/staging/rt2860/common/cmm_info.c b/drivers/staging/rt2860/common/cmm_info.c index aeb91ef0c77..ba679da5580 100644 --- a/drivers/staging/rt2860/common/cmm_info.c +++ b/drivers/staging/rt2860/common/cmm_info.c @@ -133,11 +133,9 @@ INT Show_IEEE80211H_Proc( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf); -#ifdef CONFIG_STA_SUPPORT INT Show_NetworkType_Proc( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf); -#endif // CONFIG_STA_SUPPORT // INT Show_AuthMode_Proc( IN PRTMP_ADAPTER pAd, @@ -207,9 +205,7 @@ static struct { {"WmmCapable", Show_WmmCapable_Proc}, #endif {"IEEE80211H", Show_IEEE80211H_Proc}, -#ifdef CONFIG_STA_SUPPORT {"NetworkType", Show_NetworkType_Proc}, -#endif // CONFIG_STA_SUPPORT // {"AuthMode", Show_AuthMode_Proc}, {"EncrypType", Show_EncrypType_Proc}, {"DefaultKeyID", Show_DefaultKeyID_Proc}, @@ -233,11 +229,8 @@ INT Set_DriverVersion_Proc( IN PRTMP_ADAPTER pAd, IN PUCHAR arg) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) DBGPRINT(RT_DEBUG_TRACE, ("Driver version-%s\n", STA_DRIVER_VERSION)); -#endif // CONFIG_STA_SUPPORT // return TRUE; } @@ -347,8 +340,6 @@ INT Set_WirelessMode_Proc( WirelessMode = simple_strtol(arg, 0, 10); - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { INT MaxPhyMode = PHY_11G; @@ -385,7 +376,6 @@ INT Set_WirelessMode_Proc( success = FALSE; } } -#endif // CONFIG_STA_SUPPORT // // it is needed to set SSID to take effect if (success == TRUE) @@ -423,7 +413,6 @@ INT Set_Channel_Proc( // check if this channel is valid if (ChannelSanity(pAd, Channel) == TRUE) { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pAd->CommonCfg.Channel = Channel; @@ -450,16 +439,12 @@ INT Set_Channel_Proc( } } } -#endif // CONFIG_STA_SUPPORT // success = TRUE; } else { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) success = FALSE; -#endif // CONFIG_STA_SUPPORT // } @@ -515,14 +500,11 @@ INT Set_TxPower_Proc( TxPower = (ULONG) simple_strtol(arg, 0, 10); if (TxPower <= 100) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pAd->CommonCfg.TxPowerDefault = TxPower; pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault; } -#endif // CONFIG_STA_SUPPORT // success = TRUE; } else @@ -587,22 +569,18 @@ INT Set_TxPreamble_Proc( { case Rt802_11PreambleShort: pAd->CommonCfg.TxPreamble = Preamble; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) MlmeSetTxPreamble(pAd, Rt802_11PreambleShort); -#endif // CONFIG_STA_SUPPORT // break; case Rt802_11PreambleLong: -#ifdef CONFIG_STA_SUPPORT case Rt802_11PreambleAuto: // if user wants AUTO, initialize to LONG here, then change according to AP's // capability upon association. -#endif // CONFIG_STA_SUPPORT // pAd->CommonCfg.TxPreamble = Preamble; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) MlmeSetTxPreamble(pAd, Rt802_11PreambleLong); -#endif // CONFIG_STA_SUPPORT // break; default: //Invalid argument return FALSE; @@ -631,10 +609,8 @@ INT Set_RTSThreshold_Proc( if((RtsThresh > 0) && (RtsThresh <= MAX_RTS_THRESHOLD)) pAd->CommonCfg.RtsThreshold = (USHORT)RtsThresh; -#ifdef CONFIG_STA_SUPPORT else if (RtsThresh == 0) pAd->CommonCfg.RtsThreshold = MAX_RTS_THRESHOLD; -#endif // CONFIG_STA_SUPPORT // else return FALSE; //Invalid argument @@ -675,7 +651,6 @@ INT Set_FragThreshold_Proc( pAd->CommonCfg.FragmentThreshold = (USHORT)FragThresh; } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pAd->CommonCfg.FragmentThreshold == MAX_FRAG_THRESHOLD) @@ -683,7 +658,6 @@ INT Set_FragThreshold_Proc( else pAd->CommonCfg.bUseZeroToDisableFragment = FALSE; } -#endif // CONFIG_STA_SUPPORT // DBGPRINT(RT_DEBUG_TRACE, ("Set_FragThreshold_Proc::(FragThreshold=%d)\n", pAd->CommonCfg.FragmentThreshold)); @@ -904,7 +878,6 @@ BOOLEAN RTMPCheckStrPrintAble( ======================================================================== */ -#ifdef CONFIG_STA_SUPPORT VOID RTMPSetDesiredRates( IN PRTMP_ADAPTER pAdapter, IN LONG Rates) @@ -1117,10 +1090,7 @@ NDIS_STATUS RTMPWPARemoveKeyProc( return (Status); } -#endif // CONFIG_STA_SUPPORT // - -#ifdef CONFIG_STA_SUPPORT /* ======================================================================== @@ -1170,7 +1140,6 @@ VOID RTMPWPARemoveAllKeys( } } -#endif // CONFIG_STA_SUPPORT // /* ======================================================================== @@ -1214,10 +1183,8 @@ VOID RTMPSetPhyMode( if (i == pAd->ChannelListNum) { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) pAd->CommonCfg.Channel = FirstChannel(pAd); -#endif // CONFIG_STA_SUPPORT // DBGPRINT(RT_DEBUG_ERROR, ("RTMPSetPhyMode: channel is out of range, use first channel=%d \n", pAd->CommonCfg.Channel)); } @@ -1528,14 +1495,10 @@ VOID RTMPSetHT( } AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm); - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { RTMPSetIndividualHT(pAd, 0); } -#endif // CONFIG_STA_SUPPORT // - } /* @@ -1560,8 +1523,6 @@ VOID RTMPSetIndividualHT( do { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pDesired_ht_phy = &pAd->StaCfg.DesiredHtPhyInfo; @@ -1569,7 +1530,6 @@ VOID RTMPSetIndividualHT( //pAd->StaCfg.bAutoTxRateSwitch = (DesiredMcs == MCS_AUTO) ? TRUE : FALSE; break; } -#endif // CONFIG_STA_SUPPORT // } while (FALSE); if (pDesired_ht_phy == NULL) @@ -1721,7 +1681,6 @@ VOID RTMPAddWcidAttributeEntry( USHORT Wcid = 0; { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (BssIdx > BSS0) @@ -1742,13 +1701,11 @@ VOID RTMPAddWcidAttributeEntry( else Wcid = MCAST_WCID; } -#endif // CONFIG_STA_SUPPORT // } // Update WCID attribute table offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pEntry && pEntry->ValidAsMesh) @@ -1756,7 +1713,6 @@ VOID RTMPAddWcidAttributeEntry( else WCIDAttri = (CipherAlg<<1) | SHAREDKEYTABLE; } -#endif // CONFIG_STA_SUPPORT // RTMP_IO_WRITE32(pAd, offset, WCIDAttri); @@ -1887,11 +1843,10 @@ VOID RTMPIoctlGetSiteSurvey( "Ch", "SSID", "BSSID", "Enc", "Auth", "Siganl(%)", "W-Mode", " NT"); WaitCnt = 0; -#ifdef CONFIG_STA_SUPPORT pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE; + while ((ScanRunning(pAdapter) == TRUE) && (WaitCnt++ < 200)) OS_WAIT(500); -#endif // CONFIG_STA_SUPPORT // for(i=0; i<pAdapter->ScanTab.BssNr ;i++) { @@ -1957,9 +1912,7 @@ VOID RTMPIoctlGetSiteSurvey( sprintf(msg+strlen(msg),"\n"); } -#ifdef CONFIG_STA_SUPPORT pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE; -#endif // CONFIG_STA_SUPPORT // wrq->u.data.length = strlen(msg); Status = copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length); @@ -2257,9 +2210,7 @@ INT Set_HtMcs_Proc( IN PUCHAR arg) { ULONG HtMcs, Mcs_tmp; -#ifdef CONFIG_STA_SUPPORT BOOLEAN bAutoRate = FALSE; -#endif // CONFIG_STA_SUPPORT // Mcs_tmp = simple_strtol(arg, 0, 10); @@ -2268,7 +2219,6 @@ INT Set_HtMcs_Proc( else HtMcs = MCS_AUTO; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pAd->StaCfg.DesiredTransmitSetting.field.MCS = HtMcs; @@ -2304,7 +2254,6 @@ INT Set_HtMcs_Proc( if (ADHOC_ON(pAd)) return TRUE; } -#endif // CONFIG_STA_SUPPORT // SetCommonHT(pAd); @@ -2778,10 +2727,8 @@ INT Set_FixedTxMode_Proc( fix_tx_mode = FIXED_TXMODE_CCK; } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode = fix_tx_mode; -#endif // CONFIG_STA_SUPPORT // DBGPRINT(RT_DEBUG_TRACE, ("Set_FixedTxMode_Proc::(FixedTxMode=%d)\n", fix_tx_mode)); @@ -2866,11 +2813,8 @@ INT Show_SSID_Proc( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) sprintf(pBuf, "\t%s", pAd->CommonCfg.Ssid); -#endif // CONFIG_STA_SUPPORT // return 0; } @@ -3031,11 +2975,8 @@ INT Show_HtMcs_Proc( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) sprintf(pBuf, "\t%u", pAd->StaCfg.DesiredTransmitSetting.field.MCS); -#endif // CONFIG_STA_SUPPORT // return 0; } @@ -3177,11 +3118,8 @@ INT Show_WmmCapable_Proc( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) sprintf(pBuf, "\t%s", pAd->CommonCfg.bWmmCapable ? "TRUE":"FALSE"); -#endif // CONFIG_STA_SUPPORT // return 0; } @@ -3195,7 +3133,6 @@ INT Show_IEEE80211H_Proc( return 0; } -#ifdef CONFIG_STA_SUPPORT INT Show_NetworkType_Proc( IN PRTMP_ADAPTER pAd, OUT PUCHAR pBuf) @@ -3220,7 +3157,6 @@ INT Show_NetworkType_Proc( } return 0; } -#endif // CONFIG_STA_SUPPORT // INT Show_AuthMode_Proc( IN PRTMP_ADAPTER pAd, @@ -3228,10 +3164,8 @@ INT Show_AuthMode_Proc( { NDIS_802_11_AUTHENTICATION_MODE AuthMode = Ndis802_11AuthModeOpen; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) AuthMode = pAd->StaCfg.AuthMode; -#endif // CONFIG_STA_SUPPORT // if ((AuthMode >= Ndis802_11AuthModeOpen) && (AuthMode <= Ndis802_11AuthModeWPA1PSKWPA2PSK)) @@ -3248,10 +3182,8 @@ INT Show_EncrypType_Proc( { NDIS_802_11_WEP_STATUS WepStatus = Ndis802_11WEPDisabled; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) WepStatus = pAd->StaCfg.WepStatus; -#endif // CONFIG_STA_SUPPORT // if ((WepStatus >= Ndis802_11WEPEnabled) && (WepStatus <= Ndis802_11Encryption4KeyAbsent)) @@ -3268,10 +3200,8 @@ INT Show_DefaultKeyID_Proc( { UCHAR DefaultKeyId = 0; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) DefaultKeyId = pAd->StaCfg.DefaultKeyId; -#endif // CONFIG_STA_SUPPORT // sprintf(pBuf, "\t%d", DefaultKeyId); @@ -3341,11 +3271,8 @@ INT Show_WPAPSK_Proc( INT idx; UCHAR PMK[32] = {0}; - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) NdisMoveMemory(PMK, pAd->StaCfg.PMK, 32); -#endif // CONFIG_STA_SUPPORT // sprintf(pBuf, "\tPMK = "); for (idx = 0; idx < 32; idx++) diff --git a/drivers/staging/rt2860/common/cmm_sanity.c b/drivers/staging/rt2860/common/cmm_sanity.c index 7f58c4f5295..fdd4b0c71b7 100644 --- a/drivers/staging/rt2860/common/cmm_sanity.c +++ b/drivers/staging/rt2860/common/cmm_sanity.c @@ -275,9 +275,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity( OUT PQOS_CAPABILITY_PARM pQosCapability, OUT ULONG *pRalinkIe, OUT UCHAR *pHtCapabilityLen, -#ifdef CONFIG_STA_SUPPORT OUT UCHAR *pPreNHtCapabilityLen, -#endif // CONFIG_STA_SUPPORT // OUT HT_CAPABILITY_IE *pHtCapability, OUT UCHAR *AddHtInfoLen, OUT ADD_HT_INFO_IE *AddHtInfo, @@ -286,9 +284,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity( OUT PNDIS_802_11_VARIABLE_IEs pVIE) { CHAR *Ptr; -#ifdef CONFIG_STA_SUPPORT CHAR TimLen; -#endif // CONFIG_STA_SUPPORT // PFRAME_802_11 pFrame; PEID_STRUCT pEid; UCHAR SubType; @@ -316,10 +312,8 @@ BOOLEAN PeerBeaconAndProbeRspSanity( *pAironetCellPowerLimit = 0xFF; // Default of AironetCellPowerLimit is 0xFF *LengthVIE = 0; // Set the length of VIE to init value 0 *pHtCapabilityLen = 0; // Set the length of VIE to init value 0 -#ifdef CONFIG_STA_SUPPORT if (pAd->OpMode == OPMODE_STA) *pPreNHtCapabilityLen = 0; // Set the length of VIE to init value 0 -#endif // CONFIG_STA_SUPPORT // *AddHtInfoLen = 0; // Set the length of VIE to init value 0 *pRalinkIe = 0; *pNewChannel = 0; @@ -428,7 +422,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( *(USHORT *)(&pHtCapability->HtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->HtCapInfo)); *(USHORT *)(&pHtCapability->ExtHtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->ExtHtCapInfo)); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { *pPreNHtCapabilityLen = 0; // Nnow we only support 26 bytes. @@ -437,7 +430,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2); *LengthVIE += (pEid->Len + 2); } -#endif // CONFIG_STA_SUPPORT // } else { @@ -458,14 +450,12 @@ BOOLEAN PeerBeaconAndProbeRspSanity( *(USHORT *)(&AddHtInfo->AddHtInfo2) = cpu2le16(*(USHORT *)(&AddHtInfo->AddHtInfo2)); *(USHORT *)(&AddHtInfo->AddHtInfo3) = cpu2le16(*(USHORT *)(&AddHtInfo->AddHtInfo3)); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { Ptr = (PUCHAR) pVIE; NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2); *LengthVIE += (pEid->Len + 2); } -#endif // CONFIG_STA_SUPPORT // } else { @@ -492,7 +482,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity( if(pEid->Len == 1) { *pChannel = *pEid->Octet; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (ChannelSanity(pAd, *pChannel) == 0) @@ -501,7 +491,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity( return FALSE; } } -#endif // CONFIG_STA_SUPPORT // + Sanity |= 0x4; } else @@ -539,14 +529,13 @@ BOOLEAN PeerBeaconAndProbeRspSanity( } break; -#ifdef CONFIG_STA_SUPPORT case IE_TIM: if(INFRA_ON(pAd) && SubType == SUBTYPE_BEACON) { GetTimBit((PUCHAR)pEid, pAd->StaActive.Aid, &TimLen, pBcastFlag, pDtimCount, pDtimPeriod, pMessageToMe); } break; -#endif // CONFIG_STA_SUPPORT // + case IE_CHANNEL_SWITCH_ANNOUNCEMENT: if(pEid->Len == 3) { @@ -568,7 +557,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( else *pRalinkIe = 0xf0000000; // Set to non-zero value (can't set bit0-2) to represent this is Ralink Chip. So at linkup, we will set ralinkchip flag. } -#ifdef CONFIG_STA_SUPPORT #ifdef DOT11_N_SUPPORT // This HT IE is before IEEE draft set HT IE value.2006-09-28 by Jan. @@ -589,7 +577,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( } } #endif // DOT11_N_SUPPORT // -#endif // CONFIG_STA_SUPPORT // else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)) { // Copy to pVIE which will report to microsoft bssid list. @@ -722,7 +709,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( } // For some 11a AP. it did not have the channel EID, patch here -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { UCHAR LatchRfChannel = MsgChannel; @@ -735,7 +721,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( Sanity |= 0x4; } } -#endif // CONFIG_STA_SUPPORT // if (Sanity != 0x7) { @@ -776,10 +761,8 @@ BOOLEAN MlmeScanReqSanity( if ((*pBssType == BSS_INFRA || *pBssType == BSS_ADHOC || *pBssType == BSS_ANY) && (*pScanType == SCAN_ACTIVE || *pScanType == SCAN_PASSIVE -#ifdef CONFIG_STA_SUPPORT || *pScanType == SCAN_CISCO_PASSIVE || *pScanType == SCAN_CISCO_ACTIVE || *pScanType == SCAN_CISCO_CHANNEL_LOAD || *pScanType == SCAN_CISCO_NOISE -#endif // CONFIG_STA_SUPPORT // )) { return TRUE; diff --git a/drivers/staging/rt2860/common/cmm_sync.c b/drivers/staging/rt2860/common/cmm_sync.c index 13593e7ab7e..a3f9395150a 100644 --- a/drivers/staging/rt2860/common/cmm_sync.c +++ b/drivers/staging/rt2860/common/cmm_sync.c @@ -383,27 +383,21 @@ VOID ScanNextChannel( NDIS_STATUS NStatus; ULONG FrameLen = 0; UCHAR SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0; -#ifdef CONFIG_STA_SUPPORT USHORT Status; PHEADER_802_11 pHdr80211; -#endif // CONFIG_STA_SUPPORT // UINT ScanTimeIn5gChannel = SHORT_CHANNEL_TIME; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (MONITOR_ON(pAd)) return; } -#endif // CONFIG_STA_SUPPORT // if (pAd->MlmeAux.Channel == 0) { if ((pAd->CommonCfg.BBPCurrentBW == BW_40) -#ifdef CONFIG_STA_SUPPORT && (INFRA_ON(pAd) || (pAd->OpMode == OPMODE_AP)) -#endif // CONFIG_STA_SUPPORT // ) { AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); @@ -421,7 +415,6 @@ VOID ScanNextChannel( DBGPRINT(RT_DEBUG_TRACE, ("SYNC - End of SCAN, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr)); } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // @@ -452,14 +445,11 @@ VOID ScanNextChannel( Status = MLME_SUCCESS; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status); } -#endif // CONFIG_STA_SUPPORT // - RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); } else { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // BBP and RF are not accessible in PS mode, we has to wake them up first @@ -470,12 +460,10 @@ VOID ScanNextChannel( if (pAd->StaCfg.Psm == PWR_SAVE) MlmeSetPsmBit(pAd, PWR_ACTIVE); } -#endif // CONFIG_STA_SUPPORT // AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, TRUE); AsicLockChannel(pAd, pAd->MlmeAux.Channel); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pAd->MlmeAux.Channel > 14) @@ -487,7 +475,6 @@ VOID ScanNextChannel( } } } -#endif // CONFIG_STA_SUPPORT // //Global country domain(ch1-11:active scan, ch12-14 passive scan) if ((pAd->MlmeAux.Channel <= 14) && (pAd->MlmeAux.Channel >= 12) && ((pAd->CommonCfg.CountryRegion & 0x7f) == REGION_31_BG_BAND)) @@ -499,7 +486,6 @@ VOID ScanNextChannel( // Chnage the channel scan time for CISCO stuff based on its IAPP announcement if (ScanType == FAST_SCAN_ACTIVE) RTMPSetTimer(&pAd->MlmeAux.ScanTimer, FAST_ACTIVE_SCAN_TIME); -#ifdef CONFIG_STA_SUPPORT else if (((ScanType == SCAN_CISCO_ACTIVE) || (ScanType == SCAN_CISCO_PASSIVE) || (ScanType == SCAN_CISCO_CHANNEL_LOAD) || @@ -510,7 +496,6 @@ VOID ScanNextChannel( else RTMPSetTimer(&pAd->MlmeAux.ScanTimer, pAd->StaCfg.CCXScanTime); } -#endif // CONFIG_STA_SUPPORT // else // must be SCAN_PASSIVE or SCAN_ACTIVE { if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED) @@ -535,14 +520,13 @@ VOID ScanNextChannel( if (NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("SYNC - ScanNextChannel() allocate memory fail\n")); -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_FAIL_NO_RESOURCE; MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status); } -#endif // CONFIG_STA_SUPPORT // return; } @@ -615,11 +599,8 @@ VOID ScanNextChannel( // For SCAN_CISCO_PASSIVE, do nothing and silently wait for beacon or other probe reponse -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) pAd->Mlme.SyncMachine.CurrState = SCAN_LISTEN; -#endif // CONFIG_STA_SUPPORT // - } } diff --git a/drivers/staging/rt2860/common/cmm_wpa.c b/drivers/staging/rt2860/common/cmm_wpa.c index 69baf522fa0..8f29d31d89d 100644 --- a/drivers/staging/rt2860/common/cmm_wpa.c +++ b/drivers/staging/rt2860/common/cmm_wpa.c @@ -370,7 +370,6 @@ static VOID RTMPInsertRsnIeCipher( break; } -#ifdef CONFIG_STA_SUPPORT if ((pAd->OpMode == OPMODE_STA) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled)) @@ -386,7 +385,6 @@ static VOID RTMPInsertRsnIeCipher( break; } } -#endif // CONFIG_STA_SUPPORT // // swap for big-endian platform pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version); @@ -448,7 +446,6 @@ static VOID RTMPInsertRsnIeCipher( break; } -#ifdef CONFIG_STA_SUPPORT if ((pAd->OpMode == OPMODE_STA) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled)) @@ -464,7 +461,6 @@ static VOID RTMPInsertRsnIeCipher( break; } } -#endif // CONFIG_STA_SUPPORT // // swap for big-endian platform pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version); @@ -627,7 +623,6 @@ VOID RTMPMakeRSNIE( rsnielen_ex_cur_p = NULL; { -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { #ifdef WPA_SUPPLICANT_SUPPORT @@ -660,7 +655,6 @@ VOID RTMPMakeRSNIE( bMixCipher = pAd->StaCfg.bMixCipher; } -#endif // CONFIG_STA_SUPPORT // } // indicate primary RSNIE as WPA or WPA2 @@ -1131,11 +1125,6 @@ BOOLEAN RTMPParseEapolKeyData( return FALSE; } - -#ifdef CONFIG_STA_SUPPORT - // Todo -#endif // CONFIG_STA_SUPPORT // - return TRUE; } diff --git a/drivers/staging/rt2860/common/mlme.c b/drivers/staging/rt2860/common/mlme.c index e0c39e28325..8dbbd28a4e7 100644 --- a/drivers/staging/rt2860/common/mlme.c +++ b/drivers/staging/rt2860/common/mlme.c @@ -50,11 +50,9 @@ UCHAR Ccx2QosInfo[] = {0x00, 0x40, 0x96, 0x04}; UCHAR RALINK_OUI[] = {0x00, 0x0c, 0x43}; UCHAR BROADCOM_OUI[] = {0x00, 0x90, 0x4c}; UCHAR WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04}; -#ifdef CONFIG_STA_SUPPORT #ifdef DOT11_N_SUPPORT UCHAR PRE_N_HT_OUI[] = {0x00, 0x90, 0x4c}; #endif // DOT11_N_SUPPORT // -#endif // CONFIG_STA_SUPPORT // UCHAR RateSwitchTable[] = { // Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) @@ -485,7 +483,6 @@ NDIS_STATUS MlmeInit( pAd->Mlme.bRunning = FALSE; NdisAllocateSpinLock(&pAd->Mlme.TaskLock); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { BssTableInit(&pAd->ScanTab); @@ -502,9 +499,6 @@ NDIS_STATUS MlmeInit( // state machine init MlmeCntlInit(pAd, &pAd->Mlme.CntlMachine, NULL); } -#endif // CONFIG_STA_SUPPORT // - - ActionStateMachineInit(pAd, &pAd->Mlme.ActMachine, pAd->Mlme.ActFunc); @@ -517,8 +511,6 @@ NDIS_STATUS MlmeInit( // software-based RX Antenna diversity RTMPInitTimer(pAd, &pAd->Mlme.RxAntEvalTimer, GET_TIMER_FUNCTION(AsicRxAntEvalTimeout), pAd, FALSE); - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) @@ -528,8 +520,6 @@ NDIS_STATUS MlmeInit( RTMPInitTimer(pAd, &pAd->Mlme.RadioOnOffTimer, GET_TIMER_FUNCTION(RadioOnExec), pAd, FALSE); } } -#endif // CONFIG_STA_SUPPORT // - } while (FALSE); DBGPRINT(RT_DEBUG_TRACE, ("<-- MLME Initialize\n")); @@ -589,7 +579,6 @@ VOID MlmeHandler( switch (Elem->Machine) { // STA state machines -#ifdef CONFIG_STA_SUPPORT case ASSOC_STATE_MACHINE: StateMachinePerformAction(pAd, &pAd->Mlme.AssocMachine, Elem); break; @@ -611,8 +600,6 @@ VOID MlmeHandler( case AIRONET_STATE_MACHINE: StateMachinePerformAction(pAd, &pAd->Mlme.AironetMachine, Elem); break; -#endif // CONFIG_STA_SUPPORT // - case ACTION_STATE_MACHINE: StateMachinePerformAction(pAd, &pAd->Mlme.ActMachine, Elem); break; @@ -666,7 +653,6 @@ VOID MlmeHalt( AsicDisableSync(pAd); } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Cancel pending timers @@ -682,7 +668,6 @@ VOID MlmeHalt( RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled); } } -#endif // CONFIG_STA_SUPPORT // RTMPCancelTimer(&pAd->Mlme.PeriodicTimer, &Cancelled); RTMPCancelTimer(&pAd->Mlme.RxAntEvalTimer, &Cancelled); @@ -777,7 +762,6 @@ VOID MlmePeriodicExec( pAd->StaCfg.WpaSupplicantUP = 1; } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // If Hardware controlled Radio enabled, we have to check GPIO pin2 every 2 second. @@ -818,7 +802,6 @@ VOID MlmePeriodicExec( } } } -#endif // CONFIG_STA_SUPPORT // // Do nothing if the driver is starting halt state. // This might happen when timer already been fired before cancel timer with mlmehalt @@ -869,7 +852,6 @@ VOID MlmePeriodicExec( RT28XX_MLME_PRE_SANITY_CHECK(pAd); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Do nothing if monitor mode is on @@ -895,7 +877,6 @@ VOID MlmePeriodicExec( } } } -#endif // CONFIG_STA_SUPPORT // pAd->bUpdateBcnCntDone = FALSE; @@ -905,7 +886,6 @@ VOID MlmePeriodicExec( // execute every 500ms if ((pAd->Mlme.PeriodicRound % 5 == 0) && RTMPAutoRateSwitchCheck(pAd)/*(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))*/) { -#ifdef CONFIG_STA_SUPPORT // perform dynamic tx rate switching based on past TX history IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { @@ -914,7 +894,6 @@ VOID MlmePeriodicExec( && (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))) MlmeDynamicTxRateSwitching(pAd); } -#endif // CONFIG_STA_SUPPORT // } // Normal 1 second Mlme PeriodicExec. @@ -983,14 +962,11 @@ VOID MlmePeriodicExec( } } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) STAMlmePeriodicExec(pAd); -#endif // CONFIG_STA_SUPPORT // MlmeResetRalinkCounters(pAd); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->bPCIclkOff == FALSE)) @@ -1015,7 +991,6 @@ VOID MlmePeriodicExec( } } } -#endif // CONFIG_STA_SUPPORT // RT28XX_MLME_HANDLER(pAd); } @@ -1024,7 +999,6 @@ VOID MlmePeriodicExec( pAd->bUpdateBcnCntDone = FALSE; } -#ifdef CONFIG_STA_SUPPORT VOID STAMlmePeriodicExec( PRTMP_ADAPTER pAd) { @@ -1365,7 +1339,6 @@ VOID MlmeAutoReconnectLastSSID( RT28XX_MLME_HANDLER(pAd); } } -#endif // CONFIG_STA_SUPPORT // /* ========================================================================== @@ -1414,7 +1387,6 @@ VOID MlmeSelectTxRateTable( break; } -#ifdef CONFIG_STA_SUPPORT if ((pAd->OpMode == OPMODE_STA) && ADHOC_ON(pAd)) { #ifdef DOT11_N_SUPPORT @@ -1483,7 +1455,6 @@ VOID MlmeSelectTxRateTable( } break; } -#endif // CONFIG_STA_SUPPORT // #ifdef DOT11_N_SUPPORT if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) && @@ -1587,7 +1558,6 @@ VOID MlmeSelectTxRateTable( #ifdef DOT11_N_SUPPORT #endif // DOT11_N_SUPPORT // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { #ifdef DOT11_N_SUPPORT @@ -1655,11 +1625,9 @@ VOID MlmeSelectTxRateTable( DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode (SupRateLen=%d, ExtRateLen=%d, MCSSet[0]=0x%x, MCSSet[1]=0x%x)\n", pAd->StaActive.SupRateLen, pAd->StaActive.ExtRateLen, pAd->StaActive.SupportedPhyInfo.MCSSet[0], pAd->StaActive.SupportedPhyInfo.MCSSet[1])); } -#endif // CONFIG_STA_SUPPORT // } while(FALSE); } -#ifdef CONFIG_STA_SUPPORT /* ========================================================================== Description: @@ -2755,8 +2723,6 @@ VOID MlmeSetPsmBit( RTMP_IO_WRITE32(pAd, AUTO_RSP_CFG, csr4.word); DBGPRINT(RT_DEBUG_TRACE, ("MlmeSetPsmBit = %d\n", psm)); } -#endif // CONFIG_STA_SUPPORT // - // IRQL = DISPATCH_LEVEL VOID MlmeSetTxPreamble( @@ -2895,8 +2861,6 @@ VOID MlmeUpdateTxRates( //=========================================================================== //=========================================================================== - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pHtPhy = &pAd->StaCfg.HTPhyMode; @@ -2913,7 +2877,6 @@ VOID MlmeUpdateTxRates( MaxDesire = RATE_11; } } -#endif // CONFIG_STA_SUPPORT // pAd->CommonCfg.MaxDesiredRate = MaxDesire; pMinHtPhy->word = 0; @@ -2942,7 +2905,6 @@ VOID MlmeUpdateTxRates( } #endif -#ifdef CONFIG_STA_SUPPORT if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA)) { pSupRate = &pAd->StaActive.SupRate[0]; @@ -2951,7 +2913,6 @@ VOID MlmeUpdateTxRates( ExtRateLen = pAd->StaActive.ExtRateLen; } else -#endif // CONFIG_STA_SUPPORT // { pSupRate = &pAd->CommonCfg.SupRate[0]; pExtRate = &pAd->CommonCfg.ExtRate[0]; @@ -3028,10 +2989,10 @@ VOID MlmeUpdateTxRates( if (*auto_rate_cur_p) { short dbm = 0; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) dbm = pAd->StaCfg.RssiSample.AvgRssi0 - pAd->BbpRssiToDbmDelta; -#endif // CONFIG_STA_SUPPORT // + if (bLinkUp == TRUE) pAd->CommonCfg.TxRate = RATE_24; else @@ -3190,7 +3151,6 @@ VOID MlmeUpdateHtTxRates( auto_rate_cur_p = NULL; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pDesireHtPhy = &pAd->StaCfg.DesiredHtPhyInfo; @@ -3201,9 +3161,7 @@ VOID MlmeUpdateHtTxRates( auto_rate_cur_p = &pAd->StaCfg.bAutoTxRateSwitch; } -#endif // CONFIG_STA_SUPPORT // -#ifdef CONFIG_STA_SUPPORT if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA)) { if (pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) @@ -3219,7 +3177,6 @@ VOID MlmeUpdateHtTxRates( pMaxHtPhy->field.STBC = STBC_NONE; } else -#endif // CONFIG_STA_SUPPORT // { if (pDesireHtPhy->bHtEnable == FALSE) return; @@ -3270,7 +3227,6 @@ VOID MlmeUpdateHtTxRates( pMinHtPhy->field.STBC = 0; pMinHtPhy->field.ShortGI = 0; //If STA assigns fixed rate. update to fixed here. -#ifdef CONFIG_STA_SUPPORT if ( (pAd->OpMode == OPMODE_STA) && (pDesireHtPhy->MCSSet[0] != 0xff)) { if (pDesireHtPhy->MCSSet[4] != 0) @@ -3294,8 +3250,6 @@ VOID MlmeUpdateHtTxRates( break; } } -#endif // CONFIG_STA_SUPPORT // - // Decide ht rate pHtPhy->field.STBC = pMaxHtPhy->field.STBC; @@ -3677,7 +3631,6 @@ VOID BssEntrySet( else pBss->QbssLoad.bValid = FALSE; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { PEID_STRUCT pEid; @@ -3722,7 +3675,6 @@ VOID BssEntrySet( pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len); } } -#endif // CONFIG_STA_SUPPORT // } /*! @@ -3824,7 +3776,6 @@ ULONG BssTableSetEntry( return Idx; } -#ifdef CONFIG_STA_SUPPORT // IRQL = DISPATCH_LEVEL VOID BssTableSsidSort( IN PRTMP_ADAPTER pAd, @@ -4079,8 +4030,6 @@ VOID BssTableSortByRssi( } } } -#endif // CONFIG_STA_SUPPORT // - VOID BssCipherParse( IN OUT PBSS_ENTRY pBss) @@ -4484,10 +4433,10 @@ VOID MgtMacHeaderInit( pHdr80211->FC.SubType = SubType; pHdr80211->FC.ToDs = ToDs; COPY_MAC_ADDR(pHdr80211->Addr1, pDA); -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress); -#endif // CONFIG_STA_SUPPORT // + COPY_MAC_ADDR(pHdr80211->Addr3, pBssid); } @@ -4694,7 +4643,6 @@ BOOLEAN MlmeEnqueueForRecv( return FALSE; } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (!MsgTypeSubst(pAd, pFrame, &Machine, &MsgType)) @@ -4703,7 +4651,6 @@ BOOLEAN MlmeEnqueueForRecv( return FALSE; } } -#endif // CONFIG_STA_SUPPORT // // OK, we got all the informations, it is time to put things into queue NdisAcquireSpinLock(&(Queue->Lock)); @@ -4772,9 +4719,7 @@ VOID MlmeRestartStateMachine( IN PRTMP_ADAPTER pAd) { MLME_QUEUE_ELEM *Elem = NULL; -#ifdef CONFIG_STA_SUPPORT BOOLEAN Cancelled; -#endif // CONFIG_STA_SUPPORT // DBGPRINT(RT_DEBUG_TRACE, ("MlmeRestartStateMachine \n")); @@ -4806,7 +4751,6 @@ VOID MlmeRestartStateMachine( } } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Cancel all timer events @@ -4818,7 +4762,6 @@ VOID MlmeRestartStateMachine( RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled); RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled); } -#endif // CONFIG_STA_SUPPORT // // Change back to original channel in case of doing scan AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); @@ -4827,7 +4770,6 @@ VOID MlmeRestartStateMachine( // Resume MSDU which is turned off durning scan RTMPResumeMsduTransmission(pAd); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Set all state machines back IDLE @@ -4838,7 +4780,6 @@ VOID MlmeRestartStateMachine( pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; pAd->Mlme.ActMachine.CurrState = ACT_IDLE; } -#endif // CONFIG_STA_SUPPORT // // Remove running state NdisAcquireSpinLock(&pAd->Mlme.TaskLock); @@ -4921,7 +4862,6 @@ VOID MlmeQueueDestroy( IRQL = DISPATCH_LEVEL */ -#ifdef CONFIG_STA_SUPPORT BOOLEAN MsgTypeSubst( IN PRTMP_ADAPTER pAd, IN PFRAME_802_11 pFrame, @@ -5031,7 +4971,6 @@ BOOLEAN MsgTypeSubst( return TRUE; } -#endif // CONFIG_STA_SUPPORT // // =========================================================================================== // state_machine.c @@ -6148,7 +6087,6 @@ VOID AsicAdjustTxPower( } -#ifdef CONFIG_STA_SUPPORT /* ========================================================================== Description: @@ -6199,7 +6137,7 @@ VOID AsicForceWakeup( DBGPRINT(RT_DEBUG_TRACE, ("--> AsicForceWakeup \n")); RT28XX_STA_FORCE_WAKEUP(pAd, Level); } -#endif // CONFIG_STA_SUPPORT // + /* ========================================================================== Description: @@ -6371,7 +6309,7 @@ VOID AsicEnableBssSync( DBGPRINT(RT_DEBUG_TRACE, ("--->AsicEnableBssSync(INFRA mode)\n")); RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word); -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU @@ -6380,7 +6318,7 @@ VOID AsicEnableBssSync( csr.field.bBeaconGen = 0; // do NOT generate BEACON csr.field.bTBTTEnable = 1; } -#endif // CONFIG_STA_SUPPORT // + RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word); } @@ -6575,7 +6513,7 @@ VOID AsicSetEdcaParm( Ac2Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VI]; Ac2Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_VI]; Ac2Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VI]; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Tuning for Wi-Fi WMM S06 @@ -6592,7 +6530,6 @@ VOID AsicSetEdcaParm( Ac2Cfg.field.AcTxop = 5; } } -#endif // CONFIG_STA_SUPPORT // Ac3Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VO]; Ac3Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VO]; @@ -6634,10 +6571,10 @@ VOID AsicSetEdcaParm( CwminCsr.field.Cwmin0 = pEdcaParm->Cwmin[QID_AC_BE]; CwminCsr.field.Cwmin1 = pEdcaParm->Cwmin[QID_AC_BK]; CwminCsr.field.Cwmin2 = pEdcaParm->Cwmin[QID_AC_VI]; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) CwminCsr.field.Cwmin3 = pEdcaParm->Cwmin[QID_AC_VO] - 1; //for TGn wifi test -#endif // CONFIG_STA_SUPPORT // + RTMP_IO_WRITE32(pAd, WMM_CWMIN_CFG, CwminCsr.word); CwmaxCsr.word = 0; @@ -6651,7 +6588,7 @@ VOID AsicSetEdcaParm( AifsnCsr.field.Aifsn0 = Ac0Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BE]; AifsnCsr.field.Aifsn1 = Ac1Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BK]; AifsnCsr.field.Aifsn2 = Ac2Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_VI]; -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Tuning for Wi-Fi WMM S06 @@ -6668,12 +6605,10 @@ VOID AsicSetEdcaParm( AifsnCsr.field.Aifsn2 = 7; } } -#endif // CONFIG_STA_SUPPORT // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test -#endif // CONFIG_STA_SUPPORT // + RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word); NdisMoveMemory(&pAd->CommonCfg.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM)); @@ -6724,10 +6659,8 @@ VOID AsicSetSlotTime( ULONG SlotTime; UINT32 RegValue = 0; -#ifdef CONFIG_STA_SUPPORT if (pAd->CommonCfg.Channel > 14) bUseShortSlotTime = TRUE; -#endif // CONFIG_STA_SUPPORT // if (bUseShortSlotTime) OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED); @@ -6736,7 +6669,6 @@ VOID AsicSetSlotTime( SlotTime = (bUseShortSlotTime)? 9 : 20; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // force using short SLOT time for FAE to demo performance when TxBurst is ON @@ -6752,20 +6684,17 @@ VOID AsicSetSlotTime( else if (pAd->CommonCfg.bEnableTxBurst) SlotTime = 9; } -#endif // CONFIG_STA_SUPPORT // // // For some reasons, always set it to short slot time. // // ToDo: Should consider capability with 11B // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pAd->StaCfg.BssType == BSS_ADHOC) SlotTime = 20; } -#endif // CONFIG_STA_SUPPORT // RTMP_IO_READ32(pAd, BKOFF_SLOT_CFG, &RegValue); RegValue = RegValue & 0xFFFFFF00; @@ -7387,7 +7316,6 @@ VOID RTMPCheckRates( NdisMoveMemory(SupRate, NewRate, NewRateLen); } -#ifdef CONFIG_STA_SUPPORT #ifdef DOT11_N_SUPPORT BOOLEAN RTMPCheckChannel( IN PRTMP_ADAPTER pAd, @@ -7535,7 +7463,6 @@ BOOLEAN RTMPCheckHt( return TRUE; } #endif // DOT11_N_SUPPORT // -#endif // CONFIG_STA_SUPPORT // /* ======================================================================== @@ -7719,7 +7646,6 @@ VOID AsicEvaluateRxAnt( { UCHAR BBPR3 = 0; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS | @@ -7732,7 +7658,6 @@ VOID AsicEvaluateRxAnt( if (pAd->StaCfg.Psm == PWR_SAVE) return; } -#endif // CONFIG_STA_SUPPORT // RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3); BBPR3 &= (~0x18); @@ -7749,10 +7674,10 @@ VOID AsicEvaluateRxAnt( BBPR3 |= (0x0); } RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3); -#ifdef CONFIG_STA_SUPPORT + IF_DEV_CONFIG_OPMODE_ON_STA(pAd) pAd->StaCfg.BBPR3 = BBPR3; -#endif // CONFIG_STA_SUPPORT // + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) ) { @@ -7793,12 +7718,9 @@ VOID AsicRxAntEvalTimeout( IN PVOID SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext; -#ifdef CONFIG_STA_SUPPORT UCHAR BBPR3 = 0; CHAR larger = -127, rssi0, rssi1, rssi2; -#endif // CONFIG_STA_SUPPORT // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) || @@ -7859,9 +7781,6 @@ VOID AsicRxAntEvalTimeout( RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3); pAd->StaCfg.BBPR3 = BBPR3; } - -#endif // CONFIG_STA_SUPPORT // - } @@ -7928,8 +7847,6 @@ BOOLEAN RTMPCheckEntryEnableAutoRateSwitch( { BOOLEAN result = TRUE; - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // only associated STA counts @@ -7940,9 +7857,6 @@ BOOLEAN RTMPCheckEntryEnableAutoRateSwitch( else result = FALSE; } -#endif // CONFIG_STA_SUPPORT // - - return result; } @@ -7951,14 +7865,12 @@ BOOLEAN RTMPCheckEntryEnableAutoRateSwitch( BOOLEAN RTMPAutoRateSwitchCheck( IN PRTMP_ADAPTER pAd) { - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pAd->StaCfg.bAutoTxRateSwitch) return TRUE; } -#endif // CONFIG_STA_SUPPORT // + return FALSE; } @@ -7984,13 +7896,10 @@ UCHAR RTMPStaFixedTxMode( { UCHAR tx_mode = FIXED_TXMODE_HT; - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { tx_mode = (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode; } -#endif // CONFIG_STA_SUPPORT // return tx_mode; } @@ -8047,7 +7956,6 @@ VOID RTMPUpdateLegacyTxSetting( } } -#ifdef CONFIG_STA_SUPPORT /* ========================================================================== Description: @@ -8254,7 +8162,6 @@ VOID AsicResetPBF( DBGPRINT(RT_DEBUG_TRACE, ("<--- Asic HardReset PBF !!!! \n")); } } -#endif // CONFIG_STA_SUPPORT // VOID RTMPSetAGCInitValue( IN PRTMP_ADAPTER pAd, diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c index 3a8419f7b4a..f64162c748b 100644 --- a/drivers/staging/rt2860/common/rtmp_init.c +++ b/drivers/staging/rt2860/common/rtmp_init.c @@ -163,19 +163,14 @@ RTMP_REG_PAIR MACRegTable[] = { {PWR_PIN_CFG, 0x00000003}, // patch for 2880-E }; - -#ifdef CONFIG_STA_SUPPORT RTMP_REG_PAIR STAMACRegTable[] = { {WMM_AIFSN_CFG, 0x00002273}, {WMM_CWMIN_CFG, 0x00002344}, {WMM_CWMAX_CFG, 0x000034aa}, }; -#endif // CONFIG_STA_SUPPORT // #define NUM_MAC_REG_PARMS (sizeof(MACRegTable) / sizeof(RTMP_REG_PAIR)) -#ifdef CONFIG_STA_SUPPORT #define NUM_STA_MAC_REG_PARMS (sizeof(STAMACRegTable) / sizeof(RTMP_REG_PAIR)) -#endif // CONFIG_STA_SUPPORT // // New 8k byte firmware size for RT3071/RT3072 @@ -1277,9 +1272,6 @@ VOID NICReadEEPROMParameters( NicConfig2.word = pAd->EEPROMDefaultValue[1]; - - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { NicConfig2.word = 0; @@ -1293,7 +1285,6 @@ VOID NICReadEEPROMParameters( NicConfig2.word &= 0x00ff; } } -#endif // CONFIG_STA_SUPPORT // if (NicConfig2.field.DynamicTxAgcControl == 1) pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = TRUE; @@ -1504,10 +1495,8 @@ VOID NICReadEEPROMParameters( VOID NICInitAsicFromEEPROM( IN PRTMP_ADAPTER pAd) { -#ifdef CONFIG_STA_SUPPORT UINT32 data = 0; UCHAR BBPR1 = 0; -#endif // CONFIG_STA_SUPPORT // USHORT i; EEPROM_ANTENNA_STRUC Antenna; EEPROM_NIC_CONFIG2_STRUC NicConfig2; @@ -1553,7 +1542,6 @@ VOID NICInitAsicFromEEPROM( pAd->LedIndicatorStregth = 0xFF; RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, before link up -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Read Hardware controlled Radio state enable bit @@ -1586,7 +1574,6 @@ VOID NICInitAsicFromEEPROM( AsicCheckCommanOk(pAd, PowerWakeCID); } } -#endif // CONFIG_STA_SUPPORT // // Turn off patching for cardbus controller if (NicConfig2.field.CardbusAcceleration == 1) @@ -1619,7 +1606,6 @@ VOID NICInitAsicFromEEPROM( } RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Handle the difference when 1T @@ -1632,7 +1618,7 @@ VOID NICInitAsicFromEEPROM( DBGPRINT(RT_DEBUG_TRACE, ("Use Hw Radio Control Pin=%d; if used Pin=%d;\n", pAd->CommonCfg.bHardwareRadio, pAd->CommonCfg.bHardwareRadio)); } -#endif // CONFIG_STA_SUPPORT // + DBGPRINT(RT_DEBUG_TRACE, ("TxPath = %d, RxPath = %d, RFIC=%d, Polar+LED mode=%x\n", pAd->Antenna.field.TxPath, pAd->Antenna.field.RxPath, pAd->RfIcType, pAd->LedCntl.word)); DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitAsicFromEEPROM\n")); } @@ -1880,7 +1866,6 @@ NDIS_STATUS NICInitializeAsic( } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++) @@ -1888,8 +1873,6 @@ NDIS_STATUS NICInitializeAsic( RTMP_IO_WRITE32(pAd, STAMACRegTable[Index].Register, STAMACRegTable[Index].Value); } } -#endif // CONFIG_STA_SUPPORT // - // // Before program BBP, we need to wait BBP/RF get wake up. @@ -1953,7 +1936,6 @@ NDIS_STATUS NICInitializeAsic( // Add radio off control -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (pAd->StaCfg.bRadio == FALSE) @@ -1963,7 +1945,6 @@ NDIS_STATUS NICInitializeAsic( DBGPRINT(RT_DEBUG_TRACE, ("Set Radio Off\n")); } } -#endif // CONFIG_STA_SUPPORT // // Clear raw counters RTMP_IO_READ32(pAd, RX_STA_CNT0, &Counter); @@ -2002,14 +1983,12 @@ NDIS_STATUS NICInitializeAsic( } } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // for rt2860E and after, init TXOP_CTRL_CFG with 0x583f. This is for extension channel overlapping IOT. if ((pAd->MACVersion&0xffff) != 0x0101) RTMP_IO_WRITE32(pAd, TXOP_CTRL_CFG, 0x583f); } -#endif // CONFIG_STA_SUPPORT // DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitializeAsic\n")); return NDIS_STATUS_SUCCESS; @@ -3006,7 +2985,6 @@ VOID UserCfgInit( // // part II. intialize STA specific configuration // -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { RX_FILTER_SET_FLAG(pAd, fRX_FILTER_ACCEPT_DIRECT); @@ -3045,7 +3023,6 @@ VOID UserCfgInit( pAd->StaCfg.bAutoTxRateSwitch = TRUE; pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO; } -#endif // CONFIG_STA_SUPPORT // // global variables mXXXX used in MAC protocol state machines OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM); @@ -3056,7 +3033,6 @@ VOID UserCfgInit( pAd->CommonCfg.PhyMode = PHY_11BG_MIXED; // default PHY mode OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); // CCK use LONG preamble -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // user desired power mode @@ -3101,7 +3077,6 @@ VOID UserCfgInit( #endif // WPA_SUPPLICANT_SUPPORT // } -#endif // CONFIG_STA_SUPPORT // // Default for extra information is not valid pAd->ExtraInfo = EXTRA_INFO_CLEAR; diff --git a/drivers/staging/rt2860/common/rtmp_wep.c b/drivers/staging/rt2860/common/rtmp_wep.c index ffe26c23795..8e833e7011b 100644 --- a/drivers/staging/rt2860/common/rtmp_wep.c +++ b/drivers/staging/rt2860/common/rtmp_wep.c @@ -144,14 +144,12 @@ VOID RTMPInitWepEngine( pAd->PrivateInfo.FCSCRC32 = PPPINITFCS32; //Init crc32. -#ifdef CONFIG_STA_SUPPORT if (pAd->StaCfg.bCkipOn && (pAd->StaCfg.CkipFlag & 0x10) && (pAd->OpMode == OPMODE_STA)) { ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, pKey, KeyLen); //INIT SBOX, KEYLEN+3(IV) NdisMoveMemory(pDest, pKey, 3); //Append Init Vector } else -#endif // CONFIG_STA_SUPPORT // { NdisMoveMemory(WEPKEY + 3, pKey, KeyLen); diff --git a/drivers/staging/rt2860/common/spectrum.c b/drivers/staging/rt2860/common/spectrum.c index 8bd37a4988f..598259e1384 100644 --- a/drivers/staging/rt2860/common/spectrum.c +++ b/drivers/staging/rt2860/common/spectrum.c @@ -1454,10 +1454,8 @@ static VOID PeerChSwAnnAction( { CH_SW_ANN_INFO ChSwAnnInfo; PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg; -#ifdef CONFIG_STA_SUPPORT UCHAR index = 0, Channel = 0, NewChannel = 0; ULONG Bssidx = 0; -#endif // CONFIG_STA_SUPPORT // NdisZeroMemory(&ChSwAnnInfo, sizeof(CH_SW_ANN_INFO)); if (! PeerChSwAnnSanity(pAd, Elem->Msg, Elem->MsgLen, &ChSwAnnInfo)) @@ -1466,8 +1464,6 @@ static VOID PeerChSwAnnAction( return; } - -#ifdef CONFIG_STA_SUPPORT if (pAd->OpMode == OPMODE_STA) { Bssidx = BssTableSearch(&pAd->ScanTab, pFr->Hdr.Addr3, pAd->CommonCfg.Channel); @@ -1514,7 +1510,6 @@ static VOID PeerChSwAnnAction( } } } -#endif // CONFIG_STA_SUPPORT // return; } |