* [PATCH 1/6] ath10k: fix otp board id error message
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
@ 2015-11-25 13:38 ` Kalle Valo
2015-11-25 13:48 ` Sebastian Gottschall
2015-11-25 13:38 ` [PATCH 2/6] ath10k: reorganise hardware and firmware info messages Kalle Valo
` (5 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Kalle Valo @ 2015-11-25 13:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
We check board id from all board types, not just qca99x0, so the error message
was misleading.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index f128adbae454..78fe1863ad04 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1753,7 +1753,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
ret = ath10k_core_get_board_id_from_otp(ar);
if (ret && ret != -EOPNOTSUPP) {
- ath10k_err(ar, "failed to get board id from otp for qca99x0: %d\n",
+ ath10k_err(ar, "failed to get board id from otp: %d\n",
ret);
return ret;
}
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 1/6] ath10k: fix otp board id error message
2015-11-25 13:38 ` [PATCH 1/6] ath10k: fix otp board id error message Kalle Valo
@ 2015-11-25 13:48 ` Sebastian Gottschall
0 siblings, 0 replies; 9+ messages in thread
From: Sebastian Gottschall @ 2015-11-25 13:48 UTC (permalink / raw)
To: ath10k
but consider to ignore the result. this code will still fail on all IPQ
SOC's with embedded QCA99XX cards.
they do not contain any valid otp and this function will always fail. so
the result must be ignored.
this problem has been seen on Linksys EA8500, Netgear R7500 and Trendnet
TEW827
so far all router based solutions using QCA99XX are affected
Am 25.11.2015 um 14:38 schrieb Kalle Valo:
> We check board id from all board types, not just qca99x0, so the error message
> was misleading.
>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath10k/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index f128adbae454..78fe1863ad04 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1753,7 +1753,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
>
> ret = ath10k_core_get_board_id_from_otp(ar);
> if (ret && ret != -EOPNOTSUPP) {
> - ath10k_err(ar, "failed to get board id from otp for qca99x0: %d\n",
> + ath10k_err(ar, "failed to get board id from otp: %d\n",
> ret);
> return ret;
> }
>
>
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
>
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/6] ath10k: reorganise hardware and firmware info messages
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
2015-11-25 13:38 ` [PATCH 1/6] ath10k: fix otp board id error message Kalle Valo
@ 2015-11-25 13:38 ` Kalle Valo
2015-11-25 13:38 ` [PATCH 3/6] ath10k: always show bmi chip ids and subdevice ids Kalle Valo
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-11-25 13:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
This is to make it easier to split them later and also make room for crc32
checksums.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 145c066b5087..4c0e0a1ef0f1 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -136,14 +136,28 @@ void ath10k_print_driver_info(struct ath10k *ar)
scnprintf(boardinfo, sizeof(boardinfo), "sub %04x:%04x",
ar->id.subsystem_vendor, ar->id.subsystem_device);
- ath10k_info(ar, "%s (0x%08x, 0x%08x %s) fw %s fwapi %d bdapi %d htt-ver %d.%d wmi-op %d htt-op %d cal %s max-sta %d raw %d hwcrypto %d features %s\n",
+ ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x %s",
ar->hw_params.name,
ar->target_version,
ar->chip_id,
- boardinfo,
+ boardinfo);
+
+ ath10k_info(ar, "firmware ver %s api %d features %s\n",
ar->hw->wiphy->fw_version,
ar->fw_api,
- ar->bd_api,
+ fw_features);
+
+ ath10k_info(ar, "board_file api %d",
+ ar->bd_api);
+
+ ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
+ config_enabled(CONFIG_ATH10K_DEBUG),
+ config_enabled(CONFIG_ATH10K_DEBUGFS),
+ config_enabled(CONFIG_ATH10K_TRACING),
+ config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
+ config_enabled(CONFIG_NL80211_TESTMODE));
+
+ ath10k_info(ar, "htt-ver %d.%d wmi-op %d htt-op %d cal %s max-sta %d raw %d hwcrypto %d\n",
ar->htt.target_version_major,
ar->htt.target_version_minor,
ar->wmi.op_version,
@@ -151,14 +165,7 @@ void ath10k_print_driver_info(struct ath10k *ar)
ath10k_cal_mode_str(ar->cal_mode),
ar->max_num_stations,
test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags),
- !test_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags),
- fw_features);
- ath10k_info(ar, "debug %d debugfs %d tracing %d dfs %d testmode %d\n",
- config_enabled(CONFIG_ATH10K_DEBUG),
- config_enabled(CONFIG_ATH10K_DEBUGFS),
- config_enabled(CONFIG_ATH10K_TRACING),
- config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
- config_enabled(CONFIG_NL80211_TESTMODE));
+ !test_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags));
}
EXPORT_SYMBOL(ath10k_print_driver_info);
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/6] ath10k: always show bmi chip ids and subdevice ids
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
2015-11-25 13:38 ` [PATCH 1/6] ath10k: fix otp board id error message Kalle Valo
2015-11-25 13:38 ` [PATCH 2/6] ath10k: reorganise hardware and firmware info messages Kalle Valo
@ 2015-11-25 13:38 ` Kalle Valo
2015-11-25 13:38 ` [PATCH 4/6] ath10k: split driver info messages during device initialisation Kalle Valo
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-11-25 13:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
That way we can split the messages to be printed in different stages of
device initialisation.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 4c0e0a1ef0f1..2bc7ae21ade4 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -130,25 +130,25 @@ void ath10k_print_driver_info(struct ath10k *ar)
ath10k_core_get_fw_features_str(ar, fw_features, sizeof(fw_features));
if (ar->id.bmi_ids_valid)
- scnprintf(boardinfo, sizeof(boardinfo), "bmi %d:%d",
+ scnprintf(boardinfo, sizeof(boardinfo), "%d:%d",
ar->id.bmi_chip_id, ar->id.bmi_board_id);
else
- scnprintf(boardinfo, sizeof(boardinfo), "sub %04x:%04x",
- ar->id.subsystem_vendor, ar->id.subsystem_device);
+ scnprintf(boardinfo, sizeof(boardinfo), "N/A");
- ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x %s",
+ ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x sub %04x:%04x",
ar->hw_params.name,
ar->target_version,
ar->chip_id,
- boardinfo);
+ ar->id.subsystem_vendor, ar->id.subsystem_device);
ath10k_info(ar, "firmware ver %s api %d features %s\n",
ar->hw->wiphy->fw_version,
ar->fw_api,
fw_features);
- ath10k_info(ar, "board_file api %d",
- ar->bd_api);
+ ath10k_info(ar, "board_file api %d bmi_id %s",
+ ar->bd_api,
+ boardinfo);
ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
config_enabled(CONFIG_ATH10K_DEBUG),
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/6] ath10k: split driver info messages during device initialisation
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
` (2 preceding siblings ...)
2015-11-25 13:38 ` [PATCH 3/6] ath10k: always show bmi chip ids and subdevice ids Kalle Valo
@ 2015-11-25 13:38 ` Kalle Valo
2015-11-25 13:38 ` [PATCH 5/6] ath10k: print crc32 checksums for firmware and board files Kalle Valo
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-11-25 13:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Earlier we printed all the info messages after a successful device
initialisation and firmware boot, but that's problematic if something goes
wrong and there's no easy way to know what firmware version was used and so on.
Split the info messages into smaller pieces and print them as soon as we have
the info available.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 6 ++++
drivers/net/wireless/ath/ath10k/debug.c | 44 ++++++++++++++++++++-----------
drivers/net/wireless/ath/ath10k/debug.h | 4 +++
3 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 78fe1863ad04..32917be5a6d9 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1751,6 +1751,8 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
goto err_power_down;
}
+ ath10k_debug_print_hwfw_info(ar);
+
ret = ath10k_core_get_board_id_from_otp(ar);
if (ret && ret != -EOPNOTSUPP) {
ath10k_err(ar, "failed to get board id from otp: %d\n",
@@ -1764,6 +1766,8 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
goto err_free_firmware_files;
}
+ ath10k_debug_print_board_info(ar);
+
ret = ath10k_core_init_firmware_features(ar);
if (ret) {
ath10k_err(ar, "fatal problem with firmware features: %d\n",
@@ -1786,7 +1790,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
goto err_unlock;
}
- ath10k_print_driver_info(ar);
+ ath10k_debug_print_boot_info(ar);
ath10k_core_stop(ar);
mutex_unlock(&ar->conf_mutex);
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 2bc7ae21ade4..ebe3e52cdd1d 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -122,41 +122,48 @@ void ath10k_info(struct ath10k *ar, const char *fmt, ...)
}
EXPORT_SYMBOL(ath10k_info);
-void ath10k_print_driver_info(struct ath10k *ar)
+void ath10k_debug_print_hwfw_info(struct ath10k *ar)
{
char fw_features[128] = {};
- char boardinfo[100];
ath10k_core_get_fw_features_str(ar, fw_features, sizeof(fw_features));
- if (ar->id.bmi_ids_valid)
- scnprintf(boardinfo, sizeof(boardinfo), "%d:%d",
- ar->id.bmi_chip_id, ar->id.bmi_board_id);
- else
- scnprintf(boardinfo, sizeof(boardinfo), "N/A");
-
ath10k_info(ar, "%s target 0x%08x chip_id 0x%08x sub %04x:%04x",
ar->hw_params.name,
ar->target_version,
ar->chip_id,
ar->id.subsystem_vendor, ar->id.subsystem_device);
+ ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
+ config_enabled(CONFIG_ATH10K_DEBUG),
+ config_enabled(CONFIG_ATH10K_DEBUGFS),
+ config_enabled(CONFIG_ATH10K_TRACING),
+ config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
+ config_enabled(CONFIG_NL80211_TESTMODE));
+
ath10k_info(ar, "firmware ver %s api %d features %s\n",
ar->hw->wiphy->fw_version,
ar->fw_api,
fw_features);
+}
+
+void ath10k_debug_print_board_info(struct ath10k *ar)
+{
+ char boardinfo[100];
+
+ if (ar->id.bmi_ids_valid)
+ scnprintf(boardinfo, sizeof(boardinfo), "%d:%d",
+ ar->id.bmi_chip_id, ar->id.bmi_board_id);
+ else
+ scnprintf(boardinfo, sizeof(boardinfo), "N/A");
ath10k_info(ar, "board_file api %d bmi_id %s",
ar->bd_api,
boardinfo);
+}
- ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
- config_enabled(CONFIG_ATH10K_DEBUG),
- config_enabled(CONFIG_ATH10K_DEBUGFS),
- config_enabled(CONFIG_ATH10K_TRACING),
- config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
- config_enabled(CONFIG_NL80211_TESTMODE));
-
+void ath10k_debug_print_boot_info(struct ath10k *ar)
+{
ath10k_info(ar, "htt-ver %d.%d wmi-op %d htt-op %d cal %s max-sta %d raw %d hwcrypto %d\n",
ar->htt.target_version_major,
ar->htt.target_version_minor,
@@ -167,6 +174,13 @@ void ath10k_print_driver_info(struct ath10k *ar)
test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags),
!test_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags));
}
+
+void ath10k_print_driver_info(struct ath10k *ar)
+{
+ ath10k_debug_print_hwfw_info(ar);
+ ath10k_debug_print_board_info(ar);
+ ath10k_debug_print_boot_info(ar);
+}
EXPORT_SYMBOL(ath10k_print_driver_info);
void ath10k_err(struct ath10k *ar, const char *fmt, ...)
diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h
index 7de780c4ec8d..814719cf4f22 100644
--- a/drivers/net/wireless/ath/ath10k/debug.h
+++ b/drivers/net/wireless/ath/ath10k/debug.h
@@ -63,6 +63,10 @@ extern unsigned int ath10k_debug_mask;
__printf(2, 3) void ath10k_info(struct ath10k *ar, const char *fmt, ...);
__printf(2, 3) void ath10k_err(struct ath10k *ar, const char *fmt, ...);
__printf(2, 3) void ath10k_warn(struct ath10k *ar, const char *fmt, ...);
+
+void ath10k_debug_print_hwfw_info(struct ath10k *ar);
+void ath10k_debug_print_board_info(struct ath10k *ar);
+void ath10k_debug_print_boot_info(struct ath10k *ar);
void ath10k_print_driver_info(struct ath10k *ar);
#ifdef CONFIG_ATH10K_DEBUGFS
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 5/6] ath10k: print crc32 checksums for firmware and board files
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
` (3 preceding siblings ...)
2015-11-25 13:38 ` [PATCH 4/6] ath10k: split driver info messages during device initialisation Kalle Valo
@ 2015-11-25 13:38 ` Kalle Valo
2015-11-25 13:38 ` [PATCH 6/6] ath10k: implement fw_checksums debugfs file Kalle Valo
2015-11-30 15:15 ` [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
6 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-11-25 13:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
To detect cases if the firmare or board file is corrupted or otherwise modified print crc32 value
of both. Now the output looks like:
ath10k_pci 0000:02:00.0: pci irq msi interrupts 1 irq_mode 0 reset_mode 0
ath10k_pci 0000:02:00.0: qca99x0 hw2.0 target 0x01000000 chip_id 0x003801ff sub 168c:0002
ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1
ath10k_pci 0000:02:00.0: firmware ver 10.4.1.00030-1 api 5 features no-p2p crc32 d2901e01
ath10k_pci 0000:02:00.0: board_file api 1 bmi_id 1:1 crc32 7e56fd07
ath10k_pci 0000:02:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal otp max-sta 512 raw 0 hwcrypto 1
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/Kconfig | 1 +
drivers/net/wireless/ath/ath10k/debug.c | 12 ++++++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig
index 72acb822bb11..03aa35f999a1 100644
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
@@ -2,6 +2,7 @@ config ATH10K
tristate "Atheros 802.11ac wireless cards support"
depends on MAC80211 && HAS_DMA
select ATH_COMMON
+ select CRC32
---help---
This module adds support for wireless adapters based on
Atheros IEEE 802.11ac family of chipsets.
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index ebe3e52cdd1d..79d9426426da 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -19,6 +19,8 @@
#include <linux/debugfs.h>
#include <linux/vmalloc.h>
#include <linux/utsname.h>
+#include <linux/crc32.h>
+#include <linux/firmware.h>
#include "core.h"
#include "debug.h"
@@ -141,10 +143,11 @@ void ath10k_debug_print_hwfw_info(struct ath10k *ar)
config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
config_enabled(CONFIG_NL80211_TESTMODE));
- ath10k_info(ar, "firmware ver %s api %d features %s\n",
+ ath10k_info(ar, "firmware ver %s api %d features %s crc32 %08x\n",
ar->hw->wiphy->fw_version,
ar->fw_api,
- fw_features);
+ fw_features,
+ crc32_le(0, ar->firmware->data, ar->firmware->size));
}
void ath10k_debug_print_board_info(struct ath10k *ar)
@@ -157,9 +160,10 @@ void ath10k_debug_print_board_info(struct ath10k *ar)
else
scnprintf(boardinfo, sizeof(boardinfo), "N/A");
- ath10k_info(ar, "board_file api %d bmi_id %s",
+ ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x",
ar->bd_api,
- boardinfo);
+ boardinfo,
+ crc32_le(0, ar->board->data, ar->board->size));
}
void ath10k_debug_print_boot_info(struct ath10k *ar)
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 6/6] ath10k: implement fw_checksums debugfs file
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
` (4 preceding siblings ...)
2015-11-25 13:38 ` [PATCH 5/6] ath10k: print crc32 checksums for firmware and board files Kalle Valo
@ 2015-11-25 13:38 ` Kalle Valo
2015-11-30 15:15 ` [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
6 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-11-25 13:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
When debugging firmware problems it's useful to check checksums of each
component. Add a debugfs interface to retrieve crc32 checksums:
# cat /sys/kernel/debug/ieee80211/phy0/ath10k/fw_checksums
firmware-N.bin cc3fb466
athwlan c0089f21
otp f3efeb4f
codeswap 00000000
board-N.bin bebc7c08
board bebc7c08
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 56 +++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 79d9426426da..04dfd5e8e6ae 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2161,6 +2161,59 @@ static const struct file_operations fops_btcoex = {
.open = simple_open
};
+static ssize_t ath10k_debug_fw_checksums_read(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath10k *ar = file->private_data;
+ unsigned int len = 0, buf_len = 4096;
+ ssize_t ret_cnt;
+ char *buf;
+
+ buf = kzalloc(buf_len, GFP_KERNEL);
+ if (!buf)
+ return -ENOMEM;
+
+ mutex_lock(&ar->conf_mutex);
+
+ if (len > buf_len)
+ len = buf_len;
+
+ len += scnprintf(buf + len, buf_len - len,
+ "firmware-N.bin\t\t%08x\n",
+ crc32_le(0, ar->firmware->data, ar->firmware->size));
+ len += scnprintf(buf + len, buf_len - len,
+ "athwlan\t\t\t%08x\n",
+ crc32_le(0, ar->firmware_data, ar->firmware_len));
+ len += scnprintf(buf + len, buf_len - len,
+ "otp\t\t\t%08x\n",
+ crc32_le(0, ar->otp_data, ar->otp_len));
+ len += scnprintf(buf + len, buf_len - len,
+ "codeswap\t\t%08x\n",
+ crc32_le(0, ar->swap.firmware_codeswap_data,
+ ar->swap.firmware_codeswap_len));
+ len += scnprintf(buf + len, buf_len - len,
+ "board-N.bin\t\t%08x\n",
+ crc32_le(0, ar->board->data, ar->board->size));
+ len += scnprintf(buf + len, buf_len - len,
+ "board\t\t\t%08x\n",
+ crc32_le(0, ar->board_data, ar->board_len));
+
+ ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+
+ mutex_unlock(&ar->conf_mutex);
+
+ kfree(buf);
+ return ret_cnt;
+}
+
+static const struct file_operations fops_fw_checksums = {
+ .read = ath10k_debug_fw_checksums_read,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
int ath10k_debug_create(struct ath10k *ar)
{
ar->debug.fw_crash_data = vzalloc(sizeof(*ar->debug.fw_crash_data));
@@ -2274,6 +2327,9 @@ int ath10k_debug_register(struct ath10k *ar)
debugfs_create_file("btcoex", S_IRUGO | S_IWUSR,
ar->debug.debugfs_phy, ar, &fops_btcoex);
+ debugfs_create_file("fw_checksums", S_IRUSR,
+ ar->debug.debugfs_phy, ar, &fops_fw_checksums);
+
return 0;
}
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 0/6] ath10k: print crc32 checksum
2015-11-25 13:37 [PATCH 0/6] ath10k: print crc32 checksum Kalle Valo
` (5 preceding siblings ...)
2015-11-25 13:38 ` [PATCH 6/6] ath10k: implement fw_checksums debugfs file Kalle Valo
@ 2015-11-30 15:15 ` Kalle Valo
6 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2015-11-30 15:15 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Print crc32 checksum for firmware and board files. Also some improvements how
> we print info messages during boot.
>
> ---
>
> Kalle Valo (6):
> ath10k: fix otp board id error message
> ath10k: reorganise hardware and firmware info messages
> ath10k: always show bmi chip ids and subdevice ids
> ath10k: split driver info messages during device initialisation
> ath10k: print crc32 checksums for firmware and board files
> ath10k: implement fw_checksums debugfs file
All six applied.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 9+ messages in thread