qcacld-3.0: Return valid channel if ACS scan fails
Return valid channel whenever ACS scan returns no results
Change-Id: I44d9248550a263d12ac9f060eb50ac4bfa4d1d11
CRs-Fixed: 2454070
diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c
index 5942316..547eb9d 100644
--- a/core/sap/src/sap_api_link_cntl.c
+++ b/core/sap/src/sap_api_link_cntl.c
@@ -223,18 +223,6 @@
if (list)
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
FL("num_entries %d"), qdf_list_size(list));
- if (!list || (list && !qdf_list_size(list))) {
- sme_err("get scan result failed");
- QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
- FL("Failed to get scan results"));
- if (list)
- ucfg_scan_purge_results(list);
- /*
- * No scan results So, set the operation channel not selected
- * to allow the default channel to be set when reporting to HDD
- */
- return oper_channel;
- }
wlansap_send_acs_success_event(sap_ctx, scan_id);
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c
index 167e927..e02b76c 100644
--- a/core/sap/src/sap_ch_select.c
+++ b/core/sap/src/sap_ch_select.c
@@ -339,7 +339,8 @@
mac_ctx = MAC_CONTEXT(mac_handle);
spect_ch = spect_info->pSpectCh;
- qdf_list_peek_front(scan_list, &cur_lst);
+ if (scan_list)
+ qdf_list_peek_front(scan_list, &cur_lst);
while (cur_lst) {
cur_node = qdf_container_of(cur_lst, struct scan_cache_node,
node);
@@ -1553,7 +1554,8 @@
*/
SET_ACS_BAND(operatingBand, sap_ctx);
- qdf_list_peek_front(scan_list, &cur_lst);
+ if (scan_list)
+ qdf_list_peek_front(scan_list, &cur_lst);
while (cur_lst) {
uint32_t ie_len = 0;
uint8_t *ie_ptr;
@@ -2649,7 +2651,7 @@
* If ACS weight is not enabled on noise_floor/channel_free/tx_power,
* then skip acs process if no bss found.
*/
- if (!scan_list &&
+ if ((!scan_list || !qdf_list_size(scan_list)) &&
!(sap_ctx->auto_channel_select_weight & 0xffff00)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
FL("No external AP present"));