diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index 95f13ed5db..8cd43c97d5 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -36,9 +36,7 @@ #include "reg_build_chan_list.h" #include -#define CHAN_12_CENT_FREQ 2467 #define MAX_PWR_FCC_CHAN_12 8 -#define CHAN_13_CENT_FREQ 2472 #define MAX_PWR_FCC_CHAN_13 2 #define CHAN_144_CENT_FREQ 5720 diff --git a/umac/regulatory/core/src/reg_build_chan_list.h b/umac/regulatory/core/src/reg_build_chan_list.h index 9c5b511df4..36fcf13f6e 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.h +++ b/umac/regulatory/core/src/reg_build_chan_list.h @@ -26,6 +26,9 @@ #ifndef __REG_BUILD_CHAN_LIST_H__ #define __REG_BUILD_CHAN_LIST_H__ +#define CHAN_12_CENT_FREQ 2467 +#define CHAN_13_CENT_FREQ 2472 + /** * reg_reset_reg_rules() - provides the reg domain rules info * @reg_rules: reg rules pointer diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index 9da552c855..23bc5993ae 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -529,6 +529,8 @@ void set_disable_channel_state( } #endif +#ifdef CONFIG_REG_CLIENT + QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev, bool fcc_constraint) { @@ -570,6 +572,27 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev, return status; } +bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq) +{ + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + + 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 false; + } + + if (freq != CHAN_12_CENT_FREQ && freq != CHAN_13_CENT_FREQ) + return false; + + if (!pdev_priv_obj->set_fcc_channel) + return false; + + return true; +} + +#endif /* CONFIG_REG_CLIENT */ + /** * 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 2e2a8882fa..906869776d 100644 --- a/umac/regulatory/core/src/reg_utils.h +++ b/umac/regulatory/core/src/reg_utils.h @@ -116,6 +116,16 @@ QDF_STATUS reg_cache_channel_state(struct wlan_objmgr_pdev *pdev, QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev, bool fcc_constraint); +/** + * reg_get_fcc_constraint() - Check FCC constraint on given frequency + * @pdev: physical dev to get + * @freq: frequency to be checked + * + * Return: If FCC constraint is applied on given frequency return true + * else return false. + */ +bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq); + /** * reg_read_current_country() - Get the current regulatory country * @psoc: The physical SoC to get current country from @@ -392,6 +402,20 @@ bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg, { return false; } + +static inline +QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev, + bool fcc_constraint) +{ + return QDF_STATUS_SUCCESS; +} + +static inline +bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq) +{ + return false; +} + #endif #if defined(WLAN_FEATURE_DSRC) && defined(CONFIG_REG_CLIENT) diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index dc91439dde..d698903328 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -177,6 +177,16 @@ QDF_STATUS wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev, QDF_STATUS wlan_reg_read_default_country(struct wlan_objmgr_psoc *psoc, uint8_t *country); +/** + * wlan_reg_get_fcc_constraint() - Check FCC constraint on given frequency + * @pdev: physical dev to get + * @freq: frequency to be checked + * + * Return: If FCC constraint is on applied given frequency return true + * else return false. + */ +bool wlan_reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq); + #ifdef CONFIG_REG_CLIENT /** * wlan_reg_read_current_country() - Read the current country for the regdomain diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index b4c5cfc4cf..51de942325 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -556,6 +556,11 @@ bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev return reg_is_etsi13_srd_chan_allowed_master_mode(pdev); } +bool wlan_reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq) +{ + return reg_get_fcc_constraint(pdev, freq); +} + QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev, uint32_t *chip_mode) {