From a90c5a3db115fe4d6897d2d93fd2f773a2b7898f Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Wed, 20 Jan 2021 10:56:08 +0530 Subject: [PATCH] qcacld-3.0: Do not allow pre cac during CSA After pre cac succeeds, driver triggers regulatory change to user space then starts CSA process. As a result hostapd triggers another pre cac to driver while SAP performs CSA, this makes unexpected state in driver, therefore subsequent pre cac will not be correctly performed. To address this, reject the pre cac request during CSA. Change-Id: I82187d64bf94d3bdfab84b873c2ab438a4037ea9 CRs-Fixed: 2859289 --- core/hdd/src/wlan_hdd_sap_cond_chan_switch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c index 79f784a5ca9f..e9ec8a239ca8 100644 --- a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c +++ b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c @@ -200,6 +200,11 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx, return -EINVAL; } + if (qdf_atomic_read(&ap_adapter->ch_switch_in_progress)) { + hdd_err("pre cac not allowed during CSA"); + return -EINVAL; + } + mac_handle = hdd_ctx->mac_handle; val = wlan_sap_is_pre_cac_active(mac_handle); if (val) {