From: "Michael Chan" <mchan@broadcom.com>
To: "David Miller" <davem@davemloft.net>, jeff@garzik.org
Cc: "netdev" <netdev@vger.kernel.org>
Subject: [PATCH] ethtool: Add 2.5G support
Date: Thu, 03 May 2007 00:27:10 -0700 [thread overview]
Message-ID: <1178177230.4909.63.camel@dell> (raw)
In-Reply-To: <1178068303.4820.35.camel@dell>
Add 2.5G Serdes support to ethtool user program and ethtool.8 man
page. The missing pause bits are also added to keep ethtool-copy.h
in sync with the kernel's version.
Signed-off-by: Michael Chan <mchan@broadcom.com>
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 30f5e05..4615ef6 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -306,6 +306,9 @@ struct ethtool_stats {
#define SUPPORTED_FIBRE (1 << 10)
#define SUPPORTED_BNC (1 << 11)
#define SUPPORTED_10000baseT_Full (1 << 12)
+#define SUPPORTED_Pause (1 << 13)
+#define SUPPORTED_Asym_Pause (1 << 14)
+#define SUPPORTED_2500baseX_Full (1 << 15)
/* Indicates what features are advertised by the interface. */
#define ADVERTISED_10baseT_Half (1 << 0)
@@ -321,6 +324,9 @@ struct ethtool_stats {
#define ADVERTISED_FIBRE (1 << 10)
#define ADVERTISED_BNC (1 << 11)
#define ADVERTISED_10000baseT_Full (1 << 12)
+#define ADVERTISED_Pause (1 << 13)
+#define ADVERTISED_Asym_Pause (1 << 14)
+#define ADVERTISED_2500baseX_Full (1 << 15)
/* The following are all involved in forcing a particular link
* mode for the device for setting things. When getting the
@@ -332,6 +338,7 @@ struct ethtool_stats {
#define SPEED_10 10
#define SPEED_100 100
#define SPEED_1000 1000
+#define SPEED_2500 2500
#define SPEED_10000 10000
/* Duplex, half or full. */
diff --git a/ethtool.8 b/ethtool.8
index d6561bf..248260a 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -175,7 +175,7 @@ ethtool \- Display or change ethernet card settings
.B ethtool \-s
.I ethX
-.B4 speed 10 100 1000 10000
+.B4 speed 10 100 1000 2500 10000
.B2 duplex half full
.B4 port tp aui bnc mii fibre
.B2 autoneg on off
@@ -326,7 +326,7 @@ All following options only apply if
.B \-s
was specified.
.TP
-.A4 speed 10 100 1000 10000
+.A4 speed 10 100 1000 2500 10000
Set speed in Mb/s.
.B ethtool
with just the device name as an argument will show you the supported device speeds.
@@ -360,6 +360,8 @@ a hexidecimal value using one or a combination of the following values:
.TP 3
.BR "0x020" " 1000 Full"
.TP 3
+.BR "0x8000" " 2500 Full" "(not supported by IEEE standards)"
+.TP 3
.BR "0x800" " 10000 Full"
.TP 3
.BR "0x03F" " Auto"
diff --git a/ethtool.c b/ethtool.c
index 1fbad09..4aa8e06 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -98,7 +98,7 @@ static struct option {
char *opthelp;
} args[] = {
{ "-s", "--change", MODE_SSET, "Change generic options",
- " [ speed 10|100|1000|10000 ]\n"
+ " [ speed 10|100|1000|2500|10000 ]\n"
" [ duplex half|full ]\n"
" [ port tp|aui|bnc|mii|fibre ]\n"
" [ autoneg on|off ]\n"
@@ -521,6 +521,8 @@ static void parse_cmdline(int argc, char **argp)
speed_wanted = SPEED_100;
else if (!strcmp(argp[i], "1000"))
speed_wanted = SPEED_1000;
+ else if (!strcmp(argp[i], "2500"))
+ speed_wanted = SPEED_2500;
else if (!strcmp(argp[1], "10000"))
speed_wanted = SPEED_10000;
else
@@ -649,6 +651,9 @@ static void parse_cmdline(int argc, char **argp)
else if (speed_wanted == SPEED_1000 &&
duplex_wanted == DUPLEX_FULL)
advertising_wanted = ADVERTISED_1000baseT_Full;
+ else if (speed_wanted == SPEED_2500 &&
+ duplex_wanted == DUPLEX_FULL)
+ advertising_wanted = ADVERTISED_2500baseX_Full;
else if (speed_wanted == SPEED_10000 &&
duplex_wanted == DUPLEX_FULL)
advertising_wanted = ADVERTISED_10000baseT_Full;
@@ -712,6 +717,13 @@ static void dump_supported(struct ethtool_cmd *ep)
if (mask & SUPPORTED_1000baseT_Full) {
did1++; fprintf(stdout, "1000baseT/Full ");
}
+ if (did1 && (mask & SUPPORTED_2500baseX_Full)) {
+ fprintf(stdout, "\n");
+ fprintf(stdout, " ");
+ }
+ if (mask & SUPPORTED_2500baseX_Full) {
+ did1++; fprintf(stdout, "2500baseX/Full ");
+ }
fprintf(stdout, "\n");
fprintf(stdout, " Supports auto-negotiation: ");
@@ -754,6 +766,13 @@ static void dump_advertised(struct ethtool_cmd *ep)
if (mask & ADVERTISED_1000baseT_Full) {
did1++; fprintf(stdout, "1000baseT/Full ");
}
+ if (did1 && (mask & ADVERTISED_2500baseX_Full)) {
+ fprintf(stdout, "\n");
+ fprintf(stdout, " ");
+ }
+ if (mask & ADVERTISED_2500baseX_Full) {
+ did1++; fprintf(stdout, "2500baseX/Full ");
+ }
if (did1 && (mask & ADVERTISED_10000baseT_Full)) {
fprintf(stdout, "\n");
fprintf(stdout, " ");
@@ -788,6 +807,9 @@ static int dump_ecmd(struct ethtool_cmd *ep)
case SPEED_1000:
fprintf(stdout, "1000Mb/s\n");
break;
+ case SPEED_2500:
+ fprintf(stdout, "2500Mb/s\n");
+ break;
case SPEED_10000:
fprintf(stdout, "10000Mb/s\n");
break;
@@ -1712,6 +1734,7 @@ static int do_sset(int fd, struct ifreq *ifr)
ADVERTISED_100baseT_Full |
ADVERTISED_1000baseT_Half |
ADVERTISED_1000baseT_Full |
+ ADVERTISED_2500baseX_Full |
ADVERTISED_10000baseT_Full);
else
ecmd.advertising = advertising_wanted;
next prev parent reply other threads:[~2007-05-03 6:40 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-02 1:11 [PATCH 0/20][BNX2]: Bug fixes and more 5709 suppot Michael Chan
2007-05-02 7:10 ` Jeff Garzik
2007-05-02 7:14 ` David Miller
2007-05-03 7:25 ` [ETHTOOL]: Add 2.5G bit definitions Michael Chan
2007-05-03 11:11 ` Jeff Garzik
2007-05-03 20:07 ` David Miller
2007-05-03 20:17 ` David Miller
2007-05-03 7:27 ` Michael Chan [this message]
2007-05-03 11:11 ` [PATCH] ethtool: Add 2.5G support Jeff Garzik
2007-05-11 20:46 ` Jeff Garzik
2007-05-03 7:27 ` [PATCH v2 0/16][BNX2]: Bug fixes and more 5709 suppot Michael Chan
2007-05-03 7:28 ` [PATCH v2 1/16][BNX2]: Block MII access when ifdown Michael Chan
2007-05-03 20:18 ` David Miller
2007-05-03 7:28 ` [PATCH v2 2/16][BNX2]: Fix register and memory test on 5709 Michael Chan
2007-05-03 20:18 ` David Miller
2007-05-03 7:28 ` [PATCH v2 3/16][BNX2]: Add 40-bit DMA workaround for 5708 Michael Chan
2007-05-03 20:19 ` David Miller
2007-05-03 7:29 ` [PATCH v2 4/16][BNX2]: Fix race conditions when calling register_netdev() Michael Chan
2007-05-03 20:20 ` David Miller
2007-05-03 7:29 ` [PATCH v2 5/16][BNX2]: Save PCI state during suspend Michael Chan
2007-05-03 20:20 ` David Miller
2007-05-03 7:29 ` [PATCH v2 6/16][BNX2]: Update 5708 firmware Michael Chan
2007-05-03 20:21 ` David Miller
2007-05-03 7:29 ` [PATCH v2 8/16][BNX2]: Add ipv6 TSO and checksum for 5709 Michael Chan
2007-05-03 20:22 ` David Miller
2007-05-03 7:30 ` [PATCH v2 9/16][BNX2]: Put MII register offsets in the bnx2 struct Michael Chan
2007-05-03 20:23 ` David Miller
2007-05-03 7:30 ` [PATCH v2 10/16][BNX2]: Re-structure the 2.5G Serdes code Michael Chan
2007-05-03 20:23 ` David Miller
2007-05-03 7:30 ` [PATCH v2 11/16][BNX2]: Add support for 5709 Serdes Michael Chan
2007-05-03 20:23 ` David Miller
2007-05-03 7:30 ` [PATCH v2 12/16][BNX2]: Add indirect spinlock Michael Chan
2007-05-03 20:24 ` David Miller
2007-05-03 7:31 ` [PATCH v2 13/16][BNX2]: Restructure PHY event handling Michael Chan
2007-05-03 20:24 ` David Miller
2007-05-03 7:31 ` [PATCH v2 14/16][BNX2]: Add 1-shot MSI handler for 5709 Michael Chan
2007-05-03 20:24 ` David Miller
2007-05-03 7:31 ` [PATCH v2 15/16][BNX2]: Print bus information for PCIE devices Michael Chan
2007-05-03 20:25 ` David Miller
2007-05-03 7:32 ` [PATCH v2 16/16][BNX2]: Update version and reldate Michael Chan
2007-05-03 12:40 ` Jeff Garzik
2007-05-03 20:25 ` David Miller
[not found] ` <1178177565.4909.80.camel@dell>
2007-05-03 20:21 ` [PATCH v2 7/16][BNX2]: Update 5709 firmware David 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=1178177230.4909.63.camel@dell \
--to=mchan@broadcom.com \
--cc=davem@davemloft.net \
--cc=jeff@garzik.org \
--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.