aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt61pci.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/rt61pci.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/rt61pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 4ca1d48fb737..ee9c696fe1d4 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1131,16 +1131,18 @@ dynamic_cca_tune:
1131 */ 1131 */
1132static char *rt61pci_get_firmware_name(struct rt2x00_dev *rt2x00dev) 1132static char *rt61pci_get_firmware_name(struct rt2x00_dev *rt2x00dev)
1133{ 1133{
1134 u16 chip;
1134 char *fw_name; 1135 char *fw_name;
1135 1136
1136 switch (rt2x00dev->chip.rt) { 1137 pci_read_config_word(to_pci_dev(rt2x00dev->dev), PCI_DEVICE_ID, &chip);
1137 case RT2561: 1138 switch (chip) {
1139 case RT2561_PCI_ID:
1138 fw_name = FIRMWARE_RT2561; 1140 fw_name = FIRMWARE_RT2561;
1139 break; 1141 break;
1140 case RT2561s: 1142 case RT2561s_PCI_ID:
1141 fw_name = FIRMWARE_RT2561s; 1143 fw_name = FIRMWARE_RT2561s;
1142 break; 1144 break;
1143 case RT2661: 1145 case RT2661_PCI_ID:
1144 fw_name = FIRMWARE_RT2661; 1146 fw_name = FIRMWARE_RT2661;
1145 break; 1147 break;
1146 default: 1148 default:
@@ -2282,7 +2284,6 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
2282static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) 2284static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2283{ 2285{
2284 u32 reg; 2286 u32 reg;
2285 u16 chip;
2286 u16 value; 2287 u16 value;
2287 u16 eeprom; 2288 u16 eeprom;
2288 2289
@@ -2292,16 +2293,12 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2292 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); 2293 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
2293 2294
2294 /* 2295 /*
2295 * Identify RT chipset.
2296 */
2297 pci_read_config_word(to_pci_dev(rt2x00dev->dev), PCI_DEVICE_ID, &chip);
2298
2299 /*
2300 * Identify RF chipset. 2296 * Identify RF chipset.
2301 */ 2297 */
2302 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 2298 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
2303 rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg); 2299 rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg);
2304 rt2x00_set_chip(rt2x00dev, chip, value, reg); 2300 rt2x00_set_chip(rt2x00dev, rt2x00_get_field32(reg, MAC_CSR0_CHIPSET),
2301 value, rt2x00_get_field32(reg, MAC_CSR0_REVISION));
2305 2302
2306 if (!rt2x00_rf(rt2x00dev, RF5225) && 2303 if (!rt2x00_rf(rt2x00dev, RF5225) &&
2307 !rt2x00_rf(rt2x00dev, RF5325) && 2304 !rt2x00_rf(rt2x00dev, RF5325) &&