aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-07 12:40:41 +0100
committerJohannes Berg <johannes.berg@intel.com>2012-11-09 17:34:36 +0100
commit6352c87ff69daa2211419ec2c34ddb8bc116c505 (patch)
tree046bf42d479243bd8bb70c3c22f43fe1f675afed /net/mac80211/util.c
parentmac80211: clarify interface iteration and make it configurable (diff)
downloadlinux-dev-6352c87ff69daa2211419ec2c34ddb8bc116c505.tar.xz
linux-dev-6352c87ff69daa2211419ec2c34ddb8bc116c505.zip
mac80211: reassign channel contexts before stations
Since channel contexts are usually present before stations can be added to an interface, reassign before stations them in reconfiguration as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 01b9fa62f3e3..4e4f58513673 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1422,6 +1422,23 @@ int ieee80211_reconfig(struct ieee80211_local *local)
WARN_ON(drv_add_chanctx(local, ctx));
mutex_unlock(&local->chanctx_mtx);
+ list_for_each_entry(sdata, &local->interfaces, list) {
+ struct ieee80211_chanctx_conf *ctx_conf;
+
+ if (!ieee80211_sdata_running(sdata))
+ continue;
+
+ mutex_lock(&local->chanctx_mtx);
+ ctx_conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
+ lockdep_is_held(&local->chanctx_mtx));
+ if (ctx_conf) {
+ ctx = container_of(ctx_conf, struct ieee80211_chanctx,
+ conf);
+ drv_assign_vif_chanctx(local, sdata, ctx);
+ }
+ mutex_unlock(&local->chanctx_mtx);
+ }
+
/* add STAs back */
mutex_lock(&local->sta_mtx);
list_for_each_entry(sta, &local->sta_list, list) {
@@ -1462,22 +1479,11 @@ int ieee80211_reconfig(struct ieee80211_local *local)
/* Finally also reconfigure all the BSS information */
list_for_each_entry(sdata, &local->interfaces, list) {
- struct ieee80211_chanctx_conf *ctx_conf;
u32 changed;
if (!ieee80211_sdata_running(sdata))
continue;
- mutex_lock(&local->chanctx_mtx);
- ctx_conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
- lockdep_is_held(&local->chanctx_mtx));
- if (ctx_conf) {
- ctx = container_of(ctx_conf, struct ieee80211_chanctx,
- conf);
- drv_assign_vif_chanctx(local, sdata, ctx);
- }
- mutex_unlock(&local->chanctx_mtx);
-
/* common change flags for all interface types */
changed = BSS_CHANGED_ERP_CTS_PROT |
BSS_CHANGED_ERP_PREAMBLE |