diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-11-07 06:40:41 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-11-09 11:34:36 -0500 |
commit | 6352c87ff69daa2211419ec2c34ddb8bc116c505 (patch) | |
tree | 046bf42d479243bd8bb70c3c22f43fe1f675afed /net | |
parent | 8b2c98243e8d00f9c6b6059976d6de51491ee0c7 (diff) |
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')
-rw-r--r-- | net/mac80211/util.c | 28 |
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) | |||
1422 | WARN_ON(drv_add_chanctx(local, ctx)); | 1422 | WARN_ON(drv_add_chanctx(local, ctx)); |
1423 | mutex_unlock(&local->chanctx_mtx); | 1423 | mutex_unlock(&local->chanctx_mtx); |
1424 | 1424 | ||
1425 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
1426 | struct ieee80211_chanctx_conf *ctx_conf; | ||
1427 | |||
1428 | if (!ieee80211_sdata_running(sdata)) | ||
1429 | continue; | ||
1430 | |||
1431 | mutex_lock(&local->chanctx_mtx); | ||
1432 | ctx_conf = rcu_dereference_protected(sdata->vif.chanctx_conf, | ||
1433 | lockdep_is_held(&local->chanctx_mtx)); | ||
1434 | if (ctx_conf) { | ||
1435 | ctx = container_of(ctx_conf, struct ieee80211_chanctx, | ||
1436 | conf); | ||
1437 | drv_assign_vif_chanctx(local, sdata, ctx); | ||
1438 | } | ||
1439 | mutex_unlock(&local->chanctx_mtx); | ||
1440 | } | ||
1441 | |||
1425 | /* add STAs back */ | 1442 | /* add STAs back */ |
1426 | mutex_lock(&local->sta_mtx); | 1443 | mutex_lock(&local->sta_mtx); |
1427 | list_for_each_entry(sta, &local->sta_list, list) { | 1444 | list_for_each_entry(sta, &local->sta_list, list) { |
@@ -1462,22 +1479,11 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1462 | 1479 | ||
1463 | /* Finally also reconfigure all the BSS information */ | 1480 | /* Finally also reconfigure all the BSS information */ |
1464 | list_for_each_entry(sdata, &local->interfaces, list) { | 1481 | list_for_each_entry(sdata, &local->interfaces, list) { |
1465 | struct ieee80211_chanctx_conf *ctx_conf; | ||
1466 | u32 changed; | 1482 | u32 changed; |
1467 | 1483 | ||
1468 | if (!ieee80211_sdata_running(sdata)) | 1484 | if (!ieee80211_sdata_running(sdata)) |
1469 | continue; | 1485 | continue; |
1470 | 1486 | ||
1471 | mutex_lock(&local->chanctx_mtx); | ||
1472 | ctx_conf = rcu_dereference_protected(sdata->vif.chanctx_conf, | ||
1473 | lockdep_is_held(&local->chanctx_mtx)); | ||
1474 | if (ctx_conf) { | ||
1475 | ctx = container_of(ctx_conf, struct ieee80211_chanctx, | ||
1476 | conf); | ||
1477 | drv_assign_vif_chanctx(local, sdata, ctx); | ||
1478 | } | ||
1479 | mutex_unlock(&local->chanctx_mtx); | ||
1480 | |||
1481 | /* common change flags for all interface types */ | 1487 | /* common change flags for all interface types */ |
1482 | changed = BSS_CHANGED_ERP_CTS_PROT | | 1488 | changed = BSS_CHANGED_ERP_CTS_PROT | |
1483 | BSS_CHANGED_ERP_PREAMBLE | | 1489 | BSS_CHANGED_ERP_PREAMBLE | |