wifi: mac80211: remove NAN guards on ieee80211_sta_cur_vht_bw() calls

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>
This commit is contained in:
Johannes Berg 2026-04-15 14:41:59 +02:00
parent 9dcc1af3bb
commit 8b02fd2c64
2 changed files with 6 additions and 8 deletions

View 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);

View 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]);