blob: 38b0de180ed3b1cc1a0f7c54d04944ce377057bc [file] [log] [blame]
developerf11ee162022-04-12 11:17:45 +08001From: John Crispin <john@phrozen.org>
2Date: Thu, 24 Feb 2022 12:54:59 +0100
3Subject: [PATCH] mac80211: MBSSID channel switch
4
5Trigger ieee80211_csa_finish() on the non-transmitting interfaces
6when channel switch concludes on the transmitting interface.
7
8Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
9Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10Co-developed-by: Aloka Dixit <alokad@codeaurora.org>
11Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
12Signed-off-by: John Crispin <john@phrozen.org>
13Link: https://lore.kernel.org/r/6fde4d7f9fa387494f46a7aa4a584478dcda06f1.1645702516.git.lorenzo@kernel.org
14Signed-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