From 78bb108d7c7fdf7709a38648acf2a0f74268c574 Mon Sep 17 00:00:00 2001 From: Priyadarshnee S Date: Wed, 6 May 2020 18:48:12 +0530 Subject: [PATCH] qcacmn: Add a dispatcher API to determine if RCAC is supported Add a dispatcher API ucfg_dfs_is_agile_rcac_enabled() to determine if RCAC is supported for the given pdev. Change the prototype of dfs_get_rcac_enable() to store rcac config in a bool datatype. Also, do a structure copy of ch_params of RCAC channel in utils_dfs_get_rcac_channel(). CRs-Fixed: 2679975 Change-Id: I4b033463fc8111144bfffd3bb7e7d2bef6568c46 --- umac/dfs/core/src/dfs_zero_cac.h | 23 ++-------------- umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h | 27 +++++++++++++++++-- umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c | 17 +++++++++++- umac/dfs/dispatcher/src/wlan_dfs_utils_api.c | 2 +- .../lmac_if/inc/wlan_lmac_if_def.h | 3 ++- .../lmac_if/src/wlan_lmac_if.c | 1 + 6 files changed, 47 insertions(+), 26 deletions(-) diff --git a/umac/dfs/core/src/dfs_zero_cac.h b/umac/dfs/core/src/dfs_zero_cac.h index 27eec9cce2c2..96bc7d126952 100644 --- a/umac/dfs/core/src/dfs_zero_cac.h +++ b/umac/dfs/core/src/dfs_zero_cac.h @@ -1171,11 +1171,11 @@ dfs_set_rcac_enable(struct wlan_dfs *dfs, */ #ifdef QCA_SUPPORT_ADFS_RCAC QDF_STATUS dfs_get_rcac_enable(struct wlan_dfs *dfs, - uint8_t *rcac_en); + bool *rcac_en); #else static inline QDF_STATUS dfs_get_rcac_enable(struct wlan_dfs *dfs, - uint8_t *rcac_en) + bool *rcac_en) { return QDF_STATUS_SUCCESS; } @@ -1241,25 +1241,6 @@ dfs_rcac_timer_deinit(struct dfs_soc_priv_obj *dfs_soc_obj) } #endif -/** - * dfs_is_host_agile_rcac_config_enabled() - Check if agile rCAC is enabled. - * This considers the user config and DFS domain of the pdev to - * to decide if agile RCAC is supported or not. - * @dfs: Pointer to the wlan_dfs object. - * - * Return: True if agile DFS is enabled, else false. - * - */ -#ifdef QCA_SUPPORT_ADFS_RCAC -bool dfs_is_host_agile_rcac_config_enabled(struct wlan_dfs *dfs); -#else -static inline bool -dfs_is_host_agile_rcac_config_enabled(struct wlan_dfs *dfs) -{ - return false; -} -#endif - #ifdef QCA_SUPPORT_ADFS_RCAC #define DFS_RCAC_SM_SPIN_LOCK(_soc_obj) \ qdf_spin_lock_bh(&((_soc_obj)->dfs_rcac_sm_lock)) diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h index 2a5501a6ddb3..3a6e45f845fd 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h @@ -623,11 +623,11 @@ ucfg_dfs_set_rcac_enable(struct wlan_objmgr_pdev *pdev, */ #ifdef QCA_SUPPORT_ADFS_RCAC QDF_STATUS ucfg_dfs_get_rcac_enable(struct wlan_objmgr_pdev *pdev, - uint8_t *rcac_en); + bool *rcac_en); #else static inline QDF_STATUS ucfg_dfs_get_rcac_enable(struct wlan_objmgr_pdev *pdev, - uint8_t *rcac_en) + bool *rcac_en) { return QDF_STATUS_SUCCESS; } @@ -669,4 +669,27 @@ ucfg_dfs_get_rcac_freq(struct wlan_objmgr_pdev *pdev, } #endif +/** + * ucfg_dfs_is_agile_rcac_enabled() - Determine if Rolling CAC is supported + * or not. + * @pdev: Pointer to struct wlan_objmgr_pdev. + * + * Following are the conditions needed to assertain that rolling CAC + * is enabled: + * 1. DFS domain of the PDEV must be FCC or MKK. + * 2. User has enabled Rolling CAC configuration. + * 3. FW capability to support ADFS. + * + * Return: True if RCAC support is enabled, false otherwise. + */ +#ifdef QCA_SUPPORT_ADFS_RCAC +bool ucfg_dfs_is_agile_rcac_enabled(struct wlan_objmgr_pdev *pdev); +#else +static inline bool +ucfg_dfs_is_agile_rcac_enabled(struct wlan_objmgr_pdev *pdev) +{ + return false; +} +#endif + #endif /* _WLAN_DFS_UCFG_API_H_ */ diff --git a/umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c b/umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c index a51a917cb668..807255d2f290 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c @@ -469,7 +469,7 @@ QDF_STATUS ucfg_dfs_set_rcac_enable(struct wlan_objmgr_pdev *pdev, qdf_export_symbol(ucfg_dfs_set_rcac_enable); QDF_STATUS ucfg_dfs_get_rcac_enable(struct wlan_objmgr_pdev *pdev, - uint8_t *rcac_en) + bool *rcac_en) { struct wlan_dfs *dfs; @@ -521,4 +521,19 @@ QDF_STATUS ucfg_dfs_get_rcac_freq(struct wlan_objmgr_pdev *pdev, } qdf_export_symbol(ucfg_dfs_get_rcac_freq); + +bool ucfg_dfs_is_agile_rcac_enabled(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_dfs *dfs; + + dfs = wlan_pdev_get_dfs_obj(pdev); + if (!dfs) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "null dfs"); + return false; + } + + return dfs_is_agile_rcac_enabled(dfs); +} + +qdf_export_symbol(ucfg_dfs_is_agile_rcac_enabled); #endif diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index a012d78ed974..f147da163af2 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c @@ -1668,7 +1668,7 @@ QDF_STATUS utils_dfs_get_rcac_channel(struct wlan_objmgr_pdev *pdev, return status; *target_chan_freq = dfs->dfs_rcac_param.rcac_pri_freq; - chan_params = &dfs->dfs_rcac_param.rcac_ch_params; + *chan_params = dfs->dfs_rcac_param.rcac_ch_params; return QDF_STATUS_SUCCESS; } diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 047737625cf5..91a2f36fb99a 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -1636,13 +1636,14 @@ struct wlan_lmac_if_dfs_rx_ops { QDF_STATUS (*dfs_set_rcac_enable)(struct wlan_objmgr_pdev *pdev, bool rcac_en); QDF_STATUS (*dfs_get_rcac_enable)(struct wlan_objmgr_pdev *pdev, - uint8_t *rcac_en); + bool *rcac_en); QDF_STATUS (*dfs_set_rcac_freq)(struct wlan_objmgr_pdev *pdev, qdf_freq_t rcac_freq); QDF_STATUS (*dfs_get_rcac_freq)(struct wlan_objmgr_pdev *pdev, qdf_freq_t *rcac_freq); void (*dfs_rcac_sm_deliver_evt)(struct wlan_objmgr_pdev *pdev, enum dfs_rcac_sm_evt event); + bool (*dfs_is_agile_rcac_enabled)(struct wlan_objmgr_pdev *pdev); #endif }; diff --git a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c index 33134212b6bb..43c3d379b827 100644 --- a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c +++ b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c @@ -500,6 +500,7 @@ static void register_rcac_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) rx_ops->dfs_set_rcac_freq = ucfg_dfs_set_rcac_freq; rx_ops->dfs_get_rcac_freq = ucfg_dfs_get_rcac_freq; rx_ops->dfs_rcac_sm_deliver_evt = utils_dfs_rcac_sm_deliver_evt; + rx_ops->dfs_is_agile_rcac_enabled = ucfg_dfs_is_agile_rcac_enabled; } #else static inline void