From: Johannes Berg There are three versions of this function, but now there's no caller to ieee80211_sta_cap_rx_bw() and the chandef is always given. Rename the functions to have one underscore less and rely on the chandef being passed. Signed-off-by: Johannes Berg --- net/mac80211/chan.c | 2 +- net/mac80211/ieee80211_i.h | 9 ++------- net/mac80211/tdls.c | 6 +++--- net/mac80211/vht.c | 28 ++++++++-------------------- 4 files changed, 14 insertions(+), 31 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 606d768b62cb..6beebbc93c3c 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -403,7 +403,7 @@ ieee80211_get_sta_bw(struct sta_info *sta, struct ieee80211_link_data *link) * capabilities here. Calling it RX bandwidth capability is a bit * wrong though, since capabilities are in fact symmetric. */ - width = _ieee80211_sta_cap_rx_bw(link_sta, &link->conf->chanreq.oper); + width = ieee80211_sta_cap_rx_bw(link_sta, &link->conf->chanreq.oper); if (width == IEEE80211_STA_RX_BW_20 && !link_sta->pub->ht_cap.ht_supported && diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a683a79b7dcc..8a5640cdf298 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -2278,13 +2278,8 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, const struct ieee80211_vht_cap *vht_cap_ie2, struct link_sta_info *link_sta); enum ieee80211_sta_rx_bandwidth -_ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, - struct cfg80211_chan_def *chandef); -static inline enum ieee80211_sta_rx_bandwidth -ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta) -{ - return _ieee80211_sta_cap_rx_bw(link_sta, NULL); -} +ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, + struct cfg80211_chan_def *chandef); enum ieee80211_sta_rx_bandwidth _ieee80211_sta_cur_vht_bw(struct link_sta_info *link_sta, struct cfg80211_chan_def *chandef); diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 874752738c68..dcb5fe98ec55 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -314,7 +314,7 @@ ieee80211_tdls_chandef_vht_upgrade(struct ieee80211_sub_if_data *sdata, enum nl80211_chan_width max_width; int i; - switch (ieee80211_sta_cap_rx_bw(&sta->deflink)) { + switch (ieee80211_sta_cap_rx_bw(&sta->deflink, &uc)) { case IEEE80211_STA_RX_BW_20: max_width = NL80211_CHAN_WIDTH_20; break; @@ -1337,8 +1337,8 @@ static void iee80211_tdls_recalc_chanctx(struct ieee80211_sub_if_data *sdata, enum ieee80211_sta_rx_bandwidth bw; bw = ieee80211_chan_width_to_rx_bw(conf->def.width); - bw = min(bw, _ieee80211_sta_cap_rx_bw(&sta->deflink, - &conf->def)); + bw = min(bw, ieee80211_sta_cap_rx_bw(&sta->deflink, + &conf->def)); if (bw != sta->sta.deflink.bandwidth) { sta->sta.deflink.bandwidth = bw; rate_control_rate_update(local, sband, diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c index 1bde9adac5a6..f8992d71fd19 100644 --- a/net/mac80211/vht.c +++ b/net/mac80211/vht.c @@ -329,31 +329,16 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, /* FIXME: move this to some better location - parses HE/EHT now */ static enum ieee80211_sta_rx_bandwidth -__ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, - struct cfg80211_chan_def *chandef) +_ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, enum nl80211_band band) { - unsigned int link_id = link_sta->link_id; - struct ieee80211_sub_if_data *sdata = link_sta->sta->sdata; struct ieee80211_sta_vht_cap *vht_cap = &link_sta->pub->vht_cap; struct ieee80211_sta_he_cap *he_cap = &link_sta->pub->he_cap; struct ieee80211_sta_eht_cap *eht_cap = &link_sta->pub->eht_cap; u32 cap_width; if (he_cap->has_he) { - enum nl80211_band band; u8 info; - if (chandef) { - band = chandef->chan->band; - } else { - struct ieee80211_bss_conf *link_conf; - - rcu_read_lock(); - link_conf = rcu_dereference(sdata->vif.link_conf[link_id]); - band = link_conf->chanreq.oper.chan->band; - rcu_read_unlock(); - } - if (eht_cap->has_eht && band == NL80211_BAND_6GHZ) { info = eht_cap->eht_cap_elem.phy_cap_info[0]; @@ -402,8 +387,8 @@ __ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, } enum ieee80211_sta_rx_bandwidth -_ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, - struct cfg80211_chan_def *chandef) +ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, + struct cfg80211_chan_def *chandef) { /* * With RX OMI, also pretend that the STA's capability changed. @@ -419,7 +404,7 @@ _ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta, * the transition we already need to change TX/RX separately, * so _ieee80211_sta_cur_vht_bw() below applies the _tx one. */ - return min(__ieee80211_sta_cap_rx_bw(link_sta, chandef), + return min(_ieee80211_sta_cap_rx_bw(link_sta, chandef->chan->band), link_sta->rx_omi_bw_rx); } @@ -431,9 +416,11 @@ _ieee80211_sta_cur_vht_bw(struct link_sta_info *link_sta, struct sta_info *sta = link_sta->sta; enum nl80211_chan_width bss_width; enum ieee80211_sta_rx_bandwidth bw; + enum nl80211_band band; if (chandef) { bss_width = chandef->width; + band = chandef->chan->band; } else { struct ieee80211_bss_conf *link_conf; @@ -444,11 +431,12 @@ _ieee80211_sta_cur_vht_bw(struct link_sta_info *link_sta, return IEEE80211_STA_RX_BW_20; } bss_width = link_conf->chanreq.oper.width; + band = link_conf->chanreq.oper.chan->band; rcu_read_unlock(); } /* intentionally do not take rx_bw_omi_rx into account */ - bw = __ieee80211_sta_cap_rx_bw(link_sta, chandef); + bw = _ieee80211_sta_cap_rx_bw(link_sta, band); bw = min(bw, link_sta->cur_max_bandwidth); /* but do apply rx_omi_bw_tx */ bw = min(bw, link_sta->rx_omi_bw_tx); -- 2.53.0