netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Cliburn <jacliburn@bellsouth.net>
To: netdev@vger.kernel.org
Cc: Jay Cliburn <jacliburn@bellsouth.net>
Subject: [PATCH 04/26] atl1: add ethtool register dump
Date: Mon, 31 Dec 2007 20:22:31 -0600	[thread overview]
Message-ID: <1199154173-4058-5-git-send-email-jacliburn@bellsouth.net> (raw)
In-Reply-To: <1199154173-4058-1-git-send-email-jacliburn@bellsouth.net>

Add the ethtool register dump option to the atl1 driver.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
---
 drivers/net/atlx/atl1.c |   53 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/atlx/atl1.h |    1 +
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 4e98c16..239641f 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2513,6 +2513,57 @@ static int atl1_set_wol(struct net_device *netdev,
 	return 0;
 }
 
+static int atl1_get_regs_len(struct net_device *netdev)
+{
+	return ATL1_REG_COUNT * sizeof(u32);
+}
+
+static void atl1_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
+	void *p)
+{
+	struct atl1_adapter *adapter = netdev_priv(netdev);
+	struct atl1_hw *hw = &adapter->hw;
+	unsigned int i;
+	u32 *regbuf = p;
+
+	for (i = 0; i < ATL1_REG_COUNT; i++) {
+		/*
+		 * This switch statement avoids reserved regions
+		 * of register space.
+		 */
+		switch (i) {
+		case 6 ... 9:
+		case 14:
+		case 29 ... 31:
+		case 34 ... 63:
+		case 75 ... 127:
+		case 136 ... 1023:
+		case 1027 ... 1087:
+		case 1091 ... 1151:
+		case 1194 ... 1195:
+		case 1200 ... 1201:
+		case 1206 ... 1213:
+		case 1216 ... 1279:
+		case 1290 ... 1311:
+		case 1323 ... 1343:
+		case 1358 ... 1359:
+		case 1368 ... 1375:
+		case 1378 ... 1383:
+		case 1388 ... 1391:
+		case 1393 ... 1395:
+		case 1402 ... 1403:
+		case 1410 ... 1471:
+		case 1522 ... 1535:
+			/* reserved region; don't read it */
+			regbuf[i] = 0;
+			break;
+		default:
+			/* unreserved region */
+			regbuf[i] = ioread32(hw->hw_addr + (i * sizeof(u32)));
+		}
+	}
+}
+
 static void atl1_get_ringparam(struct net_device *netdev,
 	struct ethtool_ringparam *ring)
 {
@@ -2703,6 +2754,8 @@ const struct ethtool_ops atl1_ethtool_ops = {
 	.get_drvinfo		= atl1_get_drvinfo,
 	.get_wol		= atl1_get_wol,
 	.set_wol		= atl1_set_wol,
+	.get_regs_len		= atl1_get_regs_len,
+	.get_regs		= atl1_get_regs,
 	.get_ringparam		= atl1_get_ringparam,
 	.set_ringparam		= atl1_set_ringparam,
 	.get_pauseparam		= atl1_get_pauseparam,
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
index 538948d..30c5a8d 100644
--- a/drivers/net/atlx/atl1.h
+++ b/drivers/net/atlx/atl1.h
@@ -584,6 +584,7 @@ enum atl1_dma_req_block {
 #define ATL1_DEFAULT_RFD	512
 #define ATL1_MIN_RFD		128
 #define ATL1_MAX_RFD		2048
+#define ATL1_REG_COUNT		1538
 
 #define ATL1_GET_DESC(R, i, type)	(&(((type *)((R)->desc))[i]))
 #define ATL1_RFD_DESC(R, i)	ATL1_GET_DESC(R, i, struct rx_free_desc)
-- 
1.5.3.3


  parent reply	other threads:[~2008-01-01  2:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-01  2:22 [PATCH 00/26] atl1: divide and modernize Jay Cliburn
2008-01-01  2:22 ` [PATCH 01/26] atl1: relocate atl1 driver to /drivers/net/atlx Jay Cliburn
2008-01-01  2:22 ` [PATCH 02/26] atl1: move common functions to atlx files Jay Cliburn
2008-01-01  2:22 ` [PATCH 03/26] atl1: fix broken TSO Jay Cliburn
2008-01-01  2:22 ` Jay Cliburn [this message]
2008-01-01  2:22 ` [PATCH 05/26] atl1: print debug info if rrd error Jay Cliburn
2008-01-01  2:22 ` [PATCH 06/26] atl1: update initialization parameters Jay Cliburn
2008-01-01  2:22 ` [PATCH 07/26] atl1: clarify max rx frame size Jay Cliburn
2008-01-01  2:22 ` [PATCH 08/26] atl1: additional DMA engine configuration Jay Cliburn
2008-01-01  2:22 ` [PATCH 09/26] atl1: refactor tx processing Jay Cliburn
2008-01-01  2:22 ` [PATCH 10/26] atl1: use csum_start Jay Cliburn
2008-01-01  2:22 ` [PATCH 11/26] atl1: refactor initialization and startup Jay Cliburn
2008-01-01  2:22 ` [PATCH 12/26] atl1: refactor atl1_probe Jay Cliburn
2008-01-01  2:22 ` [PATCH 13/26] atl1: refactor interrupt handling Jay Cliburn
2008-01-01  2:22 ` [PATCH 14/26] atl1: move stray defines to header file Jay Cliburn
2008-01-01  2:22 ` [PATCH 15/26] atl1: tidy up ring management Jay Cliburn
2008-01-01  2:22 ` [PATCH 16/26] atl1: modernize check link function Jay Cliburn
2008-01-01  2:22 ` [PATCH 17/26] atl1: update phy config function Jay Cliburn
2008-01-01  2:22 ` [PATCH 18/26] atl1: make function static Jay Cliburn
2008-01-01  2:22 ` [PATCH 19/26] atl1: modernize down/up functions Jay Cliburn
2008-01-01  2:22 ` [PATCH 20/26] atl1: update change mtu Jay Cliburn
2008-01-01  2:22 ` [PATCH 21/26] atl1: update atl1_close Jay Cliburn
2008-01-01  2:22 ` [PATCH 22/26] atl1: update netpoll Jay Cliburn
2008-01-01  2:22 ` [PATCH 23/26] atl1: update shutdown and remove functions Jay Cliburn
2008-01-01  2:22 ` [PATCH 24/26] atl1: update wake-on-lan Jay Cliburn
2008-01-01  2:22 ` [PATCH 25/26] atl1: add NAPI support Jay Cliburn
2008-01-01  5:58   ` Stephen Hemminger
2008-01-01  2:22 ` [PATCH 26/26] atl1: remove experimental tag and clean up comments Jay Cliburn
2008-01-01 17:58 ` [PATCH 00/26] atl1: divide and modernize Christoph Hellwig
2008-01-01 18:12   ` Jay Cliburn

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=1199154173-4058-5-git-send-email-jacliburn@bellsouth.net \
    --to=jacliburn@bellsouth.net \
    --cc=netdev@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).