From 80d045198263bb3dfad4d97574140e338c2f87bd Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Thu, 18 Oct 2018 18:17:51 +0530 Subject: [PATCH] qcacmn: Add API to clear CAC started channel Add API to clear CAC started channel in the DFS component. Also, when AP detects the RADAR in DFS channel and restarts the AP vap in NON-DFS channel, call MLME state machine to clear the DFS_WAIT flag and move the state to RUN. Since MLME state machine is per vap, move the NON-DFS check in dfs_clear_cac_started_chan() to MLME and call dfs_mlme_proc_cac() per vap. Change-Id: I67033aa6ea819b6ed5d39a3911191d2051f731fc Acked-by: Shashikala Prabhu CRs-Fixed: 2324561 --- umac/dfs/core/src/misc/dfs_cac.c | 32 -------------------- umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h | 6 ++++ umac/dfs/dispatcher/src/wlan_dfs_utils_api.c | 11 +++++++ 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/umac/dfs/core/src/misc/dfs_cac.c b/umac/dfs/core/src/misc/dfs_cac.c index 875ae76035d0..973d2744a275 100644 --- a/umac/dfs/core/src/misc/dfs_cac.c +++ b/umac/dfs/core/src/misc/dfs_cac.c @@ -332,38 +332,6 @@ void dfs_clear_cac_started_chan(struct wlan_dfs *dfs) bool dfs_check_for_cac_start(struct wlan_dfs *dfs, bool *continue_current_cac) { - if (!WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(dfs->dfs_curchan)) { - /* Consider a case where AP was up in a DFS channel and in CAC - * period (DFS-WAIT state) and the workque to initiate CAC is - * scheduled. At this time, real radar/spoof radar pulses from - * bottom-half/tasklet context are received which is given - * higher priority than Workque context. Due to radar, channel - * change happened, AP switched to non-DFS channel and curchan - * is non-DFS. The scheduled workque gets executed now, starts - * a CAC on non-DFS curchan(curchan has changed from DFS to - * non-DFS work queue func not aware of this !!). Though the - * vap state machine moves the state of the vap from DFS-WAIT - * to RUN state as curchan is non-DFS, the cac timer is not - * cancelled. CAC timer on non-DFS channel runs and it expires. - * So cancelling CAC here if chan is not DFS to avoid this - * unexpected run and expiry of CAC. - */ - dfs_cac_stop(dfs); - dfs_mlme_proc_cac(dfs->dfs_pdev_obj, 0); - - /* Clear the old dfs cac started channel if the current channel - * is NON-DFS. - * For example: AP sets the cac started channel as 100. It does - * cac on channel 100 and starts beaconing. User changes the AP - * channel to 36 and after sometime if user changes the channel - * back to 100, AP does not do the CAC since user channel and - * cac started channel is same. - */ - dfs_clear_cac_started_chan(dfs); - dfs_debug(dfs, WLAN_DEBUG_DFS, "Skip CAC on NON-DFS chan"); - return false; - } - if (dfs->dfs_ignore_dfs || dfs->dfs_cac_valid || dfs->dfs_ignore_cac) { dfs_debug(dfs, WLAN_DEBUG_DFS, "Skip CAC, ignore_dfs = %d cac_valid = %d ignore_cac = %d", diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h index f1e615b516b9..fe53d9d0b033 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h @@ -589,4 +589,10 @@ QDF_STATUS utils_dfs_get_disable_radar_marking(struct wlan_objmgr_pdev *pdev, return QDF_STATUS_SUCCESS; } #endif + +/** + * utils_dfs_clear_cac_started_chan() - Clear dfs cac started channel. + * @pdev: pdev ptr + */ +void utils_dfs_clear_cac_started_chan(struct wlan_objmgr_pdev *pdev); #endif /* _WLAN_DFS_UTILS_API_H_ */ diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index 495dfca77254..f7ae9b97b245 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c @@ -200,6 +200,17 @@ QDF_STATUS utils_dfs_cac_stop(struct wlan_objmgr_pdev *pdev) } qdf_export_symbol(utils_dfs_cac_stop); +void utils_dfs_clear_cac_started_chan(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_dfs *dfs; + + dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev); + if (!dfs) + return; + + dfs_clear_cac_started_chan(dfs); +} + bool utils_dfs_check_for_cac_start(struct wlan_objmgr_pdev *pdev, bool *continue_current_cac) {