From: Kazior Michal <Michal.Kazior@xxxxxxxxx> Reuse channels with compatible channel types. Some channel types are compatible and can be used concurrently. Signed-off-by: Michal Kazior <michal.kazior@xxxxxxxxx> --- net/mac80211/chan.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 63b7cb7..97be454 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -167,6 +167,7 @@ ieee80211_find_chanctx(struct ieee80211_local *local, enum ieee80211_chanctx_mode mode) { struct ieee80211_chanctx *ctx; + enum nl80211_channel_type compat_type; if (mode == IEEE80211_CHANCTX_EXCLUSIVE) return NULL; @@ -174,12 +175,22 @@ ieee80211_find_chanctx(struct ieee80211_local *local, return NULL; list_for_each_entry(ctx, &local->chanctx_list, list) { + compat_type = ctx->conf.channel_type; + if (ctx->conf.mode == IEEE80211_CHANCTX_EXCLUSIVE) continue; if (ctx->conf.channel != channel) continue; if (ctx->conf.channel_type != channel_type) continue; + if (!ieee80211_channel_types_are_compatible(ctx->conf.channel_type, + channel_type, + &compat_type)) + continue; + if (ctx->conf.channel_type != compat_type) { + ctx->conf.channel_type = compat_type; + drv_change_chantype(local, ctx); + } return ctx; } -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html