diff options
author | Johannes Berg <johannes.berg@intel.com> | 2022-10-05 13:52:26 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-10-07 15:23:45 +0200 |
commit | 9b41a9d7dca0159723172a47097b3f2352e37e44 (patch) | |
tree | c09ff70ce96611fde74ad527fd24dc7d33bf79ff /net/mac80211/link.c | |
parent | c2b6b1c13e17cdef76e01349f4aa6f035cfad063 (diff) | |
download | linux-9b41a9d7dca0159723172a47097b3f2352e37e44.tar.bz2 |
wifi: mac80211: recalc station aggregate data during link switch
During link switching, the active links change, so we need to
recalculate the aggregate data in the stations.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/link.c')
-rw-r--r-- | net/mac80211/link.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/mac80211/link.c b/net/mac80211/link.c index e309708abae8..d1f5a9f7c647 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -357,6 +357,11 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata, list_for_each_entry(sta, &local->sta_list, list) { if (sdata != sta->sdata) continue; + + /* this is very temporary, but do it anyway */ + __ieee80211_sta_recalc_aggregates(sta, + old_active | active_links); + ret = drv_change_sta_links(local, sdata, &sta->sta, old_active, old_active | active_links); @@ -369,10 +374,22 @@ static int _ieee80211_set_active_links(struct ieee80211_sub_if_data *sdata, list_for_each_entry(sta, &local->sta_list, list) { if (sdata != sta->sdata) continue; + + __ieee80211_sta_recalc_aggregates(sta, active_links); + ret = drv_change_sta_links(local, sdata, &sta->sta, old_active | active_links, active_links); WARN_ON_ONCE(ret); + + /* + * Do it again, just in case - the driver might very + * well have called ieee80211_sta_recalc_aggregates() + * from there when filling in the new links, which + * would set it wrong since the vif's active links are + * not switched yet... + */ + __ieee80211_sta_recalc_aggregates(sta, active_links); } for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { |