Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73867
b: refs/heads/master
c: 755a957
h: refs/heads/master
i:
  73865: 300d4e7
  73863: cc18ef7
v: v3
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Nov 15, 2007
1 parent 1156c9e commit 830d203
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 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: 14577f239fe5193d556ef1471c8667dabd556418
refs/heads/master: 755a957d407c3fcac58360d9309b1664078ac15d
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/rt2x00/rt2500pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static void rt2500pci_link_tuner(struct rt2x00_dev *rt2x00dev)
* up to version C the link tuning should halt after 20
* seconds.
*/
if (rt2x00_get_rev(&rt2x00dev->chip) < RT2560_VERSION_D &&
if (rt2x00_rev(&rt2x00dev->chip) < RT2560_VERSION_D &&
rt2x00dev->link.count > 20)
return;

Expand All @@ -630,7 +630,7 @@ static void rt2500pci_link_tuner(struct rt2x00_dev *rt2x00dev)
* Chipset versions C and lower should directly continue
* to the dynamic CCA tuning.
*/
if (rt2x00_get_rev(&rt2x00dev->chip) < RT2560_VERSION_D)
if (rt2x00_rev(&rt2x00dev->chip) < RT2560_VERSION_D)
goto dynamic_cca_tune;

/*
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev)
rt2x00_set_field16(&reg, MAC_CSR1_HOST_READY, 1);
rt2500usb_register_write(rt2x00dev, MAC_CSR1, reg);

if (rt2x00_get_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) {
if (rt2x00_rev(&rt2x00dev->chip) >= RT2570_VERSION_C) {
rt2500usb_register_read(rt2x00dev, PHY_CSR2, &reg);
reg &= ~0x0002;
} else {
Expand Down Expand Up @@ -1257,7 +1257,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_rev(&rt2x00dev->chip, 0xffff0)) {
if (!rt2x00_check_rev(&rt2x00dev->chip, 0)) {
ERROR(rt2x00dev, "Invalid RT chipset detected.\n");
return -ENODEV;
}
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,16 @@ static inline char rt2x00_rf(const struct rt2x00_chip *chipset, const u16 chip)
return (chipset->rf == chip);
}

static inline u16 rt2x00_get_rev(const struct rt2x00_chip *chipset)
static inline u16 rt2x00_rev(const struct rt2x00_chip *chipset)
{
return chipset->rev;
}

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

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

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

0 comments on commit 830d203

Please sign in to comment.