All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 13/19] iwlwifi: by default, dump entire sram data portion
Date: Fri, 20 Nov 2009 12:05:04 -0800	[thread overview]
Message-ID: <1258747510-21233-14-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1258747510-21233-1-git-send-email-reinette.chatre@intel.com>

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

For "sram" debugfs file, if user did not specify the offset and length,
dump the entire data portion of sram by default.
Data portion is 0x800000 - 0x80ffff, but the actual data size is known
to the driver from the ucode file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-debugfs.c |   14 +++++++++++---
 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 016ff40..5adf0b6 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,
 	struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
 	size_t bufsz;
 
-	bufsz =  30 + priv->dbgfs->sram_len * sizeof(char) * 12;
+	/* default is to dump the entire data segment */
+	if (!priv->dbgfs->sram_offset && !priv->dbgfs->sram_len) {
+		priv->dbgfs->sram_offset = 0x800000;
+		if (priv->ucode_type == UCODE_INIT)
+			priv->dbgfs->sram_len = priv->ucode_init_data.len;
+		else
+			priv->dbgfs->sram_len = priv->ucode_data.len;
+	}
+	bufsz =  30 + priv->dbgfs->sram_len * sizeof(char) * 10;
 	buf = kmalloc(bufsz, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
-	pos += scnprintf(buf + pos, bufsz - pos, "sram_len: %d\n",
+	pos += scnprintf(buf + pos, bufsz - pos, "sram_len: 0x%x\n",
 			priv->dbgfs->sram_len);
-	pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: %d\n",
+	pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n",
 			priv->dbgfs->sram_offset);
 	for (i = priv->dbgfs->sram_len; i > 0; i -= 4) {
 		val = iwl_read_targ_mem(priv, priv->dbgfs->sram_offset + \
-- 
1.5.6.3


  parent reply	other threads:[~2009-11-20 20:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 20:04 [PATCH 00/19] iwlwifi updates 11/20/2009 Reinette Chatre
2009-11-20 20:04 ` [PATCH 01/19] iwlwifi: Add iwl_write8() Reinette Chatre
2009-11-20 20:04 ` [PATCH 02/19] iwlagn: Use iwl_write8() for CSR_INT_COALESCING register Reinette Chatre
2009-11-20 20:04 ` [PATCH 03/19] iwlwifi: control led while update tx/rx bytes counts Reinette Chatre
2009-11-20 20:04 ` [PATCH 04/19] iwlwifi: set sm_ps_mode as part of cfg parameters Reinette Chatre
2009-11-20 20:04 ` [PATCH 05/19] iwlwifi: reset led_tpt when clear tx/rx traffic byte counts Reinette Chatre
2009-11-20 20:04 ` [PATCH 06/19] iwl3945: removed unused struct and definitions Reinette Chatre
2009-11-20 20:04 ` [PATCH 07/19] iwlwifi: set read/write permission for debugfs files Reinette Chatre
2009-11-20 20:04 ` [PATCH 08/19] iwlwifi: increase tx_queue debugfs buffer size Reinette Chatre
2009-11-20 20:05 ` [PATCH 09/19] iwlwifi: dynamically allocate buffer for sram debugfs file Reinette Chatre
2009-11-20 20:05 ` [PATCH 10/19] iwlwifi: fix reserved2 field in iwl4965_addsta Reinette Chatre
2009-11-20 20:05 ` [PATCH 11/19] iwlwifi: separate IO tracing Reinette Chatre
2009-11-20 20:05 ` [PATCH 12/19] iwlwifi: update supported PCI_ID list for 5xx0 series Reinette Chatre
2009-11-20 20:05 ` Reinette Chatre [this message]
2009-11-20 20:05 ` [PATCH 14/19] iwlwifi: dump error log when uCode error occurred Reinette Chatre
2009-11-20 20:05 ` [PATCH 15/19] iwlwifi: Tell the ucode immediately when association state changes Reinette Chatre
2009-11-20 20:05 ` [PATCH 16/19] iwlwifi: print limited number of event log when uCode error Reinette Chatre
2009-11-20 20:05 ` [PATCH 17/19] iwlwifi: change message for cmd queue full error Reinette Chatre
2009-11-20 20:05 ` [PATCH 18/19] iwlwifi: remove reset led_tpt from iwl_leds_init() Reinette Chatre
2009-11-20 20:05 ` [PATCH 19/19 w-t only] iwlwifi: no need to set use_rts_for_ht for BG device Reinette Chatre

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=1258747510-21233-14-git-send-email-reinette.chatre@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=wey-yi.w.guy@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.