Change-Id: I733b23c2b7a24cfa96fe6593adbcbeb7d0798002
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
wpa_supplicant_notify_scanning(wpa_s, 0);
#ifdef CONFIG_P2P
wpa_supplicant_notify_scanning(wpa_s, 0);
#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 &&
wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
wpa_s->p2p_cb_on_scan_complete = 0;
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
wpa_s->p2p_cb_on_scan_complete = 0;
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
#endif /* P2P_MAX_INITIAL_CONN_WAIT */
#ifndef P2P_CONCURRENT_SEARCH_DELAY
#endif /* P2P_MAX_INITIAL_CONN_WAIT */
#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 /* P2P_CONCURRENT_SEARCH_DELAY */
enum p2p_group_removal_reason {
#endif /* P2P_CONCURRENT_SEARCH_DELAY */
enum p2p_group_removal_reason {
#define WFD_DEV_INFO_SIZE 9
char wfd_dev_info_hex[2 * WFD_DEV_INFO_SIZE + 1];
os_memset(wfd_dev_info_hex, 0, sizeof(wfd_dev_info_hex));
#define WFD_DEV_INFO_SIZE 9
char wfd_dev_info_hex[2 * WFD_DEV_INFO_SIZE + 1];
os_memset(wfd_dev_info_hex, 0, sizeof(wfd_dev_info_hex));
#ifdef CONFIG_WIFI_DISPLAY
if (info->wfd_subelems) {
wpa_snprintf_hex(wfd_dev_info_hex, sizeof(wfd_dev_info_hex),
#ifdef CONFIG_WIFI_DISPLAY
if (info->wfd_subelems) {
wpa_snprintf_hex(wfd_dev_info_hex, sizeof(wfd_dev_info_hex),
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
if (!rn2 || os_strcmp(rn, rn2) != 0)
continue;
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
if (!rn2 || os_strcmp(rn, rn2) != 0)
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) {
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use %u ms search "
"delay due to concurrent operation on "
"interface %s",
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use %u ms search "
"delay due to concurrent operation on "
"interface %s",
* P2P Client, remove the interface depending up on the connection
* priority */
if(!wpas_is_p2p_prioritized(wpa_s)) {
* P2P Client, remove the interface depending up on the connection
* priority */
if(!wpas_is_p2p_prioritized(wpa_s)) {
- /* STA connection has priority over existing
+ /* STA connection has priority over existing
* P2P connection. So remove the interface */
wpa_printf(MSG_DEBUG, "P2P: Removing P2P connection due to Single channel"
"concurrent mode frequency conflict");
* P2P connection. So remove the interface */
wpa_printf(MSG_DEBUG, "P2P: Removing P2P connection due to Single channel"
"concurrent mode frequency conflict");
if (ret) {
wpa_msg(wpa_s, MSG_WARNING, "Failed to initiate AP scan");
if (ret) {
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)
wpa_supplicant_set_state(wpa_s, prev_state);
wpa_supplicant_req_scan(wpa_s, 1, 0);
if (prev_state != wpa_s->wpa_state)
wpa_supplicant_set_state(wpa_s, prev_state);
wpa_supplicant_req_scan(wpa_s, 1, 0);