linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 23/29] iwlwifi: mvm: dump NVM from debugfs
Date: Sun, 24 Nov 2013 22:06:40 +0200	[thread overview]
Message-ID: <1385323606-3603-23-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <52925BE7.4050406@gmail.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

This allows to see the content of the NVM the driver reads.
Note that the output is in binary, and requires some
external user space tool to display the data properly.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/debugfs.c |   13 +++++++++++++
 drivers/net/wireless/iwlwifi/mvm/mvm.h     |    5 +++++
 drivers/net/wireless/iwlwifi/mvm/nvm.c     |   23 +++++++++++++++++++++++
 3 files changed, 41 insertions(+)

diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index a9b2d0a..145cd72 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -716,6 +716,19 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
 		goto err;
 #endif
 
+	if (!debugfs_create_blob("nvm_hw", S_IRUSR,
+				  mvm->debugfs_dir, &mvm->nvm_hw_blob))
+		goto err;
+	if (!debugfs_create_blob("nvm_sw", S_IRUSR,
+				  mvm->debugfs_dir, &mvm->nvm_sw_blob))
+		goto err;
+	if (!debugfs_create_blob("nvm_calib", S_IRUSR,
+				  mvm->debugfs_dir, &mvm->nvm_calib_blob))
+		goto err;
+	if (!debugfs_create_blob("nvm_prod", S_IRUSR,
+				  mvm->debugfs_dir, &mvm->nvm_prod_blob))
+		goto err;
+
 	/*
 	 * Create a symlink with mac80211. It will be removed when mac80211
 	 * exists (before the opmode exists which removes the target.)
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index e7c97cc..7dc57cf 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -494,6 +494,11 @@ struct iwl_mvm {
 	u32 dbgfs_sram_offset, dbgfs_sram_len;
 	bool disable_power_off;
 	bool disable_power_off_d3;
+
+	struct debugfs_blob_wrapper nvm_hw_blob;
+	struct debugfs_blob_wrapper nvm_sw_blob;
+	struct debugfs_blob_wrapper nvm_calib_blob;
+	struct debugfs_blob_wrapper nvm_prod_blob;
 #endif
 
 	struct iwl_mvm_phy_ctxt phy_ctxts[NUM_PHY_CTX];
diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c
index 2beffd0..e4596c5 100644
--- a/drivers/net/wireless/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c
@@ -443,6 +443,29 @@ int iwl_nvm_init(struct iwl_mvm *mvm)
 			}
 			mvm->nvm_sections[section].data = temp;
 			mvm->nvm_sections[section].length = ret;
+
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+			switch (section) {
+			case NVM_SECTION_TYPE_HW:
+				mvm->nvm_hw_blob.data = temp;
+				mvm->nvm_hw_blob.size = ret;
+				break;
+			case NVM_SECTION_TYPE_SW:
+				mvm->nvm_sw_blob.data = temp;
+				mvm->nvm_sw_blob.size  = ret;
+				break;
+			case NVM_SECTION_TYPE_CALIBRATION:
+				mvm->nvm_calib_blob.data = temp;
+				mvm->nvm_calib_blob.size  = ret;
+				break;
+			case NVM_SECTION_TYPE_PRODUCTION:
+				mvm->nvm_prod_blob.data = temp;
+				mvm->nvm_prod_blob.size  = ret;
+				break;
+			default:
+				WARN(1, "section: %d", section);
+			};
+#endif
 		}
 		kfree(nvm_buffer);
 		if (ret < 0)
-- 
1.7.9.5


  parent reply	other threads:[~2013-11-24 20:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24 20:04 pull request: iwlwifi-next 2013_11_24 Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 01/29] iwlwifi: remove TX_CMD id from transport layer Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 02/29] iwlwifi: mvm: Add debugfs entry to generate NMI to NIC Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 03/29] iwlwifi: pcie: remove useless condition test Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 04/29] iwlwifi: mvm: fix and improve printing of rate scale table Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 05/29] iwlwifi: mvm: simplify iwl_mvm_send_lq_cmd Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 06/29] iwlwifi: mvm: refactor iwl_mvm_rs_rate_init Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 07/29] iwlwifi: mvm: enable d3_test even if d3_test_pme_ptr is not available Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 08/29] iwlwifi: mvm: disconnect on disconnection wakeup event Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 09/29] iwlwifi: mvm: implement rate_update hook in rs Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 10/29] iwlwifi: mvm: allow keeping connections in d3_test Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 11/29] iwlwifi: mvm: fix ht protection flags Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 12/29] iwlwifi: mvm: small debugfs cleanups Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 13/29] iwlwifi: mvm: move interface-specific debugfs to a new file Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 14/29] iwlwifi: mvm: don't use void pointers in debugfs Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 15/29] iwlwifi: mvm: refactor debugfs copy_from_user() Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 16/29] iwlwifi: mvm: add LQ flags definitions Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 17/29] iwlwifi: mvm: BT Coex - fine tune the aggregation size Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 18/29] iwlwifi: mvm: a few more SKUs for 7260 and 3160 Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 19/29] iwlwifi: pcie: remove minor dead code Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 20/29] iwlwifi: fix check for a single rx antenna Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 21/29] iwlwifi: mvm: add iwl_mvm_sta_from_mac80211 Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 22/29] iwlwifi: mvm: don't restart HW if suspending fails before D3 image is loaded Emmanuel Grumbach
2013-11-24 20:06 ` Emmanuel Grumbach [this message]
2013-11-24 20:06 ` [PATCH 24/29] iwlwifi: mvm: fix scan offloading flag definition Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 25/29] iwlwifi: mvm: Implement low-priority scan Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 26/29] iwlwifi: mvm: quota command max_duration should be zero Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 27/29] iwlwifi: mvm: stop using MIMO in case BT doesn't allow it Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 28/29] iwlwifi: mvm: don't enable VHT MCS9 in 20Mhz Emmanuel Grumbach
2013-11-24 20:06 ` [PATCH 29/29] iwlwifi: mvm: don't configure mimo rates if nss is limited to 1 Emmanuel Grumbach
2013-12-02 18:40 ` pull request: iwlwifi-next 2013_11_24 John W. Linville
2013-12-02 19:23   ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385323606-3603-23-git-send-email-egrumbach@gmail.com \
    --to=egrumbach@gmail.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).