Browse Source

P2P: Short scan wait to speed up the group re-invocation

The shorter 250 ms wait for the next scan request can be used also for
the case of persistent group re-invocation instead of just formation of
a new group. This speeds up the process and makes this more robust
especially in cases where the GO is using MCC.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Rashmi Ramanna 11 years ago
parent
commit
6fc48481e4
2 changed files with 6 additions and 4 deletions
  1. 4 2
      wpa_supplicant/events.c
  2. 2 2
      wpa_supplicant/p2p_supplicant.c

+ 4 - 2
wpa_supplicant/events.c

@@ -1353,10 +1353,12 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
 			if (wpas_p2p_scan_no_go_seen(wpa_s) == 1)
 				return 0;
 
-			if (wpa_s->p2p_in_provisioning) {
+			if (wpa_s->p2p_in_provisioning ||
+			    wpa_s->show_group_started) {
 				/*
 				 * Use shorter wait during P2P Provisioning
-				 * state to speed up group formation.
+				 * state and during P2P join-a-group operation
+				 * to speed up group formation.
 				 */
 				timeout_sec = 0;
 				timeout_usec = 250000;

+ 2 - 2
wpa_supplicant/p2p_supplicant.c

@@ -4774,10 +4774,10 @@ static int wpas_start_p2p_client(struct wpa_supplicant *wpa_s,
 	if (params->passphrase)
 		ssid->passphrase = os_strdup(params->passphrase);
 
-	wpa_supplicant_select_network(wpa_s, ssid);
-
 	wpa_s->show_group_started = 1;
 
+	wpa_supplicant_select_network(wpa_s, ssid);
+
 	return 0;
 }