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
This commit is contained in:
Rachit Kankane 2019-05-20 14:55:31 +05:30 • committed by nshrivas
commit 2dba675717
2 changed files with 5 additions and 15 deletions

View file

@ -223,18 +223,6 @@ wlansap_calculate_chan_from_scan_result(mac_handle_t mac_handle,
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);

View file

@ -339,7 +339,8 @@ static void sap_process_avoid_ie(mac_handle_t mac_handle,
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 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams,
*/
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 @@ uint8_t sap_select_channel(mac_handle_t mac_handle,
* 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"));