qcacmn: Store the threshold freq in regulatory

If a Radio supports 6G band channels, the ACS is expected to give
priority to a set of channels that are above a certain (threshold)
frequency.

Store the extracted threshold frequency from WMI into regulatory
component.

Add a new API reg_get_thresh_priority_freq to get the threshold
frequency received from the target.

CRs-Fixed: 3143318
Change-Id: I8676ce56e68b5a4eb4e4b64415dc293e086472f0
This commit is contained in:
Vijay Krishnan
2022-03-12 09:47:27 +05:30
committed by Madan Koyyalamudi
parent f683d0b718
commit 9bc8adec02
7 changed files with 57 additions and 1 deletions

View File

@@ -774,6 +774,8 @@ static void reg_propagate_6g_mas_channel_list(
pdev_priv_obj->reg_6g_superid = pdev_priv_obj->reg_6g_superid =
mas_chan_params->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_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 #else
static inline void reg_propagate_6g_mas_channel_list( 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_region_domain = mas_chan_params->reg_dmn_pair;
pdev_priv_obj->def_country_code = mas_chan_params->ctry_code; pdev_priv_obj->def_country_code = mas_chan_params->ctry_code;
qdf_mem_copy(pdev_priv_obj->default_country, qdf_mem_copy(pdev_priv_obj->default_country,
mas_chan_params->default_country, REG_ALPHA2_LEN + 1); 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; regulat_info->rnr_tpe_usable;
soc_reg->mas_chan_params[phy_id].unspecified_ap_usable = soc_reg->mas_chan_params[phy_id].unspecified_ap_usable =
regulat_info->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++) { for (i = 0; i < REG_CURRENT_MAX_AP_TYPE; i++) {
soc_reg->domain_code_6g_ap[i] = soc_reg->domain_code_6g_ap[i] =

View File

@@ -230,6 +230,8 @@ struct wlan_regulatory_psoc_priv_obj {
* sent by the target * sent by the target
* @is_reg_noaction_on_afc_pwr_evt: indicates whether regulatory needs to * @is_reg_noaction_on_afc_pwr_evt: indicates whether regulatory needs to
* take action when AFC Power event is received * 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 wlan_regulatory_pdev_priv_obj {
struct regulatory_channel cur_chan_list[NUM_CHANNELS]; 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; enum reg_6g_client_type reg_cur_6g_client_mobility_type;
bool reg_rnr_tpe_usable; bool reg_rnr_tpe_usable;
bool reg_unspecified_ap_usable; bool reg_unspecified_ap_usable;
qdf_freq_t reg_6g_thresh_priority_freq;
#endif #endif
#ifdef CONFIG_HOST_FIND_CHAN #ifdef CONFIG_HOST_FIND_CHAN
enum reg_phymode max_phymode; enum reg_phymode max_phymode;

View File

@@ -8161,3 +8161,19 @@ enum phy_ch_width reg_find_chwidth_from_bw(uint16_t bw)
} }
} }
#endif #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

View File

@@ -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); 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 #endif

View File

@@ -1167,6 +1167,8 @@ struct cur_reg_rule {
* @max_bw_5g: maximum 5G bw * @max_bw_5g: maximum 5G bw
* @num_2g_reg_rules: number 2G reg rules * @num_2g_reg_rules: number 2G reg rules
* @num_5g_reg_rules: number 5G and 6G 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_2g_ptr: ptr to 2G reg rules
* @reg_rules_5g_ptr: ptr to 5G reg rules * @reg_rules_5g_ptr: ptr to 5G reg rules
* @client_type: type of client * @client_type: type of client
@@ -1201,6 +1203,7 @@ struct cur_regulatory_info {
uint32_t max_bw_5g; uint32_t max_bw_5g;
uint32_t num_2g_reg_rules; uint32_t num_2g_reg_rules;
uint32_t num_5g_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_2g_ptr;
struct cur_reg_rule *reg_rules_5g_ptr; struct cur_reg_rule *reg_rules_5g_ptr;
enum reg_6g_client_type client_type; enum reg_6g_client_type client_type;
@@ -1539,6 +1542,8 @@ enum direction {
* @rnr_tpe_usable: if RNR TPE octet is usable for country * @rnr_tpe_usable: if RNR TPE octet is usable for country
* @unspecified_ap_usable: if not set, AP usable for country * @unspecified_ap_usable: if not set, AP usable for country
* @max_bw_5g: Maximum 5g Bandwidth * @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 { struct mas_chan_params {
enum dfs_reg dfs_region; enum dfs_reg dfs_region;
@@ -1566,6 +1571,7 @@ struct mas_chan_params {
enum reg_6g_client_type client_type; enum reg_6g_client_type client_type;
bool rnr_tpe_usable; bool rnr_tpe_usable;
bool unspecified_ap_usable; bool unspecified_ap_usable;
qdf_freq_t reg_6g_thresh_priority_freq;
#endif #endif
uint16_t max_bw_5g; uint16_t max_bw_5g;
}; };

View File

@@ -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, QDF_STATUS wlan_reg_is_chwidth_supported(struct wlan_objmgr_pdev *pdev,
enum phy_ch_width ch_width, enum phy_ch_width ch_width,
bool *is_supported); 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 #endif

View File

@@ -1704,3 +1704,10 @@ QDF_STATUS wlan_reg_is_chwidth_supported(struct wlan_objmgr_pdev *pdev,
} }
qdf_export_symbol(wlan_reg_is_chwidth_supported); 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 */