]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211: set cur_max_bandwidth to maximum
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Apr 2026 12:42:00 +0000 (14:42 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Apr 2026 07:27:44 +0000 (09:27 +0200)
Instead of calculating the individual maximum for each
station from its capabilities, just unconditionally set
cur_max_bandwidth to IEEE80211_STA_RX_BW_MAX. This still
works because cur_max_bandwidth is only used together
with the capabilities of the station anyway, and then
adjusted by HT channel width notification or VHT opmode
notification action frames.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260415144514.43cdb11b5c7e.I99a7ea2ab10b6fffb68a401a26b98d546e428c11@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/eht.c
net/mac80211/he.c
net/mac80211/ht.c
net/mac80211/sta_info.c
net/mac80211/sta_info.h
net/mac80211/vht.c

index e88f28edfd57d536f77c37e4d1b706483a9b0d5e..284b90aeb3e1af7870617c9b8a9ab3a4f839de43 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * EHT handling
  *
- * Copyright(c) 2021-2025 Intel Corporation
+ * Copyright(c) 2021-2026 Intel Corporation
  */
 
 #include "driver-ops.h"
@@ -74,7 +74,6 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata,
 
        eht_cap->has_eht = true;
 
-       link_sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(link_sta);
        link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
 
        /*
index 92d9c4f095b3508a1a1b969bf2cd418f89402d6a..19e2f359b7966b63dbe505f205fef5a0727f0a5f 100644 (file)
@@ -159,7 +159,6 @@ _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);
        link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
 
        if (he_6ghz_capa)
index 97719298e038a2b5ea7b44aa34cf457bbfea80df..8f76440e9e4838e31c3bb1739b91ee47f749ec34 100644 (file)
@@ -291,10 +291,6 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
 
        link_sta->pub->bandwidth = bw;
 
-       link_sta->cur_max_bandwidth =
-               ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?
-                               IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20;
-
        if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
            sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
            sta->sdata->vif.type == NL80211_IFTYPE_NAN ||
index 4c31ef8817ce07a559ce589e826ac726427e0645..e08db1b0cb3011e63ab97c66cc97b47f1534ce52 100644 (file)
@@ -572,6 +572,8 @@ static int sta_info_alloc_link(struct ieee80211_local *local,
        link_info->rx_omi_bw_tx = IEEE80211_STA_RX_BW_MAX;
        link_info->rx_omi_bw_staging = IEEE80211_STA_RX_BW_MAX;
 
+       link_info->cur_max_bandwidth = IEEE80211_STA_RX_BW_MAX;
+
        /*
         * Cause (a) warning(s) if IEEE80211_STA_RX_BW_MAX != 320
         * or if new values are added to the enum.
index 3e5d003bd31f183460a3daf1d6e45862e50a78db..05a776dba3e908e4fb4ca4a2b0f9761826247ebd 100644 (file)
@@ -504,7 +504,7 @@ struct ieee80211_fragment_cache {
  * @status_stats.last_ack_signal: last ACK signal
  * @status_stats.ack_signal_filled: last ACK signal validity
  * @status_stats.avg_ack_signal: average ACK signal
- * @cur_max_bandwidth: maximum bandwidth to use for TX to the station,
+ * @cur_max_bandwidth: dynamic bandwidth limit for the station,
  *     taken from HT/VHT capabilities or VHT operating mode notification.
  *     Invalid for NAN since that is operating on multiple bands.
  * @rx_omi_bw_rx: RX OMI bandwidth restriction to apply for RX
index edce0b16dc3dc472ef2ef99bb517f0ab93a1bbb0..6da8a502113645ee65a7eb047785da98ab1533f5 100644 (file)
@@ -301,29 +301,6 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
                return;
        }
 
-       /* finally set up the bandwidth */
-       switch (vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
-       case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
-       case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ:
-               link_sta->cur_max_bandwidth = IEEE80211_STA_RX_BW_160;
-               break;
-       default:
-               link_sta->cur_max_bandwidth = IEEE80211_STA_RX_BW_80;
-
-               if (!(vht_cap->vht_mcs.tx_highest &
-                               cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE)))
-                       break;
-
-               /*
-                * If this is non-zero, then it does support 160 MHz after all,
-                * in one form or the other. We don't distinguish here (or even
-                * above) between 160 and 80+80 yet.
-                */
-               if (cap_info & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK)
-                       link_sta->cur_max_bandwidth =
-                               IEEE80211_STA_RX_BW_160;
-       }
-
        link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
 
        /*