From 7e11bc35152c24c587aa3230cc0306b8e2f6ee53 Mon Sep 17 00:00:00 2001 From: Deepthi Gowri Date: Fri, 26 Aug 2016 18:18:47 +0530 Subject: [PATCH] qcacld-3.0: Flush p2p scan results before single channel p2p scan qcacld-2.0 to qcacld-3.0 propagation Currently the p2p scan results are not flushed if the p2p scan is issued for a single channel scan which would result in a stale entry. To address this, flush the p2p scan results before issuing single channel p2p scan. Change-Id: Iaaee1b4b4147e68e99927ea90082bc6f288a2e72 CRS-Fixed: 855782 --- core/hdd/src/wlan_hdd_scan.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 93cbade33a..d1700bbd98 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1309,6 +1309,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, hdd_adapter_t *con_sap_adapter; uint16_t con_dfs_ch; uint8_t num_chan = 0; + bool is_p2p_scan = false; ENTER(); @@ -1522,12 +1523,17 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, * fails which is not desired */ - if (request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN) { + if ((request->n_ssids == 1) && + (request->ssids != NULL) && + qdf_mem_cmp(&request->ssids[0], "DIRECT-", 7)) + is_p2p_scan = true; + + if (is_p2p_scan || + (request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN)) { hdd_debug("Flushing P2P Results"); sme_scan_flush_p2p_result(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId); + pAdapter->sessionId); } - if (request->ie_len) { /* save this for future association (join requires this) */ memset(&pScanInfo->scanAddIE, 0, sizeof(pScanInfo->scanAddIE));