diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2010-07-18 14:30:25 -0700 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2010-09-09 07:17:17 -0700 |
commit | 0817de904e7fd2ad383379d7c2787c5cac86f1bd (patch) | |
tree | 8f1d5b18ac53524ce2b2d4741c139300b1735a74 /wpa_supplicant/scan.c | |
parent | 5f3a6aa0a4b941cb4ba55581e6a1fdacc5603ed0 (diff) | |
download | external_wpa_supplicant_8_ti-0817de904e7fd2ad383379d7c2787c5cac86f1bd.zip external_wpa_supplicant_8_ti-0817de904e7fd2ad383379d7c2787c5cac86f1bd.tar.gz external_wpa_supplicant_8_ti-0817de904e7fd2ad383379d7c2787c5cac86f1bd.tar.bz2 |
P2P: Optimize scan timeouts for group formation
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r-- | wpa_supplicant/scan.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index d74174e..fc677da 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -383,6 +383,36 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) wpa_printf(MSG_DEBUG, "Starting AP scan for wildcard SSID"); } +#ifdef CONFIG_P2P + wpa_s->wps->dev.p2p = 1; + if (!wps) { + wps = 1; + req_type = WPS_REQ_ENROLLEE; + } + + if (params.freqs == NULL && wpa_s->p2p_in_provisioning && + wpa_s->go_params) { + /* Optimize provisioning state scan based on GO information */ + if (wpa_s->p2p_in_provisioning < 5 && + wpa_s->go_params->freq > 0) { + wpa_printf(MSG_DEBUG, "P2P: Scan only GO preferred " + "frequency %d MHz", + wpa_s->go_params->freq); + params.freqs = os_zalloc(2 * sizeof(int)); + if (params.freqs) + params.freqs[0] = wpa_s->go_params->freq; + } else if (wpa_s->go_params->freq_list[0]) { + wpa_printf(MSG_DEBUG, "P2P: Scan only common " + "channels"); + int_array_concat(¶ms.freqs, + wpa_s->go_params->freq_list); + if (params.freqs) + int_array_sort_unique(params.freqs); + } + wpa_s->p2p_in_provisioning++; + } +#endif /* CONFIG_P2P */ + #ifdef CONFIG_WPS if (params.freqs == NULL && wpa_s->after_wps && wpa_s->wps_freq) { /* |