diff --git a/umac/dcs/core/src/wlan_dcs.c b/umac/dcs/core/src/wlan_dcs.c index bdc96774edae..d7b16c899006 100644 --- a/umac/dcs/core/src/wlan_dcs.c +++ b/umac/dcs/core/src/wlan_dcs.c @@ -126,13 +126,6 @@ QDF_STATUS wlan_dcs_cmd_send(struct wlan_objmgr_psoc *psoc, dcs_tx_ops = target_if_dcs_get_tx_ops(psoc); if (dcs_tx_ops->dcs_cmd_send) { - if (dcs_enable & CAP_DCS_WLANIM) { - qdf_timer_stop(&dcs_pdev_priv->dcs_disable_timer); - qdf_mem_set(&dcs_pdev_priv->dcs_im_stats, - sizeof(dcs_pdev_priv->dcs_im_stats), 0); - dcs_pdev_priv->dcs_freq_ctrl_params. - disable_delay_process = false; - } dcs_info("dcs_enable: %u, pdev_id: %u", dcs_enable, pdev_id); return dcs_tx_ops->dcs_cmd_send(psoc, pdev_id, @@ -733,3 +726,27 @@ wlan_dcs_process(struct wlan_objmgr_psoc *psoc, struct dcs_stats_event *event) return QDF_STATUS_SUCCESS; } + +void wlan_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id) +{ + struct dcs_pdev_priv_obj *dcs_pdev_priv; + + if (!psoc) { + dcs_err("psoc is null"); + return; + } + + dcs_pdev_priv = wlan_dcs_get_pdev_private_obj(psoc, pdev_id); + if (!dcs_pdev_priv) { + dcs_err("dcs pdev private object is null"); + return; + } + + qdf_timer_stop(&dcs_pdev_priv->dcs_disable_timer); + qdf_mem_set(&dcs_pdev_priv->dcs_im_stats, + sizeof(dcs_pdev_priv->dcs_im_stats), 0); + qdf_mem_set(dcs_pdev_priv->dcs_freq_ctrl_params.timestamp, + MAX_DCS_TIME_RECORD * sizeof(unsigned long), 0); + dcs_pdev_priv->dcs_freq_ctrl_params.dcs_happened_count = 0; + dcs_pdev_priv->dcs_freq_ctrl_params.disable_delay_process = false; +} diff --git a/umac/dcs/core/src/wlan_dcs.h b/umac/dcs/core/src/wlan_dcs.h index 468502f8cc73..ec1cbc91a0e2 100644 --- a/umac/dcs/core/src/wlan_dcs.h +++ b/umac/dcs/core/src/wlan_dcs.h @@ -226,4 +226,15 @@ QDF_STATUS wlan_dcs_process(struct wlan_objmgr_psoc *psoc, */ void wlan_dcs_disable_timer_fn(void *dcs_timer_args); +/** + * wlan_dcs_clear() - clear dcs information + * @psoc: psoc pointer + * @pdev_id: pdev_id + * + * The function gets called to clear dcs information such as dcs + * frequency control parameters and stop dcs disable timer + * + * Return: None + */ +void wlan_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id); #endif /* _WLAN_DCS_H_ */ diff --git a/umac/dcs/dispatcher/inc/wlan_dcs_ucfg_api.h b/umac/dcs/dispatcher/inc/wlan_dcs_ucfg_api.h index b74763f87dc8..04e383173b9e 100644 --- a/umac/dcs/dispatcher/inc/wlan_dcs_ucfg_api.h +++ b/umac/dcs/dispatcher/inc/wlan_dcs_ucfg_api.h @@ -117,4 +117,14 @@ void ucfg_config_dcs_disable(struct wlan_objmgr_psoc *psoc, */ uint8_t ucfg_get_dcs_enable(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id); +/** + * ucfg_dcs_clear() - API to clear dcs related information + * @psoc: pointer to psoc object + * @pdev_id: pdev id + * + * This function gets called to clear dcs related information + * + * Return: None + */ +void ucfg_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id); #endif /* _WLAN_DCS_UCFG_API_H_ */ diff --git a/umac/dcs/dispatcher/src/wlan_dcs_ucfg_api.c b/umac/dcs/dispatcher/src/wlan_dcs_ucfg_api.c index 50857bb0ccbc..9d500b545884 100644 --- a/umac/dcs/dispatcher/src/wlan_dcs_ucfg_api.c +++ b/umac/dcs/dispatcher/src/wlan_dcs_ucfg_api.c @@ -91,3 +91,8 @@ uint8_t ucfg_get_dcs_enable(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id) return dcs_pdev_priv->dcs_host_params.dcs_enable; } + +void ucfg_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id) +{ + wlan_dcs_clear(psoc, pdev_id); +}