OSDN Git Service

cfg80211: add no HE indication to the channel flag
authorHaim Dreyfuss <haim.dreyfuss@intel.com>
Tue, 21 Jan 2020 08:12:13 +0000 (10:12 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Feb 2020 11:34:09 +0000 (12:34 +0100)
The regulatory domain might forbid HE operation.  Certain regulatory
domains may restrict it for specific channels whereas others may do it
for the whole regulatory domain.

Add an option to indicate it in the channel flag.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20200121081213.733757-1-luca@coelho.fi
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c
net/wireless/reg.c

index fa027d0..40f2a3a 100644 (file)
@@ -95,6 +95,7 @@ struct wiphy;
  *     on this channel.
  * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
  *     on this channel.
+ * @IEEE80211_CHAN_NO_HE: HE operation is not permitted on this channel.
  *
  */
 enum ieee80211_channel_flags {
@@ -111,6 +112,7 @@ enum ieee80211_channel_flags {
        IEEE80211_CHAN_IR_CONCURRENT    = 1<<10,
        IEEE80211_CHAN_NO_20MHZ         = 1<<11,
        IEEE80211_CHAN_NO_10MHZ         = 1<<12,
+       IEEE80211_CHAN_NO_HE            = 1<<13,
 };
 
 #define IEEE80211_CHAN_NO_HT40 \
index 809ef91..d996bac 100644 (file)
@@ -3587,6 +3587,8 @@ enum nl80211_wmm_rule {
  * @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations.
  *     This is a nested attribute that contains the wmm limitation per AC.
  *     (see &enum nl80211_wmm_rule)
+ * @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel
+ *     in current regulatory domain.
  * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
  *     currently defined
  * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -3616,6 +3618,7 @@ enum nl80211_frequency_attr {
        NL80211_FREQUENCY_ATTR_NO_20MHZ,
        NL80211_FREQUENCY_ATTR_NO_10MHZ,
        NL80211_FREQUENCY_ATTR_WMM,
+       NL80211_FREQUENCY_ATTR_NO_HE,
 
        /* keep last */
        __NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -3813,6 +3816,7 @@ enum nl80211_sched_scan_match_attr {
  * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
  * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
  * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
+ * @NL80211_RRF_NO_HE: HE operation not allowed
  */
 enum nl80211_reg_rule_flags {
        NL80211_RRF_NO_OFDM             = 1<<0,
@@ -3830,6 +3834,7 @@ enum nl80211_reg_rule_flags {
        NL80211_RRF_NO_HT40PLUS         = 1<<14,
        NL80211_RRF_NO_80MHZ            = 1<<15,
        NL80211_RRF_NO_160MHZ           = 1<<16,
+       NL80211_RRF_NO_HE               = 1<<17,
 };
 
 #define NL80211_RRF_PASSIVE_SCAN       NL80211_RRF_NO_IR
index 00f24d4..d8cdbf0 100644 (file)
@@ -972,6 +972,9 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy,
                if ((chan->flags & IEEE80211_CHAN_NO_10MHZ) &&
                    nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_10MHZ))
                        goto nla_put_failure;
+               if ((chan->flags & IEEE80211_CHAN_NO_HE) &&
+                   nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HE))
+                       goto nla_put_failure;
        }
 
        if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
index 446c76d..ea7bc56 100644 (file)
@@ -1569,6 +1569,8 @@ static u32 map_regdom_flags(u32 rd_flags)
                channel_flags |= IEEE80211_CHAN_NO_80MHZ;
        if (rd_flags & NL80211_RRF_NO_160MHZ)
                channel_flags |= IEEE80211_CHAN_NO_160MHZ;
+       if (rd_flags & NL80211_RRF_NO_HE)
+               channel_flags |= IEEE80211_CHAN_NO_HE;
        return channel_flags;
 }