aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/debugfs.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-04-17 14:46:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-04-22 15:06:31 -0400
commit1c09bf682cbcad8ddeea6ac69decda411f88dd35 (patch)
tree7fde1b0a7a907d0d991b425b82af59eaebeec655 /drivers/net/wireless/mwifiex/debugfs.c
parentbc0df75aea666d855c4111003dbbb197460b6642 (diff)
mwifiex: add fw_dump debugfs file
This option be useful to dump firmware memory for debugging purpose. Actual code to dump firmware momory for SDIO and PCIe chipsets will be added later. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/debugfs.c')
-rw-r--r--drivers/net/wireless/mwifiex/debugfs.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index b8a49aad12fd..7b419bbcd544 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -257,6 +257,29 @@ free_and_exit:
257} 257}
258 258
259/* 259/*
260 * Proc firmware dump read handler.
261 *
262 * This function is called when the 'fw_dump' file is opened for
263 * reading.
264 * This function dumps firmware memory in different files
265 * (ex. DTCM, ITCM, SQRAM etc.) based on the the segments for
266 * debugging.
267 */
268static ssize_t
269mwifiex_fw_dump_read(struct file *file, char __user *ubuf,
270 size_t count, loff_t *ppos)
271{
272 struct mwifiex_private *priv = file->private_data;
273
274 if (!priv->adapter->if_ops.fw_dump)
275 return -EIO;
276
277 priv->adapter->if_ops.fw_dump(priv->adapter);
278
279 return 0;
280}
281
282/*
260 * Proc getlog file read handler. 283 * Proc getlog file read handler.
261 * 284 *
262 * This function is called when the 'getlog' file is opened for reading 285 * This function is called when the 'getlog' file is opened for reading
@@ -699,6 +722,7 @@ static const struct file_operations mwifiex_dfs_##name##_fops = { \
699MWIFIEX_DFS_FILE_READ_OPS(info); 722MWIFIEX_DFS_FILE_READ_OPS(info);
700MWIFIEX_DFS_FILE_READ_OPS(debug); 723MWIFIEX_DFS_FILE_READ_OPS(debug);
701MWIFIEX_DFS_FILE_READ_OPS(getlog); 724MWIFIEX_DFS_FILE_READ_OPS(getlog);
725MWIFIEX_DFS_FILE_READ_OPS(fw_dump);
702MWIFIEX_DFS_FILE_OPS(regrdwr); 726MWIFIEX_DFS_FILE_OPS(regrdwr);
703MWIFIEX_DFS_FILE_OPS(rdeeprom); 727MWIFIEX_DFS_FILE_OPS(rdeeprom);
704 728
@@ -722,6 +746,7 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
722 MWIFIEX_DFS_ADD_FILE(getlog); 746 MWIFIEX_DFS_ADD_FILE(getlog);
723 MWIFIEX_DFS_ADD_FILE(regrdwr); 747 MWIFIEX_DFS_ADD_FILE(regrdwr);
724 MWIFIEX_DFS_ADD_FILE(rdeeprom); 748 MWIFIEX_DFS_ADD_FILE(rdeeprom);
749 MWIFIEX_DFS_ADD_FILE(fw_dump);
725} 750}
726 751
727/* 752/*