From 8e64f258c66b2dfc8631784bc0711146dfa42b72 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 29 Feb 2012 00:22:58 +0200 Subject: [PATCH] P2P: Optimize provisioning step scan for join-a-group sequence Copy the SSID and frequency of the selected group into go_params in join-a-running-group case so that the scan optimization can be used for the provisioning step similarly to the case of group formation. This uses a specific SSID and a single channel scan to avoid unnecessary frames during the step. Signed-hostap: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index ae9136e35..d723254bd 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -2808,6 +2808,7 @@ static int wpas_p2p_join_start(struct wpa_supplicant *wpa_s) { struct wpa_supplicant *group; struct p2p_go_neg_results res; + struct wpa_bss *bss; eloop_cancel_timeout(wpas_p2p_pd_before_join_timeout, wpa_s, NULL); group = wpas_p2p_get_group_iface(wpa_s, 0, 0); @@ -2825,6 +2826,13 @@ static int wpas_p2p_join_start(struct wpa_supplicant *wpa_s) os_memcpy(res.peer_interface_addr, wpa_s->pending_join_iface_addr, ETH_ALEN); res.wps_method = wpa_s->pending_join_wps_method; + bss = wpa_bss_get_bssid(wpa_s, wpa_s->pending_join_iface_addr); + if (bss) { + res.freq = bss->freq; + res.ssid_len = bss->ssid_len; + os_memcpy(res.ssid, bss->ssid, bss->ssid_len); + } + if (wpa_s->off_channel_freq || wpa_s->roc_waiting_drv_freq) { wpa_printf(MSG_DEBUG, "P2P: Cancel remain-on-channel prior to " "starting client");