Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] iwlagn: show_version() displays confusing/wrong firmware version
@ 2009-08-27 13:33 Bjørn Mork
  2009-08-27 14:57 ` reinette chatre
  0 siblings, 1 reply; 5+ messages in thread
From: Bjørn Mork @ 2009-08-27 13:33 UTC (permalink / raw)
  To: Zhu Yi, Reinette Chatre; +Cc: linux-wireless, Bjørn Mork

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 <bjorn@mork.no>
---
 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");
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-27 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-27 13:33 [PATCH] iwlagn: show_version() displays confusing/wrong firmware version Bjørn Mork
2009-08-27 14:57 ` reinette chatre
2009-08-27 15:09   ` Bjørn Mork
2009-08-27 15:29     ` reinette chatre
2009-08-27 16:50       ` Bjørn Mork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox