linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] mwifiex: add fw_dump debugfs file
@ 2014-04-17 18:46 Bing Zhao
  2014-04-17 18:47 ` [PATCH 2/5] mwifiex: add firmware dump feature for PCIe Bing Zhao
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Bing Zhao @ 2014-04-17 18:46 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Avinash Patil, Maithili Hinge,
	Xinming Hu, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

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>
---
 drivers/net/wireless/mwifiex/README    |  7 +++++++
 drivers/net/wireless/mwifiex/debugfs.c | 25 +++++++++++++++++++++++++
 drivers/net/wireless/mwifiex/main.h    |  1 +
 3 files changed, 33 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index b9242c3..3b55ce5 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -200,4 +200,11 @@ getlog
 
 	cat getlog
 
+fw_dump
+	This command is used to dump firmware memory into files.
+	Separate file will be created for each memory segment.
+	Usage:
+
+	cat fw_dump
+
 ===============================================================================
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index b8a49aa..7b419bb 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -257,6 +257,29 @@ free_and_exit:
 }
 
 /*
+ * Proc firmware dump read handler.
+ *
+ * This function is called when the 'fw_dump' file is opened for
+ * reading.
+ * This function dumps firmware memory in different files
+ * (ex. DTCM, ITCM, SQRAM etc.) based on the the segments for
+ * debugging.
+ */
+static ssize_t
+mwifiex_fw_dump_read(struct file *file, char __user *ubuf,
+		     size_t count, loff_t *ppos)
+{
+	struct mwifiex_private *priv = file->private_data;
+
+	if (!priv->adapter->if_ops.fw_dump)
+		return -EIO;
+
+	priv->adapter->if_ops.fw_dump(priv->adapter);
+
+	return 0;
+}
+
+/*
  * Proc getlog file read handler.
  *
  * 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 = {       \
 MWIFIEX_DFS_FILE_READ_OPS(info);
 MWIFIEX_DFS_FILE_READ_OPS(debug);
 MWIFIEX_DFS_FILE_READ_OPS(getlog);
+MWIFIEX_DFS_FILE_READ_OPS(fw_dump);
 MWIFIEX_DFS_FILE_OPS(regrdwr);
 MWIFIEX_DFS_FILE_OPS(rdeeprom);
 
@@ -722,6 +746,7 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
 	MWIFIEX_DFS_ADD_FILE(getlog);
 	MWIFIEX_DFS_ADD_FILE(regrdwr);
 	MWIFIEX_DFS_ADD_FILE(rdeeprom);
+	MWIFIEX_DFS_ADD_FILE(fw_dump);
 }
 
 /*
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index ae8b042..3418119 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -672,6 +672,7 @@ struct mwifiex_if_ops {
 	int (*init_fw_port) (struct mwifiex_adapter *);
 	int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
 	void (*card_reset) (struct mwifiex_adapter *);
+	void (*fw_dump)(struct mwifiex_adapter *);
 	int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
 };
 
-- 
1.8.2.3


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-05-05 15:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 18:46 [PATCH 1/5] mwifiex: add fw_dump debugfs file Bing Zhao
2014-04-17 18:47 ` [PATCH 2/5] mwifiex: add firmware dump feature for PCIe Bing Zhao
2014-04-24  9:08   ` Kalle Valo
2014-04-25  1:37     ` John W. Linville
2014-04-25  3:35       ` Bing Zhao
2014-04-25  8:09         ` Johannes Berg
2014-04-30  7:41           ` Kalle Valo
2014-04-30  8:29             ` Johannes Berg
2014-04-30 13:22               ` John W. Linville
2014-04-30 16:14                 ` Kalle Valo
2014-05-05 12:57                   ` Johannes Berg
2014-05-05 14:19                     ` Amitkumar Karwar
2014-05-05 15:04                       ` Johannes Berg
2014-05-05 15:49                         ` Amitkumar Karwar
2014-04-30 16:13               ` Kalle Valo
2014-05-05 12:58                 ` Johannes Berg
2014-04-17 18:47 ` [PATCH 3/5] mwifiex: increase tx/rx AMPDU window sizes for STA 11n mode Bing Zhao
2014-04-17 18:47 ` [PATCH 4/5] mwifiex: increase tx/rx AMPDU window sizes for STA 11ac mode Bing Zhao
2014-04-17 18:47 ` [PATCH 5/5] mwifiex: enable aggregation for TID 6 and 7 streams Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).