qcacld-3.0: Refactor three INI in PMO

Based on cfg framework, refactor below INI:
 - CFG_RA_RATE_LIMIT_INTERVAL_NAME
 - CFG_ACTIVE_UC_APF_MODE_NAME
 - CFG_ACTIVE_MC_BC_APF_MODE_NAME

Change-Id: I3b1ee6254de158ad6408dc8c61e83be571e180af
CRs-Fixed: 2379743
This commit is contained in:
Wu Gao 2019-01-10 21:52:31 +08:00 • committed by nshrivas
commit 9d117fbfc2
11 changed files with 174 additions and 119 deletions

View file

@ -148,6 +148,20 @@ static void wlan_pmo_runtime_pm_init_cfg(struct wlan_objmgr_psoc *psoc,
}
#endif
#if FEATURE_WLAN_RA_FILTERING
static void wlan_pmo_ra_filtering_init_cfg(struct wlan_objmgr_psoc *psoc,
struct pmo_psoc_cfg *psoc_cfg)
{
psoc_cfg->ra_ratelimit_interval =
cfg_get(psoc, CFG_RA_RATE_LIMIT_INTERVAL);
}
#else
static void wlan_pmo_ra_filtering_init_cfg(struct wlan_objmgr_psoc *psoc,
struct pmo_psoc_cfg *psoc_cfg)
{
}
#endif
static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
struct pmo_psoc_cfg *psoc_cfg)
{
@ -182,6 +196,11 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
psoc_cfg->enable_sap_suspend = cfg_get(psoc, CFG_ENABLE_SAP_SUSPEND);
psoc_cfg->wow_data_inactivity_timeout =
cfg_get(psoc, CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT);
psoc_cfg->active_uc_apf_mode =
cfg_get(psoc, CFG_ACTIVE_UC_APF_MODE);
psoc_cfg->active_mc_bc_apf_mode =
cfg_get(psoc, CFG_ACTIVE_MC_BC_APF_MODE);
wlan_pmo_ra_filtering_init_cfg(psoc, psoc_cfg);
}
QDF_STATUS pmo_psoc_open(struct wlan_objmgr_psoc *psoc)

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -38,7 +38,63 @@
1, \
"Enable APF Support")
/*
* <ini>
* gActiveUcBpfMode - Control UC active APF mode
* @Min: 0 (disabled)
* @Max: 2 (adaptive)
* @Default: 0 (disabled)
*
* This config item controls UC APF in active mode. There are 3 modes:
* 0) disabled - APF is disabled in active mode
* 1) enabled - APF is enabled for all packets in active mode
* 2) adaptive - APF is enabled for packets up to some throughput threshold
*
* Related: gActiveMcBcBpfMode
*
* Supported Feature: Active Mode APF
*
* Usage: Internal/External
* </ini>
*/
#define CFG_ACTIVE_UC_APF_MODE CFG_INI_UINT( \
"gActiveUcBpfMode", \
ACTIVE_APF_DISABLED, \
(ACTIVE_APF_MODE_COUNT - 1), \
ACTIVE_APF_DISABLED, \
CFG_VALUE_OR_DEFAULT, \
"Control UC active APF mode")
/*
* <ini>
* gActiveMcBcBpfMode - Control MC/BC active APF mode
* @Min: 0 (disabled)
* @Max: 1 (enabled)
* @Default: 0 (disabled)
*
* This config item controls MC/BC APF in active mode. There are 3 modes:
* 0) disabled - APF is disabled in active mode
* 1) enabled - APF is enabled for all packets in active mode
* 2) adaptive - APF is enabled for packets up to some throughput threshold
*
* Related: gActiveUcBpfMode
*
* Supported Feature: Active Mode APF
*
* Usage: Internal/External
* </ini>
*/
#define CFG_ACTIVE_MC_BC_APF_MODE CFG_INI_UINT( \
"gActiveUcBpfMode", \
ACTIVE_APF_DISABLED, \
ACTIVE_APF_ENABLED, \
ACTIVE_APF_DISABLED, \
CFG_VALUE_OR_DEFAULT, \
"Control MC/BC active APF mode")
#define CFG_PMO_APF_ALL \
CFG(CFG_PMO_APF_ENABLE)
CFG(CFG_PMO_APF_ENABLE) \
CFG(CFG_ACTIVE_UC_APF_MODE) \
CFG(CFG_ACTIVE_MC_BC_APF_MODE)
#endif /* WLAN_PMO_APF_CFG_H__ */

View file

@ -389,6 +389,25 @@
50, \
CFG_VALUE_OR_DEFAULT, \
"Data activity timeout in wow mode")
/*
* <ini>
* gRArateLimitInterval - RA rate limit interval
* @Min: 60
* @Max: 3600
* @Default: 60
* This ini is used to set RA rate limit interval.
*
* Usage: External
*
* </ini>
*/
#define CFG_RA_RATE_LIMIT_INTERVAL CFG_INI_UINT( \
"gRArateLimitInterval", \
60, \
3600, \
60, \
CFG_VALUE_OR_DEFAULT, \
"RA rate limit interval")
#define CFG_PMO_COMMON_ALL \
CFG(CFG_ENABLE_SAP_SUSPEND) \
@ -406,6 +425,7 @@
CFG(CFG_PMO_WOW_ENABLE) \
CFG(CFG_PMO_ACTIVE_MODE) \
CFG(CFG_PMO_PWR_FAILURE) \
CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT)
CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT) \
CFG(CFG_RA_RATE_LIMIT_INTERVAL)
#endif /* WLAN_PMO_COMMON_CFG_H__ */

View file

@ -279,6 +279,20 @@ enum pmo_auto_pwr_detect_failure_mode {
PMO_AUTO_PWR_FAILURE_DETECT_DISABLE
};
/**
* enum active_apf_mode - the modes active APF can operate in
* @ACTIVE_APF_DISABLED: APF is disabled in active mode
* @ACTIVE_APF_ENABLED: APF is enabled for all packets
* @ACTIVE_APF_ADAPTIVE: APF is enabled for packets up to some threshold
* @ACTIVE_APF_MODE_COUNT: The number of active APF modes
*/
enum active_apf_mode {
ACTIVE_APF_DISABLED = 0,
ACTIVE_APF_ENABLED,
ACTIVE_APF_ADAPTIVE,
ACTIVE_APF_MODE_COUNT
};
/**
* struct pmo_psoc_cfg - user configuration required for pmo
* @ptrn_match_enable_all_vdev: true when pattern match is enable for all vdev
@ -325,6 +339,10 @@ enum pmo_auto_pwr_detect_failure_mode {
* @wow_pulse_interval_low: The interval of low level in the pulse
* @packet_filters_bitmap: Packet filter bitmap configuration
* @wow_data_inactivity_timeout: power save wow data inactivity timeout
* @active_uc_apf_mode: Setting that determines how APF is applied in active
* mode for uc packets
* @active_mc_bc_apf_mode: Setting that determines how APF is applied in
* active mode for MC/BC packets
*/
struct pmo_psoc_cfg {
bool ptrn_match_enable_all_vdev;
@ -340,7 +358,9 @@ struct pmo_psoc_cfg {
bool ap_arpns_support;
bool d0_wow_supported;
bool ra_ratelimit_enable;
#if FEATURE_WLAN_RA_FILTERING
uint16_t ra_ratelimit_interval;
#endif
bool magic_ptrn_enable;
bool deauth_enable;
bool disassoc_enable;
@ -381,6 +401,8 @@ struct pmo_psoc_cfg {
#endif
bool enable_sap_suspend;
uint8_t wow_data_inactivity_timeout;
enum active_apf_mode active_uc_apf_mode;
enum active_apf_mode active_mc_bc_apf_mode;
};
/**

View file

@ -1000,6 +1000,26 @@ ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
* Return: pmo packet filter feature enable/disable
*/
bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_pmo_get_active_uc_apf_mode() - to get the modes active APF
* for MC/BC packets
* @psoc: objmgr psoc handle
*
* Return: the modes active APF
*/
enum active_apf_mode
ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_pmo_get_active_mc_bc_apf_mode() - to get the modes active APF
* for uc packets
* @psoc: objmgr psoc handle
*
* Return: the modes active APF
*/
enum active_apf_mode
ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc);
#ifdef FEATURE_WLAN_APF
/**
* ucfg_pmo_is_apf_enabled() - to get apf configuration
@ -1624,6 +1644,18 @@ ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
{
return false;
}
enum active_apf_mode
ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc);
{
return 0;
}
enum active_apf_mode
ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
{
return 0;
}
#endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
@ -1819,5 +1851,4 @@ ucfg_pmo_get_runtime_pm_delay(struct wlan_objmgr_psoc *psoc)
*/
bool
ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc *psoc);
#endif /* end of _WLAN_PMO_UCFG_API_H_ */

View file

@ -806,3 +806,20 @@ bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
return pmo_psoc_ctx->psoc_cfg.packet_filter_enabled;
}
enum active_apf_mode
ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc)
{
struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
return pmo_psoc_ctx->psoc_cfg.active_uc_apf_mode;
}
enum active_apf_mode
ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
{
struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
return pmo_psoc_ctx->psoc_cfg.active_mc_bc_apf_mode;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -42,20 +42,6 @@ enum cfg_sub_20_channel_width {
WLAN_SUB_20_CH_WIDTH_10 = 2,
};
/**
* enum active_apf_mode - the modes active APF can operate in
* @ACTIVE_APF_DISABLED: APF is disabled in active mode
* @ACTIVE_APF_ENABLED: APF is enabled for all packets
* @ACTIVE_APF_ADAPTIVE: APF is enabled for packets up to some threshold
* @ACTIVE_APF_MODE_COUNT: The number of active APF modes
*/
enum active_apf_mode {
ACTIVE_APF_DISABLED = 0,
ACTIVE_APF_ENABLED,
ACTIVE_APF_ADAPTIVE,
ACTIVE_APF_MODE_COUNT
};
/**
* struct cds_config_info - Place Holder for cds configuration
* @max_station: Max station supported
@ -67,7 +53,6 @@ enum active_apf_mode {
* @ap_disable_intrabss_fwd: pass intra-bss-fwd info to txrx module
* @ap_maxoffload_peers: max offload peer
* @ap_maxoffload_reorderbuffs: max offload reorder buffs
* @ra_ratelimit_interval: RA rate limit value
* @is_ra_ratelimit_enabled: Indicate RA rate limit enabled or not
* @reorder_offload: is RX re-ordering offloaded to the fw
* @dfs_pri_multiplier: dfs radar pri multiplier
@ -81,10 +66,6 @@ enum active_apf_mode {
* @tx_chain_mask_cck: Tx chain mask enabled or not
* @sub_20_channel_width: Sub 20 MHz ch width, ini intersected with fw cap
* @is_fw_timeout: Indicate whether crash host when fw timesout or not
* @active_uc_apf_mode: Setting that determines how APF is applied in active
* mode for uc packets
* @active_mc_bc_apf_mode: Setting that determines how APF is applied in
* active mode for MC/BC packets
* @ito_repeat_count: Indicates ito repeated count
* @force_target_assert_enabled: Indicate whether target assert enabled or not
* @bandcapability: Configured band by user
@ -101,7 +82,6 @@ struct cds_config_info {
uint8_t ap_maxoffload_peers;
uint8_t ap_maxoffload_reorderbuffs;
#ifdef FEATURE_WLAN_RA_FILTERING
uint16_t ra_ratelimit_interval;
bool is_ra_ratelimit_enabled;
#endif
uint8_t reorder_offload;
@ -121,8 +101,6 @@ struct cds_config_info {
bool self_recovery_enabled;
bool fw_timeout_crash;
struct ol_tx_sched_wrr_ac_specs_t ac_specs[TX_WMM_AC_NUM];
enum active_apf_mode active_uc_apf_mode;
enum active_apf_mode active_mc_bc_apf_mode;
uint8_t ito_repeat_count;
bool force_target_assert_enabled;
uint8_t bandcapability;

View file

@ -679,13 +679,6 @@ enum hdd_dot11_mode {
#define CFG_ENABLE_SNR_MONITORING_MAX (1)
#define CFG_ENABLE_SNR_MONITORING_DEFAULT (0)
#ifdef FEATURE_WLAN_RA_FILTERING
#define CFG_RA_RATE_LIMIT_INTERVAL_NAME "gRArateLimitInterval"
#define CFG_RA_RATE_LIMIT_INTERVAL_MIN (60)
#define CFG_RA_RATE_LIMIT_INTERVAL_MAX (3600)
#define CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT (60) /*60 SEC */
#endif
#ifdef DHCP_SERVER_OFFLOAD
#define CFG_DHCP_SERVER_IP_NAME "gDHCPServerIP"
#define CFG_DHCP_SERVER_IP_DEFAULT ""
@ -858,54 +851,6 @@ enum hdd_dot11_mode {
#define CFG_ADAPT_DWELL_WIFI_THRESH_MAX (100)
#define CFG_ADAPT_DWELL_WIFI_THRESH_DEFAULT (10)
/*
* <ini>
* gActiveUcBpfMode - Control UC active APF mode
* @Min: 0 (disabled)
* @Max: 2 (adaptive)
* @Default: 0 (disabled)
*
* This config item controls UC APF in active mode. There are 3 modes:
* 0) disabled - APF is disabled in active mode
* 1) enabled - APF is enabled for all packets in active mode
* 2) adaptive - APF is enabled for packets up to some throughput threshold
*
* Related: gActiveMcBcBpfMode
*
* Supported Feature: Active Mode APF
*
* Usage: Internal/External
* </ini>
*/
#define CFG_ACTIVE_UC_APF_MODE_NAME "gActiveUcBpfMode"
#define CFG_ACTIVE_UC_APF_MODE_MIN (ACTIVE_APF_DISABLED)
#define CFG_ACTIVE_UC_APF_MODE_MAX (ACTIVE_APF_MODE_COUNT - 1)
#define CFG_ACTIVE_UC_APF_MODE_DEFAULT (ACTIVE_APF_DISABLED)
/*
* <ini>
* gActiveMcBcBpfMode - Control MC/BC active APF mode
* @Min: 0 (disabled)
* @Max: 1 (enabled)
* @Default: 0 (disabled)
*
* This config item controls MC/BC APF in active mode. There are 3 modes:
* 0) disabled - APF is disabled in active mode
* 1) enabled - APF is enabled for all packets in active mode
* 2) adaptive - APF is enabled for packets up to some throughput threshold
*
* Related: gActiveUcBpfMode
*
* Supported Feature: Active Mode APF
*
* Usage: Internal/External
* </ini>
*/
#define CFG_ACTIVE_MC_BC_APF_MODE_NAME "gActiveMcBcBpfMode"
#define CFG_ACTIVE_MC_BC_APF_MODE_MIN (ACTIVE_APF_DISABLED)
#define CFG_ACTIVE_MC_BC_APF_MODE_MAX (ACTIVE_APF_ENABLED)
#define CFG_ACTIVE_MC_BC_APF_MODE_DEFAULT (ACTIVE_APF_DISABLED)
#ifdef WLAN_FEATURE_11AX
/* 11AX related INI configuration */
/*
@ -1205,9 +1150,6 @@ struct hdd_config {
uint32_t DelayedTriggerFrmInt;
#ifdef FEATURE_WLAN_RA_FILTERING
uint16_t RArateLimitInterval;
#endif
#ifdef FEATURE_WLAN_SCAN_PNO
bool PnoOffload;
#endif
@ -1252,8 +1194,6 @@ struct hdd_config {
uint8_t adapt_dwell_wifi_act_threshold;
uint16_t sap_tx_leakage_threshold;
bool sap_internal_restart;
enum active_apf_mode active_uc_apf_mode;
enum active_apf_mode active_mc_bc_apf_mode;
uint8_t he_dynamic_frag_support;
#ifdef WLAN_FEATURE_11AX
bool enable_ul_mimo;

View file

@ -115,15 +115,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_TL_DELAYED_TRGR_FRM_INT_MIN,
CFG_TL_DELAYED_TRGR_FRM_INT_MAX),
#ifdef FEATURE_WLAN_RA_FILTERING
REG_VARIABLE(CFG_RA_RATE_LIMIT_INTERVAL_NAME, WLAN_PARAM_Integer,
struct hdd_config, RArateLimitInterval,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT,
CFG_RA_RATE_LIMIT_INTERVAL_MIN,
CFG_RA_RATE_LIMIT_INTERVAL_MAX),
#endif
REG_VARIABLE(CFG_ENABLE_DFS_CHNL_SCAN_NAME, WLAN_PARAM_Integer,
struct hdd_config, enableDFSChnlScan,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@ -310,20 +301,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_ADAPT_DWELL_WIFI_THRESH_MIN,
CFG_ADAPT_DWELL_WIFI_THRESH_MAX),
REG_VARIABLE(CFG_ACTIVE_UC_APF_MODE_NAME, WLAN_PARAM_Integer,
struct hdd_config, active_uc_apf_mode,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_ACTIVE_UC_APF_MODE_DEFAULT,
CFG_ACTIVE_UC_APF_MODE_MIN,
CFG_ACTIVE_UC_APF_MODE_MAX),
REG_VARIABLE(CFG_ACTIVE_MC_BC_APF_MODE_NAME, WLAN_PARAM_Integer,
struct hdd_config, active_mc_bc_apf_mode,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_ACTIVE_MC_BC_APF_MODE_DEFAULT,
CFG_ACTIVE_MC_BC_APF_MODE_MIN,
CFG_ACTIVE_MC_BC_APF_MODE_MAX),
#ifdef WLAN_FEATURE_11AX
REG_VARIABLE(CFG_ENABLE_UL_MIMO_NAME, WLAN_PARAM_Integer,
struct hdd_config, enable_ul_mimo,

View file

@ -9812,8 +9812,6 @@ static inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg,
if (QDF_IS_STATUS_ERROR(status))
return;
cds_cfg->ra_ratelimit_interval =
hdd_ctx->config->RArateLimitInterval;
cds_cfg->is_ra_ratelimit_enabled = is_rate_limit_enabled;
}
#else
@ -9897,8 +9895,6 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx)
cfg_get(hdd_ctx->psoc, CFG_DP_MAX_MSDUS_PER_RXIND);
cds_cfg->self_recovery_enabled = self_recovery;
cds_cfg->fw_timeout_crash = fw_timeout_crash;
cds_cfg->active_uc_apf_mode = hdd_ctx->config->active_uc_apf_mode;
cds_cfg->active_mc_bc_apf_mode = hdd_ctx->config->active_mc_bc_apf_mode;
cds_cfg->ito_repeat_count = ito_repeat_count;
@ -14223,8 +14219,6 @@ static inline void hdd_ra_populate_pmo_config(
if (QDF_IS_STATUS_ERROR(status))
return;
psoc_cfg->ra_ratelimit_interval =
hdd_ctx->config->RArateLimitInterval;
psoc_cfg->ra_ratelimit_enable =
is_rate_limit_enabled;
}

View file

@ -3317,12 +3317,13 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
wma_handle->ssdp = ucfg_pmo_is_ssdp_enabled(wma_handle->psoc);
wma_handle->enable_mc_list =
ucfg_pmo_is_mc_addr_list_enabled(wma_handle->psoc);
wma_handle->active_uc_apf_mode = cds_cfg->active_uc_apf_mode;
wma_handle->active_mc_bc_apf_mode = cds_cfg->active_mc_bc_apf_mode;
wma_handle->active_uc_apf_mode =
ucfg_pmo_get_active_uc_apf_mode(wma_handle->psoc);
wma_handle->active_mc_bc_apf_mode =
ucfg_pmo_get_active_mc_bc_apf_mode(wma_handle->psoc);
wma_handle->link_stats_results = NULL;
#ifdef FEATURE_WLAN_RA_FILTERING
wma_handle->IsRArateLimitEnabled = cds_cfg->is_ra_ratelimit_enabled;
wma_handle->RArateLimitInterval = cds_cfg->ra_ratelimit_interval;
#endif /* FEATURE_WLAN_RA_FILTERING */
#ifdef WLAN_FEATURE_LPSS
wma_handle->is_lpass_enabled = cds_cfg->is_lpass_enabled;