From 641ff5696e6c6b9cf965608f2c59dba2e6c9853c Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Wed, 30 Mar 2022 16:25:45 +0800 Subject: [PATCH] qcacld-3.0: Avoid SAP channel change if target freq and bw same Move the channel frequency and bandwidth check after wlansap_get_csa_chanwidth_from_phymode API call. The API may change the target channel bw if SAP works in concurrency with STA on same channel. Change-Id: I717c58e4a9e7eb6ea66b0eb56933b5508d4d83c0 CRs-Fixed: 3161386 --- core/sap/src/sap_module.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 4ddb5d21c4..144645d1e9 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1427,9 +1427,6 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx, mac->psoc, sap_ctx->sessionId, POLICY_MGR_BAND_5), sap_get_csa_reason_str(sap_ctx->csa_reason), sap_ctx->csa_reason, strict, sap_ctx->sessionId); - if (sap_ctx->chan_freq == target_chan_freq && - sap_ctx->ch_params.ch_width == target_bw) - return QDF_STATUS_E_FAULT; state = wlan_reg_get_channel_state_for_freq(mac->pdev, target_chan_freq); @@ -1455,6 +1452,12 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx, wlan_reg_set_channel_params_for_freq(mac->pdev, target_chan_freq, 0, &tmp_ch_params); + if (sap_ctx->chan_freq == target_chan_freq && + sap_ctx->ch_params.ch_width == tmp_ch_params.ch_width) { + sap_nofl_debug("target freq and bw %d not changed", + tmp_ch_params.ch_width); + return QDF_STATUS_E_FAULT; + } is_dfs = wlan_mlme_check_chan_param_has_dfs( mac->pdev, &tmp_ch_params, target_chan_freq);