From 9cfaa707b2b96c695859f2dd963a7a26164a85a5 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 17 Oct 2016 01:20:44 -0400 Subject: [PATCH] qcacld-3.0: Fix SAP restart failure qcacld-2.0 to qcacld-3.0 propagation When the driver is configured to "force SCC" mode by gWlanMccToSccSwitchMode = 2, in STA+SAP case, the driver will check the SAP channel to avoid the MCC in same band(2.4G or 5G) and override if necessary. During ACS process, the SAP sapContext->channel is 0. The driver doesn't validate it before uses it in sapGotoChannelSel when applies the "force SCC" logic. That causes an invalid channel selection for the SAP. And finally causes the hostapd starting failed. This fix is to skip the override logic if the sapContext->channel is 0. When the SAP is starting with a valid channel, the override logic will be activated again. Change-Id: I8e3d171ac47d8be149df98ae3e30c8df391a15b0 CRs-Fixed: 1033277 --- core/sap/src/sap_fsm.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index caa8a300974a..eaed08f4ab5b 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2215,7 +2215,18 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, #endif #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH if (sap_context->cc_switch_mode != - QDF_MCC_TO_SCC_SWITCH_DISABLE) { + QDF_MCC_TO_SCC_SWITCH_DISABLE && + sap_context->channel) { + /* + * For ACS request ,the sapContext->channel is 0, + * we skip below overlap checking. When the ACS + * finish and SAPBSS start, the sapContext->channel + * will not be 0. Then the overlap checking will be + * reactivated.If we use sapContext->channel = 0 + * to perform the overlap checking, an invalid overlap + * channel con_ch could becreated. That may cause + * SAP start failed. + */ con_ch = sme_check_concurrent_channel_overlap(h_hal, sap_context->channel, sap_context->csr_roamProfile.phyMode, @@ -2245,7 +2256,8 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, #endif #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH if (sap_context->cc_switch_mode != - QDF_MCC_TO_SCC_SWITCH_DISABLE) { + QDF_MCC_TO_SCC_SWITCH_DISABLE && + sap_context->channel) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, FL("check for overlap: chan:%d mode:%d"), sap_context->channel,