aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-06-25 06:35:06 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-06-25 12:06:20 -0400
commit5bcae31d9cb1ebfad3ad5a3eea04c8cdc329a04f (patch)
tree838badeb7af332aae425df02eb541851c309fcf2 /net/mac80211/util.c
parent633e27132625a0692440c4db58b901fb3cb67c55 (diff)
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)
1698 if (local->use_chanctx) { 1698 if (local->use_chanctx) {
1699 mutex_lock(&local->chanctx_mtx); 1699 mutex_lock(&local->chanctx_mtx);
1700 list_for_each_entry(ctx, &local->chanctx_list, list) 1700 list_for_each_entry(ctx, &local->chanctx_list, list)
1701 WARN_ON(drv_add_chanctx(local, ctx)); 1701 if (ctx->replace_state !=
1702 IEEE80211_CHANCTX_REPLACES_OTHER)
1703 WARN_ON(drv_add_chanctx(local, ctx));
1702 mutex_unlock(&local->chanctx_mtx); 1704 mutex_unlock(&local->chanctx_mtx);
1703 1705
1704 list_for_each_entry(sdata, &local->interfaces, list) { 1706 list_for_each_entry(sdata, &local->interfaces, list) {
@@ -2972,6 +2974,8 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
2972 num[iftype] = 1; 2974 num[iftype] = 1;
2973 2975
2974 list_for_each_entry(ctx, &local->chanctx_list, list) { 2976 list_for_each_entry(ctx, &local->chanctx_list, list) {
2977 if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED)
2978 continue;
2975 if (ctx->conf.radar_enabled) 2979 if (ctx->conf.radar_enabled)
2976 radar_detect |= BIT(ctx->conf.def.width); 2980 radar_detect |= BIT(ctx->conf.def.width);
2977 if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) { 2981 if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) {
@@ -3030,6 +3034,9 @@ int ieee80211_max_num_channels(struct ieee80211_local *local)
3030 lockdep_assert_held(&local->chanctx_mtx); 3034 lockdep_assert_held(&local->chanctx_mtx);
3031 3035
3032 list_for_each_entry(ctx, &local->chanctx_list, list) { 3036 list_for_each_entry(ctx, &local->chanctx_list, list) {
3037 if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED)
3038 continue;
3039
3033 num_different_channels++; 3040 num_different_channels++;
3034 3041
3035 if (ctx->conf.radar_enabled) 3042 if (ctx->conf.radar_enabled)