mt76: update to version 2022-12-01
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / subsys / 325-v5.18-mac80211-MBSSID-channel-switch.patch
1 From: John Crispin <john@phrozen.org>
2 Date: Thu, 24 Feb 2022 12:54:59 +0100
3 Subject: [PATCH] mac80211: MBSSID channel switch
4
5 Trigger ieee80211_csa_finish() on the non-transmitting interfaces
6 when channel switch concludes on the transmitting interface.
7
8 Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
11 Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
12 Signed-off-by: John Crispin <john@phrozen.org>
13 Link: https://lore.kernel.org/r/6fde4d7f9fa387494f46a7aa4a584478dcda06f1.1645702516.git.lorenzo@kernel.org
14 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
15 ---
16
17 --- a/net/mac80211/cfg.c
18 +++ b/net/mac80211/cfg.c
19 @@ -3247,9 +3247,31 @@ cfg80211_beacon_dup(struct cfg80211_beac
20 void ieee80211_csa_finish(struct ieee80211_vif *vif)
21 {
22 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
23 + struct ieee80211_local *local = sdata->local;
24
25 - ieee80211_queue_work(&sdata->local->hw,
26 - &sdata->csa_finalize_work);
27 + rcu_read_lock();
28 +
29 + if (vif->mbssid_tx_vif == vif) {
30 + /* Trigger ieee80211_csa_finish() on the non-transmitting
31 + * interfaces when channel switch is received on
32 + * transmitting interface
33 + */
34 + struct ieee80211_sub_if_data *iter;
35 +
36 + list_for_each_entry_rcu(iter, &local->interfaces, list) {
37 + if (!ieee80211_sdata_running(iter))
38 + continue;
39 +
40 + if (iter == sdata || iter->vif.mbssid_tx_vif != vif)
41 + continue;
42 +
43 + ieee80211_queue_work(&iter->local->hw,
44 + &iter->csa_finalize_work);
45 + }
46 + }
47 + ieee80211_queue_work(&local->hw, &sdata->csa_finalize_work);
48 +
49 + rcu_read_unlock();
50 }
51 EXPORT_SYMBOL(ieee80211_csa_finish);
52