From a70a52c316b2e8674ee6e60c63a1314b1a28ba58 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 14 Mar 2013 15:38:11 +0200 Subject: [PATCH] P2P: Allow all channels for multi-channel concurrency (no negotiation) Commit 79879f4ae8f3eacee52699e3ccd5e0baba601c4d enabled all channels to be used when negotiating channel with a driver that supports multi-channel concurrency. Extend that to cover cases where the channel is not being negotiated (e.g., p2p_group_add to start a GO). Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 43 +++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 6770992b8..e016f8202 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3968,18 +3968,45 @@ static int wpas_p2p_init_go_params(struct wpa_supplicant *wpa_s, if (wpa_s->current_ssid && wpa_drv_get_bssid(wpa_s, bssid) == 0 && wpa_s->assoc_freq && !freq) { - wpa_printf(MSG_DEBUG, "P2P: Force GO on the channel we are " - "already using"); - params->freq = wpa_s->assoc_freq; - if (!freq_included(channels, params->freq)) { - wpa_printf(MSG_DEBUG, "P2P: Forced GO freq %d MHz not " - "accepted", params->freq); - return -1; + if (!p2p_supported_freq(wpa_s->global->p2p, wpa_s->assoc_freq) + || !freq_included(channels, wpa_s->assoc_freq)) { + if (wpa_s->drv_flags & + WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) { + wpa_printf(MSG_DEBUG, "P2P: Cannot force GO on " + "the channel we are already using " + "(%u MHz) - allow multi-channel " + "concurrency", wpa_s->assoc_freq); + } else { + wpa_printf(MSG_DEBUG, "P2P: Cannot force GO on " + "the channel we are already using " + "(%u MHz)", wpa_s->assoc_freq); + return -1; + } + } else { + wpa_printf(MSG_DEBUG, "P2P: Force GO on the channel we " + "are already using (%u MHz)", + wpa_s->assoc_freq); + params->freq = wpa_s->assoc_freq; } } res = wpa_drv_shared_freq(wpa_s); - if (res > 0 && !freq) { + if (res > 0 && !freq && + (!p2p_supported_freq(wpa_s->global->p2p, res) || + !freq_included(channels, res))) { + if (wpa_s->drv_flags & + WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) { + wpa_printf(MSG_DEBUG, "P2P: Cannot force GO on the " + "channel we are already using on a shared " + "interface (%u MHz) - allow multi-channel " + "concurrency", res); + } else { + wpa_printf(MSG_DEBUG, "P2P: Cannot force GO on the " + "channel we are already using on a shared " + "interface (%u MHz)", res); + return -1; + } + } else if (res > 0 && !freq) { wpa_printf(MSG_DEBUG, "P2P: Force GO on the channel we are " "already using on a shared interface"); params->freq = res;