Search Linux Wireless

[PATCH v10 4/4] mac80211: CSA on non-transmitting interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: John Crispin <john@xxxxxxxxxxx>

Trigger ieee80211_csa_finish() on the non-transmitting interfaces
when channel switch concludes on the transmitting interface.

The mutex wiphy->mtx is released before locking sdata->local->iflist_mtx
to avoid deadlock with any other code path which may be using the same
mutexes in opposite order.

Signed-off-by: John Crispin <john@xxxxxxxxxxx>
Co-developed-by: Aloka Dixit <alokad@xxxxxxxxxxxxxx>
Signed-off-by: Aloka Dixit <alokad@xxxxxxxxxxxxxx>
---
v10: Used iflist_mtx instead of rcu_read_lock() as most other accesses
     to sdata->local->interfaces do so.

 net/mac80211/cfg.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index db21e1a621b1..5ca75a23d54c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3254,8 +3254,21 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif)
 {
 	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
 
-	ieee80211_queue_work(&sdata->local->hw,
-			     &sdata->csa_finalize_work);
+	if (sdata->vif.mbssid.flags & IEEE80211_VIF_MBSSID_TX) {
+		struct ieee80211_sub_if_data *child;
+
+		wiphy_unlock(sdata->local->hw.wiphy);
+		mutex_lock(&sdata->local->iflist_mtx);
+		list_for_each_entry(child, &sdata->local->interfaces, list)
+			if (child->vif.mbssid.parent == vif &&
+			    ieee80211_sdata_running(child))
+				ieee80211_queue_work(&child->local->hw,
+						     &child->csa_finalize_work);
+		mutex_unlock(&sdata->local->iflist_mtx);
+		wiphy_lock(sdata->local->hw.wiphy);
+	}
+
+	ieee80211_queue_work(&sdata->local->hw, &sdata->csa_finalize_work);
 }
 EXPORT_SYMBOL(ieee80211_csa_finish);
 
-- 
2.31.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux