aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
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
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')
-rw-r--r--drivers/net/wireless/mwifiex/README7
-rw-r--r--drivers/net/wireless/mwifiex/debugfs.c25
-rw-r--r--drivers/net/wireless/mwifiex/main.h1
3 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index b9242c3dca43..3b55ce5690a5 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -200,4 +200,11 @@ getlog
200 200
201 cat getlog 201 cat getlog
202 202
203fw_dump
204 This command is used to dump firmware memory into files.
205 Separate file will be created for each memory segment.
206 Usage:
207
208 cat fw_dump
209
203=============================================================================== 210===============================================================================
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/*
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index ae8b042271c0..34181192a666 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -672,6 +672,7 @@ struct mwifiex_if_ops {
672 int (*init_fw_port) (struct mwifiex_adapter *); 672 int (*init_fw_port) (struct mwifiex_adapter *);
673 int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); 673 int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
674 void (*card_reset) (struct mwifiex_adapter *); 674 void (*card_reset) (struct mwifiex_adapter *);
675 void (*fw_dump)(struct mwifiex_adapter *);
675 int (*clean_pcie_ring) (struct mwifiex_adapter *adapter); 676 int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
676}; 677};
677 678