Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bartlomiej Zolnierkiewicz and committed by
Greg Kroah-Hartman
9eeb783e 606661ea

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