path: root/
diff options
authorJesse Brandeburg <>2012-08-21 01:37:16 -0700
committerBen Hutchings <>2012-09-06 19:10:12 +0100
commit75e6791c0d2d60705932ea5aa8ced5596cb85da4 (patch)
treeac01f3ede9f7e1d3001a2c33b2a6c0cf1a891798 /
parent74ffff9036dce839e1f5e6835774126d29bd002f (diff)
ethtool: allow setting MDI-X state
A bit ago ethtool added support for reading MDI-X state, this patch finishes the implementation, adding the complementary write command. Add support to ethtool for controlling the MDI-X (crossover) state of a network port. Most adapters correctly negotiate MDI-X, but some ill-behaved switches have trouble and end up picking the wrong MDI setting, which results in complete loss of link. Usually this error condition can be observed when multiple ethtool -r ethX are required before link is achieved. This patch allows the user to override the normal "auto" setting and force the crossover state to on or off. The set will fail if the driver doesn't support the get, as suggested by Ben Hutchings. setting MDI not supported In addition the do_gset output was changed slightly to report the value set by the user (when the driver supports the set) old: MDI-X: on new: MDI-X: on (auto) or MDI-X: on (forced) usage is ethtool -s eth0 mdix [auto|on|off] Signed-off-by: Jesse Brandeburg <> CC: Ben Hutchings <> Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher <> Signed-off-by: Ben Hutchings <>
Diffstat (limited to '')
1 files changed, 8 insertions, 0 deletions
diff --git a/ b/
index 7253832..3208d38 100644
--- a/
+++ b/
@@ -229,6 +229,7 @@ ethtool \- query or control network driver and hardware settings
.BI speed \ N
.B2 duplex half full
.B4 port tp aui bnc mii fibre
+.B3 mdix auto on off
.B2 autoneg on off
.BN advertise
.BN phyad
@@ -521,6 +522,13 @@ Sets full or half duplex mode.
.A4 port tp aui bnc mii fibre
Selects device port.
+.A3 mdix auto on off
+Selects MDI-X mode for port. May be used to override the automatic detection
+feature of most adapters. Auto means automatic detection of MDI status, on
+forces MDI-X (crossover) mode, while off means MDI (straight through) mode.
+The driver should guarantee that this command takes effect immediately, and
+if necessary may reset the link to cause the change to take effect.
.A2 autoneg on off
Specifies whether autonegotiation should be enabled. Autonegotiation
is enabled by default, but in some network devices may have trouble