ath10k: print more driver info when firmware crashes
authorKalle Valo <kvalo@qca.qualcomm.com>
Mon, 25 Aug 2014 05:37:45 +0000 (08:37 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 25 Aug 2014 08:24:04 +0000 (11:24 +0300)
Sometimes users forget to include important info like firmware version,
so better to print all the info.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/debug.h
drivers/net/wireless/ath/ath10k/pci.c

index ba2e87ab19bd4a0757bde47533dbda6e4df5243c..28f0adea73b63f5cc870c72509f61ddb6f7e2ca3 100644 (file)
@@ -815,21 +815,8 @@ int ath10k_core_start(struct ath10k *ar)
 
        INIT_LIST_HEAD(&ar->arvifs);
 
-       if (!test_bit(ATH10K_FLAG_FIRST_BOOT_DONE, &ar->dev_flags)) {
-               ath10k_info("%s (0x%08x, 0x%08x) fw %s api %d htt %d.%d\n",
-                           ar->hw_params.name,
-                           ar->target_version,
-                           ar->chip_id,
-                           ar->hw->wiphy->fw_version,
-                           ar->fw_api,
-                           ar->htt.target_version_major,
-                           ar->htt.target_version_minor);
-               ath10k_info("debug %d debugfs %d tracing %d dfs %d\n",
-                           config_enabled(CONFIG_ATH10K_DEBUG),
-                           config_enabled(CONFIG_ATH10K_DEBUGFS),
-                           config_enabled(CONFIG_ATH10K_TRACING),
-                           config_enabled(CONFIG_ATH10K_DFS_CERTIFIED));
-       }
+       if (!test_bit(ATH10K_FLAG_FIRST_BOOT_DONE, &ar->dev_flags))
+               ath10k_print_driver_info(ar);
 
        __set_bit(ATH10K_FLAG_FIRST_BOOT_DONE, &ar->dev_flags);
 
index 2171744ba2fe20c6e22168620327142401f105df..442fe93d18be9fa1c7235e0ea0cc10bb54532685 100644 (file)
@@ -142,6 +142,24 @@ int ath10k_info(const char *fmt, ...)
 }
 EXPORT_SYMBOL(ath10k_info);
 
+void ath10k_print_driver_info(struct ath10k *ar)
+{
+       ath10k_info("%s (0x%08x, 0x%08x) fw %s api %d htt %d.%d\n",
+                   ar->hw_params.name,
+                   ar->target_version,
+                   ar->chip_id,
+                   ar->hw->wiphy->fw_version,
+                   ar->fw_api,
+                   ar->htt.target_version_major,
+                   ar->htt.target_version_minor);
+       ath10k_info("debug %d debugfs %d tracing %d dfs %d\n",
+                   config_enabled(CONFIG_ATH10K_DEBUG),
+                   config_enabled(CONFIG_ATH10K_DEBUGFS),
+                   config_enabled(CONFIG_ATH10K_TRACING),
+                   config_enabled(CONFIG_ATH10K_DFS_CERTIFIED));
+}
+EXPORT_SYMBOL(ath10k_print_driver_info);
+
 int ath10k_err(const char *fmt, ...)
 {
        struct va_format vaf = {
index 416c62bbbb26cf8bdd7b197b0eabc0295c856429..47ee4a623af6c82f3ce8aefa0cc0042f732b0b78 100644 (file)
@@ -42,6 +42,7 @@ extern unsigned int ath10k_debug_mask;
 __printf(1, 2) int ath10k_info(const char *fmt, ...);
 __printf(1, 2) int ath10k_err(const char *fmt, ...);
 __printf(1, 2) int ath10k_warn(const char *fmt, ...);
+void ath10k_print_driver_info(struct ath10k *ar);
 
 #ifdef CONFIG_ATH10K_DEBUGFS
 int ath10k_debug_start(struct ath10k *ar);
index bc8c3e3345c1aa1443f9f1c3f1ab390d1d0ff1a6..bb1e4738add43734cf6e565d3c8929b84f2af12c 100644 (file)
@@ -879,9 +879,7 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar)
                scnprintf(uuid, sizeof(uuid), "n/a");
 
        ath10k_err("firmware crashed! (uuid %s)\n", uuid);
-       ath10k_err("hardware name %s version 0x%x\n",
-                  ar->hw_params.name, ar->target_version);
-       ath10k_err("firmware version: %s\n", ar->hw->wiphy->fw_version);
+       ath10k_print_driver_info(ar);
 
        if (!crash_data)
                goto exit;