From 864856f884b35ac9e3677ff45510380435ebc244 Mon Sep 17 00:00:00 2001 From: Min Liu Date: Mon, 16 Nov 2020 16:06:52 +0800 Subject: [PATCH] qcacld-3.0: Channel switch on 2G when CC is updated Current logic in wlansap_get_chan_band_restrict will skip channel switch for 2G channel which is disabled due to CC update by mistake. Update the condiction logic to make it work properly. Change-Id: Ib4c07447f14a47c2934c63ebdc09821eb8e5a3d1 CRs-Fixed: 2818651 --- core/sap/src/sap_module.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index cd218e46ab4c..1af12f3ca2e3 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -3133,9 +3133,8 @@ qdf_freq_t wlansap_get_chan_band_restrict(struct sap_context *sap_ctx, sap_debug("set 40M when switch SAP to 2G"); restart_ch_width = CH_WIDTH_40MHZ; } - } else if (sap_band == REG_BAND_2G && (band & BIT(REG_BAND_5G))) { - if (sap_ctx->chan_freq_before_switch_band == 0) - return 0; + } else if (sap_band == REG_BAND_2G && (band & BIT(REG_BAND_5G)) && + sap_ctx->chan_freq_before_switch_band) { restart_freq = sap_ctx->chan_freq_before_switch_band; restart_ch_width = sap_ctx->chan_width_before_switch_band; sap_debug("Restore chan freq: %d, width: %d",