diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2007-11-12 09:02:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-11-14 21:21:15 -0500 |
commit | 755a957d407c3fcac58360d9309b1664078ac15d (patch) | |
tree | 8668e7d54a6af0b2a843abad255972a2dc84bc81 /drivers/net/wireless/rt2x00/rt2x00.h | |
parent | 14577f239fe5193d556ef1471c8667dabd556418 (diff) |
rt2x00: Fix chipset revision validation
The validation of the chipset revision was broken
since for rt2500usb and rt73usb different registers
should be read. When rt2500usb was loaded for a rt73
device it would false think the chipset was correct
because the wrong register was read and validated.
This has been fixed by expanding the check to also
see if the first 4 bits of the revision is not-0
(When reading the wrong register offset the returned
value is usually 0 which can be interpreted as invalid)
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 8 |
1 files changed, 5 insertions, 3 deletions
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 | /* |