aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 016ff4014a7b..5adf0b606202 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -235,13 +235,21 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file,
235 struct iwl_priv *priv = (struct iwl_priv *)file->private_data; 235 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
236 size_t bufsz; 236 size_t bufsz;
237 237
238 bufsz = 30 + priv->dbgfs->sram_len * sizeof(char) * 12; 238 /* default is to dump the entire data segment */
239 if (!priv->dbgfs->sram_offset && !priv->dbgfs->sram_len) {
240 priv->dbgfs->sram_offset = 0x800000;
241 if (priv->ucode_type == UCODE_INIT)
242 priv->dbgfs->sram_len = priv->ucode_init_data.len;
243 else
244 priv->dbgfs->sram_len = priv->ucode_data.len;
245 }
246 bufsz = 30 + priv->dbgfs->sram_len * sizeof(char) * 10;
239 buf = kmalloc(bufsz, GFP_KERNEL); 247 buf = kmalloc(bufsz, GFP_KERNEL);
240 if (!buf) 248 if (!buf)
241 return -ENOMEM; 249 return -ENOMEM;
242 pos += scnprintf(buf + pos, bufsz - pos, "sram_len: %d\n", 250 pos += scnprintf(buf + pos, bufsz - pos, "sram_len: 0x%x\n",
243 priv->dbgfs->sram_len); 251 priv->dbgfs->sram_len);
244 pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: %d\n", 252 pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n",
245 priv->dbgfs->sram_offset); 253 priv->dbgfs->sram_offset);
246 for (i = priv->dbgfs->sram_len; i > 0; i -= 4) { 254 for (i = priv->dbgfs->sram_len; i > 0; i -= 4) {
247 val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \ 255 val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \