From 72a123fcb62058106ed8c25dcc2703b7ef7eef9e Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Wed, 29 Dec 2021 16:02:00 +0530 Subject: [PATCH] qcacld-3.0: Initialize sap ch_width by Max ch_width Initialize sap bw as MAX BW in policy_mgr_valid_sap_conc_channel_check() as wlansap_get_csa_chanwidth_from_phymode() take care of selecting BW for sap and it has a check that will take minimum of selected BW and initialized BW. If this BW is not initialized with Max BW then in cases where original BW is 0 (20 Mhz) (cases such as channel switch happens from 2.4Ghz to 5Ghz), the above mentioned check will result in selected BW being 0 (20 Mhz) for non-DBS HW. Change-Id: I29febf09036ffa0163df58ce51b399abe2a43fe2 CRs-Fixed: 3101285 --- core/sap/src/sap_fsm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index a36f8514cab2..85596813b7a8 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -797,7 +797,7 @@ sap_validate_chan(struct sap_context *sap_context, uint32_t sta_sap_bit_mask = QDF_STA_MASK | QDF_SAP_MASK; uint32_t concurrent_state; bool go_force_scc; - struct ch_params ch_params; + struct ch_params ch_params = {0}; mac_handle = cds_get_context(QDF_MODULE_ID_SME); mac_ctx = MAC_CONTEXT(mac_handle); @@ -837,7 +837,15 @@ sap_validate_chan(struct sap_context *sap_context, sap_context->cc_switch_mode); sap_debug("After check overlap: sap freq %d con freq:%d", sap_context->chan_freq, con_ch_freq); - ch_params = sap_context->ch_params; + /* + * For non-DBS platform, a 2.4Ghz can become a 5Ghz freq + * so lets used max BW in that case, if it remain 2.4Ghz + * then BW will be limited to 20 anyway + */ + if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_context->chan_freq)) + ch_params.ch_width = CH_WIDTH_MAX; + else + ch_params = sap_context->ch_params; if (sap_context->cc_switch_mode != QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) { @@ -851,6 +859,9 @@ sap_validate_chan(struct sap_context *sap_context, return QDF_STATUS_E_ABORTED; } } + /* if CH width didn't change fallback to original */ + if (ch_params.ch_width == CH_WIDTH_MAX) + ch_params = sap_context->ch_params; sap_debug("After check concurrency: con freq:%d", con_ch_freq);