aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800lib.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2009-11-10 16:41:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-13 17:43:57 -0500
commitf273fe55e3f3f0b66b7624c0102d3ef44bbdfe6a (patch)
tree35dbf9a54ae84f542c2cf8839ef02c81bc222d50 /drivers/net/wireless/rt2x00/rt2800lib.c
parent264d9b7d8a629620c8de84c614910c3164e935f8 (diff)
rt2x00: Properly detect Ralink RT3070 devices.
Allow rt2800usb to properly detect RT307X based devices, and set the appropriate chipset values. Signed-off-by: Gertjan van Wingede <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/rt2800lib.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index eb6d12911b9a..c41bb4a59d16 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1828,24 +1828,26 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
1828 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 1828 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
1829 rt2800_register_read(rt2x00dev, MAC_CSR0, &reg); 1829 rt2800_register_read(rt2x00dev, MAC_CSR0, &reg);
1830 1830
1831 rt2x00_set_chip_rf(rt2x00dev, value, reg);
1832
1831 if (rt2x00_intf_is_usb(rt2x00dev)) { 1833 if (rt2x00_intf_is_usb(rt2x00dev)) {
1832 struct rt2x00_chip *chip = &rt2x00dev->chip; 1834 struct rt2x00_chip *chip = &rt2x00dev->chip;
1833 1835
1834 rt2x00_set_chip(rt2x00dev, RT2870, value, reg);
1835
1836 /* 1836 /*
1837 * The check for rt2860 is not a typo, some rt2870 hardware 1837 * The check for rt2860 is not a typo, some rt2870 hardware
1838 * identifies itself as rt2860 in the CSR register. 1838 * identifies itself as rt2860 in the CSR register.
1839 */ 1839 */
1840 if (!rt2x00_check_rev(chip, 0xfff00000, 0x28600000) && 1840 if (rt2x00_check_rev(chip, 0xfff00000, 0x28600000) ||
1841 !rt2x00_check_rev(chip, 0xfff00000, 0x28700000) && 1841 rt2x00_check_rev(chip, 0xfff00000, 0x28700000) ||
1842 !rt2x00_check_rev(chip, 0xfff00000, 0x28800000) && 1842 rt2x00_check_rev(chip, 0xfff00000, 0x28800000)) {
1843 !rt2x00_check_rev(chip, 0xffff0000, 0x30700000)) { 1843 rt2x00_set_chip_rt(rt2x00dev, RT2870);
1844 } else if (rt2x00_check_rev(chip, 0xffff0000, 0x30700000)) {
1845 rt2x00_set_chip_rt(rt2x00dev, RT3070);
1846 } else {
1844 ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); 1847 ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
1845 return -ENODEV; 1848 return -ENODEV;
1846 } 1849 }
1847 } else if (rt2x00_intf_is_pci(rt2x00dev)) 1850 }
1848 rt2x00_set_chip_rf(rt2x00dev, value, reg);
1849 1851
1850 if (!rt2x00_rf(&rt2x00dev->chip, RF2820) && 1852 if (!rt2x00_rf(&rt2x00dev->chip, RF2820) &&
1851 !rt2x00_rf(&rt2x00dev->chip, RF2850) && 1853 !rt2x00_rf(&rt2x00dev->chip, RF2850) &&
@@ -1853,10 +1855,8 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
1853 !rt2x00_rf(&rt2x00dev->chip, RF2750) && 1855 !rt2x00_rf(&rt2x00dev->chip, RF2750) &&
1854 !rt2x00_rf(&rt2x00dev->chip, RF3020) && 1856 !rt2x00_rf(&rt2x00dev->chip, RF3020) &&
1855 !rt2x00_rf(&rt2x00dev->chip, RF2020) && 1857 !rt2x00_rf(&rt2x00dev->chip, RF2020) &&
1856 (rt2x00_intf_is_usb(rt2x00dev) || 1858 !rt2x00_rf(&rt2x00dev->chip, RF3021) &&
1857 (rt2x00_intf_is_pci(rt2x00dev) && 1859 !rt2x00_rf(&rt2x00dev->chip, RF3022)) {
1858 !rt2x00_rf(&rt2x00dev->chip, RF3021) &&
1859 !rt2x00_rf(&rt2x00dev->chip, RF3022)))) {
1860 ERROR(rt2x00dev, "Invalid RF chipset detected.\n"); 1860 ERROR(rt2x00dev, "Invalid RF chipset detected.\n");
1861 return -ENODEV; 1861 return -ENODEV;
1862 } 1862 }
@@ -2057,7 +2057,9 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2057 spec->channels = rf_vals; 2057 spec->channels = rf_vals;
2058 } else if (rt2x00_intf_is_usb(rt2x00dev) && 2058 } else if (rt2x00_intf_is_usb(rt2x00dev) &&
2059 (rt2x00_rf(chip, RF3020) || 2059 (rt2x00_rf(chip, RF3020) ||
2060 rt2x00_rf(chip, RF2020))) { 2060 rt2x00_rf(chip, RF2020) ||
2061 rt2x00_rf(chip, RF3021) ||
2062 rt2x00_rf(chip, RF3022))) {
2061 spec->num_channels = ARRAY_SIZE(rf_vals_3070); 2063 spec->num_channels = ARRAY_SIZE(rf_vals_3070);
2062 spec->channels = rf_vals_3070; 2064 spec->channels = rf_vals_3070;
2063 } 2065 }