diff options
author | David Spinadel <david.spinadel@intel.com> | 2012-03-10 13:00:14 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-12 14:22:09 -0400 |
commit | 6dfa8d019cd21d08634ceb65a3fb90d0648bd93b (patch) | |
tree | 04cb6b0be027598b782d8c91ab5ae681d3304d83 /drivers/net/wireless/iwlwifi/iwl-debugfs.c | |
parent | ed8c8365c4431eeb733def3dd314cf303e1b12ea (diff) | |
download | blackbird-op-linux-6dfa8d019cd21d08634ceb65a3fb90d0648bd93b.tar.gz blackbird-op-linux-6dfa8d019cd21d08634ceb65a3fb90d0648bd93b.zip |
iwlwifi: change struct iwl_fw
Change iwl_fw struct to hold an array of fw_img instead of
three separated instances.
Change fw_img to hold an array of fw_desc instead of two
separate descriptors for instructions and data.
Change load_given_ucode, load_section, verification functions
etc. to support this structure.
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 89cb9a7a3b56..b7b1c04f2fba 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c @@ -230,6 +230,7 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, int pos = 0; int sram; struct iwl_priv *priv = file->private_data; + const struct fw_img *img; size_t bufsz; /* default is to dump the entire data segment */ @@ -239,17 +240,8 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, IWL_ERR(priv, "No uCode has been loadded.\n"); return -EINVAL; } - if (priv->shrd->ucode_type == IWL_UCODE_INIT) { - priv->dbgfs_sram_len = priv->fw->ucode_init.data.len; - } else if (priv->shrd->ucode_type == IWL_UCODE_REGULAR) { - priv->dbgfs_sram_len = priv->fw->ucode_rt.data.len; - } else if (priv->shrd->ucode_type == IWL_UCODE_WOWLAN) { - priv->dbgfs_sram_len = priv->fw->ucode_wowlan.data.len; - } else { - IWL_ERR(priv, "Unsupported type of uCode loaded?" - " that shouldn't happen.\n"); - return -EINVAL; - } + img = &priv->fw->img[priv->shrd->ucode_type]; + priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; } len = priv->dbgfs_sram_len; @@ -346,13 +338,14 @@ static ssize_t iwl_dbgfs_wowlan_sram_read(struct file *file, size_t count, loff_t *ppos) { struct iwl_priv *priv = file->private_data; + const struct fw_img *img = &priv->fw->img[IWL_UCODE_WOWLAN]; if (!priv->wowlan_sram) return -ENODATA; return simple_read_from_buffer(user_buf, count, ppos, priv->wowlan_sram, - priv->fw->ucode_wowlan.data.len); + img->sec[IWL_UCODE_SECTION_DATA].len); } static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) |