wifi: mac80211: make ieee80211_check_rate_mask() link-aware

Change ieee80211_check_rate_mask() to use a link rather than
the sdata and deflink/bss_conf.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2022-07-11 15:13:20 +02:00
parent 8ec9a96b83
commit de03f8ac5c
4 changed files with 8 additions and 7 deletions

View File

@ -2524,7 +2524,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
params->basic_rates_len,
&sdata->vif.bss_conf.basic_rates);
changed |= BSS_CHANGED_BASIC_RATES;
ieee80211_check_rate_mask(sdata);
ieee80211_check_rate_mask(&sdata->deflink);
}
if (params->ap_isolate >= 0) {

View File

@ -2361,7 +2361,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
memcpy(link->u.mgd.bssid, cbss->bssid, ETH_ALEN);
memcpy(sdata->vif.cfg.ap_addr, cbss->bssid, ETH_ALEN);
ieee80211_check_rate_mask(sdata);
ieee80211_check_rate_mask(link);
if (sdata->vif.p2p ||
sdata->vif.driver_flags & IEEE80211_VIF_GET_NOA_UPDATE) {

View File

@ -270,17 +270,18 @@ static void rate_control_free(struct ieee80211_local *local,
kfree(ctrl_ref);
}
void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata)
void ieee80211_check_rate_mask(struct ieee80211_link_data *link)
{
struct ieee80211_sub_if_data *sdata = link->sdata;
struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband;
u32 user_mask, basic_rates = sdata->vif.bss_conf.basic_rates;
u32 user_mask, basic_rates = link->conf->basic_rates;
enum nl80211_band band;
if (WARN_ON(!sdata->vif.bss_conf.chandef.chan))
if (WARN_ON(!link->conf->chandef.chan))
return;
band = sdata->vif.bss_conf.chandef.chan->band;
band = link->conf->chandef.chan->band;
if (band == NL80211_BAND_S1GHZ) {
/* TODO */
return;

View File

@ -85,7 +85,7 @@ static inline void rate_control_add_debugfs(struct ieee80211_local *local)
#endif
}
void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata);
void ieee80211_check_rate_mask(struct ieee80211_link_data *link);
/* Get a reference to the rate control algorithm. If `name' is NULL, get the
* first available algorithm. */