bnx2x: treat 0 speed as link down (copper)
authorYuval Mintz <yuvalmin@broadcom.com>
Wed, 20 Jun 2012 19:05:20 +0000 (19:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Jun 2012 00:20:32 +0000 (17:20 -0700)
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Yaniv Rosner <yaniv.rosner@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_link.c

index b3c33ed..d38d269 100644 (file)
@@ -10178,17 +10178,19 @@ static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy,
                DP(NETIF_MSG_LINK, "Legacy speed status = 0x%x\n",
                   legacy_status);
                link_up = ((legacy_status & (1<<11)) == (1<<11));
-               if (link_up) {
-                       legacy_speed = (legacy_status & (3<<9));
-                       if (legacy_speed == (0<<9))
-                               vars->line_speed = SPEED_10;
-                       else if (legacy_speed == (1<<9))
-                               vars->line_speed = SPEED_100;
-                       else if (legacy_speed == (2<<9))
-                               vars->line_speed = SPEED_1000;
-                       else /* Should not happen */
-                               vars->line_speed = 0;
+               legacy_speed = (legacy_status & (3<<9));
+               if (legacy_speed == (0<<9))
+                       vars->line_speed = SPEED_10;
+               else if (legacy_speed == (1<<9))
+                       vars->line_speed = SPEED_100;
+               else if (legacy_speed == (2<<9))
+                       vars->line_speed = SPEED_1000;
+               else { /* Should not happen: Treat as link down */
+                       vars->line_speed = 0;
+                       link_up = 0;
+               }
 
+               if (link_up) {
                        if (legacy_status & (1<<8))
                                vars->duplex = DUPLEX_FULL;
                        else