diff options
| author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2017-10-19 19:32:08 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-10-21 21:14:18 -0400 |
| commit | 95491e3cf37840c518d81e1a3a6a8ef554e03c54 (patch) | |
| tree | b3ab5d889bca26bcea0f9b2c4910a41754a4a8cb | |
| parent | 1b5f962e71bfad6284574655c406597535c3ea7a (diff) | |
net: ethtool: remove error check for legacy setting transceiver type
Commit 9cab88726929605 ("net: ethtool: Add back transceiver type")
restores the transceiver type to struct ethtool_link_settings and
convert_link_ksettings_to_legacy_settings() but forgets to remove the
error check for the same in convert_legacy_settings_to_link_ksettings().
This prevents older versions of ethtool to change link settings.
# ethtool --version
ethtool version 3.16
# ethtool -s eth0 autoneg on speed 100 duplex full
Cannot set new settings: Invalid argument
not setting speed
not setting duplex
not setting autoneg
While newer versions of ethtool works.
# ethtool --version
ethtool version 4.10
# ethtool -s eth0 autoneg on speed 100 duplex full
[ 57.703268] sh-eth ee700000.ethernet eth0: Link is Down
[ 59.618227] sh-eth ee700000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
Fixes: 19cab88726929605 ("net: ethtool: Add back transceiver type")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reported-by: Renjith R V <renjith.rv@quest-global.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/core/ethtool.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 3228411ada0f..9a9a3d77e327 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
| @@ -436,7 +436,7 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32, | |||
| 436 | EXPORT_SYMBOL(ethtool_convert_link_mode_to_legacy_u32); | 436 | EXPORT_SYMBOL(ethtool_convert_link_mode_to_legacy_u32); |
| 437 | 437 | ||
| 438 | /* return false if legacy contained non-0 deprecated fields | 438 | /* return false if legacy contained non-0 deprecated fields |
| 439 | * transceiver/maxtxpkt/maxrxpkt. rest of ksettings always updated | 439 | * maxtxpkt/maxrxpkt. rest of ksettings always updated |
| 440 | */ | 440 | */ |
| 441 | static bool | 441 | static bool |
| 442 | convert_legacy_settings_to_link_ksettings( | 442 | convert_legacy_settings_to_link_ksettings( |
| @@ -451,8 +451,7 @@ convert_legacy_settings_to_link_ksettings( | |||
| 451 | * deprecated legacy fields, and they should not use | 451 | * deprecated legacy fields, and they should not use |
| 452 | * %ETHTOOL_GLINKSETTINGS/%ETHTOOL_SLINKSETTINGS | 452 | * %ETHTOOL_GLINKSETTINGS/%ETHTOOL_SLINKSETTINGS |
| 453 | */ | 453 | */ |
| 454 | if (legacy_settings->transceiver || | 454 | if (legacy_settings->maxtxpkt || |
| 455 | legacy_settings->maxtxpkt || | ||
| 456 | legacy_settings->maxrxpkt) | 455 | legacy_settings->maxrxpkt) |
| 457 | retval = false; | 456 | retval = false; |
| 458 | 457 | ||
