diff mbox

[03/12] mac80211: minor changes of ieee80211_reconfig()

Message ID d8410804796e01fe8b4c62aeaca97b791154f585.1398055854.git.gamerh2o@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gang ZHAO April 21, 2014, 4:52 a.m. UTC
Try to update chanctx only if local->use_chanctx is true.

P2P_DEVICE doesn't support ieee80211_bss_info_change_notify() for now,
so it's not needed to set changed flags for P2P_DEVICE.

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

Comments

Johannes Berg April 22, 2014, 2:47 p.m. UTC | #1
On Mon, 2014-04-21 at 12:52 +0800, Zhao, Gang wrote:
> Try to update chanctx only if local->use_chanctx is true.

I'm not convinced this part is correct, since the internal channel
context handling also has an effect when the driver doesn't use it.

Have you really thought this through?

johannes


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gang ZHAO April 23, 2014, 7:48 a.m. UTC | #2
On Tue, 2014-04-22 at 16:47:24 +0200, Johannes Berg wrote:
> On Mon, 2014-04-21 at 12:52 +0800, Zhao, Gang wrote:
>> Try to update chanctx only if local->use_chanctx is true.
>
> I'm not convinced this part is correct, since the internal channel
> context handling also has an effect when the driver doesn't use it.

Actually ieee80211_assign_chanctx() checks if local->use_chanctx is
true, so this patch doesn't change the logic. I should mentioned it in
the commit log.

> Have you really thought this through?
>
> johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg April 25, 2014, 3:37 p.m. UTC | #3
On Wed, 2014-04-23 at 15:48 +0800, Zhao, Gang wrote:
> On Tue, 2014-04-22 at 16:47:24 +0200, Johannes Berg wrote:
> > On Mon, 2014-04-21 at 12:52 +0800, Zhao, Gang wrote:
> >> Try to update chanctx only if local->use_chanctx is true.
> >
> > I'm not convinced this part is correct, since the internal channel
> > context handling also has an effect when the driver doesn't use it.
> 
> Actually ieee80211_assign_chanctx() checks if local->use_chanctx is
> true, so this patch doesn't change the logic. I should mentioned it in
> the commit log.

Oh, you're right. Please also split the patch into two.

johannes

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

Patch

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 5a6cc33..ae38592 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1565,17 +1565,17 @@  int ieee80211_reconfig(struct ieee80211_local *local)
 		list_for_each_entry(ctx, &local->chanctx_list, list)
 			WARN_ON(drv_add_chanctx(local, ctx));
 		mutex_unlock(&local->chanctx_mtx);
-	}
 
-	list_for_each_entry(sdata, &local->interfaces, list) {
-		if (!ieee80211_sdata_running(sdata))
-			continue;
-		ieee80211_assign_chanctx(local, sdata);
-	}
+		list_for_each_entry(sdata, &local->interfaces, list) {
+			if (!ieee80211_sdata_running(sdata))
+				continue;
+			ieee80211_assign_chanctx(local, sdata);
+		}
 
-	sdata = rtnl_dereference(local->monitor_sdata);
-	if (sdata && ieee80211_sdata_running(sdata))
-		ieee80211_assign_chanctx(local, sdata);
+		sdata = rtnl_dereference(local->monitor_sdata);
+		if (sdata && ieee80211_sdata_running(sdata))
+			ieee80211_assign_chanctx(local, sdata);
+	}
 
 	/* add STAs back */
 	mutex_lock(&local->sta_mtx);
@@ -1671,13 +1671,10 @@  int ieee80211_reconfig(struct ieee80211_local *local)
 			}
 			break;
 		case NL80211_IFTYPE_WDS:
-			break;
 		case NL80211_IFTYPE_AP_VLAN:
 		case NL80211_IFTYPE_MONITOR:
-			/* ignore virtual */
-			break;
 		case NL80211_IFTYPE_P2P_DEVICE:
-			changed = BSS_CHANGED_IDLE;
+			/* nothing to do */
 			break;
 		case NL80211_IFTYPE_UNSPECIFIED:
 		case NUM_NL80211_IFTYPES: