aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorGravatar Michal Kazior <michal.kazior@tieto.com> 2014-06-25 12:35:06 +0200
committerGravatar Johannes Berg <johannes.berg@intel.com> 2014-06-25 18:06:20 +0200
commit5bcae31d9cb1ebfad3ad5a3eea04c8cdc329a04f (patch)
tree838badeb7af332aae425df02eb541851c309fcf2 /net/mac80211/util.c
parentmac80211: split sched scan IEs (diff)
downloadlinux-5bcae31d9cb1ebfad3ad5a3eea04c8cdc329a04f.tar.gz
linux-5bcae31d9cb1ebfad3ad5a3eea04c8cdc329a04f.tar.bz2
linux-5bcae31d9cb1ebfad3ad5a3eea04c8cdc329a04f.zip
mac80211: implement multi-vif in-place reservations
Multi-vif in-place reservations happen when it is impossible to allocate more channel contexts as indicated by interface combinations. Such reservations are not finalized until all assigned interfaces are ready. This still doesn't handle all possible cases (i.e. degradation of number of channels) properly. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e31458201278..1b42aa16ec03 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1698,7 +1698,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
if (local->use_chanctx) {
mutex_lock(&local->chanctx_mtx);
list_for_each_entry(ctx, &local->chanctx_list, list)
- WARN_ON(drv_add_chanctx(local, ctx));
+ if (ctx->replace_state !=
+ IEEE80211_CHANCTX_REPLACES_OTHER)
+ WARN_ON(drv_add_chanctx(local, ctx));
mutex_unlock(&local->chanctx_mtx);
list_for_each_entry(sdata, &local->interfaces, list) {
@@ -2972,6 +2974,8 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
num[iftype] = 1;
list_for_each_entry(ctx, &local->chanctx_list, list) {
+ if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED)
+ continue;
if (ctx->conf.radar_enabled)
radar_detect |= BIT(ctx->conf.def.width);
if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) {
@@ -3030,6 +3034,9 @@ int ieee80211_max_num_channels(struct ieee80211_local *local)
lockdep_assert_held(&local->chanctx_mtx);
list_for_each_entry(ctx, &local->chanctx_list, list) {
+ if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED)
+ continue;
+
num_different_channels++;
if (ctx->conf.radar_enabled)