cfg80211/mac80211: avoid bss color setting in non-HE modes
authorP Praneesh <ppranees@codeaurora.org>
Thu, 9 Jul 2020 02:46:21 +0000 (08:16 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 31 Jul 2020 07:25:12 +0000 (09:25 +0200)
Adding bss-color configuration is only valid in HE mode.
Earlier we have enabled it by default, irrespective of
capabilities/mode. Fix that.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Signed-off-by: P Praneesh <ppranees@codeaurora.org>
Link: https://lore.kernel.org/r/1594262781-21444-1-git-send-email-ppranees@codeaurora.org
[fix up commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/mlme.c
net/wireless/nl80211.c

index 6a6531a50e549dfff3aac9cb5ce587dee452dc96..bbd86cd79954db5b059d3d304413c1a7685b84c5 100644 (file)
@@ -991,9 +991,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
                      BSS_CHANGED_SSID |
                      BSS_CHANGED_P2P_PS |
                      BSS_CHANGED_TXPOWER |
-                     BSS_CHANGED_TWT |
-                     BSS_CHANGED_HE_OBSS_PD |
-                     BSS_CHANGED_HE_BSS_COLOR;
+                     BSS_CHANGED_TWT;
        int i, err;
        int prev_beacon_int;
 
@@ -1019,6 +1017,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
                sdata->vif.bss_conf.frame_time_rts_th =
                        le32_get_bits(params->he_oper->he_oper_params,
                              IEEE80211_HE_OPERATION_RTS_THRESHOLD_MASK);
+               changed |= BSS_CHANGED_HE_OBSS_PD;
+
+               if (!params->he_bss_color.disabled)
+                       changed |= BSS_CHANGED_HE_BSS_COLOR;
        }
 
        mutex_lock(&local->mtx);
index 1c1b3f6bc415446028e6528c7e4ad1fcadc7c2c3..8a92a62dc54d95c0e53a49ee4a14874b36d196d8 100644 (file)
@@ -3463,7 +3463,9 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
                bss_conf->he_bss_color.disabled =
                        le32_get_bits(elems->he_operation->he_oper_params,
                                      IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED);
-               changed |= BSS_CHANGED_HE_BSS_COLOR;
+
+               if (!bss_conf->he_bss_color.disabled)
+                       changed |= BSS_CHANGED_HE_BSS_COLOR;
 
                bss_conf->htc_trig_based_pkt_ext =
                        le32_get_bits(elems->he_operation->he_oper_params,
index 13a38aab1565c95ee1298a49d335f3e8cb69bfbe..b4048f3c51349a71f2ddcfae1493aa5df2928aeb 100644 (file)
@@ -4865,6 +4865,9 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 
        memset(&params, 0, sizeof(params));
 
+       /* disable BSS color by default */
+       params.he_bss_color.disabled = true;
+
        /* these are required for START_AP */
        if (!info->attrs[NL80211_ATTR_BEACON_INTERVAL] ||
            !info->attrs[NL80211_ATTR_DTIM_PERIOD] ||