]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cfg80211: add ieee80211_operating_class_to_band
authorJohannes Berg <johannes.berg@intel.com>
Wed, 1 Aug 2012 15:00:55 +0000 (17:00 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Apr 2013 13:29:43 +0000 (15:29 +0200)
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>
include/net/cfg80211.h
net/wireless/util.c

index 57870b6469748b9f68f8912c6f8efe0978c26395..dff96d8cafcd6e59d91751ab5b1bb498f9d2bd54 100644 (file)
@@ -4024,6 +4024,17 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
 void cfg80211_ch_switch_notify(struct net_device *dev,
                               struct cfg80211_chan_def *chandef);
 
+/**
+ * ieee80211_operating_class_to_band - convert operating class to band
+ *
+ * @operating_class: the operating class to convert
+ * @band: band pointer to fill
+ *
+ * Returns %true if the conversion was successful, %false otherwise.
+ */
+bool ieee80211_operating_class_to_band(u8 operating_class,
+                                      enum ieee80211_band *band);
+
 /*
  * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
  * @dev: the device on which the operation is requested
index 37a56ee1e1ede8cc5f698901edabe26a6b397f62..3d8a1334f4a9c7414076ec47d032dc63754ab930 100644 (file)
@@ -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)
 {