diff options
author | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2006-09-06 09:38:39 -0700 |
---|---|---|
committer | Jeff Kirsher <jtkirshe@gitlost.site> | 2006-09-06 09:38:39 -0700 |
commit | bfcb014b3b18dce0e3f744b0ad919eef47b9d25d (patch) | |
tree | f0a6c011568c45c2598d0d95091c2f3df5a8925d /ethtool.c | |
parent | 0c3deb37fe907bd2ed38c63229b20a8af8d101cc (diff) | |
download | ethtool-bfcb014b3b18dce0e3f744b0ad919eef47b9d25d.tar.gz |
ethtool v5: add autoneg advertise feature
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>
Diffstat (limited to 'ethtool.c')
-rw-r--r-- | ethtool.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 **argp) 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 **argp) } } - 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 && |