diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 90c53a762d9a..52e11ab5b378 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -8238,7 +8238,11 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId, status); fCallCallback = true; } - } else if (status != QDF_STATUS_E_EXISTS) { + } else if (status == QDF_STATUS_E_EXISTS && + pProfile->BSSIDs.numOfBSSIDs) { + sme_debug("Scan entries removed either due to rssi reject or assoc disallowed"); + fCallCallback = true; + } else { /* scan for this SSID */ status = csr_scan_for_ssid(mac, sessionId, pProfile, roamId, true); @@ -8249,9 +8253,6 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId, } else { sme_debug("SSID scan requested"); } - } else { - sme_debug("Scan entries removed either due to rssi reject or assoc disallowed"); - fCallCallback = true; } } else { fCallCallback = true; diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index ce4fe8400bed..471c7db98390 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -2772,7 +2772,7 @@ QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx, qdf_list_t *list = NULL; struct scan_filter *filter = NULL; struct wlan_objmgr_pdev *pdev = NULL; - uint32_t num_bss; + uint32_t num_bss = 0; if (results) *results = CSR_INVALID_SCANRESULT_HANDLE; @@ -2800,16 +2800,20 @@ QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx, list = ucfg_scan_get_result(pdev, pFilter ? filter : NULL); - if (list) - sme_debug("num_entries %d", qdf_list_size(list)); - + if (list) { + num_bss = qdf_list_size(list); + sme_debug("num_entries %d", num_bss); + } /* Filter the scan list with the blacklist, rssi reject, avoided APs */ if (pFilter && pFilter->csrPersona == QDF_STA_MODE) wlan_blm_filter_bssid(pdev, list); if (!list || (list && !qdf_list_size(list))) { sme_debug("scan list empty"); - status = QDF_STATUS_E_NULL_VALUE; + if (num_bss) + status = QDF_STATUS_E_EXISTS; + else + status = QDF_STATUS_E_NULL_VALUE; goto error; } @@ -2823,9 +2827,6 @@ QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx, ret_list->pCurEntry = NULL; status = csr_parse_scan_list(mac_ctx, ret_list, list); - num_bss = csr_ll_count(&ret_list->List); - sme_debug("status: %d No of BSS: %d", - status, num_bss); if (QDF_IS_STATUS_ERROR(status) || !results) /* Fail or No one wants the result. */ csr_scan_result_purge(mac_ctx, (tScanResultHandle) ret_list);