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

* [PATCH 2/4] mac80211: refactor recalculate channel context functions (2)
  2014-03-07  2:17 [PATCH 1/4] mac80211: refactor recalculate channel context functions (1) Zhao, Gang
@ 2014-03-07  2:17 ` Zhao, Gang
  2014-03-07  2:17 ` [PATCH 3/4] mac80211: refactor recalculate channel context functions (3) Zhao, Gang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Zhao, Gang @ 2014-03-07  2:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

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@gmail.com>
---
 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


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

* [PATCH 3/4] mac80211: refactor recalculate channel context functions (3)
  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 ` 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
  3 siblings, 0 replies; 5+ messages in thread
From: Zhao, Gang @ 2014-03-07  2:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

Change some functions' position in the file. This is a preparation for
a wrapper function ieee80211_recalc_chanctx().

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

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 543beba..ebcc0e7 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -204,6 +204,132 @@ static void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
 	_ieee80211_recalc_chanctx_chantype(local, ctx, compat);
 }
 
+static bool ieee80211_is_radar_required(struct ieee80211_local *local)
+{
+	struct ieee80211_sub_if_data *sdata;
+
+	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;
+		}
+	}
+	rcu_read_unlock();
+
+	return false;
+}
+
+static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
+					   struct ieee80211_chanctx *chanctx)
+{
+	bool radar_enabled;
+
+	lockdep_assert_held(&local->chanctx_mtx);
+	/* for setting local->radar_detect_enabled */
+	lockdep_assert_held(&local->mtx);
+
+	radar_enabled = ieee80211_is_radar_required(local);
+
+	if (radar_enabled == chanctx->conf.radar_enabled)
+		return;
+
+	chanctx->conf.radar_enabled = radar_enabled;
+	local->radar_detect_enabled = chanctx->conf.radar_enabled;
+
+	if (!local->use_chanctx) {
+		local->hw.conf.radar_enabled = chanctx->conf.radar_enabled;
+		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
+	}
+
+	drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR);
+}
+
+void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
+				   struct ieee80211_chanctx *chanctx)
+{
+	struct ieee80211_sub_if_data *sdata;
+	u8 rx_chains_static, rx_chains_dynamic;
+
+	lockdep_assert_held(&local->chanctx_mtx);
+
+	rx_chains_static = 1;
+	rx_chains_dynamic = 1;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+		u8 needed_static, needed_dynamic;
+
+		if (!ieee80211_sdata_running(sdata))
+			continue;
+
+		if (rcu_access_pointer(sdata->vif.chanctx_conf) !=
+						&chanctx->conf)
+			continue;
+
+		switch (sdata->vif.type) {
+		case NL80211_IFTYPE_P2P_DEVICE:
+			continue;
+		case NL80211_IFTYPE_STATION:
+			if (!sdata->u.mgd.associated)
+				continue;
+			break;
+		case NL80211_IFTYPE_AP_VLAN:
+			continue;
+		case NL80211_IFTYPE_AP:
+		case NL80211_IFTYPE_ADHOC:
+		case NL80211_IFTYPE_WDS:
+		case NL80211_IFTYPE_MESH_POINT:
+			break;
+		default:
+			WARN_ON_ONCE(1);
+		}
+
+		switch (sdata->smps_mode) {
+		default:
+			WARN_ONCE(1, "Invalid SMPS mode %d\n",
+				  sdata->smps_mode);
+			/* fall through */
+		case IEEE80211_SMPS_OFF:
+			needed_static = sdata->needed_rx_chains;
+			needed_dynamic = sdata->needed_rx_chains;
+			break;
+		case IEEE80211_SMPS_DYNAMIC:
+			needed_static = 1;
+			needed_dynamic = sdata->needed_rx_chains;
+			break;
+		case IEEE80211_SMPS_STATIC:
+			needed_static = 1;
+			needed_dynamic = 1;
+			break;
+		}
+
+		rx_chains_static = max(rx_chains_static, needed_static);
+		rx_chains_dynamic = max(rx_chains_dynamic, needed_dynamic);
+	}
+	rcu_read_unlock();
+
+	if (!local->use_chanctx) {
+		if (rx_chains_static > 1)
+			local->smps_mode = IEEE80211_SMPS_OFF;
+		else if (rx_chains_dynamic > 1)
+			local->smps_mode = IEEE80211_SMPS_DYNAMIC;
+		else
+			local->smps_mode = IEEE80211_SMPS_STATIC;
+		ieee80211_hw_config(local, 0);
+	}
+
+	if (rx_chains_static == chanctx->conf.rx_chains_static &&
+	    rx_chains_dynamic == chanctx->conf.rx_chains_dynamic)
+		return;
+
+	chanctx->conf.rx_chains_static = rx_chains_static;
+	chanctx->conf.rx_chains_dynamic = rx_chains_dynamic;
+	drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS);
+}
+
 static struct ieee80211_chanctx *
 ieee80211_find_chanctx(struct ieee80211_local *local,
 		       const struct cfg80211_chan_def *chandef,
@@ -234,24 +360,6 @@ ieee80211_find_chanctx(struct ieee80211_local *local,
 	return NULL;
 }
 
-static bool ieee80211_is_radar_required(struct ieee80211_local *local)
-{
-	struct ieee80211_sub_if_data *sdata;
-
-	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;
-		}
-	}
-	rcu_read_unlock();
-
-	return false;
-}
-
 static struct ieee80211_chanctx *
 ieee80211_new_chanctx(struct ieee80211_local *local,
 		      const struct cfg80211_chan_def *chandef,
@@ -362,31 +470,6 @@ static int ieee80211_assign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
 	return 0;
 }
 
-static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
-					   struct ieee80211_chanctx *chanctx)
-{
-	bool radar_enabled;
-
-	lockdep_assert_held(&local->chanctx_mtx);
-	/* for setting local->radar_detect_enabled */
-	lockdep_assert_held(&local->mtx);
-
-	radar_enabled = ieee80211_is_radar_required(local);
-
-	if (radar_enabled == chanctx->conf.radar_enabled)
-		return;
-
-	chanctx->conf.radar_enabled = radar_enabled;
-	local->radar_detect_enabled = chanctx->conf.radar_enabled;
-
-	if (!local->use_chanctx) {
-		local->hw.conf.radar_enabled = chanctx->conf.radar_enabled;
-		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
-	}
-
-	drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR);
-}
-
 static void ieee80211_unassign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
 					   struct ieee80211_chanctx *ctx)
 {
@@ -433,89 +516,6 @@ static void __ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
 		ieee80211_free_chanctx(local, ctx);
 }
 
-void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
-				   struct ieee80211_chanctx *chanctx)
-{
-	struct ieee80211_sub_if_data *sdata;
-	u8 rx_chains_static, rx_chains_dynamic;
-
-	lockdep_assert_held(&local->chanctx_mtx);
-
-	rx_chains_static = 1;
-	rx_chains_dynamic = 1;
-
-	rcu_read_lock();
-	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		u8 needed_static, needed_dynamic;
-
-		if (!ieee80211_sdata_running(sdata))
-			continue;
-
-		if (rcu_access_pointer(sdata->vif.chanctx_conf) !=
-						&chanctx->conf)
-			continue;
-
-		switch (sdata->vif.type) {
-		case NL80211_IFTYPE_P2P_DEVICE:
-			continue;
-		case NL80211_IFTYPE_STATION:
-			if (!sdata->u.mgd.associated)
-				continue;
-			break;
-		case NL80211_IFTYPE_AP_VLAN:
-			continue;
-		case NL80211_IFTYPE_AP:
-		case NL80211_IFTYPE_ADHOC:
-		case NL80211_IFTYPE_WDS:
-		case NL80211_IFTYPE_MESH_POINT:
-			break;
-		default:
-			WARN_ON_ONCE(1);
-		}
-
-		switch (sdata->smps_mode) {
-		default:
-			WARN_ONCE(1, "Invalid SMPS mode %d\n",
-				  sdata->smps_mode);
-			/* fall through */
-		case IEEE80211_SMPS_OFF:
-			needed_static = sdata->needed_rx_chains;
-			needed_dynamic = sdata->needed_rx_chains;
-			break;
-		case IEEE80211_SMPS_DYNAMIC:
-			needed_static = 1;
-			needed_dynamic = sdata->needed_rx_chains;
-			break;
-		case IEEE80211_SMPS_STATIC:
-			needed_static = 1;
-			needed_dynamic = 1;
-			break;
-		}
-
-		rx_chains_static = max(rx_chains_static, needed_static);
-		rx_chains_dynamic = max(rx_chains_dynamic, needed_dynamic);
-	}
-	rcu_read_unlock();
-
-	if (!local->use_chanctx) {
-		if (rx_chains_static > 1)
-			local->smps_mode = IEEE80211_SMPS_OFF;
-		else if (rx_chains_dynamic > 1)
-			local->smps_mode = IEEE80211_SMPS_DYNAMIC;
-		else
-			local->smps_mode = IEEE80211_SMPS_STATIC;
-		ieee80211_hw_config(local, 0);
-	}
-
-	if (rx_chains_static == chanctx->conf.rx_chains_static &&
-	    rx_chains_dynamic == chanctx->conf.rx_chains_dynamic)
-		return;
-
-	chanctx->conf.rx_chains_static = rx_chains_static;
-	chanctx->conf.rx_chains_dynamic = rx_chains_dynamic;
-	drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS);
-}
-
 int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
 			      const struct cfg80211_chan_def *chandef,
 			      enum ieee80211_chanctx_mode mode)
-- 
1.8.5.3


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

* [PATCH 4/4] mac80211: refactor recalculate channel context functions (4)
  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 ` Zhao, Gang
  2014-03-11 13:21 ` [PATCH 1/4] mac80211: refactor recalculate channel context functions (1) Johannes Berg
  3 siblings, 0 replies; 5+ messages in thread
From: Zhao, Gang @ 2014-03-07  2:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

Change function name ieee80211_recalc_{radar, smps}_chanctx to
ieee80211_recalc_chanctx_{radar, smps} to be consistent with other
ieee80211_recalc_chanctx_* functions.

Add a wrapper function ieee80211_recalc_chanctx() to reduce code
duplication.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
---
 net/mac80211/chan.c        | 30 ++++++++++++++++--------------
 net/mac80211/ieee80211_i.h |  2 +-
 net/mac80211/util.c        |  2 +-
 3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index ebcc0e7..207b224 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -222,7 +222,7 @@ static bool ieee80211_is_radar_required(struct ieee80211_local *local)
 	return false;
 }
 
-static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
+static void ieee80211_recalc_chanctx_radar(struct ieee80211_local *local,
 					   struct ieee80211_chanctx *chanctx)
 {
 	bool radar_enabled;
@@ -247,7 +247,7 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
 	drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR);
 }
 
-void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
+void ieee80211_recalc_chanctx_smps(struct ieee80211_local *local,
 				   struct ieee80211_chanctx *chanctx)
 {
 	struct ieee80211_sub_if_data *sdata;
@@ -330,6 +330,15 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
 	drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS);
 }
 
+static void ieee80211_recalc_chanctx(struct ieee80211_local *local,
+				     struct ieee80211_chanctx *ctx)
+{
+	ieee80211_recalc_chanctx_chantype(local, ctx);
+	ieee80211_recalc_chanctx_smps(local, ctx);
+	ieee80211_recalc_chanctx_radar(local, ctx);
+	ieee80211_recalc_chanctx_min_def(local, ctx);
+}
+
 static struct ieee80211_chanctx *
 ieee80211_find_chanctx(struct ieee80211_local *local,
 		       const struct cfg80211_chan_def *chandef,
@@ -488,12 +497,8 @@ static void ieee80211_unassign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
 
 	drv_unassign_vif_chanctx(local, sdata, ctx);
 
-	if (ctx->refcount > 0) {
-		ieee80211_recalc_chanctx_chantype(sdata->local, ctx);
-		ieee80211_recalc_smps_chanctx(local, ctx);
-		ieee80211_recalc_radar_chanctx(local, ctx);
-		ieee80211_recalc_chanctx_min_def(local, ctx);
-	}
+	if (ctx->refcount > 0)
+		ieee80211_recalc_chanctx(local, ctx);
 }
 
 static void __ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
@@ -549,8 +554,8 @@ int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
 		goto out;
 	}
 
-	ieee80211_recalc_smps_chanctx(local, ctx);
-	ieee80211_recalc_radar_chanctx(local, ctx);
+	ieee80211_recalc_chanctx_smps(local, ctx);
+	ieee80211_recalc_chanctx_radar(local, ctx);
  out:
 	mutex_unlock(&local->chanctx_mtx);
 	return ret;
@@ -601,10 +606,7 @@ int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
 	chanctx_changed |= IEEE80211_CHANCTX_CHANGE_CHANNEL;
 	drv_change_chanctx(local, ctx, chanctx_changed);
 
-	ieee80211_recalc_chanctx_chantype(local, ctx);
-	ieee80211_recalc_smps_chanctx(local, ctx);
-	ieee80211_recalc_radar_chanctx(local, ctx);
-	ieee80211_recalc_chanctx_min_def(local, ctx);
+	ieee80211_recalc_chanctx(local, ctx);
 
 	ret = 0;
  out:
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8603dfb..ca1c636 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1788,7 +1788,7 @@ void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
 void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
 					 bool clear);
 
-void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
+void ieee80211_recalc_chanctx_smps(struct ieee80211_local *local,
 				   struct ieee80211_chanctx *chanctx);
 void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
 				      struct ieee80211_chanctx *ctx);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index d842af5..013b5fd 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1859,7 +1859,7 @@ void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata)
 		goto unlock;
 
 	chanctx = container_of(chanctx_conf, struct ieee80211_chanctx, conf);
-	ieee80211_recalc_smps_chanctx(local, chanctx);
+	ieee80211_recalc_chanctx_smps(local, chanctx);
  unlock:
 	mutex_unlock(&local->chanctx_mtx);
 }
-- 
1.8.5.3


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

* Re: [PATCH 1/4] mac80211: refactor recalculate channel context functions (1)
  2014-03-07  2:17 [PATCH 1/4] mac80211: refactor recalculate channel context functions (1) Zhao, Gang
                   ` (2 preceding siblings ...)
  2014-03-07  2:17 ` [PATCH 4/4] mac80211: refactor recalculate channel context functions (4) Zhao, Gang
@ 2014-03-11 13:21 ` Johannes Berg
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2014-03-11 13:21 UTC (permalink / raw)
  To: Zhao, Gang; +Cc: linux-wireless

On Fri, 2014-03-07 at 10:17 +0800, Zhao, Gang wrote:
> 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.

I think this is reasonable, but as discussed in the other thread I'll
drop this until the CSA code settles down.

johannes


^ permalink raw reply	[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).