aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2009-11-14 14:20:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-16 14:17:12 -0500
commit16475b095a9c952f16e626c142b30bc95cfeadb3 (patch)
tree4957c6a7ce58354c50c8e236e1519d1152578f5d
parentcce5fc45f9e9570f320009431d033d5a8f6144cc (diff)
rt2x00: Log RT/RF chipset information correctly.
Some drivers (rt2800* most notably) cannot set the RF and RT chipset in the correct order to have the information logging in rt2x00_set_chip be correct. Fix this by decoupling the setting of the chipset information from the logging of the chipset information so that drivers can determine themselves when all information is set. 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>
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h11
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c1
7 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 0f912f51a15a..6e68bc7efd4e 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1341,6 +1341,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1341 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 1341 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
1342 rt2x00pci_register_read(rt2x00dev, CSR0, &reg); 1342 rt2x00pci_register_read(rt2x00dev, CSR0, &reg);
1343 rt2x00_set_chip_rf(rt2x00dev, value, reg); 1343 rt2x00_set_chip_rf(rt2x00dev, value, reg);
1344 rt2x00_print_chip(rt2x00dev);
1344 1345
1345 if (!rt2x00_rf(&rt2x00dev->chip, RF2420) && 1346 if (!rt2x00_rf(&rt2x00dev->chip, RF2420) &&
1346 !rt2x00_rf(&rt2x00dev->chip, RF2421)) { 1347 !rt2x00_rf(&rt2x00dev->chip, RF2421)) {
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 6618cbd808b3..9a31e5e7b8df 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1505,6 +1505,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1505 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 1505 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
1506 rt2x00pci_register_read(rt2x00dev, CSR0, &reg); 1506 rt2x00pci_register_read(rt2x00dev, CSR0, &reg);
1507 rt2x00_set_chip_rf(rt2x00dev, value, reg); 1507 rt2x00_set_chip_rf(rt2x00dev, value, reg);
1508 rt2x00_print_chip(rt2x00dev);
1508 1509
1509 if (!rt2x00_rf(&rt2x00dev->chip, RF2522) && 1510 if (!rt2x00_rf(&rt2x00dev->chip, RF2522) &&
1510 !rt2x00_rf(&rt2x00dev->chip, RF2523) && 1511 !rt2x00_rf(&rt2x00dev->chip, RF2523) &&
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index bb64473dae67..b2de43e4f656 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1409,6 +1409,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1409 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 1409 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
1410 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1410 rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
1411 rt2x00_set_chip(rt2x00dev, RT2570, value, reg); 1411 rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
1412 rt2x00_print_chip(rt2x00dev);
1412 1413
1413 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) || 1414 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) ||
1414 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) { 1415 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index d88857ccdf85..c7108050af3a 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1854,6 +1854,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
1854 return -ENODEV; 1854 return -ENODEV;
1855 } 1855 }
1856 } 1856 }
1857 rt2x00_print_chip(rt2x00dev);
1857 1858
1858 if (!rt2x00_rf(&rt2x00dev->chip, RF2820) && 1859 if (!rt2x00_rf(&rt2x00dev->chip, RF2820) &&
1859 !rt2x00_rf(&rt2x00dev->chip, RF2850) && 1860 !rt2x00_rf(&rt2x00dev->chip, RF2850) &&
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 62da572795a8..1cbb7ac2f32f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -906,10 +906,6 @@ static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
906static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, 906static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
907 const u16 rt, const u16 rf, const u32 rev) 907 const u16 rt, const u16 rf, const u32 rev)
908{ 908{
909 INFO(rt2x00dev,
910 "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
911 rt, rf, rev);
912
913 rt2x00dev->chip.rt = rt; 909 rt2x00dev->chip.rt = rt;
914 rt2x00dev->chip.rf = rf; 910 rt2x00dev->chip.rf = rf;
915 rt2x00dev->chip.rev = rev; 911 rt2x00dev->chip.rev = rev;
@@ -927,6 +923,13 @@ static inline void rt2x00_set_chip_rf(struct rt2x00_dev *rt2x00dev,
927 rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev); 923 rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev);
928} 924}
929 925
926static inline void rt2x00_print_chip(struct rt2x00_dev *rt2x00dev)
927{
928 INFO(rt2x00dev,
929 "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
930 rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev);
931}
932
930static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip) 933static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip)
931{ 934{
932 return (chipset->rt == chip); 935 return (chipset->rt == chip);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 6e4613517461..bf04605896c7 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2300,6 +2300,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2300 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 2300 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
2301 rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg); 2301 rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg);
2302 rt2x00_set_chip_rf(rt2x00dev, value, reg); 2302 rt2x00_set_chip_rf(rt2x00dev, value, reg);
2303 rt2x00_print_chip(rt2x00dev);
2303 2304
2304 if (!rt2x00_rf(&rt2x00dev->chip, RF5225) && 2305 if (!rt2x00_rf(&rt2x00dev->chip, RF5225) &&
2305 !rt2x00_rf(&rt2x00dev->chip, RF5325) && 2306 !rt2x00_rf(&rt2x00dev->chip, RF5325) &&
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 7236f017910d..5bbcf6626f7d 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1825,6 +1825,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1825 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE); 1825 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
1826 rt2x00usb_register_read(rt2x00dev, MAC_CSR0, &reg); 1826 rt2x00usb_register_read(rt2x00dev, MAC_CSR0, &reg);
1827 rt2x00_set_chip(rt2x00dev, RT2571, value, reg); 1827 rt2x00_set_chip(rt2x00dev, RT2571, value, reg);
1828 rt2x00_print_chip(rt2x00dev);
1828 1829
1829 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0x25730) || 1830 if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0x25730) ||
1830 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) { 1831 rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {