aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00.h
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-04-11 08:31:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-12 15:22:11 -0400
commit8d0c9b65c904c6943566ccd2919c6a5ee6292c6b (patch)
tree39bec7664e3bc8bf9664cb987581a2ba4d869c3e /drivers/net/wireless/rt2x00/rt2x00.h
parente148b4c82a6269aa19476e4865afe8aa84360c8f (diff)
rt2x00: Refactor rt2800 version constants.
The rt2800 version constants are inconsistent, and the version number don't mean a lot of things anyway. Refactor the constants to have some more meaningful names, and introduce and use some new helpers to check these chipset revisions. At the same time rename to revision, as they are more revision numbers rather than version numbers. 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.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 16aa850d3700..4de505b98331 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -929,12 +929,12 @@ static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
929 rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev); 929 rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev);
930} 930}
931 931
932static inline char rt2x00_rt(struct rt2x00_dev *rt2x00dev, const u16 rt) 932static inline bool rt2x00_rt(struct rt2x00_dev *rt2x00dev, const u16 rt)
933{ 933{
934 return (rt2x00dev->chip.rt == rt); 934 return (rt2x00dev->chip.rt == rt);
935} 935}
936 936
937static inline char rt2x00_rf(struct rt2x00_dev *rt2x00dev, const u16 rf) 937static inline bool rt2x00_rf(struct rt2x00_dev *rt2x00dev, const u16 rf)
938{ 938{
939 return (rt2x00dev->chip.rf == rf); 939 return (rt2x00dev->chip.rf == rf);
940} 940}
@@ -944,6 +944,24 @@ static inline u16 rt2x00_rev(struct rt2x00_dev *rt2x00dev)
944 return rt2x00dev->chip.rev; 944 return rt2x00dev->chip.rev;
945} 945}
946 946
947static inline bool rt2x00_rt_rev(struct rt2x00_dev *rt2x00dev,
948 const u16 rt, const u16 rev)
949{
950 return (rt2x00_rt(rt2x00dev, rt) && rt2x00_rev(rt2x00dev) == rev);
951}
952
953static inline bool rt2x00_rt_rev_lt(struct rt2x00_dev *rt2x00dev,
954 const u16 rt, const u16 rev)
955{
956 return (rt2x00_rt(rt2x00dev, rt) && rt2x00_rev(rt2x00dev) < rev);
957}
958
959static inline bool rt2x00_rt_rev_gte(struct rt2x00_dev *rt2x00dev,
960 const u16 rt, const u16 rev)
961{
962 return (rt2x00_rt(rt2x00dev, rt) && rt2x00_rev(rt2x00dev) >= rev);
963}
964
947static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev, 965static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev,
948 enum rt2x00_chip_intf intf) 966 enum rt2x00_chip_intf intf)
949{ 967{