diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 51983374d53f..3cb6a6852989 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -2489,6 +2489,32 @@ bool reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq) FIVE_GIG_ENDING_EDGE_FREQ); } +bool reg_is_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq) +{ + struct regulatory_channel *cur_chan_list; + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + enum channel_enum chan_enum; + + pdev_priv_obj = reg_get_pdev_obj(pdev); + + if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { + reg_err("reg pdev priv obj is NULL"); + return false; + } + + chan_enum = reg_get_chan_enum_for_freq(freq); + + if (chan_enum == INVALID_CHANNEL) { + reg_err_rl("Invalid chan enum %d", chan_enum); + return false; + } + + cur_chan_list = pdev_priv_obj->cur_chan_list; + + return (cur_chan_list[chan_enum].chan_flags & + REGULATORY_CHAN_INDOOR_ONLY); +} + #ifdef CONFIG_BAND_6GHZ bool reg_is_6ghz_chan_freq(uint16_t freq) { @@ -2549,39 +2575,6 @@ bool reg_is_6ghz_psc_chan_freq(uint16_t freq) return false; } -/** - * reg_is_freq_indoor() - Check if the input frequency is an indoor frequency. - * @pdev: Pointer to pdev. - * @freq: Channel frequency. - * - * Return: Return true if the input frequency is indoor, else false. - */ -static bool reg_is_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq) -{ - struct regulatory_channel *cur_chan_list; - struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; - enum channel_enum chan_enum; - - pdev_priv_obj = reg_get_pdev_obj(pdev); - - if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { - reg_err("reg pdev priv obj is NULL"); - return false; - } - - chan_enum = reg_get_chan_enum_for_freq(freq); - - if (chan_enum == INVALID_CHANNEL) { - reg_err_rl("Invalid chan enum %d", chan_enum); - return false; - } - - cur_chan_list = pdev_priv_obj->cur_chan_list; - - return (cur_chan_list[chan_enum].chan_flags & - REGULATORY_CHAN_INDOOR_ONLY); -} - bool reg_is_6g_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq) { return (REG_IS_6GHZ_FREQ(freq) && reg_is_freq_indoor(pdev, freq)); diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 1c1738112092..3c11f3123cb8 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -569,6 +569,15 @@ bool reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq); */ bool reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq); +/** + * reg_is_freq_indoor() - Check if the input frequency is an indoor frequency. + * @pdev: Pointer to pdev. + * @freq: Channel frequency. + * + * Return: Return true if the input frequency is indoor, else false. + */ +bool reg_is_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq); + #ifdef CONFIG_BAND_6GHZ /** * reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 89c9802d63f3..c0f4b5182260 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -158,6 +158,15 @@ bool wlan_reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq); */ bool wlan_reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq); +/** + * wlan_reg_is_freq_indoor() - Check if a frequency is indoor. + * @pdev: Pointer to pdev. + * @freq: Channel frequency. + * + * Return: Return true if a frequency is indoor, else false. + */ +bool wlan_reg_is_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq); + #ifdef CONFIG_BAND_6GHZ /** * wlan_reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 0748ff553446..93d9d9dbb6bc 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -830,6 +830,11 @@ bool wlan_reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq) return reg_is_range_overlap_5g(low_freq, high_freq); } +bool wlan_reg_is_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq) +{ + return reg_is_freq_indoor(pdev, freq); +} + #ifdef CONFIG_BAND_6GHZ bool wlan_reg_is_6ghz_chan_freq(uint16_t freq) {