]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211: remove NAN guards on ieee80211_sta_cur_vht_bw() calls
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Apr 2026 12:41:59 +0000 (14:41 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Apr 2026 07:27:44 +0000 (09:27 +0200)
The NAN guards here make little sense, just don't WARN inside
the function (and return maximum instead of minimum). Otherwise
we need to guard more calls, such as in EHT in the future.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260415144514.be6bc3fd5fdf.I38ce6c763c361a3ce50618e820a0818eb18e49dd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/he.c
net/mac80211/vht.c

index a3e16a5bec2246615b3b13ccc4cdad455039721c..92d9c4f095b3508a1a1b969bf2cd418f89402d6a 100644 (file)
@@ -3,7 +3,7 @@
  * HE handling
  *
  * Copyright(c) 2017 Intel Deutschland GmbH
- * Copyright(c) 2019-2025 Intel Corporation
+ * Copyright(c) 2019-2026 Intel Corporation
  */
 
 #include "ieee80211_i.h"
@@ -160,8 +160,7 @@ _ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
        he_cap->has_he = true;
 
        link_sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(link_sta);
-       if (sdata->vif.type != NL80211_IFTYPE_NAN)
-               link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
+       link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
 
        if (he_6ghz_capa)
                ieee80211_update_from_he_6ghz_capa(he_6ghz_capa, link_sta);
index f3bb5a561a38a673216db7b2190d55471259dabd..edce0b16dc3dc472ef2ef99bb517f0ab93a1bbb0 100644 (file)
@@ -324,8 +324,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
                                IEEE80211_STA_RX_BW_160;
        }
 
-       if (sdata->vif.type != NL80211_IFTYPE_NAN)
-               link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
+       link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
 
        /*
         * Work around the Cisco 9115 FW 17.3 bug by taking the min of
@@ -528,9 +527,9 @@ _ieee80211_sta_cur_vht_bw(struct link_sta_info *link_sta,
                struct ieee80211_bss_conf *link_conf;
 
                /* NAN operates on multiple channels so a chandef must be given */
-               if (WARN_ON_ONCE(sta->sdata->vif.type == NL80211_IFTYPE_NAN ||
-                                sta->sdata->vif.type == NL80211_IFTYPE_NAN_DATA))
-                       return IEEE80211_STA_RX_BW_20;
+               if (sta->sdata->vif.type == NL80211_IFTYPE_NAN ||
+                   sta->sdata->vif.type == NL80211_IFTYPE_NAN_DATA)
+                       return IEEE80211_STA_RX_BW_MAX;
 
                rcu_read_lock();
                link_conf = rcu_dereference(sta->sdata->vif.link_conf[link_sta->link_id]);