diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index 72f468f5db..13be9c7cf9 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -774,6 +774,8 @@ static void reg_propagate_6g_mas_channel_list( pdev_priv_obj->reg_6g_superid = mas_chan_params->reg_6g_superid; pdev_priv_obj->reg_cur_6g_ap_pwr_type = REG_INDOOR_AP; + pdev_priv_obj->reg_6g_thresh_priority_freq = + mas_chan_params->reg_6g_thresh_priority_freq; } #else static inline void reg_propagate_6g_mas_channel_list( @@ -802,7 +804,6 @@ void reg_init_pdev_mas_chan_list( pdev_priv_obj->def_region_domain = mas_chan_params->reg_dmn_pair; pdev_priv_obj->def_country_code = mas_chan_params->ctry_code; - qdf_mem_copy(pdev_priv_obj->default_country, mas_chan_params->default_country, REG_ALPHA2_LEN + 1); @@ -2950,6 +2951,8 @@ static void reg_store_regulatory_ext_info_to_socpriv( regulat_info->rnr_tpe_usable; soc_reg->mas_chan_params[phy_id].unspecified_ap_usable = regulat_info->unspecified_ap_usable; + soc_reg->mas_chan_params[phy_id].reg_6g_thresh_priority_freq = + regulat_info->reg_6g_thresh_priority_freq; for (i = 0; i < REG_CURRENT_MAX_AP_TYPE; i++) { soc_reg->domain_code_6g_ap[i] = diff --git a/umac/regulatory/core/src/reg_priv_objs.h b/umac/regulatory/core/src/reg_priv_objs.h index 5514f69951..4fa116bfca 100644 --- a/umac/regulatory/core/src/reg_priv_objs.h +++ b/umac/regulatory/core/src/reg_priv_objs.h @@ -230,6 +230,8 @@ struct wlan_regulatory_psoc_priv_obj { * sent by the target * @is_reg_noaction_on_afc_pwr_evt: indicates whether regulatory needs to * take action when AFC Power event is received + * @reg_6g_thresh_priority_freq: All frequencies greater or equal will be given + * priority during channel selection by upper layer */ struct wlan_regulatory_pdev_priv_obj { struct regulatory_channel cur_chan_list[NUM_CHANNELS]; @@ -283,6 +285,7 @@ struct wlan_regulatory_pdev_priv_obj { enum reg_6g_client_type reg_cur_6g_client_mobility_type; bool reg_rnr_tpe_usable; bool reg_unspecified_ap_usable; + qdf_freq_t reg_6g_thresh_priority_freq; #endif #ifdef CONFIG_HOST_FIND_CHAN enum reg_phymode max_phymode; diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 9de0d432b9..62c5911bb6 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -8161,3 +8161,19 @@ enum phy_ch_width reg_find_chwidth_from_bw(uint16_t bw) } } #endif + +#ifdef CONFIG_BAND_6GHZ +qdf_freq_t reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev) +{ + 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("reg pdev private obj is NULL"); + return 0; + } + + return pdev_priv_obj->reg_6g_thresh_priority_freq; +} +#endif diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index f417c27d30..b25aeb5e43 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -2228,4 +2228,11 @@ reg_conv_6g_ap_type_to_supported_6g_pwr_types(enum reg_6g_ap_type ap_pwr_type); */ enum phy_ch_width reg_find_chwidth_from_bw(uint16_t bw); +#ifdef CONFIG_BAND_6GHZ +/** + * reg_get_thresh_priority_freq() - Get the prioritized frequency value + * @pdev: pdev pointer + */ +qdf_freq_t reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev); +#endif /* CONFIG_BAND_6GHZ */ #endif diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index 742a1d1e46..af0c4586d6 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -1167,6 +1167,8 @@ struct cur_reg_rule { * @max_bw_5g: maximum 5G bw * @num_2g_reg_rules: number 2G reg rules * @num_5g_reg_rules: number 5G and 6G reg rules + * @reg_6g_thresh_priority_freq: All frequencies greater or equal will be given + * priority during channel selection by upper layer * @reg_rules_2g_ptr: ptr to 2G reg rules * @reg_rules_5g_ptr: ptr to 5G reg rules * @client_type: type of client @@ -1201,6 +1203,7 @@ struct cur_regulatory_info { uint32_t max_bw_5g; uint32_t num_2g_reg_rules; uint32_t num_5g_reg_rules; + qdf_freq_t reg_6g_thresh_priority_freq; struct cur_reg_rule *reg_rules_2g_ptr; struct cur_reg_rule *reg_rules_5g_ptr; enum reg_6g_client_type client_type; @@ -1539,6 +1542,8 @@ enum direction { * @rnr_tpe_usable: if RNR TPE octet is usable for country * @unspecified_ap_usable: if not set, AP usable for country * @max_bw_5g: Maximum 5g Bandwidth + * @reg_6g_thresh_priority_freq: All frequencies greater or equal will be given + * priority during channel selection by upper layer */ struct mas_chan_params { enum dfs_reg dfs_region; @@ -1566,6 +1571,7 @@ struct mas_chan_params { enum reg_6g_client_type client_type; bool rnr_tpe_usable; bool unspecified_ap_usable; + qdf_freq_t reg_6g_thresh_priority_freq; #endif uint16_t max_bw_5g; }; diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index a88ddff895..ed2c1cdb20 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -2232,4 +2232,18 @@ bool wlan_reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc); QDF_STATUS wlan_reg_is_chwidth_supported(struct wlan_objmgr_pdev *pdev, enum phy_ch_width ch_width, bool *is_supported); + +#ifdef CONFIG_BAND_6GHZ +/** + * wlan_reg_get_thresh_priority_freq() - Get the prioritized frequency value + * @pdev: pdev pointer + */ +qdf_freq_t wlan_reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev); +#else +static inline +qdf_freq_t wlan_reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev) +{ + return 0; +} +#endif /* CONFIG_BAND_6GHZ */ #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 0cb3d114c7..473b4d84e8 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -1704,3 +1704,10 @@ QDF_STATUS wlan_reg_is_chwidth_supported(struct wlan_objmgr_pdev *pdev, } qdf_export_symbol(wlan_reg_is_chwidth_supported); + +#ifdef CONFIG_BAND_6GHZ +qdf_freq_t wlan_reg_get_thresh_priority_freq(struct wlan_objmgr_pdev *pdev) +{ + return reg_get_thresh_priority_freq(pdev); +} +#endif /* CONFIG_BAND_6GHZ */