From 6dfa8d019cd21d08634ceb65a3fb90d0648bd93b Mon Sep 17 00:00:00 2001 From: David Spinadel Date: Sat, 10 Mar 2012 13:00:14 -0800 Subject: 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 Signed-off-by: Wey-Yi Guy Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c') 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) -- cgit v1.2.3-59-g8ed1b