aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Dutt <usdutt@qti.qualcomm.com>2014-10-30 20:51:52 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-05 07:52:31 -0800
commit7ded1dad4115d36850ca1b0101dfeb024a5c94a8 (patch)
treeb3933fb5bc0df5478113dedea1960ba5ab840415
parent54f7321493d7a1241706b79702d6447012bd7a60 (diff)
downloadandroid_external_wpa_supplicant_8-7ded1dad4115d36850ca1b0101dfeb024a5c94a8.tar.gz
android_external_wpa_supplicant_8-7ded1dad4115d36850ca1b0101dfeb024a5c94a8.tar.bz2
android_external_wpa_supplicant_8-7ded1dad4115d36850ca1b0101dfeb024a5c94a8.zip
P2P: Do not consider the p2p_scan results after p2p_stop_find
If p2p_stop_find is issued after the p2p_scan request is triggered to the host driver, the obtained scan results are also considered to update the P2P peer entries. This is not always desired behavior, i.e., it can be clearer if no P2P-DEVICE-FOUND events are generated based of that final pending scan. Change-Id: Ia3d19990dd58c79b2252de0e5e145d8d711beae8 CRs-fixed: 750852 Git-commit: 477b082cc4e9cb2025dba83bab6f9eed47eefc05 Git-repo: git://w1.fi/srv/git/hostap.git Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wpa_supplicant/ctrl_iface.c1
-rw-r--r--wpa_supplicant/p2p_supplicant.c28
2 files changed, 29 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index d9123bae..5310eb7e 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -4976,6 +4976,7 @@ static void p2p_ctrl_flush(struct wpa_supplicant *wpa_s)
{
os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN);
wpa_s->force_long_sd = 0;
+ wpas_p2p_stop_find(wpa_s);
if (wpa_s->global->p2p)
p2p_flush(wpa_s->global->p2p);
}
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 0daa2329..2613ed38 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5759,6 +5759,28 @@ int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout,
}
+static void wpas_p2p_scan_res_ignore_search(struct wpa_supplicant *wpa_s,
+ struct wpa_scan_results *scan_res)
+{
+ wpa_printf(MSG_DEBUG, "P2P: Ignore scan results");
+
+ if (wpa_s->p2p_scan_work) {
+ struct wpa_radio_work *work = wpa_s->p2p_scan_work;
+ wpa_s->p2p_scan_work = NULL;
+ radio_work_done(work);
+ }
+
+ if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
+ return;
+
+ /*
+ * Indicate that results have been processed so that the P2P module can
+ * continue pending tasks.
+ */
+ p2p_scan_res_handled(wpa_s->global->p2p);
+}
+
+
static void wpas_p2p_stop_find_oper(struct wpa_supplicant *wpa_s)
{
wpas_p2p_clear_pending_action_tx(wpa_s);
@@ -5768,6 +5790,12 @@ static void wpas_p2p_stop_find_oper(struct wpa_supplicant *wpa_s)
if (wpa_s->global->p2p)
p2p_stop_find(wpa_s->global->p2p);
+
+ if (wpa_s->scan_res_handler == wpas_p2p_scan_res_handler) {
+ wpa_printf(MSG_DEBUG,
+ "P2P: Do not consider the scan results after stop_find");
+ wpa_s->scan_res_handler = wpas_p2p_scan_res_ignore_search;
+ }
}