diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-08-16 21:30:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:02:19 -0700 |
commit | 37843390d1645d1d3dbc20ec6da373ac0ae5c4ed (patch) | |
tree | 21a202d2e78d1fe2779318433f49edbacfff330a /drivers/staging/rt2860/common | |
parent | bf5f6ca4a855f85e2c01ca9ca7761a466db64ed5 (diff) |
Staging: rtxxx0: remove superfluous RT30xx ifdefs
* add !RT30xx version of IS_RT3090() macro
* remove superfluous RT30xx ifdefs
* unify RT30xx and !RT30xx code where possible
* kill RT28XX_UPDATE_PROTECT() macro
* remove needless variable initializations
* kill some needless function prototypes
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 | 11 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/ba_action.c | 8 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/cmm_data.c | 4 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/eeprom.c | 18 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/mlme.c | 65 | ||||
-rw-r--r-- | drivers/staging/rt2860/common/rtmp_init.c | 6 |
6 files changed, 21 insertions, 91 deletions
diff --git a/drivers/staging/rt2860/common/action.c b/drivers/staging/rt2860/common/action.c index a4d9fdc0736..256cb67e059 100644 --- a/drivers/staging/rt2860/common/action.c +++ b/drivers/staging/rt2860/common/action.c @@ -528,15 +528,8 @@ VOID SendRefreshBAR( sizeof(FRAME_BAR), &FrameBar, END_OF_ARGS); - if (1) // Now we always send BAR. - { -#ifndef RT30xx - MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen); -#endif -#ifdef RT30xx - MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen); -#endif - } + MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen); + MlmeFreeMemory(pAd, pOutBuffer); } } diff --git a/drivers/staging/rt2860/common/ba_action.c b/drivers/staging/rt2860/common/ba_action.c index b95a341caac..872349a9cc6 100644 --- a/drivers/staging/rt2860/common/ba_action.c +++ b/drivers/staging/rt2860/common/ba_action.c @@ -1391,10 +1391,8 @@ VOID SendPSMPAction( //ULONG Idx; FRAME_PSMP_ACTION Frame; ULONG FrameLen; -#ifdef RT30xx UCHAR bbpdata=0; UINT32 macdata; -#endif // RT30xx // NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if (NStatus != NDIS_STATUS_SUCCESS) @@ -1410,7 +1408,6 @@ VOID SendPSMPAction( switch (Psmp) { case MMPS_ENABLE: -#ifdef RT30xx if (IS_RT3090(pAd)) { // disable MMPS BBP control register @@ -1423,11 +1420,9 @@ VOID SendPSMPAction( macdata &= ~(0x09); //bit 0, 3 RTMP_IO_WRITE32(pAd, 0x1210, macdata); } -#endif // RT30xx // Frame.Psmp = 0; break; case MMPS_DYNAMIC: -#ifdef RT30xx if (IS_RT3090(pAd)) { // enable MMPS BBP control register @@ -1440,11 +1435,9 @@ VOID SendPSMPAction( macdata |= 0x09; //bit 0, 3 RTMP_IO_WRITE32(pAd, 0x1210, macdata); } -#endif // RT30xx // Frame.Psmp = 3; break; case MMPS_STATIC: -#ifdef RT30xx if (IS_RT3090(pAd)) { // enable MMPS BBP control register @@ -1457,7 +1450,6 @@ VOID SendPSMPAction( macdata |= 0x09; //bit 0, 3 RTMP_IO_WRITE32(pAd, 0x1210, macdata); } -#endif // RT30xx // Frame.Psmp = 1; break; } diff --git a/drivers/staging/rt2860/common/cmm_data.c b/drivers/staging/rt2860/common/cmm_data.c index 2936ca38e44..8d2e7db8b7a 100644 --- a/drivers/staging/rt2860/common/cmm_data.c +++ b/drivers/staging/rt2860/common/cmm_data.c @@ -2616,7 +2616,9 @@ BOOLEAN MacTableDeleteEntry( AsicUpdateProtect(pAd, 0 /*pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode*/, (ALLN_SETPROTECT), TRUE, 0 /*pAd->MacTab.fAnyStationNonGF*/); #endif #ifdef RT30xx - RT28XX_UPDATE_PROTECT(pAd); // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet + // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet + // Set MAC register value according operation mode + RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_UPDATE_PROTECT, NULL, 0); #endif } diff --git a/drivers/staging/rt2860/common/eeprom.c b/drivers/staging/rt2860/common/eeprom.c index d179a9f2565..3a529667067 100644 --- a/drivers/staging/rt2860/common/eeprom.c +++ b/drivers/staging/rt2860/common/eeprom.c @@ -73,16 +73,12 @@ USHORT ShiftInBits( RaiseClock(pAd, &x); RTMP_IO_READ32(pAd, E2PROM_CSR, &x); -#ifdef RT30xx - LowerClock(pAd, &x); //prevent read failed -#endif + + LowerClock(pAd, &x); /* prevent read failed */ + x &= ~(EEDI); if(x & EEDO) data |= 1; - -#ifndef RT30xx - LowerClock(pAd, &x); -#endif } return data; @@ -201,17 +197,13 @@ USHORT RTMP_EEPROM_READ16( x |= EECS; RTMP_IO_WRITE32(pAd, E2PROM_CSR, x); -#ifdef RT30xx // patch can not access e-Fuse issue if (!IS_RT3090(pAd)) { -#endif // kick a pulse RaiseClock(pAd, &x); LowerClock(pAd, &x); -#ifdef RT30xx } -#endif // output the read_opcode and register number in that order ShiftOutBits(pAd, EEPROM_READ_OPCODE, 3); @@ -262,17 +254,13 @@ VOID RTMP_EEPROM_WRITE16( x |= EECS; RTMP_IO_WRITE32(pAd, E2PROM_CSR, x); -#ifdef RT30xx // patch can not access e-Fuse issue if (!IS_RT3090(pAd)) { -#endif // kick a pulse RaiseClock(pAd, &x); LowerClock(pAd, &x); -#ifdef RT30xx } -#endif // output the read_opcode ,register number and data in that order ShiftOutBits(pAd, EEPROM_WRITE_OPCODE, 3); diff --git a/drivers/staging/rt2860/common/mlme.c b/drivers/staging/rt2860/common/mlme.c index c9be8898020..d2f0a8be59c 100644 --- a/drivers/staging/rt2860/common/mlme.c +++ b/drivers/staging/rt2860/common/mlme.c @@ -449,13 +449,7 @@ FREQUENCY_ITEM FreqItems3020[] = {13, 247, 2, 2}, {14, 248, 2, 4}, }; -#ifndef RT30xx -#define NUM_OF_3020_CHNL (sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM)) -#endif -#ifdef RT30xx -//2008/07/10:KH Modified to share this variable UCHAR NUM_OF_3020_CHNL=(sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM)); -#endif /* ========================================================================== @@ -3949,14 +3943,12 @@ VOID BssTableSsidSort( continue; // check group cipher + if ( #ifndef RT30xx - if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) && - (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled) && - (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled)) -#endif -#ifdef RT30xx - if (pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) + pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled && + pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled && #endif + pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) continue; // check pairwise cipher, skip if none matched @@ -3975,14 +3967,12 @@ VOID BssTableSsidSort( continue; // check group cipher + if ( #ifndef RT30xx - if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) && - (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled) && - (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled)) -#endif -#ifdef RT30xx - if (pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher) + pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled && + pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled && #endif + pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher) continue; // check pairwise cipher, skip if none matched @@ -8229,7 +8219,6 @@ VOID AsicSetRxAnt( IN PRTMP_ADAPTER pAd, IN UCHAR Ant) { -#ifdef RT30xx UINT32 Value; UINT32 x; @@ -8268,7 +8257,6 @@ VOID AsicSetRxAnt( RTMP_IO_WRITE32(pAd, GPIO_CTRL_CFG, Value); DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to aux antenna\n")); } -#endif // RT30xx // } #endif /* RT30xx */ @@ -8330,9 +8318,7 @@ VOID AsicEvaluateRxAnt( fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS) || OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) -#ifdef RT30xx || (pAd->EepromAccess) -#endif // RT30xx // ) return; @@ -8822,27 +8808,13 @@ VOID AsicStaBbpTuning( { R66 = 0x1C + 2*GET_LNA_GAIN(pAd) + 0x20; if (OrigR66Value != R66) - { -#ifndef RT30xx - RTUSBWriteBBPRegister(pAd, BBP_R66, R66); -#endif -#ifdef RT30xx RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66); -#endif - } } else { R66 = 0x1C + 2*GET_LNA_GAIN(pAd); if (OrigR66Value != R66) - { -#ifndef RT30xx - RTUSBWriteBBPRegister(pAd, BBP_R66, R66); -#endif -#ifdef RT30xx RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66); -#endif - } } } else @@ -9051,15 +9023,13 @@ VOID AsicTurnOffRFClk( UCHAR index; RTMP_RF_REGS *RFRegTable; -#ifdef RT30xx // The RF programming sequence is difference between 3xxx and 2xxx if (IS_RT3090(pAd)) { RT30xxLoadRFSleepModeSetup(pAd); // add by johnli, RF power sequence setup, load RF sleep-mode setup + return; } - else - { -#endif // RT30xx // + RFRegTable = RF2850RegTable; switch (pAd->RfIcType) @@ -9101,10 +9071,6 @@ VOID AsicTurnOffRFClk( default: break; } -#ifdef RT30xx - } -#endif // RT30xx // - } @@ -9118,14 +9084,10 @@ VOID AsicTurnOnRFClk( UCHAR index; RTMP_RF_REGS *RFRegTable; -#ifdef RT30xx // The RF programming sequence is difference between 3xxx and 2xxx if (IS_RT3090(pAd)) - { - } - else - { -#endif // RT30xx // + return; + RFRegTable = RF2850RegTable; switch (pAd->RfIcType) @@ -9178,8 +9140,5 @@ VOID AsicTurnOnRFClk( pAd->RfIcType, R2)); #endif -#ifdef RT30xx - } -#endif // RT30xx // } diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c index 004f53023b0..88c0615bf6c 100644 --- a/drivers/staging/rt2860/common/rtmp_init.c +++ b/drivers/staging/rt2860/common/rtmp_init.c @@ -1675,7 +1675,6 @@ VOID NICReadEEPROMParameters( Antenna.word = pAd->EEPROMDefaultValue[0]; if (Antenna.word == 0xFFFF) { -#ifdef RT30xx if(IS_RT3090(pAd)) { Antenna.word = 0; @@ -1685,15 +1684,12 @@ VOID NICReadEEPROMParameters( } else { -#endif // RT30xx // Antenna.word = 0; Antenna.field.RfIcType = RFIC_2820; Antenna.field.TxPath = 1; Antenna.field.RxPath = 2; DBGPRINT(RT_DEBUG_WARN, ("E2PROM error, hard code as 0x%04x\n", Antenna.word)); -#ifdef RT30xx } -#endif // RT30xx // } // Choose the desired Tx&Rx stream. @@ -2445,7 +2441,6 @@ NDIS_STATUS NICInitializeAsic( } } -#ifdef RT30xx // Initialize RT3070 serial MAc registers which is different from RT2870 serial if (IS_RT3090(pAd)) { @@ -2468,6 +2463,7 @@ NDIS_STATUS NICInitializeAsic( RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x0); } } +#ifdef RT30xx else if (IS_RT3070(pAd)) { RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0); |