Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122520
b: refs/heads/master
c: c02b3ac
h: refs/heads/master
v: v3
  • Loading branch information
Chatre, Reinette authored and John W. Linville committed Dec 5, 2008
1 parent 4700346 commit 426ac4c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3f911d1773d31f11038d90b04244bc3986c4ccd
refs/heads/master: c02b3acd29766c6f79c2411cb5b85e1ee72c4c8f
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
#ifndef __iwl_3945_commands_h__
#define __iwl_3945_commands_h__

/* uCode version contains 4 values: Major/Minor/API/Serial */
#define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24)
#define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16)
#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)

enum {
REPLY_ALIVE = 0x1,
REPLY_ERROR = 0x2,
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-3945.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ struct fw_desc {

/* uCode file layout */
struct iwl3945_ucode {
__le32 ver; /* major/minor/subminor */
__le32 ver; /* major/minor/API/serial */
__le32 inst_size; /* bytes of runtime instructions */
__le32 data_size; /* bytes of runtime data */
__le32 init_size; /* bytes of initialization instructions */
Expand Down Expand Up @@ -762,6 +762,8 @@ struct iwl3945_priv {
void __iomem *hw_base;

/* uCode images, save to reload in case of failure */
u32 ucode_ver; /* ucode version, copy of
iwl3945_ucode.ver */
struct fw_desc ucode_code; /* runtime inst */
struct fw_desc ucode_data; /* runtime data original */
struct fw_desc ucode_data_backup; /* runtime data save/restore */
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ static int iwl_read_ucode(struct iwl_priv *priv)
const char *name = priv->cfg->fw_name;
u8 *src;
size_t len;
u32 ver, inst_size, data_size, init_size, init_data_size, boot_size;
u32 inst_size, data_size, init_size, init_data_size, boot_size;

/* Ask kernel firmware_class module to get the boot firmware off disk.
* request_firmware() is synchronous, file is in memory on return. */
Expand All @@ -1599,14 +1599,20 @@ static int iwl_read_ucode(struct iwl_priv *priv)
/* Data from ucode file: header followed by uCode images */
ucode = (void *)ucode_raw->data;

ver = le32_to_cpu(ucode->ver);
priv->ucode_ver = le32_to_cpu(ucode->ver);
inst_size = le32_to_cpu(ucode->inst_size);
data_size = le32_to_cpu(ucode->data_size);
init_size = le32_to_cpu(ucode->init_size);
init_data_size = le32_to_cpu(ucode->init_data_size);
boot_size = le32_to_cpu(ucode->boot_size);

IWL_DEBUG_INFO("f/w package hdr ucode version = 0x%x\n", ver);
IWL_DEBUG_INFO("f/w package hdr ucode version raw = 0x%x\n",
priv->ucode_ver);
IWL_DEBUG_INFO("f/w package hdr ucode version = %u.%u.%u.%u\n",
IWL_UCODE_MAJOR(priv->ucode_ver),
IWL_UCODE_MINOR(priv->ucode_ver),
IWL_UCODE_API(priv->ucode_ver),
IWL_UCODE_SERIAL(priv->ucode_ver));
IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n",
inst_size);
IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n",
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
#ifndef __iwl_commands_h__
#define __iwl_commands_h__

/* uCode version contains 4 values: Major/Minor/API/Serial */
#define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24)
#define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16)
#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)

enum {
REPLY_ALIVE = 0x1,
REPLY_ERROR = 0x2,
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ struct fw_desc {

/* uCode file layout */
struct iwl_ucode {
__le32 ver; /* major/minor/subminor */
__le32 ver; /* major/minor/API/serial */
__le32 inst_size; /* bytes of runtime instructions */
__le32 data_size; /* bytes of runtime data */
__le32 init_size; /* bytes of initialization instructions */
Expand Down Expand Up @@ -843,6 +843,8 @@ struct iwl_priv {
u8 rev_id;

/* uCode images, save to reload in case of failure */
u32 ucode_ver; /* version of ucode, copy of
iwl_ucode.ver */
struct fw_desc ucode_code; /* runtime inst */
struct fw_desc ucode_data; /* runtime data original */
struct fw_desc ucode_data_backup; /* runtime data save/restore */
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -5302,7 +5302,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
const char *name = priv->cfg->fw_name;
u8 *src;
size_t len;
u32 ver, inst_size, data_size, init_size, init_data_size, boot_size;
u32 inst_size, data_size, init_size, init_data_size, boot_size;

/* Ask kernel firmware_class module to get the boot firmware off disk.
* request_firmware() is synchronous, file is in memory on return. */
Expand All @@ -5326,14 +5326,20 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
/* Data from ucode file: header followed by uCode images */
ucode = (void *)ucode_raw->data;

ver = le32_to_cpu(ucode->ver);
priv->ucode_ver = le32_to_cpu(ucode->ver);
inst_size = le32_to_cpu(ucode->inst_size);
data_size = le32_to_cpu(ucode->data_size);
init_size = le32_to_cpu(ucode->init_size);
init_data_size = le32_to_cpu(ucode->init_data_size);
boot_size = le32_to_cpu(ucode->boot_size);

IWL_DEBUG_INFO("f/w package hdr ucode version = 0x%x\n", ver);
IWL_DEBUG_INFO("f/w package hdr ucode version raw = 0x%x\n",
priv->ucode_ver);
IWL_DEBUG_INFO("f/w package hdr ucode version = %u.%u.%u.%u\n",
IWL_UCODE_MAJOR(priv->ucode_ver),
IWL_UCODE_MINOR(priv->ucode_ver),
IWL_UCODE_API(priv->ucode_ver),
IWL_UCODE_SERIAL(priv->ucode_ver));
IWL_DEBUG_INFO("f/w package hdr runtime inst size = %u\n", inst_size);
IWL_DEBUG_INFO("f/w package hdr runtime data size = %u\n", data_size);
IWL_DEBUG_INFO("f/w package hdr init inst size = %u\n", init_size);
Expand Down

0 comments on commit 426ac4c

Please sign in to comment.