diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 21c45bf72000..50b843b00d9f 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -4494,41 +4494,6 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev, return status; } -/** - * reg_is_afc_available() - check if the automated frequency control system is - * available, function will need to be updated once AFC is implemented - * @pdev: Pointer to pdev structure - * - * Return: false since the AFC system is not yet available - */ -static bool reg_is_afc_available(struct wlan_objmgr_pdev *pdev) -{ - return false; -} - -enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev) -{ - struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; - enum reg_6g_ap_type ap_pwr_type = REG_INDOOR_AP; - - 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 REG_VERY_LOW_POWER_AP; - } - - if (reg_is_afc_available(pdev)) - ap_pwr_type = REG_STANDARD_POWER_AP; - else if (pdev_priv_obj->indoor_chan_enabled) - ap_pwr_type = REG_INDOOR_AP; - else if (pdev_priv_obj->reg_6g_superid != FCC1_6G && - pdev_priv_obj->reg_6g_superid != FCC1_6G_CL) - ap_pwr_type = REG_VERY_LOW_POWER_AP; - - reg_set_cur_6g_ap_pwr_type(pdev, ap_pwr_type); - - return ap_pwr_type; -} #endif QDF_STATUS diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index aa5bb4a169e7..70be60a512fb 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -1435,15 +1435,6 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev, qdf_freq_t chan_freq, bool *is_psd, uint16_t *tx_power, uint16_t *eirp_psd_power); - -/** - * reg_decide_6g_ap_pwr_type() - Decide which power mode AP should operate in - * - * @pdev: pdev ptr - * - * Return: AP power type - */ -enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev); #else static inline QDF_STATUS reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev, @@ -1529,12 +1520,6 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev, *eirp_psd_power = 0; return QDF_STATUS_E_NOSUPPORT; } - -static inline enum reg_6g_ap_type -reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev) -{ - return REG_INDOOR_AP; -} #endif /** diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index 11bb875ad479..12b0ad9b0c53 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -742,6 +742,43 @@ bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq) return true; } +#ifdef CONFIG_BAND_6GHZ +/** + * reg_is_afc_available() - check if the automated frequency control system is + * available, function will need to be updated once AFC is implemented + * @pdev: Pointer to pdev structure + * + * Return: false since the AFC system is not yet available + */ +static bool reg_is_afc_available(struct wlan_objmgr_pdev *pdev) +{ + return false; +} + +enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + enum reg_6g_ap_type ap_pwr_type = REG_INDOOR_AP; + + 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 REG_VERY_LOW_POWER_AP; + } + + if (reg_is_afc_available(pdev)) + ap_pwr_type = REG_STANDARD_POWER_AP; + else if (pdev_priv_obj->reg_6g_superid != FCC1_6G && + pdev_priv_obj->reg_6g_superid != FCC1_6G_CL) + ap_pwr_type = REG_VERY_LOW_POWER_AP; + + reg_set_cur_6g_ap_pwr_type(pdev, ap_pwr_type); + reg_compute_pdev_current_chan_list(pdev_priv_obj); + + return ap_pwr_type; +} +#endif /* CONFIG_BAND_6GHZ */ + #endif /* CONFIG_REG_CLIENT */ /** diff --git a/umac/regulatory/core/src/reg_utils.h b/umac/regulatory/core/src/reg_utils.h index 081227bee37a..4cfbd8c68a28 100644 --- a/umac/regulatory/core/src/reg_utils.h +++ b/umac/regulatory/core/src/reg_utils.h @@ -390,6 +390,22 @@ QDF_STATUS reg_set_curr_country( bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg, struct cur_regulatory_info *regulat_info); +#ifdef CONFIG_BAND_6GHZ +/** + * reg_decide_6g_ap_pwr_type() - Decide which power mode AP should operate in + * + * @pdev: pdev ptr + * + * Return: AP power type + */ +enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev); +#else +static inline enum reg_6g_ap_type +reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev) +{ + return REG_CURRENT_MAX_AP_TYPE; +} +#endif /* CONFIG_BAND_6GHZ */ #else static inline QDF_STATUS reg_read_current_country(struct wlan_objmgr_psoc *psoc, uint8_t *country_code) @@ -488,6 +504,12 @@ bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq) return false; } +static inline enum reg_6g_ap_type +reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev) +{ + return REG_CURRENT_MAX_AP_TYPE; +} + #endif #if defined(WLAN_FEATURE_DSRC) && defined(CONFIG_REG_CLIENT)