All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation
@ 2015-01-04 10:13 Eliad Peller
  2015-01-04 10:13 ` [PATCH 2/3] mac80211: don't defer scans in case of radar detection Eliad Peller
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Eliad Peller @ 2015-01-04 10:13 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

no need to consider all the vifs, but only the ones
that have this context assigned.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
This patch was already sent previously as part of a different patchset
(in which the other patch was later dropped).
However, i don't see it in patchwork, so resend it.

 net/mac80211/chan.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 5d6dae9..7f83451 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -388,22 +388,31 @@ ieee80211_find_chanctx(struct ieee80211_local *local,
 	return NULL;
 }
 
-static bool ieee80211_is_radar_required(struct ieee80211_local *local)
+static bool ieee80211_is_radar_required(struct ieee80211_local *local,
+					struct ieee80211_chanctx *ctx)
 {
+	struct ieee80211_chanctx_conf *conf = &ctx->conf;
 	struct ieee80211_sub_if_data *sdata;
+	bool required = false;
 
+	lockdep_assert_held(&local->chanctx_mtx);
 	lockdep_assert_held(&local->mtx);
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		if (sdata->radar_required) {
-			rcu_read_unlock();
-			return true;
-		}
+		if (!ieee80211_sdata_running(sdata))
+			continue;
+		if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
+			continue;
+		if (!sdata->radar_required)
+			continue;
+
+		required = true;
+		break;
 	}
 	rcu_read_unlock();
 
-	return false;
+	return required;
 }
 
 static struct ieee80211_chanctx *
@@ -425,7 +434,7 @@ ieee80211_alloc_chanctx(struct ieee80211_local *local,
 	ctx->conf.rx_chains_static = 1;
 	ctx->conf.rx_chains_dynamic = 1;
 	ctx->mode = mode;
-	ctx->conf.radar_enabled = ieee80211_is_radar_required(local);
+	ctx->conf.radar_enabled = ieee80211_is_radar_required(local, ctx);
 	ieee80211_recalc_chanctx_min_def(local, ctx);
 
 	return ctx;
@@ -570,7 +579,7 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
 	/* for setting local->radar_detect_enabled */
 	lockdep_assert_held(&local->mtx);
 
-	radar_enabled = ieee80211_is_radar_required(local);
+	radar_enabled = ieee80211_is_radar_required(local, chanctx);
 
 	if (radar_enabled == chanctx->conf.radar_enabled)
 		return;
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-01-07 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-04 10:13 [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Eliad Peller
2015-01-04 10:13 ` [PATCH 2/3] mac80211: don't defer scans in case of radar detection Eliad Peller
2015-01-04 10:13 ` [PATCH 3/3] mac80211: always recalc_radar on chanctx changes Eliad Peller
2015-01-06 11:04 ` [PATCH 1/3] mac80211: consider only relevant vifs for radar_required calculation Johannes Berg
2015-01-06 14:05   ` Johannes Berg
2015-01-06 14:14     ` Johannes Berg
2015-01-06 18:57       ` Eliad Peller
2015-01-06 19:02         ` Johannes Berg
2015-01-06 19:36           ` Eliad Peller
2015-01-07 15:58             ` Eliad Peller
2015-01-07 16:32               ` Johannes Berg
2015-01-07 16:42                 ` Eliad Peller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.