Skip to content

Commit 4dde3c3

Browse files
gomordjmberg-intel
authored andcommitted
mac80211: update channel context before station state
Currently channel context is updated only after station got an update about new assoc state, this results in station using the old channel context. Fix this by moving the update channel context before updating station, enabling the driver to immediately use the updated channel context in the new assoc state. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211129152938.1c80c17ffd8a.I94ae31378b363c1182cfdca46c4b7e7165cff984@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f22d981 commit 4dde3c3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

net/mac80211/sta_info.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,19 +667,22 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
667667

668668
list_add_tail_rcu(&sta->list, &local->sta_list);
669669

670+
/* update channel context before notifying the driver about state
671+
* change, this enables driver using the updated channel context right away.
672+
*/
673+
if (sta->sta_state >= IEEE80211_STA_ASSOC) {
674+
ieee80211_recalc_min_chandef(sta->sdata);
675+
if (!sta->sta.support_p2p_ps)
676+
ieee80211_recalc_p2p_go_ps_allowed(sta->sdata);
677+
}
678+
670679
/* notify driver */
671680
err = sta_info_insert_drv_state(local, sdata, sta);
672681
if (err)
673682
goto out_remove;
674683

675684
set_sta_flag(sta, WLAN_STA_INSERTED);
676685

677-
if (sta->sta_state >= IEEE80211_STA_ASSOC) {
678-
ieee80211_recalc_min_chandef(sta->sdata);
679-
if (!sta->sta.support_p2p_ps)
680-
ieee80211_recalc_p2p_go_ps_allowed(sta->sdata);
681-
}
682-
683686
/* accept BA sessions now */
684687
clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
685688

0 commit comments

Comments
 (0)