aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rt2870
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-08-23 15:32:06 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:02:23 -0700
commit9eeb783ed4a11d7eb82d0cb5d23cc214e3827c8d (patch)
tree77f8c138a7f0f825e95b88921a59ae96068b6226 /drivers/staging/rt2870
parentStaging: rt2870: add Antenna Diversity support (diff)
downloadlinux-dev-9eeb783ed4a11d7eb82d0cb5d23cc214e3827c8d.tar.xz
linux-dev-9eeb783ed4a11d7eb82d0cb5d23cc214e3827c8d.zip
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>
Diffstat (limited to 'drivers/staging/rt2870')
-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
6 files changed, 6 insertions, 65 deletions
diff --git a/drivers/staging/rt2870/2870_main_dev.c b/drivers/staging/rt2870/2870_main_dev.c
index b725c750a11d..d0ed48bed2bb 100644
--- a/drivers/staging/rt2870/2870_main_dev.c
+++ b/drivers/staging/rt2870/2870_main_dev.c
@@ -50,6 +50,7 @@ MODULE_LICENSE("GPL");
#ifdef MODULE_VERSION
MODULE_VERSION(STA_DRIVER_VERSION);
#endif
+MODULE_ALIAS("rt3070sta");
/* Kernel thread and vars, which handles packets that are completed. Only
* packets that have a "complete" function are sent here. This way, the
@@ -65,19 +66,15 @@ struct usb_device_id rtusb_usb_id[] = {
{ USB_DEVICE(0x1737, 0x0070) }, /* Linksys */
{ USB_DEVICE(0x148F, 0x2870) }, /* Ralink */
{ USB_DEVICE(0x148F, 0x3070) }, /* Ralink 3070 */
-#ifdef RT30xx
{ USB_DEVICE(0x148F, 0x3071) }, /* Ralink 3071 */
{ USB_DEVICE(0x148F, 0x3072) }, /* Ralink 3072 */
-#endif
{ USB_DEVICE(0x0B05, 0x1731) }, /* Asus */
{ USB_DEVICE(0x0B05, 0x1732) }, /* Asus */
{ USB_DEVICE(0x0B05, 0x1742) }, /* Asus */
{ USB_DEVICE(0x0DF6, 0x0017) }, /* Sitecom */
{ USB_DEVICE(0x0DF6, 0x002B) }, /* Sitecom */
{ USB_DEVICE(0x0DF6, 0x002C) }, /* Sitecom */
-#ifdef RT30xx
{ USB_DEVICE(0x0DF6, 0x003E) }, /* Sitecom 3070 */
-#endif
{ USB_DEVICE(0x0DF6, 0x002D) }, /* Sitecom */
{ USB_DEVICE(0x0DF6, 0x0039) }, /* Sitecom 2770 */
{ USB_DEVICE(0x0DF6, 0x003F) }, /* Sitecom WL-608 */
@@ -88,10 +85,8 @@ struct usb_device_id rtusb_usb_id[] = {
{ USB_DEVICE(0x2019, 0xAB25) }, /* Planex Communications, Inc. RT3070 */
{ USB_DEVICE(0x07D1, 0x3C09) }, /* D-Link */
{ USB_DEVICE(0x07D1, 0x3C11) }, /* D-Link */
-#ifdef RT30xx
{ USB_DEVICE(0x2001, 0x3C09) }, /* D-Link */
{ USB_DEVICE(0x2001, 0x3C0A) }, /* D-Link 3072*/
-#endif
{ USB_DEVICE(0x14B2, 0x3C07) }, /* AL */
{ USB_DEVICE(0x14B2, 0x3C12) }, /* AL 3070 */
{ USB_DEVICE(0x050D, 0x8053) }, /* Belkin */
@@ -104,34 +99,24 @@ struct usb_device_id rtusb_usb_id[] = {
{ USB_DEVICE(0x07AA, 0x003F) }, /* Corega */
{ USB_DEVICE(0x18C5, 0x0012) }, /* Corega 3070 */
{ USB_DEVICE(0x1044, 0x800B) }, /* Gigabyte */
-#ifdef RT30xx
{ USB_DEVICE(0x1044, 0x800D) }, /* Gigabyte GN-WB32L 3070 */
-#endif
{ USB_DEVICE(0x15A9, 0x0006) }, /* Sparklan */
{ USB_DEVICE(0x083A, 0xB522) }, /* SMC */
{ USB_DEVICE(0x083A, 0xA618) }, /* SMC */
-#ifdef RT30xx
{ USB_DEVICE(0x083A, 0x8522) }, /* Arcadyan */
{ USB_DEVICE(0x083A, 0x7512) }, /* Arcadyan 2770 */
-#endif
{ USB_DEVICE(0x083A, 0x7522) }, /* Arcadyan */
-#ifdef RT30xx
{ USB_DEVICE(0x083A, 0x7511) }, /* Arcadyan 3070 */
-#endif
{ USB_DEVICE(0x0CDE, 0x0022) }, /* ZCOM */
{ USB_DEVICE(0x0586, 0x3416) }, /* Zyxel */
{ USB_DEVICE(0x0CDE, 0x0025) }, /* Zyxel */
{ USB_DEVICE(0x1740, 0x9701) }, /* EnGenius */
{ USB_DEVICE(0x1740, 0x9702) }, /* EnGenius */
-#ifdef RT30xx
{ USB_DEVICE(0x1740, 0x9703) }, /* EnGenius 3070 */
-#endif
{ USB_DEVICE(0x0471, 0x200f) }, /* Philips */
{ USB_DEVICE(0x14B2, 0x3C25) }, /* Draytek */
{ USB_DEVICE(0x13D3, 0x3247) }, /* AzureWave */
-#ifdef RT30xx
{ USB_DEVICE(0x13D3, 0x3273) }, /* AzureWave 3070*/
-#endif
{ USB_DEVICE(0x083A, 0x6618) }, /* Accton */
{ USB_DEVICE(0x15c5, 0x0008) }, /* Amit */
{ USB_DEVICE(0x0E66, 0x0001) }, /* Hawking */
@@ -146,23 +131,17 @@ struct usb_device_id rtusb_usb_id[] = {
{ USB_DEVICE(0x07B8, 0x3071) }, /* AboCom 3071 */
{ USB_DEVICE(0x07B8, 0x2870) }, /* AboCom */
{ USB_DEVICE(0x07B8, 0x2770) }, /* AboCom */
-#ifdef RT30xx
{ USB_DEVICE(0x07B8, 0x3072) }, /* Abocom 3072 */
-#endif
{ USB_DEVICE(0x7392, 0x7711) }, /* Edimax 3070 */
{ USB_DEVICE(0x5A57, 0x0280) }, /* Zinwell */
{ USB_DEVICE(0x5A57, 0x0282) }, /* Zinwell */
-#ifdef RT30xx
{ USB_DEVICE(0x1A32, 0x0304) }, /* Quanta 3070 */
-#endif
{ USB_DEVICE(0x0789, 0x0162) }, /* Logitec 2870 */
{ USB_DEVICE(0x0789, 0x0163) }, /* Logitec 2870 */
{ USB_DEVICE(0x0789, 0x0164) }, /* Logitec 2870 */
{ USB_DEVICE(0x7392, 0x7717) }, /* Edimax */
-#ifdef RT30xx
{ USB_DEVICE(0x1EDA, 0x2310) }, /* AirTies 3070 */
{ USB_DEVICE(0x1737, 0x0077) }, /* Linksys WUSB54GC-EU v3 */
-#endif
{ } /* Terminating entry */
};
diff --git a/drivers/staging/rt2870/Kconfig b/drivers/staging/rt2870/Kconfig
index 8398d9797e1d..76841f6dea93 100644
--- a/drivers/staging/rt2870/Kconfig
+++ b/drivers/staging/rt2870/Kconfig
@@ -1,6 +1,5 @@
config RT2870
- tristate "Ralink 2870 wireless support"
+ tristate "Ralink 2870/3070 wireless support"
depends on USB && X86 && WLAN_80211
---help---
- This is an experimental driver for the Ralink 2870 wireless chip.
-
+ This is an experimental driver for the Ralink xx70 wireless chips.
diff --git a/drivers/staging/rt2870/Makefile b/drivers/staging/rt2870/Makefile
index 3c17921b74aa..306c33113c58 100644
--- a/drivers/staging/rt2870/Makefile
+++ b/drivers/staging/rt2870/Makefile
@@ -2,7 +2,7 @@ obj-$(CONFIG_RT2870) += rt2870sta.o
# TODO: all of these should be removed
EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
-EXTRA_CFLAGS += -DRT2870
+EXTRA_CFLAGS += -DRT2870 -DRT3070
EXTRA_CFLAGS += -DDBG
rt2870sta-objs := \
diff --git a/drivers/staging/rt2870/common/cmm_data_2870.c b/drivers/staging/rt2870/common/cmm_data_2870.c
index d6fc056f81d9..3b63a48310f0 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(
AutoWakeupCfg.word = 0;
RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
-#ifndef RT30xx
- AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
-#endif
-#ifdef RT30xx
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
-#endif
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
}
@@ -852,12 +847,7 @@ VOID RT28xxUsbMlmeRadioOn(
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
return;
-#ifndef RT30xx
- AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x00);
-#endif
-#ifdef RT30xx
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
-#endif
RTMPusecDelay(10000);
NICResetFromError(pAd);
@@ -908,22 +898,6 @@ VOID RT28xxUsbMlmeRadioOFF(
BssTableInit(&pAd->ScanTab);
}
-#ifndef RT30xx
- // Disable MAC Tx/Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= (0xfffffff3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // MAC_SYS_CTRL => value = 0x0 => 40mA
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0);
-
- // PWR_PIN_CFG => value = 0x0 => 40mA
- RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0);
-
- // TX_PIN_CFG => value = 0x0 => 20mA
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, 0);
-#endif
-
if (pAd->CommonCfg.BBPCurrentBW == BW_40)
{
// Must using 40MHz.
@@ -935,13 +909,11 @@ VOID RT28xxUsbMlmeRadioOFF(
AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
}
-#ifdef RT30xx
// Disable Tx/Rx DMA
RTUSBReadMACRegister(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
GloCfg.field.EnableTxDMA = 0;
GloCfg.field.EnableRxDMA = 0;
RTUSBWriteMACRegister(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
-#endif
// Waiting for DMA idle
i = 0;
@@ -954,12 +926,10 @@ VOID RT28xxUsbMlmeRadioOFF(
RTMPusecDelay(1000);
}while (i++ < 100);
-#ifdef RT30xx
// Disable MAC Tx/Rx
RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
Value &= (0xfffffff3);
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-#endif
AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
}
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c
index 94a3c5e0b2d9..1d69590421a3 100644
--- a/drivers/staging/rt2870/common/rtusb_io.c
+++ b/drivers/staging/rt2870/common/rtusb_io.c
@@ -110,11 +110,9 @@ NTSTATUS RTUSBFirmwareWrite(
Status = RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff);
Status = RTUSBFirmwareRun(pAd);
-#ifdef RT30xx
RTMPusecDelay(10000);
RTUSBWriteMACRegister(pAd,H2M_MAILBOX_CSR,0);
AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00);//reset rf by MCU supported by new firmware
-#endif
return Status;
}
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
index 131f3329ac9c..4c67bafad4e6 100644
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -349,11 +349,8 @@ extern UCHAR EpToQueue[6];
{ RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL); \
RTUSBKickBulkOut(pAd); }
-#ifdef RT30xx
-#define RT28xx_CHIP_NAME "RT3070"
-#else
-#define RT28xx_CHIP_NAME "RT2870"
-#endif
+#define RT28xx_CHIP_NAME "RTxx70"
+
#define USB_CYC_CFG 0x02a4
#define STATUS_SUCCESS 0x00
#define STATUS_UNSUCCESSFUL 0x01
@@ -462,9 +459,7 @@ typedef struct _RT_SET_ASIC_WCID {
ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
ULONG SetTid; // time-based: seconds, packet-based: kilo-packets
ULONG DeleteTid; // time-based: seconds, packet-based: kilo-packets
-#ifndef RT30xx
UCHAR Addr[MAC_ADDR_LEN]; // avoid in interrupt when write key
-#endif
} RT_SET_ASIC_WCID,*PRT_SET_ASIC_WCID;
typedef struct _RT_SET_ASIC_WCID_ATTRI {