diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-08-01 11:00:55 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-16 09:29:43 -0400 |
commit | 1ce3e82b0eb472161313183be0033e46d5c4bbaf (patch) | |
tree | 120caf85a20d1f9b480b69cbb284dfd3a3ca5483 /net/wireless/util.c | |
parent | 37799e52a29af2268d1fbe18908a0d6b9f68af88 (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/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 20 |
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, | |||
1155 | } | 1155 | } |
1156 | EXPORT_SYMBOL(cfg80211_get_p2p_attr); | 1156 | EXPORT_SYMBOL(cfg80211_get_p2p_attr); |
1157 | 1157 | ||
1158 | bool ieee80211_operating_class_to_band(u8 operating_class, | ||
1159 | enum ieee80211_band *band) | ||
1160 | { | ||
1161 | switch (operating_class) { | ||
1162 | case 112: | ||
1163 | case 115 ... 127: | ||
1164 | *band = IEEE80211_BAND_5GHZ; | ||
1165 | return true; | ||
1166 | case 81: | ||
1167 | case 82: | ||
1168 | case 83: | ||
1169 | case 84: | ||
1170 | *band = IEEE80211_BAND_2GHZ; | ||
1171 | return true; | ||
1172 | } | ||
1173 | |||
1174 | return false; | ||
1175 | } | ||
1176 | EXPORT_SYMBOL(ieee80211_operating_class_to_band); | ||
1177 | |||
1158 | int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, | 1178 | int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, |
1159 | u32 beacon_int) | 1179 | u32 beacon_int) |
1160 | { | 1180 | { |