aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-08-01 11:00:55 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-16 09:29:43 -0400
commit1ce3e82b0eb472161313183be0033e46d5c4bbaf (patch)
tree120caf85a20d1f9b480b69cbb284dfd3a3ca5483
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>
-rw-r--r--include/net/cfg80211.h11
-rw-r--r--net/wireless/util.c20
2 files changed, 31 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 57870b646974..dff96d8cafcd 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4024,6 +4024,17 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
4024void cfg80211_ch_switch_notify(struct net_device *dev, 4024void cfg80211_ch_switch_notify(struct net_device *dev,
4025 struct cfg80211_chan_def *chandef); 4025 struct cfg80211_chan_def *chandef);
4026 4026
4027/**
4028 * ieee80211_operating_class_to_band - convert operating class to band
4029 *
4030 * @operating_class: the operating class to convert
4031 * @band: band pointer to fill
4032 *
4033 * Returns %true if the conversion was successful, %false otherwise.
4034 */
4035bool ieee80211_operating_class_to_band(u8 operating_class,
4036 enum ieee80211_band *band);
4037
4027/* 4038/*
4028 * cfg80211_tdls_oper_request - request userspace to perform TDLS operation 4039 * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
4029 * @dev: the device on which the operation is requested 4040 * @dev: the device on which the operation is requested
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}
1156EXPORT_SYMBOL(cfg80211_get_p2p_attr); 1156EXPORT_SYMBOL(cfg80211_get_p2p_attr);
1157 1157
1158bool 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}
1176EXPORT_SYMBOL(ieee80211_operating_class_to_band);
1177
1158int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, 1178int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
1159 u32 beacon_int) 1179 u32 beacon_int)
1160{ 1180{