Browse Source

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
Liangwei Dong 3 years ago
parent
commit
1ad0172d7e
1 changed files with 9 additions and 0 deletions
  1. 9 0
      components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

+ 9 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -2462,12 +2462,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");