Commit bc1b5030 authored by Ganesh Goudar's avatar Ganesh Goudar Committed by David S. Miller

cxgb4: do not return DUPLEX_UNKNOWN when link is down

We were returning DUPLEX_UNKNOWN in get_link_ksettings() when
the link was down.  Unfortunately, this causes a problem when
"ethtool -s autoneg on" is issued for a link which is down because
the ethtool code first reads the settings and then reapplies them
with only the changes provided on the command line. Which results
in us diving into set_link_ksettings() with DUPLEX_UNKNOWN which is
not DUPLEX_FULL, so set_link_ksettings() throws an -EINVAL error.
do not return DUPLEX_UNKNOWN to fix the issue.
Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d9f37d01
...@@ -628,13 +628,10 @@ static int get_link_ksettings(struct net_device *dev, ...@@ -628,13 +628,10 @@ static int get_link_ksettings(struct net_device *dev,
fw_caps_to_lmm(pi->port_type, pi->link_cfg.lpacaps, fw_caps_to_lmm(pi->port_type, pi->link_cfg.lpacaps,
link_ksettings->link_modes.lp_advertising); link_ksettings->link_modes.lp_advertising);
if (netif_carrier_ok(dev)) { base->speed = (netif_carrier_ok(dev)
base->speed = pi->link_cfg.speed; ? pi->link_cfg.speed
: SPEED_UNKNOWN);
base->duplex = DUPLEX_FULL; base->duplex = DUPLEX_FULL;
} else {
base->speed = SPEED_UNKNOWN;
base->duplex = DUPLEX_UNKNOWN;
}
if (pi->link_cfg.fc & PAUSE_RX) { if (pi->link_cfg.fc & PAUSE_RX) {
if (pi->link_cfg.fc & PAUSE_TX) { if (pi->link_cfg.fc & PAUSE_TX) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment