From 422c1e3376ffa7a37f427b783c4082ca0cd4f9ad Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Sat, 8 May 2021 20:12:46 +0800 Subject: [PATCH] qcacld-3.0: Fix LTE unsafe channel switching failure of SAP At present LTE unsafe channel switch and DCS is using hdd_switch_sap_channel to switch channel of SAP. hdd_switch_sap_channel has no bw setting parameters and just use the original bw of SAP - ch_width_orig. The ch_width_orig (80Mhz) may not be applicable if SAP is channel switching from 5G 80Mhz to 2G. Use the new API wlan_get_ap_prefer_conc_ch_params to override the bw to appropriate value for the new channel. Change-Id: I9ab6c92a0534517c524bd56b0c3087d7f75f6368 CRs-Fixed: 2939654 --- .../cmn_services/policy_mgr/src/wlan_policy_mgr_action.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 48cbbe58ca69..0c6e5c991d50 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -2454,12 +2454,21 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, uint32_t ch_width, bool forced) { struct policy_mgr_psoc_priv_obj *pm_ctx; + struct ch_params ch_params = {0}; + QDF_STATUS status; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid context"); return; } + if (pm_ctx->hdd_cbacks.wlan_get_ap_prefer_conc_ch_params) { + status = pm_ctx->hdd_cbacks.wlan_get_ap_prefer_conc_ch_params( + psoc, vdev_id, ch_freq, &ch_params); + if (QDF_IS_STATUS_SUCCESS(status) && + ch_width > ch_params.ch_width) + ch_width = ch_params.ch_width; + } if (pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { policy_mgr_info("SAP change change without restart");