qcacmn: Add APIs to configure target AFC flags

Add common code to configure target AFC flags:
enable_6ghz_sp_pwrmode_supp, afc_disable_timer_check,
afc_disable_request_id_check.

Remove cfg_get set is_afc_reg_noaction code, add it to psoc regulatory
private data.

Add APIs to set and get these AFC configures.

Change-Id: Idf74b245113eee18b071a7fbb92bb151cd535ce8
CRs-Fixed: 3154185
This commit is contained in:
Will Huang
2022-10-27 12:07:29 +08:00
committed by Madan Koyyalamudi
parent ac613788de
commit f8f0b97ffa
13 changed files with 470 additions and 4 deletions

View File

@@ -535,6 +535,8 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
target_if_set_regulatory_eirp_preferred_support(psoc);
tgt_if_set_reg_afc_configure(tgt_hdl, psoc);
/* send init command */
init_deinit_set_send_init_cmd(psoc, tgt_hdl);

View File

@@ -102,6 +102,24 @@ QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc);
struct wlan_lmac_if_reg_tx_ops *
target_if_regulatory_get_tx_ops(struct wlan_objmgr_psoc *psoc);
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
/**
* tgt_if_set_reg_afc_configure() - Configure target AFC feature
* @tgt_hdl: target psoc info handler
* @psoc: pointer to psoc
*
* Return: None
*/
void tgt_if_set_reg_afc_configure(struct target_psoc_info *tgt_hdl,
struct wlan_objmgr_psoc *psoc);
#else
static inline
void tgt_if_set_reg_afc_configure(struct target_psoc_info *tgt_hdl,
struct wlan_objmgr_psoc *psoc)
{
}
#endif
#if defined(CONFIG_BAND_6GHZ)
/**
* target_if_reg_set_lower_6g_edge_ch_info() - populate lower 6ghz edge channel

View File

@@ -958,6 +958,32 @@ QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc)
return QDF_STATUS_SUCCESS;
}
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
void tgt_if_set_reg_afc_configure(struct target_psoc_info *tgt_hdl,
struct wlan_objmgr_psoc *psoc)
{
struct tgt_info *info;
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle || !tgt_hdl)
return;
if (!wmi_service_enabled(wmi_handle, wmi_service_afc_support)) {
target_if_err("service afc support not enable");
return;
}
info = (&tgt_hdl->info);
info->wlan_res_cfg.is_6ghz_sp_pwrmode_supp_enabled =
ucfg_reg_get_enable_6ghz_sp_mode_support(psoc);
info->wlan_res_cfg.afc_timer_check_disable =
ucfg_reg_get_afc_disable_timer_check(psoc);
info->wlan_res_cfg.afc_req_id_check_disable =
ucfg_reg_get_afc_disable_request_id_check(psoc);
}
#endif
#if defined(CONFIG_BAND_6GHZ)
/**
* tgt_if_regulatory_is_lower_6g_edge_ch_supp() - Check if lower 6ghz

View File

@@ -267,11 +267,11 @@ reg_destroy_afc_cb_spinlock(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
}
static void
reg_init_afc_vars(struct wlan_objmgr_psoc *psoc,
reg_init_afc_vars(struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj,
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
{
pdev_priv_obj->is_reg_noaction_on_afc_pwr_evt =
cfg_get(psoc, CFG_OL_AFC_REG_NO_ACTION);
psoc_priv_obj->is_afc_reg_noaction;
}
static inline void
@@ -293,7 +293,7 @@ reg_destroy_afc_cb_spinlock(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
}
static void
reg_init_afc_vars(struct wlan_objmgr_psoc *psoc,
reg_init_afc_vars(struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj,
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
{
}
@@ -411,7 +411,7 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
reg_compute_pdev_current_chan_list(pdev_priv_obj);
reg_init_afc_vars(parent_psoc, pdev_priv_obj);
reg_init_afc_vars(psoc_priv_obj, pdev_priv_obj);
if (!psoc_priv_obj->is_11d_offloaded)
reg_11d_host_scan_init(parent_psoc);

View File

@@ -138,6 +138,11 @@ struct ctry_change_cbk_entry {
* @reg_afc_dev_type: AFC device deployment type from BDF
* @reg_is_eirp_support_preferred: Whether target prefers EIRP format for
* WMI Set TPC command
* @enable_6ghz_sp_pwrmode_supp: Whether enable target Standard Power mode
* support
* @afc_disable_timer_check: Whether disable target AFC timer check
* @afc_disable_request_id_check: Whether disable target AFC request id check
* @is_afc_reg_noaction: Whether no action to AFC power event
* @sta_sap_scc_on_indoor_channel: Value of sap+sta scc on indoor support
* @fcc_rules_ptr : Value of fcc channel frequency and tx_power list received
* from firmware
@@ -213,6 +218,10 @@ struct wlan_regulatory_psoc_priv_obj {
#ifdef CONFIG_AFC_SUPPORT
enum reg_afc_dev_deploy_type reg_afc_dev_type;
bool reg_is_eirp_support_preferred;
bool enable_6ghz_sp_pwrmode_supp;
bool afc_disable_timer_check;
bool afc_disable_request_id_check;
bool is_afc_reg_noaction;
#endif
bool sta_sap_scc_on_indoor_channel;
#ifdef CONFIG_REG_CLIENT

View File

@@ -2238,6 +2238,123 @@ QDF_STATUS reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
bool reg_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return false;
}
return psoc_priv_obj->enable_6ghz_sp_pwrmode_supp;
}
void reg_set_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc,
bool value)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return;
}
psoc_priv_obj->enable_6ghz_sp_pwrmode_supp = value;
}
bool reg_get_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return false;
}
return psoc_priv_obj->afc_disable_timer_check;
}
void reg_set_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc,
bool value)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return;
}
psoc_priv_obj->afc_disable_timer_check = value;
}
bool reg_get_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return false;
}
return psoc_priv_obj->afc_disable_request_id_check;
}
void reg_set_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc,
bool value)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return;
}
psoc_priv_obj->afc_disable_request_id_check = value;
}
bool reg_get_afc_noaction(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return false;
}
return psoc_priv_obj->is_afc_reg_noaction;
}
void reg_set_afc_noaction(struct wlan_objmgr_psoc *psoc, bool value)
{
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_err("psoc reg component is NULL");
return;
}
psoc_priv_obj->is_afc_reg_noaction = value;
}
#endif
bool reg_chan_in_range(struct regulatory_channel *chan_list,
qdf_freq_t low_freq_2g, qdf_freq_t high_freq_2g,
qdf_freq_t low_freq_5g, qdf_freq_t high_freq_5g,

View File

@@ -350,6 +350,79 @@ QDF_STATUS reg_modify_chan_144(struct wlan_objmgr_pdev *pdev, bool en_chan_144);
*/
bool reg_get_en_chan_144(struct wlan_objmgr_pdev *pdev);
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
/**
* reg_get_enable_6ghz_sp_mode_support() - Get enable 6 GHz SP mode support
* @psoc: pointer to psoc object
*
* Return: enable 6 GHz SP mode support flag
*/
bool reg_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc);
/**
* reg_set_enable_6ghz_sp_mode_support() - Set enable 6 GHz SP mode support
* @psoc: pointer to psoc object
* @value: value to be set
*
* Return: None
*/
void reg_set_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* reg_get_afc_disable_timer_check() - Get AFC timer check flag
* @psoc: pointer to psoc object
*
* Return: AFC timer check flag
*/
bool reg_get_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc);
/**
* reg_set_afc_disable_timer_check() - Set AFC disable timer check
* @psoc: pointer to psoc object
* @value: value to be set
*
* Return: None
*/
void reg_set_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* reg_get_afc_disable_request_id_check() - Get AFC request id check flag
* @psoc: pointer to psoc object
*
* Return: AFC request id check flag
*/
bool reg_get_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc);
/**
* reg_set_afc_disable_request_id_check() - Set AFC disable request id flag
* @psoc: pointer to psoc object
* @value: value to be set
*
* Return: None
*/
void reg_set_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* reg_get_afc_noaction() - Get AFC no action flag
* @psoc: pointer to psoc object
*
* Return: AFC no action flag
*/
bool reg_get_afc_noaction(struct wlan_objmgr_psoc *psoc);
/**
* reg_set_afc_noaction() - Set AFC no action flag
* @psoc: pointer to psoc object
* @value: value to be set
*
* Return: None
*/
void reg_set_afc_noaction(struct wlan_objmgr_psoc *psoc, bool value);
#endif
/**
* reg_get_hal_reg_cap() - Get HAL REG capabilities
* @psoc: psoc for country information

View File

@@ -884,6 +884,28 @@ static void reg_change_pdev_for_config(struct wlan_objmgr_psoc *psoc,
reg_send_scheduler_msg_sb(psoc, pdev);
}
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
static inline void
reg_set_afc_vars(struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj,
struct reg_config_vars *config_vars)
{
psoc_priv_obj->enable_6ghz_sp_pwrmode_supp =
config_vars->enable_6ghz_sp_pwrmode_supp;
psoc_priv_obj->afc_disable_timer_check =
config_vars->afc_disable_timer_check;
psoc_priv_obj->afc_disable_request_id_check =
config_vars->afc_disable_request_id_check;
psoc_priv_obj->is_afc_reg_noaction =
config_vars->is_afc_reg_noaction;
}
#else
static inline void
reg_set_afc_vars(struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj,
struct reg_config_vars *config_vars)
{
}
#endif
QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
struct reg_config_vars config_vars)
{
@@ -918,6 +940,7 @@ QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
reg_get_coex_unsafe_chan_reg_disable(psoc_priv_obj, config_vars);
psoc_priv_obj->sta_sap_scc_on_indoor_channel =
config_vars.sta_sap_scc_on_indoor_channel;
reg_set_afc_vars(psoc_priv_obj, &config_vars);
status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID);
if (QDF_IS_STATUS_ERROR(status)) {

View File

@@ -1526,6 +1526,10 @@ enum restart_beaconing_on_ch_avoid_rule {
* userspace
* @coex_unsafe_chan_reg_disable: To disable reg channels for received coex
* unsafe channels list
* @enable_6ghz_sp_pwrmode_supp: Enable target 6 GHz Standard Power mode support
* @afc_disable_timer_check: Disable target AFC timer check
* @afc_disable_request_id_check: Disable target AFC request id check
* @is_afc_reg_noaction: Whether no action to AFC power event
* @sta_sap_scc_on_indoor_channel: Value of sap+sta scc on indoor support
*/
struct reg_config_vars {
@@ -1544,6 +1548,12 @@ struct reg_config_vars {
#ifdef FEATURE_WLAN_CH_AVOID_EXT
bool coex_unsafe_chan_nb_user_prefer;
bool coex_unsafe_chan_reg_disable;
#endif
#if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
bool enable_6ghz_sp_pwrmode_supp;
bool afc_disable_timer_check;
bool afc_disable_request_id_check;
bool is_afc_reg_noaction;
#endif
bool sta_sap_scc_on_indoor_channel;
};

View File

@@ -426,6 +426,126 @@ void ucfg_reg_ch_avoid_ext(struct wlan_objmgr_psoc *psoc,
struct ch_avoid_ind_type *ch_avoid);
#endif
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
/**
* ucfg_reg_get_enable_6ghz_sp_mode_support() - Get enable 6 GHz SP mode support
* @psoc: psoc ptr
*
* Return: enable 6 GHz SP mode support flag
*/
bool ucfg_reg_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_reg_set_enable_6ghz_sp_mode_support() - Set enable 6 GHz SP mode support
* @psoc: psoc ptr
* @value: value to be set
*
* Return: None
*/
void ucfg_reg_set_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* ucfg_reg_get_afc_disable_timer_check() - Get AFC timer check disable flag
* @psoc: psoc ptr
*
* Return: AFC timer check disable flag
*/
bool ucfg_reg_get_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_reg_set_afc_disable_timer_check() - Set AFC timer check disable flag
* @psoc: psoc ptr
* @value: value to be set
*
* Return: None
*/
void ucfg_reg_set_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* ucfg_reg_get_afc_disable_request_id_check() - Get AFC request id check flag
* @psoc: psoc ptr
*
* Return: AFC request id check disable flag
*/
bool ucfg_reg_get_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_reg_set_afc_disable_request_id_check() - Set AFC request id check flag
* @psoc: psoc ptr
* @value: value to be set
*
* Return: None
*/
void ucfg_reg_set_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc,
bool value);
/**
* ucfg_reg_get_afc_no_action() - Get AFC no action flag
* @psoc: psoc ptr
*
* Return: AFC no action flag
*/
bool ucfg_reg_get_afc_no_action(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_reg_set_afc_no_action() - Set AFC no action flag
* @psoc: psoc ptr
* @value: value to be set
*
* Return: None
*/
void ucfg_reg_set_afc_no_action(struct wlan_objmgr_psoc *psoc, bool value);
#else
static inline
bool ucfg_reg_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline
void ucfg_reg_set_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc,
bool value)
{
}
static inline
bool ucfg_reg_get_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline
void ucfg_reg_set_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc,
bool value)
{
}
static inline
bool ucfg_reg_get_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline
void ucfg_reg_set_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc,
bool value)
{
}
static inline
bool ucfg_reg_get_afc_no_action(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline
void ucfg_reg_set_afc_no_action(struct wlan_objmgr_psoc *psoc, bool value)
{
}
#endif
/**
* ucfg_reg_11d_vdev_delete_update() - update vdev delete to regulatory
* @vdev: vdev ptr

View File

@@ -417,6 +417,67 @@ ucfg_reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
qdf_export_symbol(ucfg_reg_get_cur_6g_ap_pwr_type);
#endif
#if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
bool ucfg_reg_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc)
{
return reg_get_enable_6ghz_sp_mode_support(psoc);
}
qdf_export_symbol(ucfg_reg_get_enable_6ghz_sp_mode_support);
void ucfg_reg_set_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc,
bool value)
{
reg_set_enable_6ghz_sp_mode_support(psoc, value);
}
qdf_export_symbol(ucfg_reg_set_enable_6ghz_sp_mode_support);
bool ucfg_reg_get_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc)
{
return reg_get_afc_disable_timer_check(psoc);
}
qdf_export_symbol(ucfg_reg_get_afc_disable_timer_check);
void ucfg_reg_set_afc_disable_timer_check(struct wlan_objmgr_psoc *psoc,
bool value)
{
reg_set_afc_disable_timer_check(psoc, value);
}
qdf_export_symbol(ucfg_reg_set_afc_disable_timer_check);
bool ucfg_reg_get_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc)
{
return reg_get_afc_disable_request_id_check(psoc);
}
qdf_export_symbol(ucfg_reg_get_afc_disable_request_id_check);
void ucfg_reg_set_afc_disable_request_id_check(struct wlan_objmgr_psoc *psoc,
bool value)
{
reg_set_afc_disable_request_id_check(psoc, value);
}
qdf_export_symbol(ucfg_reg_set_afc_disable_request_id_check);
bool ucfg_reg_get_afc_no_action(struct wlan_objmgr_psoc *psoc)
{
return reg_get_afc_noaction(psoc);
}
qdf_export_symbol(ucfg_reg_get_afc_no_action);
void ucfg_reg_set_afc_no_action(struct wlan_objmgr_psoc *psoc, bool value)
{
reg_set_afc_noaction(psoc, value);
}
qdf_export_symbol(ucfg_reg_set_afc_no_action);
#endif
#if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
QDF_STATUS
ucfg_reg_send_afc_resp_rx_ind(struct wlan_objmgr_pdev *pdev,

View File

@@ -5835,6 +5835,9 @@ typedef enum {
#if defined(CONFIG_BAND_6GHZ)
wmi_service_lower_6g_edge_ch_supp,
wmi_service_disable_upper_6g_edge_ch_supp,
#ifdef CONFIG_AFC_SUPPORT
wmi_service_afc_support,
#endif
#endif
wmi_service_dcs_awgn_int_support,
#ifdef WLAN_FEATURE_IGMP_OFFLOAD

View File

@@ -21018,6 +21018,10 @@ static void populate_tlv_service(uint32_t *wmi_service)
WMI_SERVICE_ENABLE_LOWER_6G_EDGE_CH_SUPP;
wmi_service[wmi_service_disable_upper_6g_edge_ch_supp] =
WMI_SERVICE_DISABLE_UPPER_6G_EDGE_CH_SUPP;
#ifdef CONFIG_AFC_SUPPORT
wmi_service[wmi_service_afc_support] =
WMI_SERVICE_AFC_SUPPORT;
#endif
#endif
wmi_service[wmi_service_dcs_awgn_int_support] =
WMI_SERVICE_DCS_AWGN_INT_SUPPORT;