From 749f0bd02284a57ab7eb0f600ff2d7d8eb6d9037 Mon Sep 17 00:00:00 2001 From: "Aggarwal, Nishank" Date: Tue, 14 Jun 2016 17:51:55 +0530 Subject: qcacld-2.0: Fix to restart SAP on preferred channel 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/sapApiLinkCntl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CORE/SAP/src/sapApiLinkCntl.c b/CORE/SAP/src/sapApiLinkCntl.c index 130a8dbe3446..1fe613868e1f 100644 --- a/CORE/SAP/src/sapApiLinkCntl.c +++ b/CORE/SAP/src/sapApiLinkCntl.c @@ -192,6 +192,16 @@ WLANSAP_ScanCallback "%s: ACS scan id: %d (skipped ACS SCAN)", __func__, scanID); #endif operChannel = sapSelectChannel(halHandle, psapContext, pResult); + if (!operChannel) { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("No channel was selected from preferred channel for Operating channel")); + + operChannel = psapContext->acs_cfg->start_ch; + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Selecting operating channel as starting channel from preferred channel list: %d"), + operChannel); + } sme_ScanResultPurge(halHandle, pResult); break; @@ -410,6 +420,16 @@ WLANSAP_PreStartBssAcsScanCallback } #endif operChannel = sapSelectChannel(halHandle, psapContext, pResult); + if (!operChannel) { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("No channel was selected from preferred channel for Operating channel")); + + operChannel = psapContext->acs_cfg->start_ch; + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Selecting operating channel as starting channel from preferred channel list: %d"), + operChannel); + } sme_ScanResultPurge(halHandle, pResult); } -- cgit v1.2.3