netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REVISED] [PATCH] ethtool v4: add autoneg advertise feature
@ 2006-08-24 16:17 Jeff Kirsher
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2006-08-24 16:17 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


adds the ability to change the advertised speed and duplex for a network interface.  Previously, a network interface was only able to advertise all supported speed's and duplex's, or one individual speed and duplex.  The feature allows the user to choose which supported speed's and duplex's to advertise by using the hex value.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>

---

 ethtool.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 87e22ab..b7f189a 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -99,6 +99,7 @@ static struct option {
 		"		[ duplex half|full ]\n"
 		"		[ port tp|aui|bnc|mii|fibre ]\n"
 		"		[ autoneg on|off ]\n"
+		"		[ advertise %%x ]\n"
 		"		[ phyad %%d ]\n"
 		"		[ xcvr internal|external ]\n"
 		"		[ wol p|u|m|b|a|g|s|d... ]\n"
@@ -549,6 +550,15 @@ static void parse_cmdline(int argc, char
 					show_usage(1);
 				}
 				break;
+			} else if (!strcmp(argp[i], "advertise")) {
+				gset_changed = 1;
+				i += 1;
+				if (i >= argc)
+					show_usage(1);
+				advertising_wanted = strtol(argp[i], NULL, 16);
+				if (advertising_wanted < 0)
+					show_usage(1);
+				break;
 			} else if (!strcmp(argp[i], "phyad")) {
 				gset_changed = 1;
 				i += 1;
@@ -601,7 +611,7 @@ static void parse_cmdline(int argc, char
 		}
 	}
 
-	if (autoneg_wanted == AUTONEG_ENABLE){
+	if ((autoneg_wanted == AUTONEG_ENABLE) && (advertising_wanted < 0)) {
 		if (speed_wanted == SPEED_10 && duplex_wanted == DUPLEX_HALF)
 			advertising_wanted = ADVERTISED_10baseT_Half;
 		else if (speed_wanted == SPEED_10 &&

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [REVISED] [PATCH] ethtool v4: add autoneg advertise feature
@ 2006-09-05 15:10 Jeff Kirsher
  2006-09-06 18:19 ` Jeff Kirsher
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2006-09-05 15:10 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


adds the ability to change the advertised speed and duplex for a network interface.  Previously, a network interface was only able to advertise all supported speed's and duplex's, or one individual speed and duplex.  The feature allows the user to choose which supported speed's and duplex's to advertise by using the hex value.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>

---

 ethtool.8 |   24 ++++++++++++++++++++++++
 ethtool.c |   12 +++++++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/ethtool.8 b/ethtool.8
index 888a7d8..679f6bc 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -176,6 +176,8 @@ ethtool \- Display or change ethernet ca
 .B2 duplex half full
 .B4 port tp aui bnc mii fibre
 .B2 autoneg on off
+.RB [ advertise
+.IR N ]
 .RB [ phyad
 .IR N ]
 .B2 xcvr internal external
@@ -327,6 +329,28 @@ Select device port.
 Specify if autonegotiation is enabled. In the usual case it is, but might
 cause some problems with some network devices, so you can turn it off.
 .TP
+.BI advertise \ N
+Set the speed and duplex advertised by autonegotiation.  The argument is
+a hexidecimal value using one or a combination of the following values:
+.RS
+.PD 0
+.TP 3
+.BR "0x01" "    10 Half"
+.TP 3
+.BR "0x02" "    10 Full"
+.TP 3
+.BR "0x04" "    100 Half"
+.TP 3
+.BR "0x08" "    100 Full"
+.TP 3
+.BR "0x10" "    1000 Half" "(not supported by IEEE standards)"
+.TP 3
+.BR "0x20" "    1000 Full"
+.TP 3
+.BR "0x3F" "    Auto"
+.PD
+.RE
+.TP
 .BI phyad \ N
 PHY address.
 .TP
diff --git a/ethtool.c b/ethtool.c
index 87e22ab..b7f189a 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -99,6 +99,7 @@ static struct option {
 		"		[ duplex half|full ]\n"
 		"		[ port tp|aui|bnc|mii|fibre ]\n"
 		"		[ autoneg on|off ]\n"
+		"		[ advertise %%x ]\n"
 		"		[ phyad %%d ]\n"
 		"		[ xcvr internal|external ]\n"
 		"		[ wol p|u|m|b|a|g|s|d... ]\n"
@@ -549,6 +550,15 @@ static void parse_cmdline(int argc, char
 					show_usage(1);
 				}
 				break;
+			} else if (!strcmp(argp[i], "advertise")) {
+				gset_changed = 1;
+				i += 1;
+				if (i >= argc)
+					show_usage(1);
+				advertising_wanted = strtol(argp[i], NULL, 16);
+				if (advertising_wanted < 0)
+					show_usage(1);
+				break;
 			} else if (!strcmp(argp[i], "phyad")) {
 				gset_changed = 1;
 				i += 1;
@@ -601,7 +611,7 @@ static void parse_cmdline(int argc, char
 		}
 	}
 
-	if (autoneg_wanted == AUTONEG_ENABLE){
+	if ((autoneg_wanted == AUTONEG_ENABLE) && (advertising_wanted < 0)) {
 		if (speed_wanted == SPEED_10 && duplex_wanted == DUPLEX_HALF)
 			advertising_wanted = ADVERTISED_10baseT_Half;
 		else if (speed_wanted == SPEED_10 &&

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [REVISED] [PATCH] ethtool v4: add autoneg advertise feature
  2006-09-05 15:10 [REVISED] [PATCH] ethtool v4: add autoneg advertise feature Jeff Kirsher
@ 2006-09-06 18:19 ` Jeff Kirsher
  2006-09-19 19:04   ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2006-09-06 18:19 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg

On 9/5/06, Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
>
> adds the ability to change the advertised speed and duplex for a network interface.  Previously, a network interface was only able to advertise all supported speed's and duplex's, or one individual speed and duplex.  The feature allows the user to choose which supported speed's and duplex's to advertise by using the hex value.
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>
> ---

This patch can be pull from the following location:

git pull git://lost.foo-projects.org/~jtkirshe/ethtool e1000

-- 
Cheers,
Jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [REVISED] [PATCH] ethtool v4: add autoneg advertise feature
  2006-09-06 18:19 ` Jeff Kirsher
@ 2006-09-19 19:04   ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2006-09-19 19:04 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: netdev, David Miller, John Rociak, Jesse Brandeburg

Jeff Kirsher wrote:
> On 9/5/06, Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
>>
>> adds the ability to change the advertised speed and duplex for a 
>> network interface.  Previously, a network interface was only able to 
>> advertise all supported speed's and duplex's, or one individual speed 
>> and duplex.  The feature allows the user to choose which supported 
>> speed's and duplex's to advertise by using the hex value.
>>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
>>
>> ---
> 
> This patch can be pull from the following location:
> 
> git pull git://lost.foo-projects.org/~jtkirshe/ethtool e1000

pulled



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-19 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-05 15:10 [REVISED] [PATCH] ethtool v4: add autoneg advertise feature Jeff Kirsher
2006-09-06 18:19 ` Jeff Kirsher
2006-09-19 19:04   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2006-08-24 16:17 Jeff Kirsher

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).