aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800usb.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-02-13 14:55:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-15 16:14:11 -0500
commit49e721ec6ca74f90ee99089ad2de1c338a95c6d5 (patch)
tree203bd5d436af015599f083bcb447e0ee03c91654 /drivers/net/wireless/rt2x00/rt2800usb.c
parent714fa6636331d33c6045efe394f36c964a6c14ee (diff)
rt2x00: rework RT chipset and revision determination for PCI an SOC devices.
The recent rt2800 devices are no longer really identified by their PCI ID's, but rather by the contents of their CSR0 register. Also for the other chipsets is the contents of this CSR0 register important. Change the chipset determination logic to be more aligned with the rt2800 model. Preparation for the support of rt3070 / rt3090 based devices. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 82755cf8b73e..79ea3798d597 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -92,7 +92,6 @@ static bool rt2800usb_check_crc(const u8 *data, const size_t len)
92static int rt2800usb_check_firmware(struct rt2x00_dev *rt2x00dev, 92static int rt2800usb_check_firmware(struct rt2x00_dev *rt2x00dev,
93 const u8 *data, const size_t len) 93 const u8 *data, const size_t len)
94{ 94{
95 u16 chipset = (rt2x00_rev(rt2x00dev) >> 16) & 0xffff;
96 size_t offset = 0; 95 size_t offset = 0;
97 96
98 /* 97 /*
@@ -111,9 +110,9 @@ static int rt2800usb_check_firmware(struct rt2x00_dev *rt2x00dev,
111 * Check if we need the upper 4kb firmware data or not. 110 * Check if we need the upper 4kb firmware data or not.
112 */ 111 */
113 if ((len == 4096) && 112 if ((len == 4096) &&
114 (chipset != 0x2860) && 113 !rt2x00_rt(rt2x00dev, RT2860) &&
115 (chipset != 0x2872) && 114 !rt2x00_rt(rt2x00dev, RT2872) &&
116 (chipset != 0x3070)) 115 !rt2x00_rt(rt2x00dev, RT3070))
117 return FW_BAD_VERSION; 116 return FW_BAD_VERSION;
118 117
119 /* 118 /*
@@ -138,14 +137,13 @@ static int rt2800usb_load_firmware(struct rt2x00_dev *rt2x00dev,
138 u32 reg; 137 u32 reg;
139 u32 offset; 138 u32 offset;
140 u32 length; 139 u32 length;
141 u16 chipset = (rt2x00_rev(rt2x00dev) >> 16) & 0xffff;
142 140
143 /* 141 /*
144 * Check which section of the firmware we need. 142 * Check which section of the firmware we need.
145 */ 143 */
146 if ((chipset == 0x2860) || 144 if (rt2x00_rt(rt2x00dev, RT2860) ||
147 (chipset == 0x2872) || 145 rt2x00_rt(rt2x00dev, RT2872) ||
148 (chipset == 0x3070)) { 146 rt2x00_rt(rt2x00dev, RT3070)) {
149 offset = 0; 147 offset = 0;
150 length = 4096; 148 length = 4096;
151 } else { 149 } else {
@@ -200,9 +198,9 @@ static int rt2800usb_load_firmware(struct rt2x00_dev *rt2x00dev,
200 */ 198 */
201 rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); 199 rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0);
202 200
203 if ((chipset == 0x3070) || 201 if (rt2x00_rt(rt2x00dev, RT3070) ||
204 (chipset == 0x3071) || 202 rt2x00_rt(rt2x00dev, RT3071) ||
205 (chipset == 0x3572)) { 203 rt2x00_rt(rt2x00dev, RT3572)) {
206 udelay(200); 204 udelay(200);
207 rt2800_mcu_request(rt2x00dev, MCU_CURRENT, 0, 0, 0); 205 rt2800_mcu_request(rt2x00dev, MCU_CURRENT, 0, 0, 0);
208 udelay(10); 206 udelay(10);