From patchwork Wed Nov 25 13:38:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 7699451 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 227B9BF90C for ; Wed, 25 Nov 2015 13:39:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F84A208E4 for ; Wed, 25 Nov 2015 13:39:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7451E208E2 for ; Wed, 25 Nov 2015 13:39:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1aHl-0002Vw-UP; Wed, 25 Nov 2015 13:39:01 +0000 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a1aHj-0002MJ-6v for ath10k@lists.infradead.org; Wed, 25 Nov 2015 13:39:00 +0000 Received: from potku.adurom.net (a88-115-185-251.elisa-laajakaista.fi [88.115.185.251]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 6ABA24061; Wed, 25 Nov 2015 15:38:36 +0200 (EET) Subject: [PATCH 5/6] ath10k: print crc32 checksums for firmware and board files To: ath10k@lists.infradead.org From: Kalle Valo Date: Wed, 25 Nov 2015 15:38:34 +0200 Message-ID: <20151125133834.25507.23767.stgit@potku.adurom.net> In-Reply-To: <20151125133654.25507.10863.stgit@potku.adurom.net> References: <20151125133654.25507.10863.stgit@potku.adurom.net> User-Agent: StGit/0.15 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151125_053859_620953_0752A219 X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include #include +#include +#include #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)