wpa_supplicant: Improve scan during p2p_find
Change-Id: I733b23c2b7a24cfa96fe6593adbcbeb7d0798002 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
@@ -1074,11 +1074,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
|
|||||||
wpa_supplicant_notify_scanning(wpa_s, 0);
|
wpa_supplicant_notify_scanning(wpa_s, 0);
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
#ifdef ANDROID_P2P
|
|
||||||
if (p2p_search_pending(wpa_s->global->p2p) && !wpa_s->global->p2p_disabled &&
|
|
||||||
#else
|
|
||||||
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||||
#endif
|
|
||||||
wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
|
wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
|
||||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||||
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||||
|
|||||||
@@ -62,11 +62,7 @@
|
|||||||
#endif /* P2P_MAX_INITIAL_CONN_WAIT */
|
#endif /* P2P_MAX_INITIAL_CONN_WAIT */
|
||||||
|
|
||||||
#ifndef P2P_CONCURRENT_SEARCH_DELAY
|
#ifndef P2P_CONCURRENT_SEARCH_DELAY
|
||||||
#ifdef ANDROID_P2P
|
|
||||||
#define P2P_CONCURRENT_SEARCH_DELAY 0
|
|
||||||
#else
|
|
||||||
#define P2P_CONCURRENT_SEARCH_DELAY 500
|
#define P2P_CONCURRENT_SEARCH_DELAY 500
|
||||||
#endif
|
|
||||||
#endif /* P2P_CONCURRENT_SEARCH_DELAY */
|
#endif /* P2P_CONCURRENT_SEARCH_DELAY */
|
||||||
|
|
||||||
enum p2p_group_removal_reason {
|
enum p2p_group_removal_reason {
|
||||||
@@ -1200,7 +1196,6 @@ void wpas_dev_found(void *ctx, const u8 *addr,
|
|||||||
#define WFD_DEV_INFO_SIZE 9
|
#define WFD_DEV_INFO_SIZE 9
|
||||||
char wfd_dev_info_hex[2 * WFD_DEV_INFO_SIZE + 1];
|
char wfd_dev_info_hex[2 * WFD_DEV_INFO_SIZE + 1];
|
||||||
os_memset(wfd_dev_info_hex, 0, sizeof(wfd_dev_info_hex));
|
os_memset(wfd_dev_info_hex, 0, sizeof(wfd_dev_info_hex));
|
||||||
|
|
||||||
#ifdef CONFIG_WIFI_DISPLAY
|
#ifdef CONFIG_WIFI_DISPLAY
|
||||||
if (info->wfd_subelems) {
|
if (info->wfd_subelems) {
|
||||||
wpa_snprintf_hex(wfd_dev_info_hex, sizeof(wfd_dev_info_hex),
|
wpa_snprintf_hex(wfd_dev_info_hex, sizeof(wfd_dev_info_hex),
|
||||||
@@ -5340,7 +5335,12 @@ unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s)
|
|||||||
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
|
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
|
||||||
if (!rn2 || os_strcmp(rn, rn2) != 0)
|
if (!rn2 || os_strcmp(rn, rn2) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
#ifdef ANDROID_P2P
|
||||||
|
/* We need not delay the p2p_scan if STA is already connected */
|
||||||
|
if (ifs->wpa_state > WPA_SCANNING && ifs->wpa_state < WPA_COMPLETED) {
|
||||||
|
#else
|
||||||
if (ifs->wpa_state > WPA_SCANNING) {
|
if (ifs->wpa_state > WPA_SCANNING) {
|
||||||
|
#endif
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use %u ms search "
|
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use %u ms search "
|
||||||
"delay due to concurrent operation on "
|
"delay due to concurrent operation on "
|
||||||
"interface %s",
|
"interface %s",
|
||||||
|
|||||||
@@ -690,6 +690,12 @@ scan:
|
|||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
wpa_msg(wpa_s, MSG_WARNING, "Failed to initiate AP scan");
|
wpa_msg(wpa_s, MSG_WARNING, "Failed to initiate AP scan");
|
||||||
|
#ifdef ANDROID_P2P
|
||||||
|
/* Restore back the wpa_s->scan_req if we failed the scan becoz of any reason */
|
||||||
|
wpa_msg(wpa_s, MSG_DEBUG, "Restoring back the wpa_s->scan_req "
|
||||||
|
"to the original value %d", scan_req);
|
||||||
|
wpa_s->scan_req = scan_req;
|
||||||
|
#endif
|
||||||
if (prev_state != wpa_s->wpa_state)
|
if (prev_state != wpa_s->wpa_state)
|
||||||
wpa_supplicant_set_state(wpa_s, prev_state);
|
wpa_supplicant_set_state(wpa_s, prev_state);
|
||||||
wpa_supplicant_req_scan(wpa_s, 1, 0);
|
wpa_supplicant_req_scan(wpa_s, 1, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user