Commit 59694f00 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

bnx2x: Correct advertised speed/duplex

If link is down due to management (and not due to actual phy link being lost),
driver should still behave as if the link is down; Querying via ethtool about
speed/duplex state should result in 'UNKNOWN' (same behaviour as when link is
actually down).
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c96bdc0c
...@@ -231,18 +231,14 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -231,18 +231,14 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->advertising &= ~(ADVERTISED_10000baseT_Full); cmd->advertising &= ~(ADVERTISED_10000baseT_Full);
} }
if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) { if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up &&
if (!(bp->flags & MF_FUNC_DIS)) { !(bp->flags & MF_FUNC_DIS)) {
ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
cmd->duplex = bp->link_vars.duplex; cmd->duplex = bp->link_vars.duplex;
} else {
ethtool_cmd_speed_set(
cmd, bp->link_params.req_line_speed[cfg_idx]);
cmd->duplex = bp->link_params.req_duplex[cfg_idx];
}
if (IS_MF(bp) && !BP_NOMCP(bp)) if (IS_MF(bp) && !BP_NOMCP(bp))
ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp)); ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
else
ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
} else { } else {
cmd->duplex = DUPLEX_UNKNOWN; cmd->duplex = DUPLEX_UNKNOWN;
ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN); ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
......
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