ath10k: Add WMI diag fw logging support for WCN3990
PATCH 1/1 ath10k: Add WMI diag fw logging support for WCN3990
Integrated WiFi chipset ex:WCN399x supports fw logging using WMI copy engine and shared mem DIAG based fw logging. By default shared mem DIAG based fw logging is enabled. To support WMI copy engine based fw logging add QMI control message to enable WMI copy engine based fw logging.
Enable WMI based fw logging using fw_diag_log module parameter.
insmod ath10k_core.ko fw_diag_log=1
DIAG utility(https://github.com/andersson/diag) implements extraction of diagnostics related messages between application processor and various subsystems while shared mem DIAG based fw logging is enabled.
Testing: Tested on WCN3990/QCA6174 HW
Tested FW: WLAN.HL.3.1-00959-QCAHLSWMTPLZ-1
--- drivers/net/wireless/ath/ath10k/core.c | 9 ++++++ drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/hif.h | 15 +++++++++ drivers/net/wireless/ath/ath10k/qmi.c | 45 ++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/qmi.h | 1 + drivers/net/wireless/ath/ath10k/snoc.c | 14 ++++++++ 6 files changed, 85 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +9 -0
@@ -41,6 +41,7 @@ static unsigned int ath10k_cryptmode_param;static bool uart_print;static bool skip_otp;static bool rawmode; +static bool fw_diag_log;unsigned long ath10k_coredump_mask =BIT (ATH10K_FW_CRASH_DUMP_REGISTERS ) |BIT (ATH10K_FW_CRASH_DUMP_CE_DATA );
@@ -51,6 +52,7 @@ module_param_named(cryptmode, ath10k_cryptmode_param, uint, 0644);module_param (uart_print, bool,0644 );module_param (skip_otp, bool,0644 );module_param (rawmode, bool,0644 ); +module_param (fw_diag_log, bool,0644 );module_param_named (coredump_mask, ath10k_coredump_mask, ulong,0444 );MODULE_PARM_DESC (debug_mask,"Debugging mask" );
@@ -59,6 +61,7 @@ MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode");MODULE_PARM_DESC (cryptmode,"Crypto mode: 0-hardware, 1-software" );MODULE_PARM_DESC (rawmode,"Use raw 802.11 frame datapath" );MODULE_PARM_DESC (coredump_mask,"Bitfield of what to include in firmware crash file" ); +MODULE_PARM_DESC (fw_diag_log,"Diag based fw log debugging" );static const struct ath10k_hw_params ath10k_hw_params_list[] = { {
@@ -2698,6 +2701,12 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,if (status) goto err_hif_stop; + status =ath10k_hif_set_target_log_mode (ar, fw_diag_log); +if (status && status != -EOPNOTSUPP ) { +ath10k_warn (ar,"set traget log mode faileds: %d\n" , status); + goto err_hif_stop; + } +return 0 ; err_hif_stop:
drivers/net/wireless/ath/ath10k/core.h +1 -0
@@ -635,6 +635,7 @@ struct ath10k_debug {u32 nf_cal_period;void *cal_data;u32 enable_extd_tx_stats; +u8 fw_dbglog_mode; };enum ath10k_state {
drivers/net/wireless/ath/ath10k/hif.h +15 -0
@@ -23,6 +23,12 @@#include "bmi.h" #include "debug.h" +/* Types of fw logging mode */ +enum ath_dbg_mode { +ATH10K_ENABLE_FW_LOG_DIAG , +ATH10K_ENABLE_FW_LOG_CE , +}; +struct ath10k_hif_sg_item {u16 transfer_id;void *transfer_context;/* NULL = tx completion callback not called */
@@ -97,6 +103,7 @@ struct ath10k_hif_ops {int (*get_target_info)(struct ath10k *ar,struct bmi_target_info *target_info); +int (*set_target_log_mode)(struct ath10k *ar,u8 fw_log_mode); }; static inline int ath10k_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
@@ -231,4 +238,12 @@ static inline int ath10k_hif_get_target_info(struct ath10k *ar, return ar->hif.ops->get_target_info(ar, tgt_info); } +static inline int ath10k_hif_set_target_log_mode (struct ath10k *ar, +u8 fw_log_mode) +{ +if (!ar->hif.ops->set_target_log_mode) +return -EOPNOTSUPP ; + +return ar->hif.ops->set_target_log_mode (ar, fw_log_mode); +}#endif /* _HIF_H_ */
drivers/net/wireless/ath/ath10k/qmi.c +45 -0
51 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/qmi.h +1 -0
@@ -125,5 +125,6 @@ int ath10k_qmi_wlan_disable(struct ath10k *ar);int ath10k_qmi_register_service_notifier (struct notifier_block *nb);int ath10k_qmi_init (struct ath10k *ar,u32 msa_size);int ath10k_qmi_deinit (struct ath10k *ar); +int ath10k_qmi_set_fw_log_mode (struct ath10k *ar,u8 fw_log_mode);#endif /* ATH10K_QMI_H */
drivers/net/wireless/ath/ath10k/snoc.c +14 -0
@@ -1042,6 +1042,19 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar)return ret; } +static int ath10k_snoc_hif_set_target_log_mode (struct ath10k *ar, +u8 fw_log_mode) +{ +u8 fw_dbg_mode; + +if (fw_log_mode) + fw_dbg_mode =ATH10K_ENABLE_FW_LOG_CE ; +else + fw_dbg_mode =ATH10K_ENABLE_FW_LOG_DIAG ; + +return ath10k_qmi_set_fw_log_mode (ar, fw_dbg_mode); +} +static const struct ath10k_hif_ops ath10k_snoc_hif_ops = { .read32 = ath10k_snoc_read32, .write32 = ath10k_snoc_write32,
@@ -1055,6 +1068,7 @@ static const struct ath10k_hif_ops ath10k_snoc_hif_ops = { .send_complete_check = ath10k_snoc_hif_send_complete_check, .get_free_queue_number = ath10k_snoc_hif_get_free_queue_number, .get_target_info = ath10k_snoc_hif_get_target_info, + .set_target_log_mode = ath10k_snoc_hif_set_target_log_mode, };static const struct ath10k_bus_ops ath10k_snoc_bus_ops = {
Signature · 8 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 14 lines · Govind Singh
Integrated WiFi chipset ex:WCN399x supports fw logging using WMI copy engine and shared mem DIAG based fw logging. By default shared mem DIAG based fw logging is enabled. To support WMI copy engine based fw logging add QMI control message to enable WMI copy engine based fw logging.
Enable WMI based fw logging using
fw_diag_logmodule parameter.insmod ath10k_core.ko fw_diag_log=1
DIAG utility(https://github.com/andersson/diag) implements extraction of diagnostics related messages between application processor and various subsystems while shared mem DIAG based fw logging is enabled.
Quoted 5 lines
Testing: Tested on WCN3990/QCA6174 HW
Tested FW: WLAN.HL.3.1-00959-QCAHLSWMTPLZ-1Signed-off-by Govind Singh <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
d9e47698965d ath10k: Add WMI diag fw logging support for WCN3990
Signature · 9 lines
https://patchwork.kernel.org/patch/10879943/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 14 lines · Govind Singh
Integrated WiFi chipset ex:WCN399x supports fw logging using WMI copy engine and shared mem DIAG based fw logging. By default shared mem DIAG based fw logging is enabled. To support WMI copy engine based fw logging add QMI control message to enable WMI copy engine based fw logging.
Enable WMI based fw logging using
fw_diag_logmodule parameter.insmod ath10k_core.ko fw_diag_log=1
DIAG utility(https://github.com/andersson/diag) implements extraction of diagnostics related messages between application processor and various subsystems while shared mem DIAG based fw logging is enabled.
Quoted 5 lines
Testing: Tested on WCN3990/QCA6174 HW
Tested FW: WLAN.HL.3.1-00959-QCAHLSWMTPLZ-1Signed-off-by Govind Singh <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
d9e47698965d ath10k: Add WMI diag fw logging support for WCN3990
Signature · 3 lines
https://patchwork.kernel.org/patch/10879943/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches