diff options
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 2 |
4 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index ff2d63267b19..702321c30164 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -620,7 +620,7 @@ static void rt2500pci_link_tuner(struct rt2x00_dev *rt2x00dev) | |||
620 | * up to version C the link tuning should halt after 20 | 620 | * up to version C the link tuning should halt after 20 |
621 | * seconds. | 621 | * seconds. |
622 | */ | 622 | */ |
623 | if (rt2x00_get_rev(&rt2x00dev->chip) < RT2560_VERSION_D && | 623 | if (rt2x00_rev(&rt2x00dev->chip) < RT2560_VERSION_D && |
624 | rt2x00dev->link.count > 20) | 624 | rt2x00dev->link.count > 20) |
625 | return; | 625 | return; |
626 | 626 | ||
@@ -630,7 +630,7 @@ static void rt2500pci_link_tuner(struct rt2x00_dev *rt2x00dev) | |||
630 | * Chipset versions C and lower should directly continue | 630 | * Chipset versions C and lower should directly continue |
631 | * to the dynamic CCA tuning. | 631 | * to the dynamic CCA tuning. |
632 | */ | 632 | */ |
633 | if (rt2x00_get_rev(&rt2x00dev->chip) < RT2560_VERSION_D) | 633 | if (rt2x00_rev(&rt2x00dev->chip) < RT2560_VERSION_D) |
634 | goto dynamic_cca_tune; | 634 | goto dynamic_cca_tune; |
635 | 635 | ||
636 | /* | 636 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 7cdc80a122bb..277a020b35e9 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -753,7 +753,7 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev) | |||
753 | rt2x00_set_field16(®, MAC_CSR1_HOST_READY, 1); | 753 | rt2x00_set_field16(®, MAC_CSR1_HOST_READY, 1); |
754 | rt2500usb_register_write(rt2x00dev, MAC_CSR1, reg); | 754 | rt2500usb_register_write(rt2x00dev, MAC_CSR1, reg); |
755 | 755 | ||
756 | if (rt2x00_get_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) { | 756 | if (rt2x00_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) { |
757 | rt2500usb_register_read(rt2x00dev, PHY_CSR2, ®); | 757 | rt2500usb_register_read(rt2x00dev, PHY_CSR2, ®); |
758 | reg &= ~0x0002; | 758 | reg &= ~0x0002; |
759 | } else { | 759 | } else { |
@@ -1257,7 +1257,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1257 | rt2500usb_register_read(rt2x00dev, MAC_CSR0, ®); | 1257 | rt2500usb_register_read(rt2x00dev, MAC_CSR0, ®); |
1258 | rt2x00_set_chip(rt2x00dev, RT2570, value, reg); | 1258 | rt2x00_set_chip(rt2x00dev, RT2570, value, reg); |
1259 | 1259 | ||
1260 | if (rt2x00_rev(&rt2x00dev->chip, 0xffff0)) { | 1260 | if (!rt2x00_check_rev(&rt2x00dev->chip, 0)) { |
1261 | ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); | 1261 | ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); |
1262 | return -ENODEV; | 1262 | return -ENODEV; |
1263 | } | 1263 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 9845e584b731..d1ad5251a77a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -751,14 +751,16 @@ static inline char rt2x00_rf(const struct rt2x00_chip *chipset, const u16 chip) | |||
751 | return (chipset->rf == chip); | 751 | return (chipset->rf == chip); |
752 | } | 752 | } |
753 | 753 | ||
754 | static inline u16 rt2x00_get_rev(const struct rt2x00_chip *chipset) | 754 | static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset) |
755 | { | 755 | { |
756 | return chipset->rev; | 756 | return chipset->rev; |
757 | } | 757 | } |
758 | 758 | ||
759 | static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset, const u32 mask) | 759 | static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset, |
760 | const u32 rev) | ||
760 | { | 761 | { |
761 | return chipset->rev & mask; | 762 | return (((chipset->rev & 0xffff0) == rev) && |
763 | !!(chipset->rev & 0x0000f)); | ||
762 | } | 764 | } |
763 | 765 | ||
764 | /* | 766 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 46c8c0840a65..dc640bf6b5eb 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1486,7 +1486,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1486 | rt73usb_register_read(rt2x00dev, MAC_CSR0, ®); | 1486 | rt73usb_register_read(rt2x00dev, MAC_CSR0, ®); |
1487 | rt2x00_set_chip(rt2x00dev, RT2571, value, reg); | 1487 | rt2x00_set_chip(rt2x00dev, RT2571, value, reg); |
1488 | 1488 | ||
1489 | if (!rt2x00_rev(&rt2x00dev->chip, 0x25730)) { | 1489 | if (!rt2x00_check_rev(&rt2x00dev->chip, 0x25730)) { |
1490 | ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); | 1490 | ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); |
1491 | return -ENODEV; | 1491 | return -ENODEV; |
1492 | } | 1492 | } |