]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: remove ieee80211_sta_cap_chan_bw()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Apr 2026 12:42:04 +0000 (14:42 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Apr 2026 07:27:45 +0000 (09:27 +0200)
This function is only used by TDLS, but is more or less equivalent
to ieee80211_sta_cap_rx_bw() (which takes OMI into account, but that
won't be used in TDLS), except it tries to differentiate 80+80 and
160, but then caller doesn't care about that. Remove the function.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260415144514.138728393e2b.I4ea9221cafcfd034dda430e76de82eec59ab1e71@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/tdls.c
net/mac80211/vht.c

index 2a693406294bc1fd7295a2bef24b63a89a905772..029600b3b7c022a426017d3f0eea77da4e6128f5 100644 (file)
@@ -2316,8 +2316,6 @@ ieee80211_sta_cur_vht_bw(struct link_sta_info *link_sta)
        return _ieee80211_sta_cur_vht_bw(link_sta, NULL);
 }
 void ieee80211_sta_init_nss(struct link_sta_info *link_sta);
-enum nl80211_chan_width
-ieee80211_sta_cap_chan_bw(struct link_sta_info *link_sta);
 void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata,
                                 struct ieee80211_link_data *link,
                                 struct ieee80211_mgmt *mgmt);
index 90a122dc274f03307fe1e6441491e7fe9798f9c6..874752738c6831aa633b8059ee3d1fc6b8b06fa5 100644 (file)
@@ -311,17 +311,20 @@ ieee80211_tdls_chandef_vht_upgrade(struct ieee80211_sub_if_data *sdata,
        /* IEEE802.11ac-2013 Table E-4 */
        static const u16 centers_80mhz[] = { 5210, 5290, 5530, 5610, 5690, 5775 };
        struct cfg80211_chan_def uc = sta->tdls_chandef;
-       enum nl80211_chan_width max_width =
-               ieee80211_sta_cap_chan_bw(&sta->deflink);
+       enum nl80211_chan_width max_width;
        int i;
 
-       /* only support upgrading non-narrow channels up to 80Mhz */
-       if (max_width == NL80211_CHAN_WIDTH_5 ||
-           max_width == NL80211_CHAN_WIDTH_10)
-               return;
-
-       if (max_width > NL80211_CHAN_WIDTH_80)
+       switch (ieee80211_sta_cap_rx_bw(&sta->deflink)) {
+       case IEEE80211_STA_RX_BW_20:
+               max_width = NL80211_CHAN_WIDTH_20;
+               break;
+       case IEEE80211_STA_RX_BW_40:
+               max_width = NL80211_CHAN_WIDTH_40;
+               break;
+       default: /* 80 or higher, only support upgrade to 80 */
                max_width = NL80211_CHAN_WIDTH_80;
+               break;
+       }
 
        if (uc.width >= max_width)
                return;
index 6da8a502113645ee65a7eb047785da98ab1533f5..c25190bc7c5cca0caedd2f8b0021ca03b0d74067 100644 (file)
@@ -433,30 +433,6 @@ _ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta,
                   link_sta->rx_omi_bw_rx);
 }
 
-enum nl80211_chan_width
-ieee80211_sta_cap_chan_bw(struct link_sta_info *link_sta)
-{
-       struct ieee80211_sta_vht_cap *vht_cap = &link_sta->pub->vht_cap;
-       u32 cap_width;
-
-       if (!vht_cap->vht_supported) {
-               if (!link_sta->pub->ht_cap.ht_supported)
-                       return NL80211_CHAN_WIDTH_20_NOHT;
-
-               return link_sta->pub->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?
-                               NL80211_CHAN_WIDTH_40 : NL80211_CHAN_WIDTH_20;
-       }
-
-       cap_width = vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
-
-       if (cap_width == IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ)
-               return NL80211_CHAN_WIDTH_160;
-       else if (cap_width == IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
-               return NL80211_CHAN_WIDTH_80P80;
-
-       return NL80211_CHAN_WIDTH_80;
-}
-
 enum nl80211_chan_width
 ieee80211_sta_rx_bw_to_chan_width(struct link_sta_info *link_sta)
 {