From 85ea132a13e81c0cb96ff471872f925008c9f80f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 29 Feb 2012 00:34:53 +0200 Subject: [PATCH] P2P: Use scan optimization for post-provisioning connection Since P2P GO cannot change the SSID after WPS provisioning step, we can use the specific SSID for the scan for data connection. In addition, mark this as p2p_probe to avoid unnecessary use of 802.11b rates. Signed-hostap: Jouni Malinen --- wpa_supplicant/scan.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 497900fdc..eec5c7bf6 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -513,9 +513,10 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) } #ifdef CONFIG_P2P - if (wpa_s->p2p_in_provisioning && wpa_s->go_params) { + if ((wpa_s->p2p_in_provisioning || wpa_s->show_group_started) && + wpa_s->go_params) { wpa_printf(MSG_DEBUG, "P2P: Use specific SSID for scan during " - "P2P provisioning"); + "P2P group formation"); params.ssids[0].ssid = wpa_s->go_params->ssid; params.ssids[0].ssid_len = wpa_s->go_params->ssid_len; params.num_ssids = 1; @@ -641,7 +642,8 @@ ssid_list_set: } #ifdef CONFIG_P2P - if (wpa_s->p2p_in_provisioning) { + if (wpa_s->p2p_in_provisioning || + (wpa_s->show_group_started && wpa_s->go_params)) { /* * The interface may not yet be in P2P mode, so we have to * explicitly request P2P probe to disable CCK rates.