From f9068320ec451c2cc0568165f7bdf0be8900b4e2 Mon Sep 17 00:00:00 2001 From: Nishank Aggarwal Date: Tue, 2 Aug 2016 15:38:16 +0530 Subject: qcacld-3.0: Fix to restart SAP on preferred channel qcacld-2.0 to qcacld-3.0 propagation In some case when complete preferred channel list is unsafe, SAP won't be able to pick any channel as operating channel. This will lead to SAP start failure. Fix this issue by making first channel from preferred channel list as operating channel. Change-Id: Id2bd177b15bd7089250a49019a9c751a691dac01 CRs-Fixed: 1026420 --- core/sap/src/sap_api_link_cntl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 860449492622..3a9dca9b1928 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -160,7 +160,16 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle, __func__, scan_id); #endif operChannel = sap_select_channel(hal_handle, sap_ctx, result); + if (!operChannel) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + "No channel was selected from preferred channel for Operating channel"); + + operChannel = sap_ctx->acs_cfg->start_ch; + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + "Selecting operating channel as starting channel from preferred channel list: %d", + operChannel); + } sme_scan_result_purge(hal_handle, result); break; @@ -364,6 +373,16 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext, } #endif oper_channel = sap_select_channel(hal_handle, sap_ctx, presult); + if (!oper_channel) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + "No channel was selected from preferred channel for Operating channel"); + + oper_channel = sap_ctx->acs_cfg->start_ch; + + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + "Selecting operating channel as starting channel from preferred channel list: %d", + oper_channel); + } sme_scan_result_purge(hal_handle, presult); } -- cgit v1.2.3