diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-02-13 14:55:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-15 16:14:10 -0500 |
commit | 714fa6636331d33c6045efe394f36c964a6c14ee (patch) | |
tree | dcdb5f14cd2275cec4dac094327d3b3524e201de /drivers/net/wireless | |
parent | cea90e55969ff70b970d64d564076a5469331527 (diff) |
rt2x00: Reorganize RT chipset setting for PCI/SOC devices.
Don't set the RT chipset for a device from within the generic PCI/SOC code,
but rather from the individual drivers, so that individual drivers have
more control over what RT chipset is set.
Preparation for chip handling updates for rt2800 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')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 15 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00soc.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00soc.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 1 |
12 files changed, 58 insertions, 59 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 184335950825..9207b9b100b0 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1327,6 +1327,7 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1327 | static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | 1327 | static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev) |
1328 | { | 1328 | { |
1329 | u32 reg; | 1329 | u32 reg; |
1330 | u16 chip; | ||
1330 | u16 value; | 1331 | u16 value; |
1331 | u16 eeprom; | 1332 | u16 eeprom; |
1332 | 1333 | ||
@@ -1336,12 +1337,16 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1336 | rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); | 1337 | rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); |
1337 | 1338 | ||
1338 | /* | 1339 | /* |
1340 | * Identify RT chipset. | ||
1341 | */ | ||
1342 | pci_read_config_word(to_pci_dev(rt2x00dev->dev), PCI_DEVICE_ID, &chip); | ||
1343 | |||
1344 | /* | ||
1339 | * Identify RF chipset. | 1345 | * Identify RF chipset. |
1340 | */ | 1346 | */ |
1341 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 1347 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
1342 | rt2x00pci_register_read(rt2x00dev, CSR0, ®); | 1348 | rt2x00pci_register_read(rt2x00dev, CSR0, ®); |
1343 | rt2x00_set_chip_rf(rt2x00dev, value, reg); | 1349 | rt2x00_set_chip(rt2x00dev, chip, value, reg); |
1344 | rt2x00_print_chip(rt2x00dev); | ||
1345 | 1350 | ||
1346 | if (!rt2x00_rf(rt2x00dev, RF2420) && !rt2x00_rf(rt2x00dev, RF2421)) { | 1351 | if (!rt2x00_rf(rt2x00dev, RF2420) && !rt2x00_rf(rt2x00dev, RF2421)) { |
1347 | ERROR(rt2x00dev, "Invalid RF chipset detected.\n"); | 1352 | ERROR(rt2x00dev, "Invalid RF chipset detected.\n"); |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 7dfcffadda2a..0f6d001267ac 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1490,6 +1490,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1490 | static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | 1490 | static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) |
1491 | { | 1491 | { |
1492 | u32 reg; | 1492 | u32 reg; |
1493 | u16 chip; | ||
1493 | u16 value; | 1494 | u16 value; |
1494 | u16 eeprom; | 1495 | u16 eeprom; |
1495 | 1496 | ||
@@ -1499,12 +1500,16 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1499 | rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); | 1500 | rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); |
1500 | 1501 | ||
1501 | /* | 1502 | /* |
1503 | * Identify RT chipset. | ||
1504 | */ | ||
1505 | pci_read_config_word(to_pci_dev(rt2x00dev->dev), PCI_DEVICE_ID, &chip); | ||
1506 | |||
1507 | /* | ||
1502 | * Identify RF chipset. | 1508 | * Identify RF chipset. |
1503 | */ | 1509 | */ |
1504 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 1510 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
1505 | rt2x00pci_register_read(rt2x00dev, CSR0, ®); | 1511 | rt2x00pci_register_read(rt2x00dev, CSR0, ®); |
1506 | rt2x00_set_chip_rf(rt2x00dev, value, reg); | 1512 | rt2x00_set_chip(rt2x00dev, chip, value, reg); |
1507 | rt2x00_print_chip(rt2x00dev); | ||
1508 | 1513 | ||
1509 | if (!rt2x00_rf(rt2x00dev, RF2522) && | 1514 | if (!rt2x00_rf(rt2x00dev, RF2522) && |
1510 | !rt2x00_rf(rt2x00dev, RF2523) && | 1515 | !rt2x00_rf(rt2x00dev, RF2523) && |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 81ca4ec068db..99b7cb88a648 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1408,7 +1408,6 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1408 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 1408 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
1409 | rt2500usb_register_read(rt2x00dev, MAC_CSR0, ®); | 1409 | rt2500usb_register_read(rt2x00dev, MAC_CSR0, ®); |
1410 | rt2x00_set_chip(rt2x00dev, RT2570, value, reg); | 1410 | rt2x00_set_chip(rt2x00dev, RT2570, value, reg); |
1411 | rt2x00_print_chip(rt2x00dev); | ||
1412 | 1411 | ||
1413 | if (!rt2x00_check_rev(rt2x00dev, 0x000ffff0, 0) || | 1412 | if (!rt2x00_check_rev(rt2x00dev, 0x000ffff0, 0) || |
1414 | rt2x00_check_rev(rt2x00dev, 0x0000000f, 0)) { | 1413 | rt2x00_check_rev(rt2x00dev, 0x0000000f, 0)) { |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index e78df53b9515..7340e487df6b 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -40,6 +40,9 @@ | |||
40 | #if defined(CONFIG_RT2X00_LIB_USB) || defined(CONFIG_RT2X00_LIB_USB_MODULE) | 40 | #if defined(CONFIG_RT2X00_LIB_USB) || defined(CONFIG_RT2X00_LIB_USB_MODULE) |
41 | #include "rt2x00usb.h" | 41 | #include "rt2x00usb.h" |
42 | #endif | 42 | #endif |
43 | #if defined(CONFIG_RT2X00_LIB_PCI) || defined(CONFIG_RT2X00_LIB_PCI_MODULE) | ||
44 | #include "rt2x00pci.h" | ||
45 | #endif | ||
43 | #include "rt2800lib.h" | 46 | #include "rt2800lib.h" |
44 | #include "rt2800.h" | 47 | #include "rt2800.h" |
45 | #include "rt2800usb.h" | 48 | #include "rt2800usb.h" |
@@ -1839,6 +1842,7 @@ EXPORT_SYMBOL_GPL(rt2800_validate_eeprom); | |||
1839 | int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | 1842 | int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) |
1840 | { | 1843 | { |
1841 | u32 reg; | 1844 | u32 reg; |
1845 | u16 chip; | ||
1842 | u16 value; | 1846 | u16 value; |
1843 | u16 eeprom; | 1847 | u16 eeprom; |
1844 | 1848 | ||
@@ -1853,25 +1857,40 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1853 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 1857 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
1854 | rt2800_register_read(rt2x00dev, MAC_CSR0, ®); | 1858 | rt2800_register_read(rt2x00dev, MAC_CSR0, ®); |
1855 | 1859 | ||
1856 | rt2x00_set_chip_rf(rt2x00dev, value, reg); | 1860 | if (rt2x00_is_pci(rt2x00dev)) { |
1857 | 1861 | #if defined(CONFIG_RT2X00_LIB_PCI) || defined(CONFIG_RT2X00_LIB_PCI_MODULE) | |
1858 | if (rt2x00_is_usb(rt2x00dev)) { | 1862 | pci_read_config_word(to_pci_dev(rt2x00dev->dev), |
1863 | PCI_DEVICE_ID, | ||
1864 | &chip); | ||
1865 | #else | ||
1866 | BUG(); | ||
1867 | #endif | ||
1868 | } else if (rt2x00_is_usb(rt2x00dev)) { | ||
1859 | /* | 1869 | /* |
1860 | * The check for rt2860 is not a typo, some rt2870 hardware | 1870 | * The check for rt2860 is not a typo, some rt2870 hardware |
1861 | * identifies itself as rt2860 in the CSR register. | 1871 | * identifies itself as rt2860 in the CSR register. |
1862 | */ | 1872 | */ |
1863 | if (rt2x00_check_rev(rt2x00dev, 0xfff00000, 0x28600000) || | 1873 | if (((reg & 0xfff00000) == 0x28600000) || |
1864 | rt2x00_check_rev(rt2x00dev, 0xfff00000, 0x28700000) || | 1874 | ((reg & 0xfff00000) == 0x28700000) || |
1865 | rt2x00_check_rev(rt2x00dev, 0xfff00000, 0x28800000)) { | 1875 | ((reg & 0xfff00000) == 0x28800000)) { |
1866 | rt2x00_set_chip_rt(rt2x00dev, RT2870); | 1876 | chip = RT2870; |
1867 | } else if (rt2x00_check_rev(rt2x00dev, 0xffff0000, 0x30700000)) { | 1877 | } else if ((reg & 0xffff0000) == 0x30700000) { |
1868 | rt2x00_set_chip_rt(rt2x00dev, RT3070); | 1878 | chip = RT3070; |
1869 | } else { | 1879 | } else { |
1870 | ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); | 1880 | ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); |
1871 | return -ENODEV; | 1881 | return -ENODEV; |
1872 | } | 1882 | } |
1883 | } else if (rt2x00_is_soc(rt2x00dev)) { | ||
1884 | #if defined(CONFIG_RALINK_RT288X) | ||
1885 | chip = RT2880; | ||
1886 | #elif defined(CONFIG_RALINK_RT305X) | ||
1887 | chip = RT3052; | ||
1888 | #else | ||
1889 | BUG(); | ||
1890 | #endif | ||
1873 | } | 1891 | } |
1874 | rt2x00_print_chip(rt2x00dev); | 1892 | |
1893 | rt2x00_set_chip(rt2x00dev, chip, value, reg); | ||
1875 | 1894 | ||
1876 | if (!rt2x00_rf(rt2x00dev, RF2820) && | 1895 | if (!rt2x00_rf(rt2x00dev, RF2820) && |
1877 | !rt2x00_rf(rt2x00dev, RF2850) && | 1896 | !rt2x00_rf(rt2x00dev, RF2850) && |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index d57531ce1f82..fc351052229b 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -1219,11 +1219,10 @@ MODULE_DEVICE_TABLE(pci, rt2800pci_device_table); | |||
1219 | MODULE_LICENSE("GPL"); | 1219 | MODULE_LICENSE("GPL"); |
1220 | 1220 | ||
1221 | #ifdef CONFIG_RT2800PCI_SOC | 1221 | #ifdef CONFIG_RT2800PCI_SOC |
1222 | #if defined(CONFIG_RALINK_RT288X) | 1222 | static int rt2800soc_probe(struct platform_device *pdev) |
1223 | __rt2x00soc_probe(RT2880, &rt2800pci_ops); | 1223 | { |
1224 | #elif defined(CONFIG_RALINK_RT305X) | 1224 | return rt2x00soc_probe(pdev, rt2800pci_ops); |
1225 | __rt2x00soc_probe(RT3052, &rt2800pci_ops); | 1225 | } |
1226 | #endif | ||
1227 | 1226 | ||
1228 | static struct platform_driver rt2800soc_driver = { | 1227 | static struct platform_driver rt2800soc_driver = { |
1229 | .driver = { | 1228 | .driver = { |
@@ -1231,7 +1230,7 @@ static struct platform_driver rt2800soc_driver = { | |||
1231 | .owner = THIS_MODULE, | 1230 | .owner = THIS_MODULE, |
1232 | .mod_name = KBUILD_MODNAME, | 1231 | .mod_name = KBUILD_MODNAME, |
1233 | }, | 1232 | }, |
1234 | .probe = __rt2x00soc_probe, | 1233 | .probe = rt2800soc_probe, |
1235 | .remove = __devexit_p(rt2x00soc_remove), | 1234 | .remove = __devexit_p(rt2x00soc_remove), |
1236 | .suspend = rt2x00soc_suspend, | 1235 | .suspend = rt2x00soc_suspend, |
1237 | .resume = rt2x00soc_resume, | 1236 | .resume = rt2x00soc_resume, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index d741367304bb..1fed90acd198 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -923,22 +923,7 @@ static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, | |||
923 | rt2x00dev->chip.rt = rt; | 923 | rt2x00dev->chip.rt = rt; |
924 | rt2x00dev->chip.rf = rf; | 924 | rt2x00dev->chip.rf = rf; |
925 | rt2x00dev->chip.rev = rev; | 925 | rt2x00dev->chip.rev = rev; |
926 | } | ||
927 | |||
928 | static inline void rt2x00_set_chip_rt(struct rt2x00_dev *rt2x00dev, | ||
929 | const u16 rt) | ||
930 | { | ||
931 | rt2x00dev->chip.rt = rt; | ||
932 | } | ||
933 | 926 | ||
934 | static inline void rt2x00_set_chip_rf(struct rt2x00_dev *rt2x00dev, | ||
935 | const u16 rf, const u32 rev) | ||
936 | { | ||
937 | rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev); | ||
938 | } | ||
939 | |||
940 | static inline void rt2x00_print_chip(struct rt2x00_dev *rt2x00dev) | ||
941 | { | ||
942 | INFO(rt2x00dev, | 927 | INFO(rt2x00dev, |
943 | "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n", | 928 | "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n", |
944 | rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); | 929 | rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 801be436cf1d..047123b766fc 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -272,7 +272,6 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
272 | struct ieee80211_hw *hw; | 272 | struct ieee80211_hw *hw; |
273 | struct rt2x00_dev *rt2x00dev; | 273 | struct rt2x00_dev *rt2x00dev; |
274 | int retval; | 274 | int retval; |
275 | u16 chip; | ||
276 | 275 | ||
277 | retval = pci_request_regions(pci_dev, pci_name(pci_dev)); | 276 | retval = pci_request_regions(pci_dev, pci_name(pci_dev)); |
278 | if (retval) { | 277 | if (retval) { |
@@ -315,12 +314,6 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
315 | 314 | ||
316 | rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); | 315 | rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); |
317 | 316 | ||
318 | /* | ||
319 | * Determine RT chipset by reading PCI header. | ||
320 | */ | ||
321 | pci_read_config_word(pci_dev, PCI_DEVICE_ID, &chip); | ||
322 | rt2x00_set_chip_rt(rt2x00dev, chip); | ||
323 | |||
324 | retval = rt2x00pci_alloc_reg(rt2x00dev); | 317 | retval = rt2x00pci_alloc_reg(rt2x00dev); |
325 | if (retval) | 318 | if (retval) |
326 | goto exit_free_device; | 319 | goto exit_free_device; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h index d4f9449ab0a4..8149ff68410a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.h +++ b/drivers/net/wireless/rt2x00/rt2x00pci.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define RT2X00PCI_H | 27 | #define RT2X00PCI_H |
28 | 28 | ||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/pci.h> | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * This variable should be used with the | 33 | * This variable should be used with the |
diff --git a/drivers/net/wireless/rt2x00/rt2x00soc.c b/drivers/net/wireless/rt2x00/rt2x00soc.c index 0d6b43afc4e8..4efdc96010f6 100644 --- a/drivers/net/wireless/rt2x00/rt2x00soc.c +++ b/drivers/net/wireless/rt2x00/rt2x00soc.c | |||
@@ -71,9 +71,7 @@ exit: | |||
71 | return -ENOMEM; | 71 | return -ENOMEM; |
72 | } | 72 | } |
73 | 73 | ||
74 | int rt2x00soc_probe(struct platform_device *pdev, | 74 | int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops) |
75 | const unsigned short chipset, | ||
76 | const struct rt2x00_ops *ops) | ||
77 | { | 75 | { |
78 | struct ieee80211_hw *hw; | 76 | struct ieee80211_hw *hw; |
79 | struct rt2x00_dev *rt2x00dev; | 77 | struct rt2x00_dev *rt2x00dev; |
@@ -95,7 +93,6 @@ int rt2x00soc_probe(struct platform_device *pdev, | |||
95 | rt2x00dev->name = pdev->dev.driver->name; | 93 | rt2x00dev->name = pdev->dev.driver->name; |
96 | 94 | ||
97 | rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); | 95 | rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); |
98 | rt2x00_set_chip_rt(rt2x00dev, chipset); | ||
99 | 96 | ||
100 | retval = rt2x00soc_alloc_reg(rt2x00dev); | 97 | retval = rt2x00soc_alloc_reg(rt2x00dev); |
101 | if (retval) | 98 | if (retval) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00soc.h b/drivers/net/wireless/rt2x00/rt2x00soc.h index 8a3416624af5..4739edfe2f00 100644 --- a/drivers/net/wireless/rt2x00/rt2x00soc.h +++ b/drivers/net/wireless/rt2x00/rt2x00soc.h | |||
@@ -28,18 +28,10 @@ | |||
28 | 28 | ||
29 | #define KSEG1ADDR(__ptr) __ptr | 29 | #define KSEG1ADDR(__ptr) __ptr |
30 | 30 | ||
31 | #define __rt2x00soc_probe(__chipset, __ops) \ | ||
32 | static int __rt2x00soc_probe(struct platform_device *pdev) \ | ||
33 | { \ | ||
34 | return rt2x00soc_probe(pdev, (__chipset), (__ops)); \ | ||
35 | } | ||
36 | |||
37 | /* | 31 | /* |
38 | * SoC driver handlers. | 32 | * SoC driver handlers. |
39 | */ | 33 | */ |
40 | int rt2x00soc_probe(struct platform_device *pdev, | 34 | int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops); |
41 | const unsigned short chipset, | ||
42 | const struct rt2x00_ops *ops); | ||
43 | int rt2x00soc_remove(struct platform_device *pdev); | 35 | int rt2x00soc_remove(struct platform_device *pdev); |
44 | #ifdef CONFIG_PM | 36 | #ifdef CONFIG_PM |
45 | int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state); | 37 | int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state); |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 881340026c2a..4ca1d48fb737 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2282,6 +2282,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
2282 | static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | 2282 | static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) |
2283 | { | 2283 | { |
2284 | u32 reg; | 2284 | u32 reg; |
2285 | u16 chip; | ||
2285 | u16 value; | 2286 | u16 value; |
2286 | u16 eeprom; | 2287 | u16 eeprom; |
2287 | 2288 | ||
@@ -2291,12 +2292,16 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
2291 | rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); | 2292 | rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); |
2292 | 2293 | ||
2293 | /* | 2294 | /* |
2295 | * Identify RT chipset. | ||
2296 | */ | ||
2297 | pci_read_config_word(to_pci_dev(rt2x00dev->dev), PCI_DEVICE_ID, &chip); | ||
2298 | |||
2299 | /* | ||
2294 | * Identify RF chipset. | 2300 | * Identify RF chipset. |
2295 | */ | 2301 | */ |
2296 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 2302 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
2297 | rt2x00pci_register_read(rt2x00dev, MAC_CSR0, ®); | 2303 | rt2x00pci_register_read(rt2x00dev, MAC_CSR0, ®); |
2298 | rt2x00_set_chip_rf(rt2x00dev, value, reg); | 2304 | rt2x00_set_chip(rt2x00dev, chip, value, reg); |
2299 | rt2x00_print_chip(rt2x00dev); | ||
2300 | 2305 | ||
2301 | if (!rt2x00_rf(rt2x00dev, RF5225) && | 2306 | if (!rt2x00_rf(rt2x00dev, RF5225) && |
2302 | !rt2x00_rf(rt2x00dev, RF5325) && | 2307 | !rt2x00_rf(rt2x00dev, RF5325) && |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 3781eb7b4aa0..2950ac754921 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1821,7 +1821,6 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1821 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); | 1821 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); |
1822 | rt2x00usb_register_read(rt2x00dev, MAC_CSR0, ®); | 1822 | rt2x00usb_register_read(rt2x00dev, MAC_CSR0, ®); |
1823 | rt2x00_set_chip(rt2x00dev, RT2571, value, reg); | 1823 | rt2x00_set_chip(rt2x00dev, RT2571, value, reg); |
1824 | rt2x00_print_chip(rt2x00dev); | ||
1825 | 1824 | ||
1826 | if (!rt2x00_check_rev(rt2x00dev, 0x000ffff0, 0x25730) || | 1825 | if (!rt2x00_check_rev(rt2x00dev, 0x000ffff0, 0x25730) || |
1827 | rt2x00_check_rev(rt2x00dev, 0x0000000f, 0)) { | 1826 | rt2x00_check_rev(rt2x00dev, 0x0000000f, 0)) { |