From 37ac32ba18880c3f05487bc61994f8f7d29fab4e Mon Sep 17 00:00:00 2001 From: Shaakir Mohamed Date: Thu, 25 Jul 2019 13:54:36 -0700 Subject: [PATCH] qcacmn: Fix CAC during vdev restart Add compile time flag to restart CAC when vap is restarted on same channel. Change-Id: I7d4d4fdf4a6defac8fc436b63495b51c272669af CRs-Fixed: 2495630 --- umac/dfs/core/src/dfs.h | 14 ++++++++++++ umac/dfs/core/src/misc/dfs_cac.c | 37 ++++++++++++++++++++------------ 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index b143538dcbf8..f387ce1385dc 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -2669,4 +2669,18 @@ void dfs_reset_agile_config(struct dfs_soc_priv_obj *dfs_soc); * @dfs: Pointer to wlan_dfs. */ int dfs_reinit_timers(struct wlan_dfs *dfs); + +/** + * dfs_skip_cac_after_vdev_restart() - Skip CAC if new channel is same + * as old channel after vdev restart. + * @dfs: Pointer to wlan_dfs structure. + */ +#ifdef QCA_SKIP_CAC_AFTER_RESTART +bool dfs_skip_cac_after_vdev_restart(struct wlan_dfs *dfs); +#else +static inline bool dfs_skip_cac_after_vdev_restart(struct wlan_dfs *dfs) +{ + return true; +} +#endif #endif /* _DFS_H_ */ diff --git a/umac/dfs/core/src/misc/dfs_cac.c b/umac/dfs/core/src/misc/dfs_cac.c index 140db5ae1df1..b1ac44f9f2d3 100644 --- a/umac/dfs/core/src/misc/dfs_cac.c +++ b/umac/dfs/core/src/misc/dfs_cac.c @@ -342,6 +342,28 @@ void dfs_clear_cac_started_chan(struct wlan_dfs *dfs) sizeof(dfs->dfs_cac_started_chan)); } +#ifdef QCA_SKIP_CAC_AFTER_RESTART +bool dfs_skip_cac_after_vdev_restart(struct wlan_dfs *dfs) +{ + if (dfs_is_curchan_subset_of_cac_started_chan(dfs)) { + /* AP bandwidth reduce case: + * When AP detects the RADAR in in-service monitoring + * mode in channel A, it cancels the running CAC and + * tries to find the channel B with the reduced + * bandwidth of channel A. + * If the new channel B is subset of the channel A + * then AP skips the CAC. + */ + if (!dfs->dfs_cac_aborted) { + dfs_debug(dfs, WLAN_DEBUG_DFS, "Skip CAC"); + return false; + } + } + + return true; +} +#endif + bool dfs_check_for_cac_start(struct wlan_dfs *dfs, bool *continue_current_cac) { @@ -397,20 +419,7 @@ bool dfs_check_for_cac_start(struct wlan_dfs *dfs, dfs_cancel_cac_timer(dfs); } } else { /* CAC timer is not running. */ - if (dfs_is_curchan_subset_of_cac_started_chan(dfs)) { - /* AP bandwidth reduce case: - * When AP detects the RADAR in in-service monitoring - * mode in channel A, it cancels the running CAC and - * tries to find the channel B with the reduced - * bandwidth of channel A. - * If the new channel B is subset of the channel A - * then AP skips the CAC. - */ - if (!dfs->dfs_cac_aborted) { - dfs_debug(dfs, WLAN_DEBUG_DFS, "Skip CAC"); - return false; - } - } + return dfs_skip_cac_after_vdev_restart(dfs); } return true;