net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed
authorLABBE Corentin <clabbe.montjoie@gmail.com>
Wed, 15 Feb 2017 09:46:41 +0000 (10:46 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Feb 2017 18:20:55 +0000 (13:20 -0500)
In case of invalid speed given, stmmac_adjust_link() still record it as
current speed.
This patch modify the default case to set speed as SPEED_UNKNOWN if not
10/100/1000.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index a87071d0ebfedcef4c925864e8ca80cdcd7a2c0b..f7664b956efff05df67b78f791377233d52c73e5 100644 (file)
@@ -739,6 +739,7 @@ static void stmmac_adjust_link(struct net_device *dev)
                        default:
                                netif_warn(priv, link, priv->dev,
                                           "broken speed: %d\n", phydev->speed);
+                               phydev->speed = SPEED_UNKNOWN;
                                break;
                        }