netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net
Cc: jgarzik@pobox.com, netdev@oss.sgi.com
Subject: [PATCH 2.6.12-rc5 1/9] tg3: Add basic selftest infrastructure
Date: Thu, 26 May 2005 10:56:24 -0700	[thread overview]
Message-ID: <1117130184.3744.52.camel@rh4> (raw)
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d1.patch --]
[-- Type: text/x-patch, Size: 2107 bytes --]

diff -Nru d0/drivers/net/tg3.c d1/drivers/net/tg3.c
--- d0/drivers/net/tg3.c	2005-05-25 12:57:36.000000000 -0700
+++ d1/drivers/net/tg3.c	2005-05-25 12:58:50.000000000 -0700
@@ -133,6 +133,8 @@
 /* number of ETHTOOL_GSTATS u64's */
 #define TG3_NUM_STATS		(sizeof(struct tg3_ethtool_stats)/sizeof(u64))
 
+#define TG3_NUM_TEST		6
+
 static char version[] __devinitdata =
 	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
@@ -316,6 +318,17 @@
 	{ "nic_tx_threshold_hit" }
 };
 
+static struct {
+	const char string[ETH_GSTRING_LEN];
+} ethtool_test_keys[TG3_NUM_TEST] = {
+	{ "nvram test     (online) " },
+	{ "link test      (online) " },
+	{ "register test  (offline)" },
+	{ "memory test    (offline)" },
+	{ "loopback test  (offline)" },
+	{ "interrupt test (offline)" },
+};
+
 static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
 {
 	if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) != 0) {
@@ -7199,12 +7212,20 @@
 	return TG3_NUM_STATS;
 }
 
+static int tg3_get_test_count (struct net_device *dev)
+{
+	return TG3_NUM_TEST;
+}
+
 static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
 {
 	switch (stringset) {
 	case ETH_SS_STATS:
 		memcpy(buf, &ethtool_stats_keys, sizeof(ethtool_stats_keys));
 		break;
+	case ETH_SS_TEST:
+		memcpy(buf, &ethtool_test_keys, sizeof(ethtool_test_keys));
+		break;
 	default:
 		WARN_ON(1);	/* we need a WARN() */
 		break;
@@ -7218,6 +7239,11 @@
 	memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
 }
 
+static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+			  u64 *data)
+{
+}
+
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	struct mii_ioctl_data *data = if_mii(ifr);
@@ -7331,6 +7357,8 @@
 	.get_tso		= ethtool_op_get_tso,
 	.set_tso		= tg3_set_tso,
 #endif
+	.self_test_count	= tg3_get_test_count,
+	.self_test		= tg3_self_test,
 	.get_strings		= tg3_get_strings,
 	.get_stats_count	= tg3_get_stats_count,
 	.get_ethtool_stats	= tg3_get_ethtool_stats,

  reply	other threads:[~2005-05-26 17:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-26 17:33 [PATCH 2.6.12-rc5 0/9] tg3: Add ethtool selftest Michael Chan
2005-05-26 17:56 ` Michael Chan [this message]
2005-05-26 17:57 ` [PATCH 2.6.12-rc5 2/9] tg3: Add nvram test Michael Chan
2005-05-26 17:57 ` [PATCH 2.6.12-rc5 3/9] tg3: Add link test Michael Chan
2005-05-26 17:58 ` [PATCH 2.6.12-rc5 4/9] tg3: Add parameter to tg3_halt Michael Chan
2005-05-26 17:58 ` [PATCH 2.6.12-rc5 5/9] tg3: Add register test Michael Chan
2005-05-26 17:58 ` [PATCH 2.6.12-rc5 6/9] tg3: Add memory test Michael Chan
2005-05-26 17:59 ` [PATCH 2.6.12-rc5 7/9] tg3: Add loopback test Michael Chan
2005-05-26 17:59 ` [PATCH 2.6.12-rc5 8/9] tg3: Add interrupt test Michael Chan
2005-05-26 18:00 ` [PATCH 2.6.12-rc5 9/9] tg3: Fix bug in tg3_load_firmware_cpu Michael Chan
2005-05-26 19:13   ` Jeff Garzik
2005-05-26 22:10   ` David S. Miller

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=1117130184.3744.52.camel@rh4 \
    --to=mchan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.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 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).