summaryrefslogtreecommitdiffstats
path: root/include/net/ieee80211.h
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2005-10-03 09:50:40 -0500
committerJames Ketrenos <jketreno@linux.intel.com>2005-10-03 09:50:40 -0500
commit7c254d3dba0fae124b1d33f784ca23572ac386b0 (patch)
tree033b9cacdabd184bac9f543308976234ce97146b /include/net/ieee80211.h
parent604116a32eaef4e10d05ae3361450b3f4a4e6a90 (diff)
downloadop-kernel-dev-7c254d3dba0fae124b1d33f784ca23572ac386b0.zip
op-kernel-dev-7c254d3dba0fae124b1d33f784ca23572ac386b0.tar.gz
This will move the ieee80211_is_ofdm_rate function to the ieee80211.h
header, and I also added the ieee80211_is_cck_rate counterpart. Various drivers currently create there own version of these functions, but I guess the ieee80211 stack is the best place to provide such routines. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Diffstat (limited to 'include/net/ieee80211.h')
-rw-r--r--include/net/ieee80211.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 33b595e..58f6222 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -1045,6 +1045,34 @@ static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
}
+static inline int ieee80211_is_ofdm_rate(u8 rate)
+{
+ switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
+ case IEEE80211_OFDM_RATE_6MB:
+ case IEEE80211_OFDM_RATE_9MB:
+ case IEEE80211_OFDM_RATE_12MB:
+ case IEEE80211_OFDM_RATE_18MB:
+ case IEEE80211_OFDM_RATE_24MB:
+ case IEEE80211_OFDM_RATE_36MB:
+ case IEEE80211_OFDM_RATE_48MB:
+ case IEEE80211_OFDM_RATE_54MB:
+ return 1;
+ }
+ return 0;
+}
+
+static inline int ieee80211_is_cck_rate(u8 rate)
+{
+ switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
+ case IEEE80211_CCK_RATE_1MB:
+ case IEEE80211_CCK_RATE_2MB:
+ case IEEE80211_CCK_RATE_5MB:
+ case IEEE80211_CCK_RATE_11MB:
+ return 1;
+ }
+ return 0;
+}
+
/* ieee80211.c */
extern void free_ieee80211(struct net_device *dev);
extern struct net_device *alloc_ieee80211(int sizeof_priv);
OpenPOWER on IntegriCloud