All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH ethtool] marvell chip decode formatting
Date: Wed, 31 Jan 2007 16:23:46 -0800	[thread overview]
Message-ID: <20070131162346.48d796d4@freekitty> (raw)

Fix some typo's and formatting on Marvell ethtool output.
If sync transmit queue is not used, don't print settings.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
 marvell.c |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/marvell.c b/marvell.c
index b73addc..b17548e 100644
--- a/marvell.c
+++ b/marvell.c
@@ -51,6 +51,12 @@ static void dump_queue(const char *name,
 	};
 	const struct desc *d = a;
 
+	/* is reset bit set? */
+	if (!(d->ctl & 2)) {
+		printf("\n%s (disabled)\n", name);
+		return;
+	}
+
 	printf("\n%s\n", name);
 	printf("---------------\n");
 	printf("Descriptor Address       0x%08X%08X\n",
@@ -82,13 +88,19 @@ static void dump_ram(const char *name, c
 {
 	const u32 *r = p;
 
+	if (!(r[10] & 2)) {
+		printf("\n%s (disabled)\n", name);
+		return;
+	}
+
 	printf("\n%s\n", name);
 	printf("---------------\n");
 	printf("Start Address                    0x%08X\n", r[0]);
 	printf("End Address                      0x%08X\n", r[1]);
 	printf("Write Pointer                    0x%08X\n", r[2]);
 	printf("Read Pointer                     0x%08X\n", r[3]);
-	if (*name == 'R') {
+
+	if (*name == 'R') { /* Receive only */
 		printf("Upper Threshold/Pause Packets    0x%08X\n", r[4]);
 		printf("Lower Threshold/Pause Packets    0x%08X\n", r[5]);
 		printf("Upper Threshold/High Priority    0x%08X\n", r[6]);
@@ -96,7 +108,7 @@ static void dump_ram(const char *name, c
 	}
 	printf("Packet Counter                   0x%08X\n", r[8]);
 	printf("Level                            0x%08X\n", r[9]);
-	printf("Test                             0x%08X\n", r[10]);
+	printf("Control                          0x%08X\n", r[10]);
 }
 
 static void dump_fifo(const char *name, const void *p)
@@ -161,15 +173,14 @@ static void dump_mac(const u8 *r)
 	id = r[0x11b];
 	printf("Chip Id                      0x%02X ", id);
 	switch (id) {
-	case 0x0a:	puts("Genesis");	break;
-	case 0xb0:	puts("Yukon");	break;
-	case 0xb1:	puts("Yukon-Lite");	break;
-	case 0xb2:	puts("Yukon-LP");	break;
-	case 0xb3:	puts("Yukon-2 XL");	break;
-	case 0xb4:	puts("Yukon-2 EC Ultra");	break;
-	case 0xb6:	puts("Yukon-2 EC");	break;
- 	case 0xb7:	puts("Yukon-2 FE");	break;
-	default:	puts("Unknown");
+	case 0x0a:	printf("Genesis");	break;
+	case 0xb0:	printf("Yukon");	break;
+	case 0xb1:	printf("Yukon-Lite");	break;
+	case 0xb2:	printf("Yukon-LP");	break;
+	case 0xb3:	printf("Yukon-2 XL");	break;
+	case 0xb4:	printf("Yukon-2 EC Ultra");	break;
+	case 0xb6:	printf("Yukon-2 EC");	break;
+ 	case 0xb7:	printf("Yukon-2 FE");	break;
 	}
 
 	printf(" (rev %d)\n", r[0x11a] & 0xf);
@@ -328,9 +339,9 @@ static void dump_queue2(const char *name
 	printf("Request                          0x%08X%08X\n",
 	       d->req_hi, d->req_lo);
 	if (rx) {
-		printf("Csum1      Offset %4d Piston   %d\n",
+		printf("Csum1      Offset %4d Position   %d\n",
 		       d->csum1, d->csum1_start);
-		printf("Csum2      Offset %4d Positing   %d\n",
+		printf("Csum2      Offset %4d Position  %d\n",
 		       d->csum2, d->csum2_start);
 	} else
 		printf("Csum Start 0x%04X Pos %4d Write %d\n",
-- 
1.4.1


             reply	other threads:[~2007-02-01  0:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-01  0:23 Stephen Hemminger [this message]
2007-02-09 21:32 ` [PATCH ethtool] marvell chip decode formatting Jeff Garzik

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=20070131162346.48d796d4@freekitty \
    --to=shemminger@linux-foundation.org \
    --cc=jgarzik@pobox.com \
    --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 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.