summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-08-01 17:00:55 +0200
committerJohannes Berg <johannes.berg@intel.com>2013-04-16 15:29:43 +0200
commit1ce3e82b0eb472161313183be0033e46d5c4bbaf (patch)
tree120caf85a20d1f9b480b69cbb284dfd3a3ca5483 /net
parent37799e52a29af2268d1fbe18908a0d6b9f68af88 (diff)
cfg80211: add ieee80211_operating_class_to_band
This function converts a (global only!) operating class to an internal band identifier. This will be needed for extended channel switch support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 37a56ee1e1ed..3d8a1334f4a9 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1155,6 +1155,26 @@ int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
}
EXPORT_SYMBOL(cfg80211_get_p2p_attr);
+bool ieee80211_operating_class_to_band(u8 operating_class,
+ enum ieee80211_band *band)
+{
+ switch (operating_class) {
+ case 112:
+ case 115 ... 127:
+ *band = IEEE80211_BAND_5GHZ;
+ return true;
+ case 81:
+ case 82:
+ case 83:
+ case 84:
+ *band = IEEE80211_BAND_2GHZ;
+ return true;
+ }
+
+ return false;
+}
+EXPORT_SYMBOL(ieee80211_operating_class_to_band);
+
int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
u32 beacon_int)
{