]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
rt2x00: Log RT/RF chipset information correctly.
authorGertjan van Wingerde <gwingerde@gmail.com>
Sat, 14 Nov 2009 19:20:35 +0000 (20:20 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Nov 2009 19:17:12 +0000 (14:17 -0500)
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>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2800lib.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 0f912f51a15a9ddaac3e8e7f31a903e4c3fd59ee..6e68bc7efd4e332a57d9b94d3885fd1f3f154bf4 100644 (file)
@@ -1341,6 +1341,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
        value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
        rt2x00pci_register_read(rt2x00dev, CSR0, &reg);
        rt2x00_set_chip_rf(rt2x00dev, value, reg);
+       rt2x00_print_chip(rt2x00dev);
 
        if (!rt2x00_rf(&rt2x00dev->chip, RF2420) &&
            !rt2x00_rf(&rt2x00dev->chip, RF2421)) {
index 6618cbd808b338f52f3f5daef65138d7fc606658..9a31e5e7b8df22a6d0bc548447281ba2bf984bef 100644 (file)
@@ -1505,6 +1505,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
        value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
        rt2x00pci_register_read(rt2x00dev, CSR0, &reg);
        rt2x00_set_chip_rf(rt2x00dev, value, reg);
+       rt2x00_print_chip(rt2x00dev);
 
        if (!rt2x00_rf(&rt2x00dev->chip, RF2522) &&
            !rt2x00_rf(&rt2x00dev->chip, RF2523) &&
index bb64473dae67cd0d02e4693b080403184ba56f6d..b2de43e4f6564fe4c0ab21b122d73539280baab6 100644 (file)
@@ -1409,6 +1409,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
        value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
        rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
        rt2x00_set_chip(rt2x00dev, RT2570, value, reg);
+       rt2x00_print_chip(rt2x00dev);
 
        if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0) ||
            rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
index d88857ccdf851f71273ff062bd07338b5009c522..c7108050af3addb1012c475cf72e44af2a8fc83d 100644 (file)
@@ -1854,6 +1854,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
                        return -ENODEV;
                }
        }
+       rt2x00_print_chip(rt2x00dev);
 
        if (!rt2x00_rf(&rt2x00dev->chip, RF2820) &&
            !rt2x00_rf(&rt2x00dev->chip, RF2850) &&
index 62da572795a8ffd75b5db0716d28c9dfc08c361a..1cbb7ac2f32f13230372764ed10a2d6d0552d236 100644 (file)
@@ -906,10 +906,6 @@ static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
 static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
                                   const u16 rt, const u16 rf, const u32 rev)
 {
-       INFO(rt2x00dev,
-            "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
-            rt, rf, rev);
-
        rt2x00dev->chip.rt = rt;
        rt2x00dev->chip.rf = rf;
        rt2x00dev->chip.rev = rev;
@@ -927,6 +923,13 @@ static inline void rt2x00_set_chip_rf(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev);
 }
 
+static inline void rt2x00_print_chip(struct rt2x00_dev *rt2x00dev)
+{
+       INFO(rt2x00dev,
+            "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
+            rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev);
+}
+
 static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip)
 {
        return (chipset->rt == chip);
index 6e461351746177a73d2aa7115482086122e2e253..bf04605896c7a83067668ed9eb654ce7ef325f98 100644 (file)
@@ -2300,6 +2300,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
        value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
        rt2x00pci_register_read(rt2x00dev, MAC_CSR0, &reg);
        rt2x00_set_chip_rf(rt2x00dev, value, reg);
+       rt2x00_print_chip(rt2x00dev);
 
        if (!rt2x00_rf(&rt2x00dev->chip, RF5225) &&
            !rt2x00_rf(&rt2x00dev->chip, RF5325) &&
index 7236f017910d310d169f62ec31730dcd2a0ef7ca..5bbcf6626f7d3bc11b8df9d6a3d494f7f5a8ec15 100644 (file)
@@ -1825,6 +1825,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
        value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RF_TYPE);
        rt2x00usb_register_read(rt2x00dev, MAC_CSR0, &reg);
        rt2x00_set_chip(rt2x00dev, RT2571, value, reg);
+       rt2x00_print_chip(rt2x00dev);
 
        if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0x25730) ||
            rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {