linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mac80211: refactor recalculate channel context functions (1)
@ 2014-03-07  2:17 Zhao, Gang
  2014-03-07  2:17 ` [PATCH 2/4] mac80211: refactor recalculate channel context functions (2) Zhao, Gang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Zhao, Gang @ 2014-03-07  2:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

Function ieee80211_change_chanctx() updates struct
ieee80211_chanctx_conf's def and min_def members, in a somewhat mixed
way. Since there are other members can be updated, this function's
name is a bit inaccurate.

Rename ieee80211_change_chanctx() to ieee80211_recalc_chanctx_def()
and only update def member in this function. Add a wrapper function
_ieee80211_recalc_chanctx_chantype() to do ieee80211_change_chanctx()'s
work.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
---
 net/mac80211/chan.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 42c6592..49fa37e 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -143,9 +143,10 @@ void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
 	drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_MIN_WIDTH);
 }
 
-static void ieee80211_change_chanctx(struct ieee80211_local *local,
-				     struct ieee80211_chanctx *ctx,
-				     const struct cfg80211_chan_def *chandef)
+static void
+ieee80211_recalc_chanctx_def(struct ieee80211_local *local,
+			     struct ieee80211_chanctx *ctx,
+			     const struct cfg80211_chan_def *chandef)
 {
 	if (cfg80211_chandef_identical(&ctx->conf.def, chandef))
 		return;
@@ -154,7 +155,6 @@ static void ieee80211_change_chanctx(struct ieee80211_local *local,
 
 	ctx->conf.def = *chandef;
 	drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_WIDTH);
-	ieee80211_recalc_chanctx_min_def(local, ctx);
 
 	if (!local->use_chanctx) {
 		local->_oper_chandef = *chandef;
@@ -162,6 +162,15 @@ static void ieee80211_change_chanctx(struct ieee80211_local *local,
 	}
 }
 
+static void
+_ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
+				   struct ieee80211_chanctx *ctx,
+				   const struct cfg80211_chan_def *chandef)
+{
+	ieee80211_recalc_chanctx_def(local, ctx, chandef);
+	ieee80211_recalc_chanctx_min_def(local, ctx);
+}
+
 static struct ieee80211_chanctx *
 ieee80211_find_chanctx(struct ieee80211_local *local,
 		       const struct cfg80211_chan_def *chandef,
@@ -184,7 +193,7 @@ ieee80211_find_chanctx(struct ieee80211_local *local,
 		if (!compat)
 			continue;
 
-		ieee80211_change_chanctx(local, ctx, compat);
+		_ieee80211_recalc_chanctx_chantype(local, ctx, compat);
 
 		return ctx;
 	}
@@ -350,7 +359,7 @@ static void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
 	if (WARN_ON_ONCE(!compat))
 		return;
 
-	ieee80211_change_chanctx(local, ctx, compat);
+	_ieee80211_recalc_chanctx_chantype(local, ctx, compat);
 }
 
 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
-- 
1.8.5.3


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

end of thread, other threads:[~2014-03-11 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07  2:17 [PATCH 1/4] mac80211: refactor recalculate channel context functions (1) Zhao, Gang
2014-03-07  2:17 ` [PATCH 2/4] mac80211: refactor recalculate channel context functions (2) Zhao, Gang
2014-03-07  2:17 ` [PATCH 3/4] mac80211: refactor recalculate channel context functions (3) Zhao, Gang
2014-03-07  2:17 ` [PATCH 4/4] mac80211: refactor recalculate channel context functions (4) Zhao, Gang
2014-03-11 13:21 ` [PATCH 1/4] mac80211: refactor recalculate channel context functions (1) Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).