From 0e6b19c47ca6eec28ea22b5799bf544a85c3e69f Mon Sep 17 00:00:00 2001 From: Vignesh U Date: Thu, 14 Feb 2019 15:20:21 +0530 Subject: [PATCH] qcacmn: Move the function used by WIN out of MCL specific macro Move reg_enable_dfs_channels() outside of MCL specific macro as it is also used by WIN. Change-Id: I8fecf365a695524ad7a97b66eca5c6657aedb264 CRs-Fixed: 2398789 --- .../regulatory/core/src/reg_services_common.c | 52 +++++++++++++++++++ .../regulatory/core/src/reg_services_common.h | 8 +++ umac/regulatory/core/src/reg_utils.c | 52 ------------------- umac/regulatory/core/src/reg_utils.h | 14 ----- 4 files changed, 60 insertions(+), 66 deletions(-) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index a291d9cf9b24..e4e7bfa613b1 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -1956,3 +1956,55 @@ uint32_t reg_max_5ghz_ch_num(void) { return REG_MAX_5GHZ_CH_NUM; } + +QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, + bool enable) +{ + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + struct wlan_objmgr_psoc *psoc; + QDF_STATUS status; + struct wlan_lmac_if_reg_tx_ops *reg_tx_ops; + + pdev_priv_obj = reg_get_pdev_obj(pdev); + if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { + reg_err("pdev reg component is NULL"); + return QDF_STATUS_E_INVAL; + } + + if (pdev_priv_obj->dfs_enabled == enable) { + reg_info("dfs_enabled is already set to %d", enable); + return QDF_STATUS_SUCCESS; + } + + psoc = wlan_pdev_get_psoc(pdev); + if (!psoc) { + reg_err("psoc is NULL"); + return QDF_STATUS_E_INVAL; + } + + psoc_priv_obj = reg_get_psoc_obj(psoc); + if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) { + reg_err("psoc reg component is NULL"); + return QDF_STATUS_E_INVAL; + } + + reg_info("setting dfs_enabled: %d", enable); + + pdev_priv_obj->dfs_enabled = enable; + + reg_compute_pdev_current_chan_list(pdev_priv_obj); + + reg_tx_ops = reg_get_psoc_tx_ops(psoc); + + /* Fill the ic channel list with the updated current channel + * chan list. + */ + if (reg_tx_ops->fill_umac_legacy_chanlist) + reg_tx_ops->fill_umac_legacy_chanlist(pdev, + pdev_priv_obj->cur_chan_list); + + status = reg_send_scheduler_msg_sb(psoc, pdev); + + return status; +} diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 1d95309e140b..26a19f950e65 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -497,4 +497,12 @@ uint32_t reg_min_5ghz_ch_num(void); * Return: Maximum 5GHz channel number */ uint32_t reg_max_5ghz_ch_num(void); + +/** + * reg_enable_dfs_channels() - Enable the use of DFS channels + * @pdev: The physical dev to enable/disable DFS channels for + * + * Return: QDF_STATUS + */ +QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, bool enable); #endif diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index a9c15b66fa43..37fa9a3eed32 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -538,58 +538,6 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev, return status; } -QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, - bool enable) -{ - struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; - struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; - struct wlan_objmgr_psoc *psoc; - QDF_STATUS status; - struct wlan_lmac_if_reg_tx_ops *reg_tx_ops; - - pdev_priv_obj = reg_get_pdev_obj(pdev); - if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { - reg_err("pdev reg component is NULL"); - return QDF_STATUS_E_INVAL; - } - - if (pdev_priv_obj->dfs_enabled == enable) { - reg_info("dfs_enabled is already set to %d", enable); - return QDF_STATUS_SUCCESS; - } - - psoc = wlan_pdev_get_psoc(pdev); - if (!psoc) { - reg_err("psoc is NULL"); - return QDF_STATUS_E_INVAL; - } - - psoc_priv_obj = reg_get_psoc_obj(psoc); - if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) { - reg_err("psoc reg component is NULL"); - return QDF_STATUS_E_INVAL; - } - - reg_info("setting dfs_enabled: %d", enable); - - pdev_priv_obj->dfs_enabled = enable; - - reg_compute_pdev_current_chan_list(pdev_priv_obj); - - reg_tx_ops = reg_get_psoc_tx_ops(psoc); - - /* Fill the ic channel list with the updated current channel - * chan list. - */ - if (reg_tx_ops->fill_umac_legacy_chanlist) - reg_tx_ops->fill_umac_legacy_chanlist(pdev, - pdev_priv_obj->cur_chan_list); - - status = reg_send_scheduler_msg_sb(psoc, pdev); - - return status; -} - /** * reg_change_pdev_for_config() - Update user configuration in pdev private obj. * @psoc: Pointer to global psoc structure. diff --git a/umac/regulatory/core/src/reg_utils.h b/umac/regulatory/core/src/reg_utils.h index b05098b87316..9e7ce89ce3bd 100644 --- a/umac/regulatory/core/src/reg_utils.h +++ b/umac/regulatory/core/src/reg_utils.h @@ -160,14 +160,6 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev, uint8_t *country); */ QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc); -/** - * reg_enable_dfs_channels() - Enable the use of DFS channels - * @pdev: The physical dev to enable/disable DFS channels for - * - * Return: QDF_STATUS - */ -QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, bool enable); - /** * reg_get_domain_from_country_code() - Get regdomain from country code * @reg_domain_ptr: Pointer to save regdomain @@ -323,12 +315,6 @@ static inline QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } -static inline QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, - bool enable) -{ - return QDF_STATUS_SUCCESS; -} - static inline QDF_STATUS reg_get_domain_from_country_code( v_REGDOMAIN_t *reg_domain_ptr, const uint8_t *country_alpha2, enum country_src source)