diff --git a/core/bmi/inc/bmi.h b/core/bmi/inc/bmi.h index 1ebcdedb4f..2adae5d9d7 100644 --- a/core/bmi/inc/bmi.h +++ b/core/bmi/inc/bmi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -55,7 +55,7 @@ void ol_cds_free(void); struct ol_config_info { bool enable_uart_print; bool enable_self_recovery; - bool enable_fw_log; + uint8_t enable_fw_log; bool enable_lpass_support; bool enable_ramdump_collection; }; diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index cc3cadb8eb..9404bccc44 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -3380,11 +3380,13 @@ typedef enum { */ #define CFG_ENABLE_FW_LOG_NAME "gEnablefwlog" #define CFG_ENABLE_FW_LOG_DISABLE (0) -#define CFG_ENABLE_FW_LOG_ENABLE (1) +#define CFG_ENABLE_FW_LOG_WMI (1) +#define CFG_ENABLE_FW_LOG_DIAG (2) +#define CFG_ENABLE_FW_LOG_MAX (CFG_ENABLE_FW_LOG_DIAG) #ifdef QCA_WIFI_3_0_ADRASTEA -#define CFG_ENABLE_FW_LOG_DEFAULT (CFG_ENABLE_FW_LOG_DISABLE) +#define CFG_ENABLE_FW_LOG_DEFAULT (CFG_ENABLE_FW_LOG_DIAG) #else -#define CFG_ENABLE_FW_LOG_DEFAULT (CFG_ENABLE_FW_LOG_ENABLE) +#define CFG_ENABLE_FW_LOG_DEFAULT (CFG_ENABLE_FW_LOG_WMI) #endif /* @@ -5775,7 +5777,7 @@ struct hdd_config { bool enable_ip_tcp_udp_checksum_offload; bool enablePowersaveOffload; bool enablefwprint; - bool enable_fw_log; + uint8_t enable_fw_log; uint8_t fVhtAmpduLenExponent; uint32_t vhtMpduLen; uint32_t IpaConfig; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 36efb7ca4e..f03abb94b2 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2605,7 +2605,7 @@ REG_TABLE_ENTRY g_registry_table[] = { VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, CFG_ENABLE_FW_LOG_DEFAULT, CFG_ENABLE_FW_LOG_DISABLE, - CFG_ENABLE_FW_LOG_ENABLE), + CFG_ENABLE_FW_LOG_MAX), #ifdef IPA_OFFLOAD REG_VARIABLE(CFG_IPA_OFFLOAD_CONFIG_NAME, WLAN_PARAM_HexInteger, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8ce2c229aa..038e74702b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6742,8 +6742,8 @@ static hdd_context_t *hdd_context_create(struct device *dev) goto err_free_config; - pld_set_fw_debug_mode(hdd_ctx->parent_dev, - hdd_ctx->config->enable_fw_log); + pld_set_fw_log_mode(hdd_ctx->parent_dev, + hdd_ctx->config->enable_fw_log); /* Uses to enabled logging after SSR */ diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index df5510f314..763a9d3dc1 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -335,7 +335,7 @@ void pld_unregister_driver(void); int pld_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, enum pld_driver_mode mode, const char *host_version); int pld_wlan_disable(struct device *dev, enum pld_driver_mode mode); -int pld_set_fw_debug_mode(struct device *dev, bool enablefwlog); +int pld_set_fw_log_mode(struct device *dev, u8 fw_log_mode); void pld_get_default_fw_files(struct pld_fw_files *pfw_files); int pld_get_fw_files_for_target(struct device *dev, struct pld_fw_files *pfw_files, diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 7fdfbc006d..9c441a00bf 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -391,24 +391,25 @@ int pld_wlan_disable(struct device *dev, enum pld_driver_mode mode) } /** - * pld_set_fw_debug_mode() - Set FW debug mode + * pld_set_fw_log_mode() - Set FW debug log mode * @dev: device - * @enablefwlog: 0 for QXDM, 1 for WMI + * @fw_log_mode: 0 for No log, 1 for WMI, 2 for DIAG * - * Switch Fw debug mode between DIAG logging and WMI logging. + * Switch Fw debug log mode between DIAG logging and WMI logging. * * Return: 0 for success * Non zero failure code for errors */ -int pld_set_fw_debug_mode(struct device *dev, bool enablefwlog) +int pld_set_fw_log_mode(struct device *dev, u8 fw_log_mode) { int ret = 0; switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_PCIE: - ret = pld_pcie_set_fw_debug_mode(enablefwlog); + ret = pld_pcie_set_fw_log_mode(fw_log_mode); break; case PLD_BUS_TYPE_SNOC: + ret = pld_snoc_set_fw_log_mode(fw_log_mode); break; case PLD_BUS_TYPE_SDIO: break; diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index 04b7ea51a1..139c91e2e4 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -74,7 +74,7 @@ int pld_pcie_wlan_disable(struct device *dev, enum pld_driver_mode mode); #endif #if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(QCA_WIFI_3_0_ADRASTEA)) -static inline int pld_pcie_set_fw_debug_mode(bool enablefwlog) +static inline int pld_pcie_set_fw_log_mode(u8 fw_log_mode) { return 0; } @@ -83,9 +83,9 @@ static inline void pld_pcie_intr_notify_q6(void) return; } #else -static inline int pld_pcie_set_fw_debug_mode(bool enablefwlog) +static inline int pld_pcie_set_fw_log_mode(u8 fw_log_mode) { - return cnss_set_fw_debug_mode(enablefwlog); + return cnss_set_fw_debug_mode(fw_log_mode); } static inline void pld_pcie_intr_notify_q6(void) { diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index d3ea8c6a1c..e03f854b81 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -145,6 +145,10 @@ static inline uint8_t *pld_snoc_get_wlan_mac_address(struct device *dev, *num = 0; return NULL; } +static inline int pld_snoc_set_fw_log_mode(u8 fw_log_mode) +{ + return 0; +} #else int pld_snoc_register_driver(void); void pld_snoc_unregister_driver(void); @@ -242,5 +246,9 @@ static inline uint8_t *pld_snoc_get_wlan_mac_address(struct device *dev, { return icnss_get_wlan_mac_address(dev, num); } +static inline int pld_snoc_set_fw_log_mode(u8 fw_log_mode) +{ + return icnss_set_fw_log_mode(fw_log_mode); +} #endif #endif