aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c12
6 files changed, 36 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index 735891a768a2..daf99ea88e90 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -69,6 +69,12 @@
69#ifndef __iwl_3945_commands_h__ 69#ifndef __iwl_3945_commands_h__
70#define __iwl_3945_commands_h__ 70#define __iwl_3945_commands_h__
71 71
72/* uCode version contains 4 values: Major/Minor/API/Serial */
73#define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24)
74#define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16)
75#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
76#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)
77
72enum { 78enum {
73 REPLY_ALIVE = 0x1, 79 REPLY_ALIVE = 0x1,
74 REPLY_ERROR = 0x2, 80 REPLY_ERROR = 0x2,
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 2a924c10ff93..972c4542e5bc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -505,7 +505,7 @@ struct fw_desc {
505 505
506/* uCode file layout */ 506/* uCode file layout */
507struct iwl3945_ucode { 507struct iwl3945_ucode {
508 __le32 ver; /* major/minor/subminor */ 508 __le32 ver; /* major/minor/API/serial */
509 __le32 inst_size; /* bytes of runtime instructions */ 509 __le32 inst_size; /* bytes of runtime instructions */
510 __le32 data_size; /* bytes of runtime data */ 510 __le32 data_size; /* bytes of runtime data */
511 __le32 init_size; /* bytes of initialization instructions */ 511 __le32 init_size; /* bytes of initialization instructions */
@@ -762,6 +762,8 @@ struct iwl3945_priv {
762 void __iomem *hw_base; 762 void __iomem *hw_base;
763 763
764 /* uCode images, save to reload in case of failure */ 764 /* uCode images, save to reload in case of failure */
765 u32 ucode_ver; /* ucode version, copy of
766 iwl3945_ucode.ver */
765 struct fw_desc ucode_code; /* runtime inst */ 767 struct fw_desc ucode_code; /* runtime inst */
766 struct fw_desc ucode_data; /* runtime data original */ 768 struct fw_desc ucode_data; /* runtime data original */
767 struct fw_desc ucode_data_backup; /* runtime data save/restore */ 769 struct fw_desc ucode_data_backup; /* runtime data save/restore */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e8368b69d8cd..5912cdec33a7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1575,7 +1575,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1575 const char *name = priv->cfg->fw_name; 1575 const char *name = priv->cfg->fw_name;
1576 u8 *src; 1576 u8 *src;
1577 size_t len; 1577 size_t len;
1578 u32 ver, inst_size, data_size, init_size, init_data_size, boot_size; 1578 u32 inst_size, data_size, init_size, init_data_size, boot_size;
1579 1579
1580 /* Ask kernel firmware_class module to get the boot firmware off disk. 1580 /* Ask kernel firmware_class module to get the boot firmware off disk.
1581 * request_firmware() is synchronous, file is in memory on return. */ 1581 * request_firmware() is synchronous, file is in memory on return. */
@@ -1599,14 +1599,20 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1599 /* Data from ucode file: header followed by uCode images */ 1599 /* Data from ucode file: header followed by uCode images */
1600 ucode = (void *)ucode_raw->data; 1600 ucode = (void *)ucode_raw->data;
1601 1601
1602 ver = le32_to_cpu(ucode->ver); 1602 priv->ucode_ver = le32_to_cpu(ucode->ver);
1603 inst_size = le32_to_cpu(ucode->inst_size); 1603 inst_size = le32_to_cpu(ucode->inst_size);
1604 data_size = le32_to_cpu(ucode->data_size); 1604 data_size = le32_to_cpu(ucode->data_size);
1605 init_size = le32_to_cpu(ucode->init_size); 1605 init_size = le32_to_cpu(ucode->init_size);
1606 init_data_size = le32_to_cpu(ucode->init_data_size); 1606 init_data_size = le32_to_cpu(ucode->init_data_size);
1607 boot_size = le32_to_cpu(ucode->boot_size); 1607 boot_size = le32_to_cpu(ucode->boot_size);
1608 1608
1609 IWL_DEBUG_INFO("f/w package hdr ucode version = 0x%x\n", ver); 1609 IWL_DEBUG_INFO("f/w package hdr ucode version raw = 0x%x\n",
1610 priv->ucode_ver);
1611 IWL_DEBUG_INFO("f/w package hdr ucode version = %u.%u.%u.%u\n",
1612 IWL_UCODE_MAJOR(priv->ucode_ver),
1613 IWL_UCODE_MINOR(priv->ucode_ver),
1614 IWL_UCODE_API(priv->ucode_ver),
1615 IWL_UCODE_SERIAL(priv->ucode_ver));
1610 IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n", 1616 IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n",
1611 inst_size); 1617 inst_size);
1612 IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n", 1618 IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 9c786db6f90b..528bcab49d13 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -69,6 +69,12 @@
69#ifndef __iwl_commands_h__ 69#ifndef __iwl_commands_h__
70#define __iwl_commands_h__ 70#define __iwl_commands_h__
71 71
72/* uCode version contains 4 values: Major/Minor/API/Serial */
73#define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24)
74#define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16)
75#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
76#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)
77
72enum { 78enum {
73 REPLY_ALIVE = 0x1, 79 REPLY_ALIVE = 0x1,
74 REPLY_ERROR = 0x2, 80 REPLY_ERROR = 0x2,
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 5f6805bfec3f..a19fbb5eaae4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -462,7 +462,7 @@ struct fw_desc {
462 462
463/* uCode file layout */ 463/* uCode file layout */
464struct iwl_ucode { 464struct iwl_ucode {
465 __le32 ver; /* major/minor/subminor */ 465 __le32 ver; /* major/minor/API/serial */
466 __le32 inst_size; /* bytes of runtime instructions */ 466 __le32 inst_size; /* bytes of runtime instructions */
467 __le32 data_size; /* bytes of runtime data */ 467 __le32 data_size; /* bytes of runtime data */
468 __le32 init_size; /* bytes of initialization instructions */ 468 __le32 init_size; /* bytes of initialization instructions */
@@ -843,6 +843,8 @@ struct iwl_priv {
843 u8 rev_id; 843 u8 rev_id;
844 844
845 /* uCode images, save to reload in case of failure */ 845 /* uCode images, save to reload in case of failure */
846 u32 ucode_ver; /* version of ucode, copy of
847 iwl_ucode.ver */
846 struct fw_desc ucode_code; /* runtime inst */ 848 struct fw_desc ucode_code; /* runtime inst */
847 struct fw_desc ucode_data; /* runtime data original */ 849 struct fw_desc ucode_data; /* runtime data original */
848 struct fw_desc ucode_data_backup; /* runtime data save/restore */ 850 struct fw_desc ucode_data_backup; /* runtime data save/restore */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 12ff1121e6dc..03ff87fbe924 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -5302,7 +5302,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
5302 const char *name = priv->cfg->fw_name; 5302 const char *name = priv->cfg->fw_name;
5303 u8 *src; 5303 u8 *src;
5304 size_t len; 5304 size_t len;
5305 u32 ver, inst_size, data_size, init_size, init_data_size, boot_size; 5305 u32 inst_size, data_size, init_size, init_data_size, boot_size;
5306 5306
5307 /* Ask kernel firmware_class module to get the boot firmware off disk. 5307 /* Ask kernel firmware_class module to get the boot firmware off disk.
5308 * request_firmware() is synchronous, file is in memory on return. */ 5308 * request_firmware() is synchronous, file is in memory on return. */
@@ -5326,14 +5326,20 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
5326 /* Data from ucode file: header followed by uCode images */ 5326 /* Data from ucode file: header followed by uCode images */
5327 ucode = (void *)ucode_raw->data; 5327 ucode = (void *)ucode_raw->data;
5328 5328
5329 ver = le32_to_cpu(ucode->ver); 5329 priv->ucode_ver = le32_to_cpu(ucode->ver);
5330 inst_size = le32_to_cpu(ucode->inst_size); 5330 inst_size = le32_to_cpu(ucode->inst_size);
5331 data_size = le32_to_cpu(ucode->data_size); 5331 data_size = le32_to_cpu(ucode->data_size);
5332 init_size = le32_to_cpu(ucode->init_size); 5332 init_size = le32_to_cpu(ucode->init_size);
5333 init_data_size = le32_to_cpu(ucode->init_data_size); 5333 init_data_size = le32_to_cpu(ucode->init_data_size);
5334 boot_size = le32_to_cpu(ucode->boot_size); 5334 boot_size = le32_to_cpu(ucode->boot_size);
5335 5335
5336 IWL_DEBUG_INFO("f/w package hdr ucode version = 0x%x\n", ver); 5336 IWL_DEBUG_INFO("f/w package hdr ucode version raw = 0x%x\n",
5337 priv->ucode_ver);
5338 IWL_DEBUG_INFO("f/w package hdr ucode version = %u.%u.%u.%u\n",
5339 IWL_UCODE_MAJOR(priv->ucode_ver),
5340 IWL_UCODE_MINOR(priv->ucode_ver),
5341 IWL_UCODE_API(priv->ucode_ver),
5342 IWL_UCODE_SERIAL(priv->ucode_ver));
5337 IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n", inst_size); 5343 IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n", inst_size);
5338 IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n", data_size); 5344 IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n", data_size);
5339 IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n", init_size); 5345 IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n", init_size);