Reuse channels with compatible channel types. Some channel types are compatible and can be used concurrently. Change-Id: I30665b42ea141ed63bba94be6fd2755c7e16589d 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 030d44e..75549bc 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -162,6 +162,7 @@ ieee80211_find_channel_context(struct ieee80211_local *local, enum nl80211_channel_type channel_type) { struct ieee80211_channel_context *ctx; + enum nl80211_channel_type compat_type; int i; if (WARN_ON(!channel)) @@ -169,10 +170,20 @@ ieee80211_find_channel_context(struct ieee80211_local *local, for (i = 0; i < IEEE80211_MAX_CHANNEL_CONTEXTS; i++) { ctx = &local->channel_contexts[i]; + compat_type = ctx->channel_type; + if (ctx->channel != channel) continue; if (ctx->channel_type != channel_type) continue; + if (!ieee80211_channel_types_are_compatible(ctx->channel_type, + channel_type, + &compat_type)) + continue; + if (ctx->channel_type != compat_type) { + ctx->channel_type = compat_type; + drv_change_channel_type(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