diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index e4c840d051..fcd3681018 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -892,6 +892,29 @@ enum channel_state reg_get_channel_state(struct wlan_objmgr_pdev *pdev, return pdev_priv_obj->cur_chan_list[ch_idx].state; } +bool reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch) +{ + enum channel_enum ch_idx; + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + + ch_idx = reg_get_chan_enum(ch); + + if (ch_idx == INVALID_CHANNEL) + return false; + + pdev_priv_obj = reg_get_pdev_obj(pdev); + + if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { + reg_err("pdev reg obj is NULL"); + return false; + } + if (pdev_priv_obj->cur_chan_list[ch_idx].chan_flags & + REGULATORY_CHAN_RADAR) + return true; + + return false; +} + /** * reg_get_5g_bonded_chan_array() - get ptr to bonded channel * @oper_ch: operating channel number diff --git a/umac/regulatory/core/src/reg_services.h b/umac/regulatory/core/src/reg_services.h index 0fe24d08a3..c64e641a42 100644 --- a/umac/regulatory/core/src/reg_services.h +++ b/umac/regulatory/core/src/reg_services.h @@ -106,6 +106,16 @@ QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev, enum channel_state reg_get_channel_state(struct wlan_objmgr_pdev *pdev, uint32_t ch); +/** + * reg_chan_has_dfs_attribute() - check channel has dfs attribue or not + * @ch: channel number. + * + * This API get chan initial dfs attribue flag from regdomain + * + * Return: true if chan is dfs, otherwise false + */ +bool reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch); + enum channel_state reg_get_5g_bonded_channel_state(struct wlan_objmgr_pdev *pdev, uint8_t ch, diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 6238653560..12f456407a 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -103,6 +103,17 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc, enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev, uint32_t ch); +/** + * wlan_reg_chan_has_dfs_attribute() - check channel has dfs attribute flag + * @ch: channel number. + * + * This API get chan initial dfs attribute from regdomain + * + * Return: true if chan is dfs, otherwise false + */ +bool +wlan_reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch); + /** * wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state * @pdev: The physical dev to program country code or regdomain diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 1d957ef7a5..a3a6db8d37 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -85,6 +85,12 @@ enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev, return reg_get_channel_state(pdev, ch); } +bool +wlan_reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch) +{ + return reg_chan_has_dfs_attribute(pdev, ch); +} + /** * wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state * @ch: channel number.