7eb1092
Currently the only way for wireless drivers to tell whether or not OFDM
7eb1092
is allowed on the current channel is to check the regulatory
7eb1092
information. However, this requires hodling cfg80211_mutex, which is not
7eb1092
visible to the drivers.
7eb1092
7eb1092
Other regulatory restrictions are provided as flags in the channel
7eb1092
definition, so let's do similarly with OFDM. This patch adds a new flag,
7eb1092
IEEE80211_CHAN_NO_OFDM, to tell drivers that OFDM on a channel is not
7eb1092
allowed. This flag is set on any channels for which regulatory indicates
7eb1092
that OFDM is prohibited.
7eb1092
7eb1092
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
7eb1092
---
7eb1092
 include/net/cfg80211.h |    2 ++
7eb1092
 net/wireless/reg.c     |    2 ++
7eb1092
 2 files changed, 4 insertions(+)
7eb1092
7eb1092
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
7eb1092
index 493fa0c..3d254e1 100644
7eb1092
--- a/include/net/cfg80211.h
7eb1092
+++ b/include/net/cfg80211.h
7eb1092
@@ -96,6 +96,7 @@ enum ieee80211_band {
7eb1092
  * 	is not permitted.
7eb1092
  * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
7eb1092
  * 	is not permitted.
7eb1092
+ * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel.
7eb1092
  */
7eb1092
 enum ieee80211_channel_flags {
7eb1092
 	IEEE80211_CHAN_DISABLED		= 1<<0,
7eb1092
@@ -104,6 +105,7 @@ enum ieee80211_channel_flags {
7eb1092
 	IEEE80211_CHAN_RADAR		= 1<<3,
7eb1092
 	IEEE80211_CHAN_NO_HT40PLUS	= 1<<4,
7eb1092
 	IEEE80211_CHAN_NO_HT40MINUS	= 1<<5,
7eb1092
+	IEEE80211_CHAN_NO_OFDM		= 1<<6,
7eb1092
 };
7eb1092
 
7eb1092
 #define IEEE80211_CHAN_NO_HT40 \
7eb1092
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
7eb1092
index 2303ee7..0f3a8a1 100644
7eb1092
--- a/net/wireless/reg.c
7eb1092
+++ b/net/wireless/reg.c
7eb1092
@@ -680,6 +680,8 @@ static u32 map_regdom_flags(u32 rd_flags)
7eb1092
 		channel_flags |= IEEE80211_CHAN_NO_IBSS;
7eb1092
 	if (rd_flags & NL80211_RRF_DFS)
7eb1092
 		channel_flags |= IEEE80211_CHAN_RADAR;
7eb1092
+	if (rd_flags & NL80211_RRF_NO_OFDM)
7eb1092
+		channel_flags |= IEEE80211_CHAN_NO_OFDM;
7eb1092
 	return channel_flags;
7eb1092
 }
7eb1092
 
7eb1092
-- 
7eb1092
1.7.9.5
7eb1092