]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Allow all channels for multi-channel concurrency (no negotiation)
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 14 Mar 2013 13:38:11 +0000 (15:38 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 14 Mar 2013 13:38:11 +0000 (15:38 +0200)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/p2p_supplicant.c

index 6770992b8eddbc4e5185494d4c5906a3c5efbaa7..e016f8202a4b15f6ded191862c86a3347b4bbfe8 100644 (file)
@@ -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;