aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-08-23 09:32:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:23 -0400
commit9eeb783ed4a11d7eb82d0cb5d23cc214e3827c8d (patch)
tree77f8c138a7f0f825e95b88921a59ae96068b6226
parent606661ea0476fb506ca87cd41b58cbb7dc14fcc0 (diff)
Staging: rtxx70: merge rt3070 with rt2870
* remove RT30xx ifdefs * add -DRT3070 to rt2870's EXTRA_CFLAGS * because of changes in the way that hardware is initialized/accessed rt3070 driver's firmware should be now also used by rt2870 driver (this is also done by newer out-of-tree vendor driver versions, i.e. 2.1.0.0, historically in-kernel driver was based on 1.4.0.0 version) * change RT28xx_CHIP_NAME to RTxx70 * update rt2870's help entry text * add MODULE_ALIAS("rt3070sta") to rt2870 * update rt3070's dependencies Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/rt2860/common/cmm_info.c11
-rw-r--r--drivers/staging/rt2860/common/mlme.c30
-rw-r--r--drivers/staging/rt2860/common/rtmp_init.c81
-rw-r--r--drivers/staging/rt2860/rt_main_dev.c2
-rw-r--r--drivers/staging/rt2860/rtmp.h4
-rw-r--r--drivers/staging/rt2870/2870_main_dev.c23
-rw-r--r--drivers/staging/rt2870/Kconfig5
-rw-r--r--drivers/staging/rt2870/Makefile2
-rw-r--r--drivers/staging/rt2870/common/cmm_data_2870.c30
-rw-r--r--drivers/staging/rt2870/common/rtusb_io.c2
-rw-r--r--drivers/staging/rt2870/rt2870.h9
-rw-r--r--drivers/staging/rt3070/Kconfig2
12 files changed, 33 insertions, 168 deletions
diff --git a/drivers/staging/rt2860/common/cmm_info.c b/drivers/staging/rt2860/common/cmm_info.c
index 05623979e6b..9d589c240ed 100644
--- a/drivers/staging/rt2860/common/cmm_info.c
+++ b/drivers/staging/rt2860/common/cmm_info.c
@@ -1419,17 +1419,6 @@ VOID RTMPSetHT(
1419 pAd->CommonCfg.DesiredHtPhy.RxSTBC = 0; 1419 pAd->CommonCfg.DesiredHtPhy.RxSTBC = 0;
1420 } 1420 }
1421 1421
1422#ifndef RT30xx
1423#ifdef RT2870
1424 /* Frank recommend ,If not, Tx maybe block in high power. Rx has no problem*/
1425 if(IS_RT3070(pAd) && ((pAd->RfIcType == RFIC_3020) || (pAd->RfIcType == RFIC_2020)))
1426 {
1427 pAd->CommonCfg.HtCapability.HtCapInfo.TxSTBC = 0;
1428 pAd->CommonCfg.DesiredHtPhy.TxSTBC = 0;
1429 }
1430#endif // RT2870 //
1431#endif
1432
1433 if(pHTPhyMode->SHORTGI == GI_400) 1422 if(pHTPhyMode->SHORTGI == GI_400)
1434 { 1423 {
1435 pAd->CommonCfg.HtCapability.HtCapInfo.ShortGIfor20 = 1; 1424 pAd->CommonCfg.HtCapability.HtCapInfo.ShortGIfor20 = 1;
diff --git a/drivers/staging/rt2860/common/mlme.c b/drivers/staging/rt2860/common/mlme.c
index 9de5e240a49..61a2a4eb714 100644
--- a/drivers/staging/rt2860/common/mlme.c
+++ b/drivers/staging/rt2860/common/mlme.c
@@ -5565,8 +5565,7 @@ VOID AsicUpdateProtect(
5565 } 5565 }
5566} 5566}
5567 5567
5568#ifdef RT30xx 5568#ifdef RT2870
5569// add by johnli, RF power sequence setup
5570/* 5569/*
5571 ========================================================================== 5570 ==========================================================================
5572 Description: 5571 Description:
@@ -5721,8 +5720,7 @@ VOID RT30xxReverseRFSleepModeSetup(
5721 RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue); 5720 RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
5722 } 5721 }
5723} 5722}
5724// end johnli 5723#endif
5725#endif // RT30xx //
5726 5724
5727/* 5725/*
5728 ========================================================================== 5726 ==========================================================================
@@ -5764,9 +5762,7 @@ VOID AsicSwitchChannel(
5764#ifdef RT2870 5762#ifdef RT2870
5765 // The RF programming sequence is difference between 3xxx and 2xxx 5763 // The RF programming sequence is difference between 3xxx and 2xxx
5766 if ((IS_RT3070(pAd) || IS_RT3090(pAd)) && ( 5764 if ((IS_RT3070(pAd) || IS_RT3090(pAd)) && (
5767#ifdef RT30xx
5768 (pAd->RfIcType == RFIC_3022) || (pAd->RfIcType == RFIC_3021) || 5765 (pAd->RfIcType == RFIC_3022) || (pAd->RfIcType == RFIC_3021) ||
5769#endif
5770 (pAd->RfIcType == RFIC_3020) || (pAd->RfIcType == RFIC_2020))) 5766 (pAd->RfIcType == RFIC_3020) || (pAd->RfIcType == RFIC_2020)))
5771 { 5767 {
5772 /* modify by WY for Read RF Reg. error */ 5768 /* modify by WY for Read RF Reg. error */
@@ -5789,7 +5785,6 @@ VOID AsicSwitchChannel(
5789 RFValue = (RFValue & 0xE0) | TxPwer; 5785 RFValue = (RFValue & 0xE0) | TxPwer;
5790 RT30xxWriteRFRegister(pAd, RF_R12, RFValue); 5786 RT30xxWriteRFRegister(pAd, RF_R12, RFValue);
5791 5787
5792#ifdef RT30xx
5793 // Set Tx1 Power 5788 // Set Tx1 Power
5794 RT30xxReadRFRegister(pAd, RF_R13, &RFValue); 5789 RT30xxReadRFRegister(pAd, RF_R13, &RFValue);
5795 RFValue = (RFValue & 0xE0) | TxPwer2; 5790 RFValue = (RFValue & 0xE0) | TxPwer2;
@@ -5809,7 +5804,6 @@ VOID AsicSwitchChannel(
5809 else if (pAd->Antenna.field.RxPath == 2) 5804 else if (pAd->Antenna.field.RxPath == 2)
5810 RFValue |= 0x40; 5805 RFValue |= 0x40;
5811 RT30xxWriteRFRegister(pAd, RF_R01, RFValue); 5806 RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
5812#endif
5813 5807
5814 // Set RF offset 5808 // Set RF offset
5815 RT30xxReadRFRegister(pAd, RF_R23, &RFValue); 5809 RT30xxReadRFRegister(pAd, RF_R23, &RFValue);
@@ -5827,9 +5821,8 @@ VOID AsicSwitchChannel(
5827 RFValue = pAd->Mlme.CaliBW20RfR24; 5821 RFValue = pAd->Mlme.CaliBW20RfR24;
5828 } 5822 }
5829 RT30xxWriteRFRegister(pAd, RF_R24, RFValue); 5823 RT30xxWriteRFRegister(pAd, RF_R24, RFValue);
5830#ifdef RT30xx
5831 RT30xxWriteRFRegister(pAd, RF_R31, RFValue); 5824 RT30xxWriteRFRegister(pAd, RF_R31, RFValue);
5832#endif 5825
5833 // Enable RF tuning 5826 // Enable RF tuning
5834 RT30xxReadRFRegister(pAd, RF_R07, &RFValue); 5827 RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
5835 RFValue = RFValue | 0x1; 5828 RFValue = RFValue | 0x1;
@@ -5838,7 +5831,6 @@ VOID AsicSwitchChannel(
5838 // latch channel for future usage. 5831 // latch channel for future usage.
5839 pAd->LatchRfRegs.Channel = Channel; 5832 pAd->LatchRfRegs.Channel = Channel;
5840 5833
5841#ifdef RT30xx
5842 DBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%d, Pwr1=%d, %dT), N=0x%02X, K=0x%02X, R=0x%02X\n", 5834 DBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%d, Pwr1=%d, %dT), N=0x%02X, K=0x%02X, R=0x%02X\n",
5843 Channel, 5835 Channel,
5844 pAd->RfIcType, 5836 pAd->RfIcType,
@@ -5848,8 +5840,6 @@ VOID AsicSwitchChannel(
5848 FreqItems3020[index].N, 5840 FreqItems3020[index].N,
5849 FreqItems3020[index].K, 5841 FreqItems3020[index].K,
5850 FreqItems3020[index].R)); 5842 FreqItems3020[index].R));
5851#endif
5852
5853 break; 5843 break;
5854 } 5844 }
5855 } 5845 }
@@ -6828,13 +6818,13 @@ VOID AsicSetEdcaParm(
6828 Ac2Cfg.field.AcTxop = 5; 6818 Ac2Cfg.field.AcTxop = 5;
6829 } 6819 }
6830 6820
6831#ifdef RT30xx 6821#ifdef RT2870
6832 if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020) 6822 if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
6833 { 6823 {
6834 // Tuning for WiFi WMM S3-T07: connexant legacy sta ==> broadcom 11n sta. 6824 // Tuning for WiFi WMM S3-T07: connexant legacy sta ==> broadcom 11n sta.
6835 Ac2Cfg.field.Aifsn = 5; 6825 Ac2Cfg.field.Aifsn = 5;
6836 } 6826 }
6837#endif // RT30xx // 6827#endif
6838 } 6828 }
6839 6829
6840 Ac3Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VO]; 6830 Ac3Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VO];
@@ -6915,11 +6905,10 @@ VOID AsicSetEdcaParm(
6915 } 6905 }
6916 6906
6917 AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test 6907 AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test
6918#ifdef RT30xx 6908#ifdef RT2870
6919 if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020) 6909 if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
6920 AifsnCsr.field.Aifsn2 = 0x2; //pEdcaParm->Aifsn[QID_AC_VI]; //for WiFi WMM S4-T04. 6910 AifsnCsr.field.Aifsn2 = 0x2; //pEdcaParm->Aifsn[QID_AC_VI]; //for WiFi WMM S4-T04.
6921#endif // RT30xx // 6911#endif
6922
6923 RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word); 6912 RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word);
6924 6913
6925 NdisMoveMemory(&pAd->CommonCfg.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM)); 6914 NdisMoveMemory(&pAd->CommonCfg.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM));
@@ -8493,12 +8482,7 @@ VOID AsicStaBbpTuning(
8493#ifdef RT2870 8482#ifdef RT2870
8494 // RT3070 is a no LNA solution, it should have different control regarding to AGC gain control 8483 // RT3070 is a no LNA solution, it should have different control regarding to AGC gain control
8495 // Otherwise, it will have some throughput side effect when low RSSI 8484 // Otherwise, it will have some throughput side effect when low RSSI
8496#ifndef RT30xx
8497 if (IS_RT3070(pAd))
8498#endif
8499#ifdef RT30xx
8500 if (IS_RT30xx(pAd)) 8485 if (IS_RT30xx(pAd))
8501#endif
8502 { 8486 {
8503 if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY) 8487 if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
8504 { 8488 {
diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c
index e6a43b64502..e7d1ed1224e 100644
--- a/drivers/staging/rt2860/common/rtmp_init.c
+++ b/drivers/staging/rt2860/common/rtmp_init.c
@@ -38,16 +38,12 @@
38 Jan Lee 2006-09-15 RT2860. Change for 802.11n , EEPROM, Led, BA, HT. 38 Jan Lee 2006-09-15 RT2860. Change for 802.11n , EEPROM, Led, BA, HT.
39*/ 39*/
40#include "../rt_config.h" 40#include "../rt_config.h"
41#ifndef RT30xx
42#ifdef RT2860 41#ifdef RT2860
43#include "firmware.h" 42#include "firmware.h"
44#include <linux/bitrev.h> 43#include <linux/bitrev.h>
45#endif 44#endif
46#ifdef RT2870 45#ifdef RT2870
47#include "../../rt2870/common/firmware.h" 46/* New firmware handles both RT2870 and RT3070. */
48#endif
49#endif
50#ifdef RT30xx
51#include "../../rt3070/firmware.h" 47#include "../../rt3070/firmware.h"
52#endif 48#endif
53 49
@@ -147,12 +143,7 @@ REG_PAIR RT30xx_RFRegTable[] = {
147 {RF_R06, 0x02}, 143 {RF_R06, 0x02},
148 {RF_R07, 0x70}, 144 {RF_R07, 0x70},
149 {RF_R09, 0x0F}, 145 {RF_R09, 0x0F},
150#ifndef RT30xx
151 {RF_R10, 0x71},
152#endif
153#ifdef RT30xx
154 {RF_R10, 0x41}, 146 {RF_R10, 0x41},
155#endif
156 {RF_R11, 0x21}, 147 {RF_R11, 0x21},
157 {RF_R12, 0x7B}, 148 {RF_R12, 0x7B},
158 {RF_R14, 0x90}, 149 {RF_R14, 0x90},
@@ -165,9 +156,6 @@ REG_PAIR RT30xx_RFRegTable[] = {
165 {RF_R21, 0xDB}, 156 {RF_R21, 0xDB},
166 {RF_R24, 0x16}, 157 {RF_R24, 0x16},
167 {RF_R25, 0x01}, 158 {RF_R25, 0x01},
168#ifndef RT30xx
169 {RF_R27, 0x03},
170#endif
171 {RF_R29, 0x1F}, 159 {RF_R29, 0x1F},
172}; 160};
173#define NUM_RF_REG_PARMS (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR)) 161#define NUM_RF_REG_PARMS (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR))
@@ -1107,7 +1095,7 @@ VOID RTMPFilterCalibration(
1107 UCHAR RF_R24_Value = 0; 1095 UCHAR RF_R24_Value = 0;
1108 1096
1109 // Give bbp filter initial value 1097 // Give bbp filter initial value
1110#ifndef RT30xx 1098#ifndef RT2870
1111 pAd->Mlme.CaliBW20RfR24 = 0x16; 1099 pAd->Mlme.CaliBW20RfR24 = 0x16;
1112 pAd->Mlme.CaliBW40RfR24 = 0x36; //Bit[5] must be 1 for BW 40 1100 pAd->Mlme.CaliBW40RfR24 = 0x36; //Bit[5] must be 1 for BW 40
1113#else 1101#else
@@ -1131,7 +1119,7 @@ VOID RTMPFilterCalibration(
1131 BBPValue&= (~0x18); 1119 BBPValue&= (~0x18);
1132 BBPValue|= (0x10); 1120 BBPValue|= (0x10);
1133 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); 1121 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
1134#ifdef RT30xx 1122#ifdef RT2870
1135 // set to BW40 1123 // set to BW40
1136 RT30xxReadRFRegister(pAd, RF_R31, &value); 1124 RT30xxReadRFRegister(pAd, RF_R31, &value);
1137 value |= 0x20; 1125 value |= 0x20;
@@ -1147,7 +1135,7 @@ VOID RTMPFilterCalibration(
1147 FilterTarget = 0x13; 1135 FilterTarget = 0x13;
1148 else 1136 else
1149 FilterTarget = 0x16; 1137 FilterTarget = 0x16;
1150#ifdef RT30xx 1138#ifdef RT2870
1151 // set to BW20 1139 // set to BW20
1152 RT30xxReadRFRegister(pAd, RF_R31, &value); 1140 RT30xxReadRFRegister(pAd, RF_R31, &value);
1153 value &= (~0x20); 1141 value &= (~0x20);
@@ -1263,20 +1251,13 @@ VOID NICInitRT30xxRFRegisters(IN PRTMP_ADAPTER pAd)
1263 INT i; 1251 INT i;
1264 // Driver must read EEPROM to get RfIcType before initial RF registers 1252 // Driver must read EEPROM to get RfIcType before initial RF registers
1265 // Initialize RF register to default value 1253 // Initialize RF register to default value
1266 if (IS_RT3070(pAd) 1254 if (IS_RT3070(pAd) || IS_RT3071(pAd))
1267#ifdef RT30xx
1268 || IS_RT3071(pAd)
1269#else
1270 && (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
1271#endif
1272 )
1273 { 1255 {
1274 // Init RF calibration 1256 // Init RF calibration
1275 // Driver should toggle RF R30 bit7 before init RF registers 1257 // Driver should toggle RF R30 bit7 before init RF registers
1276 UINT32 RfReg = 0; 1258 UINT32 RfReg = 0;
1277#ifdef RT30xx
1278 UINT32 data; 1259 UINT32 data;
1279#endif 1260
1280 RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg); 1261 RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
1281 RfReg |= 0x80; 1262 RfReg |= 0x80;
1282 RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg); 1263 RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
@@ -1290,7 +1271,6 @@ VOID NICInitRT30xxRFRegisters(IN PRTMP_ADAPTER pAd)
1290 RT30xxWriteRFRegister(pAd, RT30xx_RFRegTable[i].Register, RT30xx_RFRegTable[i].Value); 1271 RT30xxWriteRFRegister(pAd, RT30xx_RFRegTable[i].Register, RT30xx_RFRegTable[i].Value);
1291 } 1272 }
1292 1273
1293#ifdef RT30xx
1294 if (IS_RT3070(pAd)) 1274 if (IS_RT3070(pAd))
1295 { 1275 {
1296 // Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate 1276 // Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate
@@ -1328,10 +1308,10 @@ VOID NICInitRT30xxRFRegisters(IN PRTMP_ADAPTER pAd)
1328 data &= ~(0x20); 1308 data &= ~(0x20);
1329 RTUSBWriteMACRegister(pAd, GPIO_SWITCH, data); 1309 RTUSBWriteMACRegister(pAd, GPIO_SWITCH, data);
1330 } 1310 }
1331#endif 1311
1332 //For RF filter Calibration 1312 //For RF filter Calibration
1333 RTMPFilterCalibration(pAd); 1313 RTMPFilterCalibration(pAd);
1334#ifdef RT30xx 1314
1335 // Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration() 1315 // Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
1336 if ((pAd->MACVersion & 0xffff) < 0x0211) 1316 if ((pAd->MACVersion & 0xffff) < 0x0211)
1337 RT30xxWriteRFRegister(pAd, RF_R27, 0x3); 1317 RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
@@ -1346,7 +1326,6 @@ VOID NICInitRT30xxRFRegisters(IN PRTMP_ADAPTER pAd)
1346 // add by johnli, RF power sequence setup, load RF normal operation-mode setup 1326 // add by johnli, RF power sequence setup, load RF normal operation-mode setup
1347 RT30xxLoadRFNormalModeSetup(pAd); 1327 RT30xxLoadRFNormalModeSetup(pAd);
1348 } 1328 }
1349#endif
1350 } 1329 }
1351} 1330}
1352#endif // RT2870 // 1331#endif // RT2870 //
@@ -1567,9 +1546,6 @@ VOID NICReadEEPROMParameters(
1567 NicConfig2.word = pAd->EEPROMDefaultValue[1]; 1546 NicConfig2.word = pAd->EEPROMDefaultValue[1];
1568 1547
1569 { 1548 {
1570#ifndef RT30xx
1571 NicConfig2.word = 0;
1572#endif
1573 if ((NicConfig2.word & 0x00ff) == 0xff) 1549 if ((NicConfig2.word & 0x00ff) == 0xff)
1574 { 1550 {
1575 NicConfig2.word &= 0xff00; 1551 NicConfig2.word &= 0xff00;
@@ -1806,10 +1782,9 @@ VOID NICInitAsicFromEEPROM(
1806 } 1782 }
1807 } 1783 }
1808 1784
1809#ifndef RT30xx 1785#ifndef RT2870
1810 Antenna.word = pAd->Antenna.word; 1786 Antenna.word = pAd->Antenna.word;
1811#endif 1787#else
1812#ifdef RT30xx
1813 Antenna.word = pAd->EEPROMDefaultValue[0]; 1788 Antenna.word = pAd->EEPROMDefaultValue[0];
1814 if (Antenna.word == 0xFFFF) 1789 if (Antenna.word == 0xFFFF)
1815 { 1790 {
@@ -1820,7 +1795,7 @@ VOID NICInitAsicFromEEPROM(
1820 pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath; 1795 pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath;
1821 pAd->RfIcType = (UCHAR) Antenna.field.RfIcType; 1796 pAd->RfIcType = (UCHAR) Antenna.field.RfIcType;
1822 1797
1823#ifdef RT30xx 1798#ifdef RT2870
1824 DBGPRINT(RT_DEBUG_WARN, ("pAd->RfIcType = %d, RealRxPath=%d, TxPath = %d\n", pAd->RfIcType, pAd->Mlme.RealRxPath,Antenna.field.TxPath)); 1799 DBGPRINT(RT_DEBUG_WARN, ("pAd->RfIcType = %d, RealRxPath=%d, TxPath = %d\n", pAd->RfIcType, pAd->Mlme.RealRxPath,Antenna.field.TxPath));
1825 1800
1826 // Save the antenna for future use 1801 // Save the antenna for future use
@@ -1828,7 +1803,7 @@ VOID NICInitAsicFromEEPROM(
1828#endif 1803#endif
1829 NicConfig2.word = pAd->EEPROMDefaultValue[1]; 1804 NicConfig2.word = pAd->EEPROMDefaultValue[1];
1830 1805
1831#ifdef RT30xx 1806#ifdef RT2870
1832 { 1807 {
1833 if ((NicConfig2.word & 0x00ff) == 0xff) 1808 if ((NicConfig2.word & 0x00ff) == 0xff)
1834 { 1809 {
@@ -1844,7 +1819,7 @@ VOID NICInitAsicFromEEPROM(
1844 // Save the antenna for future use 1819 // Save the antenna for future use
1845 pAd->NicConfig2.word = NicConfig2.word; 1820 pAd->NicConfig2.word = NicConfig2.word;
1846 1821
1847#ifdef RT30xx 1822#ifdef RT2870
1848 // set default antenna as main 1823 // set default antenna as main
1849 if (pAd->RfIcType == RFIC_3020) 1824 if (pAd->RfIcType == RFIC_3020)
1850 AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt); 1825 AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
@@ -2251,21 +2226,8 @@ NDIS_STATUS NICInitializeAsic(
2251#endif // RT3070 // 2226#endif // RT3070 //
2252 RTMP_IO_WRITE32(pAd, (USHORT)MACRegTable[Index].Register, MACRegTable[Index].Value); 2227 RTMP_IO_WRITE32(pAd, (USHORT)MACRegTable[Index].Register, MACRegTable[Index].Value);
2253 } 2228 }
2254
2255#ifndef RT30xx
2256 if(IS_RT3070(pAd))
2257 {
2258 // According to Frank Hsu (from Gary Tsao)
2259 RTMP_IO_WRITE32(pAd, (USHORT)TX_SW_CFG0, 0x00000400);
2260
2261 // Initialize RT3070 serial MAC registers which is different from RT2870 serial
2262 RTUSBWriteMACRegister(pAd, TX_SW_CFG1, 0);
2263 RTUSBWriteMACRegister(pAd, TX_SW_CFG2, 0);
2264 }
2265#endif
2266#endif // RT2870 // 2229#endif // RT2870 //
2267 2230
2268
2269 { 2231 {
2270 for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++) 2232 for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++)
2271 { 2233 {
@@ -2300,7 +2262,7 @@ NDIS_STATUS NICInitializeAsic(
2300 RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x0); 2262 RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x0);
2301 } 2263 }
2302 } 2264 }
2303#ifdef RT30xx 2265#ifdef RT2870
2304 else if (IS_RT3070(pAd)) 2266 else if (IS_RT3070(pAd))
2305 { 2267 {
2306 RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0); 2268 RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0);
@@ -2347,22 +2309,11 @@ NDIS_STATUS NICInitializeAsic(
2347 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[Index].Register, BBPRegTable[Index].Value); 2309 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[Index].Register, BBPRegTable[Index].Value);
2348 } 2310 }
2349 2311
2350#ifndef RT30xx 2312#ifndef RT2870
2351 // for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT. 2313 // for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT.
2352 if ((pAd->MACVersion&0xffff) != 0x0101) 2314 if ((pAd->MACVersion&0xffff) != 0x0101)
2353 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R84, 0x19); 2315 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R84, 0x19);
2354 2316#else
2355#ifdef RT2870
2356 //write RT3070 BBP wchich different with 2870 after write RT2870 BBP
2357 if (IS_RT3070(pAd))
2358 {
2359 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0a);
2360 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R84, 0x99);
2361 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R105, 0x05);
2362 }
2363#endif // RT2870 //
2364#endif
2365#ifdef RT30xx
2366 // for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT. 2317 // for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT.
2367 // RT3090 should not program BBP R84 to 0x19, otherwise TX will block. 2318 // RT3090 should not program BBP R84 to 0x19, otherwise TX will block.
2368 if (((pAd->MACVersion&0xffff) != 0x0101) && (!IS_RT30xx(pAd))) 2319 if (((pAd->MACVersion&0xffff) != 0x0101) && (!IS_RT30xx(pAd)))
diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c
index b4111e55b06..7f4441462a1 100644
--- a/drivers/staging/rt2860/rt_main_dev.c
+++ b/drivers/staging/rt2860/rt_main_dev.c
@@ -522,7 +522,7 @@ static int rt28xx_init(IN struct net_device *net_dev)
522 AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); 522 AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
523 AsicLockChannel(pAd, pAd->CommonCfg.Channel); 523 AsicLockChannel(pAd, pAd->CommonCfg.Channel);
524 524
525#ifndef RT30xx 525#ifndef RT2870
526 // 8051 firmware require the signal during booting time. 526 // 8051 firmware require the signal during booting time.
527 AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00); 527 AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00);
528#endif 528#endif
diff --git a/drivers/staging/rt2860/rtmp.h b/drivers/staging/rt2860/rtmp.h
index 8c1737901c7..3f498f6f3ff 100644
--- a/drivers/staging/rt2860/rtmp.h
+++ b/drivers/staging/rt2860/rtmp.h
@@ -391,14 +391,14 @@ typedef struct _QUEUE_HEADER {
391 (_idx) = (_idx+1) % (_RingSize); \ 391 (_idx) = (_idx+1) % (_RingSize); \
392} 392}
393 393
394#ifdef RT30xx 394#ifdef RT2870
395// We will have a cost down version which mac version is 0x3090xxxx 395// We will have a cost down version which mac version is 0x3090xxxx
396#define IS_RT3090(_pAd) ((((_pAd)->MACVersion & 0xffff0000) == 0x30710000) || (((_pAd)->MACVersion & 0xffff0000) == 0x30900000)) 396#define IS_RT3090(_pAd) ((((_pAd)->MACVersion & 0xffff0000) == 0x30710000) || (((_pAd)->MACVersion & 0xffff0000) == 0x30900000))
397#else 397#else
398#define IS_RT3090(_pAd) 0 398#define IS_RT3090(_pAd) 0
399#endif 399#endif
400#define IS_RT3070(_pAd) (((_pAd)->MACVersion & 0xffff0000) == 0x30700000) 400#define IS_RT3070(_pAd) (((_pAd)->MACVersion & 0xffff0000) == 0x30700000)
401#ifdef RT30xx 401#ifdef RT2870
402#define IS_RT3071(_pAd) (((_pAd)->MACVersion & 0xffff0000) == 0x30710000) 402#define IS_RT3071(_pAd) (((_pAd)->MACVersion & 0xffff0000) == 0x30710000)
403#define IS_RT30xx(_pAd) (((_pAd)->MACVersion & 0xfff00000) == 0x30700000) 403#define IS_RT30xx(_pAd) (((_pAd)->MACVersion & 0xfff00000) == 0x30700000)
404#endif 404#endif
diff --git a/drivers/staging/rt2870/2870_main_dev.c b/drivers/staging/rt2870/2870_main_dev.c
index b725c750a11..d0ed48bed2b 100644
--- a/drivers/staging/rt2870/2870_main_dev.c
+++ b/drivers/staging/rt2870/2870_main_dev.c
@@ -50,6 +50,7 @@ MODULE_LICENSE("GPL");
50#ifdef MODULE_VERSION 50#ifdef MODULE_VERSION
51MODULE_VERSION(STA_DRIVER_VERSION); 51MODULE_VERSION(STA_DRIVER_VERSION);
52#endif 52#endif
53MODULE_ALIAS("rt3070sta");
53 54
54/* Kernel thread and vars, which handles packets that are completed. Only 55/* Kernel thread and vars, which handles packets that are completed. Only
55 * packets that have a "complete" function are sent here. This way, the 56 * packets that have a "complete" function are sent here. This way, the
@@ -65,19 +66,15 @@ struct usb_device_id rtusb_usb_id[] = {
65 { USB_DEVICE(0x1737, 0x0070) }, /* Linksys */ 66 { USB_DEVICE(0x1737, 0x0070) }, /* Linksys */
66 { USB_DEVICE(0x148F, 0x2870) }, /* Ralink */ 67 { USB_DEVICE(0x148F, 0x2870) }, /* Ralink */
67 { USB_DEVICE(0x148F, 0x3070) }, /* Ralink 3070 */ 68 { USB_DEVICE(0x148F, 0x3070) }, /* Ralink 3070 */
68#ifdef RT30xx
69 { USB_DEVICE(0x148F, 0x3071) }, /* Ralink 3071 */ 69 { USB_DEVICE(0x148F, 0x3071) }, /* Ralink 3071 */
70 { USB_DEVICE(0x148F, 0x3072) }, /* Ralink 3072 */ 70 { USB_DEVICE(0x148F, 0x3072) }, /* Ralink 3072 */
71#endif
72 { USB_DEVICE(0x0B05, 0x1731) }, /* Asus */ 71 { USB_DEVICE(0x0B05, 0x1731) }, /* Asus */
73 { USB_DEVICE(0x0B05, 0x1732) }, /* Asus */ 72 { USB_DEVICE(0x0B05, 0x1732) }, /* Asus */
74 { USB_DEVICE(0x0B05, 0x1742) }, /* Asus */ 73 { USB_DEVICE(0x0B05, 0x1742) }, /* Asus */
75 { USB_DEVICE(0x0DF6, 0x0017) }, /* Sitecom */ 74 { USB_DEVICE(0x0DF6, 0x0017) }, /* Sitecom */
76 { USB_DEVICE(0x0DF6, 0x002B) }, /* Sitecom */ 75 { USB_DEVICE(0x0DF6, 0x002B) }, /* Sitecom */
77 { USB_DEVICE(0x0DF6, 0x002C) }, /* Sitecom */ 76 { USB_DEVICE(0x0DF6, 0x002C) }, /* Sitecom */
78#ifdef RT30xx
79 { USB_DEVICE(0x0DF6, 0x003E) }, /* Sitecom 3070 */ 77 { USB_DEVICE(0x0DF6, 0x003E) }, /* Sitecom 3070 */
80#endif
81 { USB_DEVICE(0x0DF6, 0x002D) }, /* Sitecom */ 78 { USB_DEVICE(0x0DF6, 0x002D) }, /* Sitecom */
82 { USB_DEVICE(0x0DF6, 0x0039) }, /* Sitecom 2770 */ 79 { USB_DEVICE(0x0DF6, 0x0039) }, /* Sitecom 2770 */
83 { USB_DEVICE(0x0DF6, 0x003F) }, /* Sitecom WL-608 */ 80 { USB_DEVICE(0x0DF6, 0x003F) }, /* Sitecom WL-608 */
@@ -88,10 +85,8 @@ struct usb_device_id rtusb_usb_id[] = {
88 { USB_DEVICE(0x2019, 0xAB25) }, /* Planex Communications, Inc. RT3070 */ 85 { USB_DEVICE(0x2019, 0xAB25) }, /* Planex Communications, Inc. RT3070 */
89 { USB_DEVICE(0x07D1, 0x3C09) }, /* D-Link */ 86 { USB_DEVICE(0x07D1, 0x3C09) }, /* D-Link */
90 { USB_DEVICE(0x07D1, 0x3C11) }, /* D-Link */ 87 { USB_DEVICE(0x07D1, 0x3C11) }, /* D-Link */
91#ifdef RT30xx
92 { USB_DEVICE(0x2001, 0x3C09) }, /* D-Link */ 88 { USB_DEVICE(0x2001, 0x3C09) }, /* D-Link */
93 { USB_DEVICE(0x2001, 0x3C0A) }, /* D-Link 3072*/ 89 { USB_DEVICE(0x2001, 0x3C0A) }, /* D-Link 3072*/
94#endif
95 { USB_DEVICE(0x14B2, 0x3C07) }, /* AL */ 90 { USB_DEVICE(0x14B2, 0x3C07) }, /* AL */
96 { USB_DEVICE(0x14B2, 0x3C12) }, /* AL 3070 */ 91 { USB_DEVICE(0x14B2, 0x3C12) }, /* AL 3070 */
97 { USB_DEVICE(0x050D, 0x8053) }, /* Belkin */ 92 { USB_DEVICE(0x050D, 0x8053) }, /* Belkin */
@@ -104,34 +99,24 @@ struct usb_device_id rtusb_usb_id[] = {
104 { USB_DEVICE(0x07AA, 0x003F) }, /* Corega */ 99 { USB_DEVICE(0x07AA, 0x003F) }, /* Corega */
105 { USB_DEVICE(0x18C5, 0x0012) }, /* Corega 3070 */ 100 { USB_DEVICE(0x18C5, 0x0012) }, /* Corega 3070 */
106 { USB_DEVICE(0x1044, 0x800B) }, /* Gigabyte */ 101 { USB_DEVICE(0x1044, 0x800B) }, /* Gigabyte */
107#ifdef RT30xx
108 { USB_DEVICE(0x1044, 0x800D) }, /* Gigabyte GN-WB32L 3070 */ 102 { USB_DEVICE(0x1044, 0x800D) }, /* Gigabyte GN-WB32L 3070 */
109#endif
110 { USB_DEVICE(0x15A9, 0x0006) }, /* Sparklan */ 103 { USB_DEVICE(0x15A9, 0x0006) }, /* Sparklan */
111 { USB_DEVICE(0x083A, 0xB522) }, /* SMC */ 104 { USB_DEVICE(0x083A, 0xB522) }, /* SMC */
112 { USB_DEVICE(0x083A, 0xA618) }, /* SMC */ 105 { USB_DEVICE(0x083A, 0xA618) }, /* SMC */
113#ifdef RT30xx
114 { USB_DEVICE(0x083A, 0x8522) }, /* Arcadyan */ 106 { USB_DEVICE(0x083A, 0x8522) }, /* Arcadyan */
115 { USB_DEVICE(0x083A, 0x7512) }, /* Arcadyan 2770 */ 107 { USB_DEVICE(0x083A, 0x7512) }, /* Arcadyan 2770 */
116#endif
117 { USB_DEVICE(0x083A, 0x7522) }, /* Arcadyan */ 108 { USB_DEVICE(0x083A, 0x7522) }, /* Arcadyan */
118#ifdef RT30xx
119 { USB_DEVICE(0x083A, 0x7511) }, /* Arcadyan 3070 */ 109 { USB_DEVICE(0x083A, 0x7511) }, /* Arcadyan 3070 */
120#endif
121 { USB_DEVICE(0x0CDE, 0x0022) }, /* ZCOM */ 110 { USB_DEVICE(0x0CDE, 0x0022) }, /* ZCOM */
122 { USB_DEVICE(0x0586, 0x3416) }, /* Zyxel */ 111 { USB_DEVICE(0x0586, 0x3416) }, /* Zyxel */
123 { USB_DEVICE(0x0CDE, 0x0025) }, /* Zyxel */ 112 { USB_DEVICE(0x0CDE, 0x0025) }, /* Zyxel */
124 { USB_DEVICE(0x1740, 0x9701) }, /* EnGenius */ 113 { USB_DEVICE(0x1740, 0x9701) }, /* EnGenius */
125 { USB_DEVICE(0x1740, 0x9702) }, /* EnGenius */ 114 { USB_DEVICE(0x1740, 0x9702) }, /* EnGenius */
126#ifdef RT30xx
127 { USB_DEVICE(0x1740, 0x9703) }, /* EnGenius 3070 */ 115 { USB_DEVICE(0x1740, 0x9703) }, /* EnGenius 3070 */
128#endif
129 { USB_DEVICE(0x0471, 0x200f) }, /* Philips */ 116 { USB_DEVICE(0x0471, 0x200f) }, /* Philips */
130 { USB_DEVICE(0x14B2, 0x3C25) }, /* Draytek */ 117 { USB_DEVICE(0x14B2, 0x3C25) }, /* Draytek */
131 { USB_DEVICE(0x13D3, 0x3247) }, /* AzureWave */ 118 { USB_DEVICE(0x13D3, 0x3247) }, /* AzureWave */
132#ifdef RT30xx
133 { USB_DEVICE(0x13D3, 0x3273) }, /* AzureWave 3070*/ 119 { USB_DEVICE(0x13D3, 0x3273) }, /* AzureWave 3070*/
134#endif
135 { USB_DEVICE(0x083A, 0x6618) }, /* Accton */ 120 { USB_DEVICE(0x083A, 0x6618) }, /* Accton */
136 { USB_DEVICE(0x15c5, 0x0008) }, /* Amit */ 121 { USB_DEVICE(0x15c5, 0x0008) }, /* Amit */
137 { USB_DEVICE(0x0E66, 0x0001) }, /* Hawking */ 122 { USB_DEVICE(0x0E66, 0x0001) }, /* Hawking */
@@ -146,23 +131,17 @@ struct usb_device_id rtusb_usb_id[] = {
146 { USB_DEVICE(0x07B8, 0x3071) }, /* AboCom 3071 */ 131 { USB_DEVICE(0x07B8, 0x3071) }, /* AboCom 3071 */
147 { USB_DEVICE(0x07B8, 0x2870) }, /* AboCom */ 132 { USB_DEVICE(0x07B8, 0x2870) }, /* AboCom */
148 { USB_DEVICE(0x07B8, 0x2770) }, /* AboCom */ 133 { USB_DEVICE(0x07B8, 0x2770) }, /* AboCom */
149#ifdef RT30xx
150 { USB_DEVICE(0x07B8, 0x3072) }, /* Abocom 3072 */ 134 { USB_DEVICE(0x07B8, 0x3072) }, /* Abocom 3072 */
151#endif
152 { USB_DEVICE(0x7392, 0x7711) }, /* Edimax 3070 */ 135 { USB_DEVICE(0x7392, 0x7711) }, /* Edimax 3070 */
153 { USB_DEVICE(0x5A57, 0x0280) }, /* Zinwell */ 136 { USB_DEVICE(0x5A57, 0x0280) }, /* Zinwell */
154 { USB_DEVICE(0x5A57, 0x0282) }, /* Zinwell */ 137 { USB_DEVICE(0x5A57, 0x0282) }, /* Zinwell */
155#ifdef RT30xx
156 { USB_DEVICE(0x1A32, 0x0304) }, /* Quanta 3070 */ 138 { USB_DEVICE(0x1A32, 0x0304) }, /* Quanta 3070 */
157#endif
158 { USB_DEVICE(0x0789, 0x0162) }, /* Logitec 2870 */ 139 { USB_DEVICE(0x0789, 0x0162) }, /* Logitec 2870 */
159 { USB_DEVICE(0x0789, 0x0163) }, /* Logitec 2870 */ 140 { USB_DEVICE(0x0789, 0x0163) }, /* Logitec 2870 */
160 { USB_DEVICE(0x0789, 0x0164) }, /* Logitec 2870 */ 141 { USB_DEVICE(0x0789, 0x0164) }, /* Logitec 2870 */
161 { USB_DEVICE(0x7392, 0x7717) }, /* Edimax */ 142 { USB_DEVICE(0x7392, 0x7717) }, /* Edimax */
162#ifdef RT30xx
163 { USB_DEVICE(0x1EDA, 0x2310) }, /* AirTies 3070 */ 143 { USB_DEVICE(0x1EDA, 0x2310) }, /* AirTies 3070 */
164 { USB_DEVICE(0x1737, 0x0077) }, /* Linksys WUSB54GC-EU v3 */ 144 { USB_DEVICE(0x1737, 0x0077) }, /* Linksys WUSB54GC-EU v3 */
165#endif
166 { } /* Terminating entry */ 145 { } /* Terminating entry */
167}; 146};
168 147
diff --git a/drivers/staging/rt2870/Kconfig b/drivers/staging/rt2870/Kconfig
index 8398d9797e1..76841f6dea9 100644
--- a/drivers/staging/rt2870/Kconfig
+++ b/drivers/staging/rt2870/Kconfig
@@ -1,6 +1,5 @@
1config RT2870 1config RT2870
2 tristate "Ralink 2870 wireless support" 2 tristate "Ralink 2870/3070 wireless support"
3 depends on USB && X86 && WLAN_80211 3 depends on USB && X86 && WLAN_80211
4 ---help--- 4 ---help---
5 This is an experimental driver for the Ralink 2870 wireless chip. 5 This is an experimental driver for the Ralink xx70 wireless chips.
6
diff --git a/drivers/staging/rt2870/Makefile b/drivers/staging/rt2870/Makefile
index 3c17921b74a..306c33113c5 100644
--- a/drivers/staging/rt2870/Makefile
+++ b/drivers/staging/rt2870/Makefile
@@ -2,7 +2,7 @@ obj-$(CONFIG_RT2870) += rt2870sta.o
2 2
3# TODO: all of these should be removed 3# TODO: all of these should be removed
4EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT 4EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
5EXTRA_CFLAGS += -DRT2870 5EXTRA_CFLAGS += -DRT2870 -DRT3070
6EXTRA_CFLAGS += -DDBG 6EXTRA_CFLAGS += -DDBG
7 7
8rt2870sta-objs := \ 8rt2870sta-objs := \
diff --git a/drivers/staging/rt2870/common/cmm_data_2870.c b/drivers/staging/rt2870/common/cmm_data_2870.c
index d6fc056f81d..3b63a48310f 100644
--- a/drivers/staging/rt2870/common/cmm_data_2870.c
+++ b/drivers/staging/rt2870/common/cmm_data_2870.c
@@ -810,12 +810,7 @@ VOID RT28xxUsbStaAsicForceWakeup(
810 AutoWakeupCfg.word = 0; 810 AutoWakeupCfg.word = 0;
811 RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word); 811 RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
812 812
813#ifndef RT30xx
814 AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
815#endif
816#ifdef RT30xx
817 AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02); 813 AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
818#endif
819 814
820 OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); 815 OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
821} 816}
@@ -852,12 +847,7 @@ VOID RT28xxUsbMlmeRadioOn(
852 if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) 847 if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
853 return; 848 return;
854 849
855#ifndef RT30xx
856 AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
857#endif
858#ifdef RT30xx
859 AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02); 850 AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
860#endif
861 RTMPusecDelay(10000); 851 RTMPusecDelay(10000);
862 852
863 NICResetFromError(pAd); 853 NICResetFromError(pAd);
@@ -908,22 +898,6 @@ VOID RT28xxUsbMlmeRadioOFF(
908 BssTableInit(&pAd->ScanTab); 898 BssTableInit(&pAd->ScanTab);
909 } 899 }
910 900
911#ifndef RT30xx
912 // Disable MAC Tx/Rx
913 RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
914 Value &= (0xfffffff3);
915 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
916
917 // MAC_SYS_CTRL => value = 0x0 => 40mA
918 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0);
919
920 // PWR_PIN_CFG => value = 0x0 => 40mA
921 RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0);
922
923 // TX_PIN_CFG => value = 0x0 => 20mA
924 RTMP_IO_WRITE32(pAd, TX_PIN_CFG, 0);
925#endif
926
927 if (pAd->CommonCfg.BBPCurrentBW == BW_40) 901 if (pAd->CommonCfg.BBPCurrentBW == BW_40)
928 { 902 {
929 // Must using 40MHz. 903 // Must using 40MHz.
@@ -935,13 +909,11 @@ VOID RT28xxUsbMlmeRadioOFF(
935 AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel); 909 AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
936 } 910 }
937 911
938#ifdef RT30xx
939 // Disable Tx/Rx DMA 912 // Disable Tx/Rx DMA
940 RTUSBReadMACRegister(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA 913 RTUSBReadMACRegister(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
941 GloCfg.field.EnableTxDMA = 0; 914 GloCfg.field.EnableTxDMA = 0;
942 GloCfg.field.EnableRxDMA = 0; 915 GloCfg.field.EnableRxDMA = 0;
943 RTUSBWriteMACRegister(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings 916 RTUSBWriteMACRegister(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
944#endif
945 917
946 // Waiting for DMA idle 918 // Waiting for DMA idle
947 i = 0; 919 i = 0;
@@ -954,12 +926,10 @@ VOID RT28xxUsbMlmeRadioOFF(
954 RTMPusecDelay(1000); 926 RTMPusecDelay(1000);
955 }while (i++ < 100); 927 }while (i++ < 100);
956 928
957#ifdef RT30xx
958 // Disable MAC Tx/Rx 929 // Disable MAC Tx/Rx
959 RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value); 930 RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
960 Value &= (0xfffffff3); 931 Value &= (0xfffffff3);
961 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value); 932 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
962#endif
963 933
964 AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02); 934 AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
965} 935}
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c
index 94a3c5e0b2d..1d69590421a 100644
--- a/drivers/staging/rt2870/common/rtusb_io.c
+++ b/drivers/staging/rt2870/common/rtusb_io.c
@@ -110,11 +110,9 @@ NTSTATUS RTUSBFirmwareWrite(
110 Status = RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff); 110 Status = RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff);
111 Status = RTUSBFirmwareRun(pAd); 111 Status = RTUSBFirmwareRun(pAd);
112 112
113#ifdef RT30xx
114 RTMPusecDelay(10000); 113 RTMPusecDelay(10000);
115 RTUSBWriteMACRegister(pAd,H2M_MAILBOX_CSR,0); 114 RTUSBWriteMACRegister(pAd,H2M_MAILBOX_CSR,0);
116 AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00);//reset rf by MCU supported by new firmware 115 AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00);//reset rf by MCU supported by new firmware
117#endif
118 116
119 return Status; 117 return Status;
120} 118}
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
index 131f3329ac9..4c67bafad4e 100644
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -349,11 +349,8 @@ extern UCHAR EpToQueue[6];
349 { RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL); \ 349 { RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL); \
350 RTUSBKickBulkOut(pAd); } 350 RTUSBKickBulkOut(pAd); }
351 351
352#ifdef RT30xx 352#define RT28xx_CHIP_NAME "RTxx70"
353#define RT28xx_CHIP_NAME "RT3070" 353
354#else
355#define RT28xx_CHIP_NAME "RT2870"
356#endif
357#define USB_CYC_CFG 0x02a4 354#define USB_CYC_CFG 0x02a4
358#define STATUS_SUCCESS 0x00 355#define STATUS_SUCCESS 0x00
359#define STATUS_UNSUCCESSFUL 0x01 356#define STATUS_UNSUCCESSFUL 0x01
@@ -462,9 +459,7 @@ typedef struct _RT_SET_ASIC_WCID {
462 ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based 459 ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
463 ULONG SetTid; // time-based: seconds, packet-based: kilo-packets 460 ULONG SetTid; // time-based: seconds, packet-based: kilo-packets
464 ULONG DeleteTid; // time-based: seconds, packet-based: kilo-packets 461 ULONG DeleteTid; // time-based: seconds, packet-based: kilo-packets
465#ifndef RT30xx
466 UCHAR Addr[MAC_ADDR_LEN]; // avoid in interrupt when write key 462 UCHAR Addr[MAC_ADDR_LEN]; // avoid in interrupt when write key
467#endif
468} RT_SET_ASIC_WCID,*PRT_SET_ASIC_WCID; 463} RT_SET_ASIC_WCID,*PRT_SET_ASIC_WCID;
469 464
470typedef struct _RT_SET_ASIC_WCID_ATTRI { 465typedef struct _RT_SET_ASIC_WCID_ATTRI {
diff --git a/drivers/staging/rt3070/Kconfig b/drivers/staging/rt3070/Kconfig
index b37fb5d13a4..652d825338e 100644
--- a/drivers/staging/rt3070/Kconfig
+++ b/drivers/staging/rt3070/Kconfig
@@ -1,6 +1,6 @@
1config RT3070 1config RT3070
2 tristate "Ralink 3070 wireless support" 2 tristate "Ralink 3070 wireless support"
3 depends on USB && X86 && WLAN_80211 3 depends on USB && X86 && WLAN_80211 && !RT2870
4 ---help--- 4 ---help---
5 This is an experimental driver for the Ralink 3070 wireless chip. 5 This is an experimental driver for the Ralink 3070 wireless chip.
6 6