summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2020-05-28 21:34:25 +0200
committerJohannes Berg <johannes.berg@intel.com>2020-05-31 11:26:09 +0200
commitafbc9c9e8bfe71e8bd12a8c01bedd969fbab8f0e (patch)
tree3e89d6f0321e31747b75e701d3c5afc8fa944c93 /include/net
parent0e47901d78f0b91901f845c2fc575ae48d8ed395 (diff)
downloadlinux-afbc9c9e8bfe71e8bd12a8c01bedd969fbab8f0e.tar.bz2
cfg80211: add a helper to identify 6 GHz PSCs
This allows identifying whether or not a channel is a PSC (preferred scanning channel). Link: https://lore.kernel.org/r/20200528213443.414363ecf62c.Ic15e681a0e249eab7350a06ceb582cca8bb9a080@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e2dbc9c02ef3..a38653358885 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5278,6 +5278,21 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
}
/**
+ * cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC
+ * @chan: control channel to check
+ *
+ * The Preferred Scanning Channels (PSC) are defined in
+ * Draft IEEE P802.11ax/D5.0, 26.17.2.3.3
+ */
+static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan)
+{
+ if (chan->band != NL80211_BAND_6GHZ)
+ return false;
+
+ return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5;
+}
+
+/**
* ieee80211_get_response_rate - get basic rate for a given rate
*
* @sband: the band to look for rates in