Search Linux Wireless

[PATCH 2/4] mac80211: refactor recalculate channel context functions (2)

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

 



Change function ieee80211_recalc_chanctx_chantype's position in the
file, if the change is included in next patch, the next patch's diff
will be a mess...

Signed-off-by: Zhao, Gang <gamerh2o@xxxxxxxxx>
---
 net/mac80211/chan.c | 66 ++++++++++++++++++++++++++---------------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 49fa37e..543beba 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -171,6 +171,39 @@ _ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
 	ieee80211_recalc_chanctx_min_def(local, ctx);
 }
 
+static void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
+					      struct ieee80211_chanctx *ctx)
+{
+	struct ieee80211_chanctx_conf *conf = &ctx->conf;
+	struct ieee80211_sub_if_data *sdata;
+	const struct cfg80211_chan_def *compat = NULL;
+
+	lockdep_assert_held(&local->chanctx_mtx);
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+
+		if (!ieee80211_sdata_running(sdata))
+			continue;
+		if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
+			continue;
+
+		if (!compat)
+			compat = &sdata->vif.bss_conf.chandef;
+
+		compat = cfg80211_chandef_compatible(
+				&sdata->vif.bss_conf.chandef, compat);
+		if (!compat)
+			break;
+	}
+	rcu_read_unlock();
+
+	if (WARN_ON_ONCE(!compat))
+		return;
+
+	_ieee80211_recalc_chanctx_chantype(local, ctx, compat);
+}
+
 static struct ieee80211_chanctx *
 ieee80211_find_chanctx(struct ieee80211_local *local,
 		       const struct cfg80211_chan_def *chandef,
@@ -329,39 +362,6 @@ static int ieee80211_assign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
 	return 0;
 }
 
-static void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
-					      struct ieee80211_chanctx *ctx)
-{
-	struct ieee80211_chanctx_conf *conf = &ctx->conf;
-	struct ieee80211_sub_if_data *sdata;
-	const struct cfg80211_chan_def *compat = NULL;
-
-	lockdep_assert_held(&local->chanctx_mtx);
-
-	rcu_read_lock();
-	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-
-		if (!ieee80211_sdata_running(sdata))
-			continue;
-		if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
-			continue;
-
-		if (!compat)
-			compat = &sdata->vif.bss_conf.chandef;
-
-		compat = cfg80211_chandef_compatible(
-				&sdata->vif.bss_conf.chandef, compat);
-		if (!compat)
-			break;
-	}
-	rcu_read_unlock();
-
-	if (WARN_ON_ONCE(!compat))
-		return;
-
-	_ieee80211_recalc_chanctx_chantype(local, ctx, compat);
-}
-
 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
 					   struct ieee80211_chanctx *chanctx)
 {
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux