summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2026-04-15 15:42:04 +0300
committerJohannes Berg <johannes.berg@intel.com>2026-04-28 10:27:45 +0300
commit163ddfd3bbeb3bafc110675e55d0112692d2b2ea (patch)
treece09f839c6c8ba45d8c745beb8c70ac75e111caf
parent0e5c735ef797c9b88bfa8ac817158cfe15db1f0b (diff)
downloadlinux-163ddfd3bbeb3bafc110675e55d0112692d2b2ea.tar.xz
wifi: mac80211: remove ieee80211_sta_cap_chan_bw()
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>
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/tdls.c19
-rw-r--r--net/mac80211/vht.c24
3 files changed, 11 insertions, 34 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 2a693406294b..029600b3b7c0 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -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);
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 90a122dc274f..874752738c68 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -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;
diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c
index 6da8a5021136..c25190bc7c5c 100644
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -434,30 +434,6 @@ _ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta,
}
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)
{
enum ieee80211_sta_rx_bandwidth cur_bw =