Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150186
b: refs/heads/master
c: 358623c
h: refs/heads/master
v: v3
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed May 6, 2009
1 parent 4b01dfc commit 97b6032
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6cfe62cd58da862db04d4eb61f218f65b0cedbb3
refs/heads/master: 358623c22c9fd837b3b1b444377037f72553dc9f
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
rt2500usb_register_read(rt2x00dev, MAC_CSR0, &reg);
rt2x00_set_chip(rt2x00dev, RT2570, value, reg);

if (!rt2x00_check_rev(&rt2x00dev->chip, 0)) {
if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0)) {
ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
return -ENODEV;
}
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/net/wireless/rt2x00/rt2800usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2348,9 +2348,10 @@ static int rt2800usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
* The check for rt2860 is not a typo, some rt2870 hardware
* identifies itself as rt2860 in the CSR register.
*/
if ((rt2x00_get_field32(reg, MAC_CSR0_ASIC_VER) != 0x2860) &&
(rt2x00_get_field32(reg, MAC_CSR0_ASIC_VER) != 0x2870) &&
(rt2x00_get_field32(reg, MAC_CSR0_ASIC_VER) != 0x3070)) {
if (!rt2x00_check_rev(&rt2x00dev->chip, 0xfff00000, 0x28600000) &&
!rt2x00_check_rev(&rt2x00dev->chip, 0xfff00000, 0x28700000) &&
!rt2x00_check_rev(&rt2x00dev->chip, 0xfff00000, 0x28800000) &&
!rt2x00_check_rev(&rt2x00dev->chip, 0xffff0000, 0x30700000)) {
ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
return -ENODEV;
}
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -915,11 +915,10 @@ static inline u32 rt2x00_rev(const struct rt2x00_chip *chipset)
return chipset->rev;
}

static inline u16 rt2x00_check_rev(const struct rt2x00_chip *chipset,
const u32 rev)
static inline bool rt2x00_check_rev(const struct rt2x00_chip *chipset,
const u32 mask, const u32 rev)
{
return (((chipset->rev & 0xffff0) == rev) &&
!!(chipset->rev & 0x0000f));
return ((chipset->rev & mask) == rev);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt73usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,8 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00usb_register_read(rt2x00dev, MAC_CSR0, &reg);
rt2x00_set_chip(rt2x00dev, RT2571, value, reg);

if (!rt2x00_check_rev(&rt2x00dev->chip, 0x25730)) {
if (!rt2x00_check_rev(&rt2x00dev->chip, 0x000ffff0, 0x25730) ||
!rt2x00_check_rev(&rt2x00dev->chip, 0x0000000f, 0)) {
ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
return -ENODEV;
}
Expand Down

0 comments on commit 97b6032

Please sign in to comment.