aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2012-03-10 16:00:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-12 14:22:09 -0400
commit6dfa8d019cd21d08634ceb65a3fb90d0648bd93b (patch)
tree04cb6b0be027598b782d8c91ab5ae681d3304d83 /drivers/net/wireless/iwlwifi/iwl-debugfs.c
parented8c8365c4431eeb733def3dd314cf303e1b12ea (diff)
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.c17
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 89cb9a7a3b5..b7b1c04f2fb 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,
230 int pos = 0; 230 int pos = 0;
231 int sram; 231 int sram;
232 struct iwl_priv *priv = file->private_data; 232 struct iwl_priv *priv = file->private_data;
233 const struct fw_img *img;
233 size_t bufsz; 234 size_t bufsz;
234 235
235 /* default is to dump the entire data segment */ 236 /* default is to dump the entire data segment */
@@ -239,17 +240,8 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
239 IWL_ERR(priv, "No uCode has been loadded.\n"); 240 IWL_ERR(priv, "No uCode has been loadded.\n");
240 return -EINVAL; 241 return -EINVAL;
241 } 242 }
242 if (priv->shrd->ucode_type == IWL_UCODE_INIT) { 243 img = &priv->fw->img[priv->shrd->ucode_type];
243 priv->dbgfs_sram_len = priv->fw->ucode_init.data.len; 244 priv->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len;
244 } else if (priv->shrd->ucode_type == IWL_UCODE_REGULAR) {
245 priv->dbgfs_sram_len = priv->fw->ucode_rt.data.len;
246 } else if (priv->shrd->ucode_type == IWL_UCODE_WOWLAN) {
247 priv->dbgfs_sram_len = priv->fw->ucode_wowlan.data.len;
248 } else {
249 IWL_ERR(priv, "Unsupported type of uCode loaded?"
250 " that shouldn't happen.\n");
251 return -EINVAL;
252 }
253 } 245 }
254 len = priv->dbgfs_sram_len; 246 len = priv->dbgfs_sram_len;
255 247
@@ -346,13 +338,14 @@ static ssize_t iwl_dbgfs_wowlan_sram_read(struct file *file,
346 size_t count, loff_t *ppos) 338 size_t count, loff_t *ppos)
347{ 339{
348 struct iwl_priv *priv = file->private_data; 340 struct iwl_priv *priv = file->private_data;
341 const struct fw_img *img = &priv->fw->img[IWL_UCODE_WOWLAN];
349 342
350 if (!priv->wowlan_sram) 343 if (!priv->wowlan_sram)
351 return -ENODATA; 344 return -ENODATA;
352 345
353 return simple_read_from_buffer(user_buf, count, ppos, 346 return simple_read_from_buffer(user_buf, count, ppos,
354 priv->wowlan_sram, 347 priv->wowlan_sram,
355 priv->fw->ucode_wowlan.data.len); 348 img->sec[IWL_UCODE_SECTION_DATA].len);
356} 349}
357static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, 350static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
358 size_t count, loff_t *ppos) 351 size_t count, loff_t *ppos)