From patchwork Thu Aug 27 13:33:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 44262 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7RDhXgM025495 for ; Thu, 27 Aug 2009 13:43:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbZH0Nna (ORCPT ); Thu, 27 Aug 2009 09:43:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752683AbZH0Nna (ORCPT ); Thu, 27 Aug 2009 09:43:30 -0400 Received: from canardo.mork.no ([148.122.252.1]:37215 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbZH0Nn3 (ORCPT ); Thu, 27 Aug 2009 09:43:29 -0400 X-Greylist: delayed 610 seconds by postgrey-1.27 at vger.kernel.org; Thu, 27 Aug 2009 09:43:28 EDT Received: from canardo.mork.no (ip6-localhost [IPv6:::1]) by canardo.mork.no (8.14.3/8.14.3) with ESMTP id n7RDXASu020753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Aug 2009 15:33:10 +0200 Received: (from bjorn@localhost) by canardo.mork.no (8.14.3/8.14.3/Submit) id n7RDX9rY020752; Thu, 27 Aug 2009 15:33:09 +0200 From: =?utf-8?q?Bj=C3=B8rn=20Mork?= To: Zhu Yi , Reinette Chatre Cc: linux-wireless@vger.kernel.org, =?utf-8?q?Bj=C3=B8rn=20Mork?= Subject: [PATCH] iwlagn: show_version() displays confusing/wrong firmware version Date: Thu, 27 Aug 2009 15:33:09 +0200 Message-Id: <1251379989-20728-1-git-send-email-bjorn@mork.no> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00, DATE_IN_FUTURE_96_XX,NO_RELAYS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on canardo.mork.no X-Virus-Scanned: clamav-milter 0.95.2 at canardo X-Virus-Status: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The output of show_version() is confusing at best, and can also be considered wrong if you don't know that the order of the API and SERIAL number has been switched. The unusual dotted hex is also unecessary unreadable and different from the filename convention and outout from iwl_read_ucode(): bjorn@nemi:~$ cat /sys/class/net/wlan0/device/version fw version: 0x8.0x18.0xC.0x2 fw type: 0x1 0x0 EEPROM version: 0x11e iwl_read_ucode() prints this when loading the same firmware: [ 21.406218] iwlagn 0000:03:00.0: firmware: requesting iwlwifi-5000-2.ucode [ 21.453118] iwlagn 0000:03:00.0: loaded firmware version 8.24.2.12 Note that I have no documentation on the intended usage of the u8 sw_rev[8] array in struct iwl_alive_resp. sw_rev[0] and sw_rev[1] have been switched to make the output match iwl_read_ucode(). Nothing more, nothing less. Signed-off-by: Bjørn Mork --- drivers/net/wireless/iwlwifi/iwl-agn.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 355f50e..1a1ccb4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c @@ -2498,10 +2498,10 @@ static ssize_t show_version(struct device *d, if (palive->is_valid) pos += sprintf(buf + pos, - "fw version: 0x%01X.0x%01X.0x%01X.0x%01X\n" + "fw version: %u.%u.%u.%u\n" "fw type: 0x%01X 0x%01X\n", palive->ucode_major, palive->ucode_minor, - palive->sw_rev[0], palive->sw_rev[1], + palive->sw_rev[1], palive->sw_rev[0], palive->ver_type, palive->ver_subtype); else pos += sprintf(buf + pos, "fw not loaded\n");