bnx2x: Correct advertised speed/duplex
authorYuval Mintz <yuvalmin@broadcom.com>
Sun, 2 Dec 2012 04:05:49 +0000 (04:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Dec 2012 01:22:59 +0000 (20:22 -0500)
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: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c

index c7270c082ad6e8f95ec2f69d25b8c0bdf8b55c65..277f17e3c8f850bac954db7d99c55b7f06d194eb 100644 (file)
@@ -231,18 +231,14 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                cmd->advertising &= ~(ADVERTISED_10000baseT_Full);
        }
 
-       if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) {
-               if (!(bp->flags & MF_FUNC_DIS)) {
-                       ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
+       if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up &&
+           !(bp->flags & MF_FUNC_DIS)) {
                        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))
                        ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
+               else
+                       ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
        } else {
                cmd->duplex = DUPLEX_UNKNOWN;
                ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);