]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Use GO's operating channel to optimize scan during join
authorJithu Jance <jithu@broadcom.com>
Wed, 15 Jan 2014 13:47:19 +0000 (19:17 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 17 Jan 2014 09:57:07 +0000 (11:57 +0200)
Use P2P GO's operating channel information, if known, to do a single
channel scan during the join operation.

Signed-hostap: Jithu Jance <jithu@broadcom.com>

wpa_supplicant/p2p_supplicant.c

index 7d5667c2f4d8542d97d9f7663e6c5d558ac2021a..91ed508d29362c8617b0e2c7b9241b5ff235437b 100644 (file)
@@ -4279,6 +4279,18 @@ static void wpas_p2p_join_scan_req(struct wpa_supplicant *wpa_s, int freq,
        params.p2p_probe = 1;
        params.extra_ies = wpabuf_head(ies);
        params.extra_ies_len = wpabuf_len(ies);
+
+       if (!freq) {
+               int oper_freq;
+               /*
+                * If freq is not provided, check the operating freq of the GO
+                * and use a single channel scan on if possible.
+                */
+               oper_freq = p2p_get_oper_freq(wpa_s->global->p2p,
+                                             wpa_s->pending_join_iface_addr);
+               if (oper_freq > 0)
+                       freq = oper_freq;
+       }
        if (freq > 0) {
                freqs[0] = freq;
                params.freqs = freqs;