qcacld-3.0: Refine gFwDebugModuleLoglevel configurations

Refine gFwDebugModuleLoglevel configurations based on converged cfg
component. Remove related legacy codes.

Change-Id: I5a1099872163bdcf0fc2e08478c4b608529db736
CRs-Fixed: 2355599
This commit is contained in:
lifeng 2018-11-24 01:53:56 +08:00 • committed by nshrivas
commit faa83cb69c
10 changed files with 154 additions and 89 deletions

View file

@ -127,6 +127,8 @@ struct wlan_fwol_ie_whitelist {
* @get_rts_profile: Set the RTS profile
* @enable_fw_log_level: Set the FW log level
* @enable_fw_log_type: Set the FW log type
* @enable_fw_module_log_level: enable fw module log level
* @enable_fw_module_log_level_num: enablefw module log level num
* @is_rate_limit_enabled: Enable/disable RA rate limited
* @tsf_gpio_pin: TSF GPIO Pin config
* @enable_dhcp_server_offload: DHCP Offload is enabled or not
@ -150,6 +152,8 @@ struct wlan_fwol_cfg {
uint16_t get_rts_profile;
uint16_t enable_fw_log_level;
uint16_t enable_fw_log_type;
uint8_t enable_fw_module_log_level[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
uint8_t enable_fw_module_log_level_num;
#ifdef FEATURE_WLAN_RA_FILTERING
bool is_rate_limit_enabled;
#endif

View file

@ -267,6 +267,7 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
QDF_STATUS status = QDF_STATUS_SUCCESS;
struct wlan_fwol_psoc_obj *fwol_obj;
struct wlan_fwol_cfg *fwol_cfg;
qdf_size_t enable_fw_module_log_level_num;
fwol_obj = fwol_get_psoc_obj(psoc);
if (!fwol_obj) {
@ -296,6 +297,12 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
fwol_cfg->enable_fw_log_level =
cfg_get(psoc, CFG_ENABLE_FW_DEBUG_LOG_LEVEL);
fwol_cfg->enable_fw_log_type = cfg_get(psoc, CFG_ENABLE_FW_LOG_TYPE);
qdf_uint8_array_parse(cfg_get(psoc, CFG_ENABLE_FW_MODULE_LOG_LEVEL),
fwol_cfg->enable_fw_module_log_level,
FW_MODULE_LOG_LEVEL_STRING_LENGTH,
&enable_fw_module_log_level_num);
fwol_cfg->enable_fw_module_log_level_num =
(uint8_t)enable_fw_module_log_level_num;
ucfg_fwol_fetch_ra_filter(psoc, fwol_cfg);
ucfg_fwol_fetch_tsf_gpio_pin(psoc, fwol_cfg);
ucfg_fwol_fetch_dhcp_server_settings(psoc, fwol_cfg);

View file

@ -348,6 +348,47 @@
CFG_VALUE_OR_DEFAULT, \
"Default value to be given to the net link cnss_diag service")
/*
* <ini>
* gFwDebugModuleLoglevel - modulized firmware debug log level
* @Min: N/A
* @Max: N/A
* @Default: N/A
*
* This ini is used to set modulized firmware debug log level.
* FW module log level input string format looks like below:
* gFwDebugModuleLoglevel="<FW Module ID>,<Log Level>,..."
* For example:
* gFwDebugModuleLoglevel="1,0,2,1,3,2,4,3,5,4,6,5,7,6"
* The above input string means:
* For FW module ID 1 enable log level 0
* For FW module ID 2 enable log level 1
* For FW module ID 3 enable log level 2
* For FW module ID 4 enable log level 3
* For FW module ID 5 enable log level 4
* For FW module ID 6 enable log level 5
* For FW module ID 7 enable log level 6
* For valid values of log levels check enum DBGLOG_LOG_LVL and
* for valid values of module ids check enum WLAN_MODULE_ID.
*
* Related: None
*
* Supported Feature: Debugging
*
* Usage: Internal/External
*
* </ini>
*/
#define FW_MODULE_LOG_LEVEL_STRING_LENGTH (512)
#define CFG_ENABLE_FW_MODULE_LOG_LEVEL CFG_INI_STRING( \
"gFwDebugModuleLoglevel", \
0, \
FW_MODULE_LOG_LEVEL_STRING_LENGTH, \
"2,1,3,1,5,1,9,1,13,1,14,1,18,1,19,1,26,1,28,1,29,1,31,1,36,1,38,1,"\
"46,1,47,1,50,1,52,1,53,1,56,1,60,1,61,1,4,1", \
"Set modulized firmware debug log level")
#ifdef FEATURE_WLAN_RA_FILTERING
/* <ini>
* gRAFilterEnable
@ -456,6 +497,7 @@
CFG(CFG_ENABLE_FW_RTS_PROFILE) \
CFG(CFG_ENABLE_FW_DEBUG_LOG_LEVEL) \
CFG(CFG_ENABLE_FW_LOG_TYPE) \
CFG(CFG_ENABLE_FW_MODULE_LOG_LEVEL) \
CFG(CFG_RA_FILTER_ENABLE) \
CFG(CFG_SET_TSF_GPIO_PIN)

View file

@ -236,6 +236,21 @@ QDF_STATUS ucfg_fwol_get_enable_fw_log_level(struct wlan_objmgr_psoc *psoc,
*/
QDF_STATUS ucfg_fwol_get_enable_fw_log_type(struct wlan_objmgr_psoc *psoc,
uint16_t *enable_fw_log_type);
/**
* ucfg_fwol_get_enable_fw_module_log_level() - Assigns
* enable_fw_module_log_level string
* @psoc: pointer to the psoc object
* @enable_fw_module_log_level:
* pointer to enable_fw_module_log_level array
* @enable_fw_module_log_level_num:
* pointer to enable_fw_module_log_leve array element num
*
* Return: QDF Status
*/
QDF_STATUS ucfg_fwol_get_enable_fw_module_log_level(
struct wlan_objmgr_psoc *psoc,
uint8_t **enable_fw_module_log_level,
uint8_t *enable_fw_module_log_level_num);
#ifdef FEATURE_WLAN_RA_FILTERING
/**

View file

@ -428,6 +428,25 @@ QDF_STATUS ucfg_fwol_get_enable_fw_log_type(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS ucfg_fwol_get_enable_fw_module_log_level(
struct wlan_objmgr_psoc *psoc,
uint8_t **enable_fw_module_log_level,
uint8_t *enable_fw_module_log_level_num)
{
struct wlan_fwol_psoc_obj *fwol_obj;
fwol_obj = fwol_get_psoc_obj(psoc);
if (!fwol_obj) {
fwol_err("Failed to get FWOL obj");
return QDF_STATUS_E_FAILURE;
}
*enable_fw_module_log_level = fwol_obj->cfg.enable_fw_module_log_level;
*enable_fw_module_log_level_num =
fwol_obj->cfg.enable_fw_module_log_level_num;
return QDF_STATUS_SUCCESS;
}
#ifdef FEATURE_WLAN_RA_FILTERING
QDF_STATUS ucfg_fwol_set_is_rate_limit_enabled(struct wlan_objmgr_psoc *psoc,
bool is_rate_limit_enabled)

View file

@ -1750,41 +1750,6 @@ enum hdd_link_speed_rpt_type {
#define CFG_LINK_SPEED_RSSI_LOW_MAX (0)
#define CFG_LINK_SPEED_RSSI_LOW_DEFAULT (-80)
/*
* <ini>
* gFwDebugModuleLoglevel - modulized firmware debug log level
* @Min: N/A
* @Max: N/A
* @Default: N/A
*
* This ini is used to set modulized firmware debug log level.
* FW module log level input string format looks like below:
* gFwDebugModuleLoglevel="<FW Module ID>,<Log Level>,..."
* For example:
* gFwDebugModuleLoglevel="1,0,2,1,3,2,4,3,5,4,6,5,7,6"
* The above input string means:
* For FW module ID 1 enable log level 0
* For FW module ID 2 enable log level 1
* For FW module ID 3 enable log level 2
* For FW module ID 4 enable log level 3
* For FW module ID 5 enable log level 4
* For FW module ID 6 enable log level 5
* For FW module ID 7 enable log level 6
* For valid values of log levels check enum DBGLOG_LOG_LVL and
* for valid values of module ids check enum WLAN_MODULE_ID.
*
* Related: None
*
* Supported Feature: Debugging
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_ENABLE_FW_MODULE_LOG_LEVEL "gFwDebugModuleLoglevel"
#define CFG_ENABLE_FW_MODULE_LOG_DEFAULT "2,1,3,1,5,1,9,1,13,1,14,1,18,1,19,1,26,1,28,1,29,1,31,1,36,1,38,1,46,1,47,1,50,1,52,1,53,1,56,1,60,1,61,1,4,1"
#ifdef ENABLE_MTRACE_LOG
/*
* Enable MTRACE for all modules
@ -3641,7 +3606,6 @@ struct hdd_config {
bool IpaClkScalingEnable;
bool fRegChangeDefCountry;
bool advertiseConcurrentOperation;
uint8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
#ifdef FEATURE_WLAN_FORCE_SAP_SCC
uint8_t SapSccChanAvoidance;

View file

@ -470,11 +470,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_PERIODIC_STATS_DISPLAY_TIME_MAX),
#endif
REG_VARIABLE_STRING(CFG_ENABLE_FW_MODULE_LOG_LEVEL, WLAN_PARAM_String,
struct hdd_config, enableFwModuleLogLevel,
VAR_FLAGS_OPTIONAL,
(void *)CFG_ENABLE_FW_MODULE_LOG_DEFAULT),
#ifdef DHCP_SERVER_OFFLOAD
REG_VARIABLE_STRING(CFG_DHCP_SERVER_IP_NAME, WLAN_PARAM_String,
struct hdd_config, dhcpServerIP,

View file

@ -4579,9 +4579,6 @@ static QDF_STATUS hdd_check_for_existing_macaddr(struct hdd_context *hdd_ctx,
static void hdd_set_fw_log_params(struct hdd_context *hdd_ctx,
struct hdd_adapter *adapter)
{
uint8_t count = 0, numentries = 0,
moduleloglevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
uint32_t value = 0;
QDF_STATUS status;
uint16_t enable_fw_log_level, enable_fw_log_type;
int ret;
@ -4617,51 +4614,8 @@ static void hdd_set_fw_log_params(struct hdd_context *hdd_ctx,
hdd_err("Failed to enable FW log level ret %d",
ret);
hdd_string_to_u8_array(
hdd_ctx->config->enableFwModuleLogLevel,
moduleloglevel,
&numentries,
FW_MODULE_LOG_LEVEL_STRING_LENGTH);
while (count < numentries) {
/*
* FW module log level input string looks like
* below:
* gFwDebugModuleLoglevel=<FW Module ID>,
* <Log Level>,...
* For example:
* gFwDebugModuleLoglevel=
* 1,0,2,1,3,2,4,3,5,4,6,5,7,6
* Above input string means :
* For FW module ID 1 enable log level 0
* For FW module ID 2 enable log level 1
* For FW module ID 3 enable log level 2
* For FW module ID 4 enable log level 3
* For FW module ID 5 enable log level 4
* For FW module ID 6 enable log level 5
* For FW module ID 7 enable log level 6
*/
if ((moduleloglevel[count] > WLAN_MODULE_ID_MAX)
|| (moduleloglevel[count + 1] > DBGLOG_LVL_MAX)) {
hdd_err("Module id %d and dbglog level %d input length is more than max",
moduleloglevel[count],
moduleloglevel[count + 1]);
return;
}
value = moduleloglevel[count] << 16;
value |= moduleloglevel[count + 1];
ret = sme_cli_set_command(adapter->session_id,
WMI_DBGLOG_MOD_LOG_LEVEL,
value, DBG_CMD);
if (ret != 0)
hdd_err("Failed to enable FW module log level %d ret %d",
value, ret);
count += 2;
}
sme_enable_fw_module_log_level(hdd_ctx->mac_handle,
adapter->session_id);
}
#else
static void hdd_set_fw_log_params(struct hdd_context *hdd_ctx,

View file

@ -3167,4 +3167,13 @@ sme_get_roam_scan_stats(mac_handle_t mac_handle, roam_scan_stats_cb cb,
*/
void sme_update_score_config(mac_handle_t mac_handle,
struct scoring_config *score_config);
/**
* sme_enable_fw_module_log_level() - enable fw module log level
* @mac_handle: handle returned by mac_open
* @vdev_id: vdev id
*
* Return: None
*/
void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id);
#endif /* #if !defined( __SME_API_H ) */

View file

@ -16462,3 +16462,59 @@ void sme_update_score_config(mac_handle_t mac_handle,
score_config->oce_wan_scoring.score_pcnt15_to_12 =
mlme_scoring_cfg->oce_wan_scoring.score_pcnt15_to_12;
}
void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id)
{
QDF_STATUS status;
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
uint8_t *enable_fw_module_log_level;
uint8_t enable_fw_module_log_level_num;
uint8_t count = 0;
uint32_t value = 0;
int ret;
status = ucfg_fwol_get_enable_fw_module_log_level(
mac_ctx->psoc, &enable_fw_module_log_level,
&enable_fw_module_log_level_num);
if (QDF_IS_STATUS_ERROR(status))
return;
while (count < enable_fw_module_log_level_num) {
/*
* FW module log level input array looks like
* below:
* enable_fw_module_log_level = {<FW Module ID>,
* <Log Level>,...}
* For example:
* enable_fw_module_log_level=
* {1,0,2,1,3,2,4,3,5,4,6,5,7,6}
* Above input array means :
* For FW module ID 1 enable log level 0
* For FW module ID 2 enable log level 1
* For FW module ID 3 enable log level 2
* For FW module ID 4 enable log level 3
* For FW module ID 5 enable log level 4
* For FW module ID 6 enable log level 5
* For FW module ID 7 enable log level 6
*/
if ((enable_fw_module_log_level[count] > WLAN_MODULE_ID_MAX) ||
(enable_fw_module_log_level[count + 1] > DBGLOG_LVL_MAX)) {
sme_err("Module id %d or dbglog level %d input value is more than max",
enable_fw_module_log_level[count],
enable_fw_module_log_level[count + 1]);
continue;
}
value = enable_fw_module_log_level[count] << 16;
value |= enable_fw_module_log_level[count + 1];
ret = sme_cli_set_command(vdev_id,
WMI_DBGLOG_MOD_LOG_LEVEL,
value, DBG_CMD);
if (ret != 0)
sme_err("Failed to enable FW module log level %d ret %d",
value, ret);
count += 2;
}
}