diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-02-13 14:55:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-15 16:14:11 -0500 |
commit | 49e721ec6ca74f90ee99089ad2de1c338a95c6d5 (patch) | |
tree | 203bd5d436af015599f083bcb447e0ee03c91654 /drivers/net/wireless/rt2x00/rt2x00.h | |
parent | 714fa6636331d33c6045efe394f36c964a6c14ee (diff) |
rt2x00: rework RT chipset and revision determination for PCI an SOC devices.
The recent rt2800 devices are no longer really identified by their PCI
ID's, but rather by the contents of their CSR0 register. Also for the
other chipsets is the contents of this CSR0 register important.
Change the chipset determination logic to be more aligned with the rt2800
model.
Preparation for the support of rt3070 / rt3090 based devices.
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>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 1fed90acd198..d9daa9c406fa 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -170,25 +170,26 @@ enum rt2x00_chip_intf { | |||
170 | */ | 170 | */ |
171 | struct rt2x00_chip { | 171 | struct rt2x00_chip { |
172 | u16 rt; | 172 | u16 rt; |
173 | #define RT2460 0x0101 | 173 | #define RT2460 0x2460 |
174 | #define RT2560 0x0201 | 174 | #define RT2560 0x2560 |
175 | #define RT2570 0x1201 | 175 | #define RT2570 0x2570 |
176 | #define RT2561s 0x0301 /* Turbo */ | 176 | #define RT2661 0x2661 |
177 | #define RT2561 0x0302 | 177 | #define RT2573 0x2573 |
178 | #define RT2661 0x0401 | 178 | #define RT2860 0x2860 /* 2.4GHz PCI/CB */ |
179 | #define RT2571 0x1300 | 179 | #define RT2870 0x2870 |
180 | #define RT2860 0x0601 /* 2.4GHz PCI/CB */ | 180 | #define RT2872 0x2872 |
181 | #define RT2860D 0x0681 /* 2.4GHz, 5GHz PCI/CB */ | ||
182 | #define RT2890 0x0701 /* 2.4GHz PCIe */ | ||
183 | #define RT2890D 0x0781 /* 2.4GHz, 5GHz PCIe */ | ||
184 | #define RT2880 0x2880 /* WSOC */ | 181 | #define RT2880 0x2880 /* WSOC */ |
182 | #define RT2883 0x2883 /* WSOC */ | ||
183 | #define RT2890 0x2890 /* 2.4GHz PCIe */ | ||
185 | #define RT3052 0x3052 /* WSOC */ | 184 | #define RT3052 0x3052 /* WSOC */ |
185 | #define RT3070 0x3070 | ||
186 | #define RT3071 0x3071 | ||
186 | #define RT3090 0x3090 /* 2.4GHz PCIe */ | 187 | #define RT3090 0x3090 /* 2.4GHz PCIe */ |
187 | #define RT2870 0x1600 | 188 | #define RT3390 0x3390 |
188 | #define RT3070 0x1800 | 189 | #define RT3572 0x3572 |
189 | 190 | ||
190 | u16 rf; | 191 | u16 rf; |
191 | u32 rev; | 192 | u16 rev; |
192 | 193 | ||
193 | enum rt2x00_chip_intf intf; | 194 | enum rt2x00_chip_intf intf; |
194 | }; | 195 | }; |
@@ -918,14 +919,14 @@ static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev, | |||
918 | * Chipset handlers | 919 | * Chipset handlers |
919 | */ | 920 | */ |
920 | static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, | 921 | static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, |
921 | const u16 rt, const u16 rf, const u32 rev) | 922 | const u16 rt, const u16 rf, const u16 rev) |
922 | { | 923 | { |
923 | rt2x00dev->chip.rt = rt; | 924 | rt2x00dev->chip.rt = rt; |
924 | rt2x00dev->chip.rf = rf; | 925 | rt2x00dev->chip.rf = rf; |
925 | rt2x00dev->chip.rev = rev; | 926 | rt2x00dev->chip.rev = rev; |
926 | 927 | ||
927 | INFO(rt2x00dev, | 928 | INFO(rt2x00dev, |
928 | "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n", | 929 | "Chipset detected - rt: %04x, rf: %04x, rev: %04x.\n", |
929 | rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); | 930 | rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); |
930 | } | 931 | } |
931 | 932 | ||
@@ -939,17 +940,11 @@ static inline char rt2x00_rf(struct rt2x00_dev *rt2x00dev, const u16 rf) | |||
939 | return (rt2x00dev->chip.rf == rf); | 940 | return (rt2x00dev->chip.rf == rf); |
940 | } | 941 | } |
941 | 942 | ||
942 | static inline u32 rt2x00_rev(struct rt2x00_dev *rt2x00dev) | 943 | static inline u16 rt2x00_rev(struct rt2x00_dev *rt2x00dev) |
943 | { | 944 | { |
944 | return rt2x00dev->chip.rev; | 945 | return rt2x00dev->chip.rev; |
945 | } | 946 | } |
946 | 947 | ||
947 | static inline bool rt2x00_check_rev(struct rt2x00_dev *rt2x00dev, | ||
948 | const u32 mask, const u32 rev) | ||
949 | { | ||
950 | return ((rt2x00dev->chip.rev & mask) == rev); | ||
951 | } | ||
952 | |||
953 | static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, | 948 | static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, |
954 | enum rt2x00_chip_intf intf) | 949 | enum rt2x00_chip_intf intf) |
955 | { | 950 | { |