From: Florian Fainelli Date: Wed, 26 Nov 2014 05:16:36 +0000 (-0800) Subject: net: bcmgenet: support restarting auto-negotiation X-Git-Tag: firefly_0821_release~176^2~2717^2~109^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6b0c54060ecb678473d442bba01fcb2b3079f594;p=firefly-linux-kernel-4.4.55.git net: bcmgenet: support restarting auto-negotiation Hook a nway_reset ethtool callback to allow restarting the auto-negotiation process when asked to. We defer to the PHY library call to do the heavy lifting. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index bf44e0e23799..f2fadb053d52 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -799,6 +799,13 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_eee *e) return phy_ethtool_set_eee(priv->phydev, e); } +static int bcmgenet_nway_reset(struct net_device *dev) +{ + struct bcmgenet_priv *priv = netdev_priv(dev); + + return genphy_restart_aneg(priv->phydev); +} + /* standard ethtool support functions. */ static struct ethtool_ops bcmgenet_ethtool_ops = { .get_strings = bcmgenet_get_strings, @@ -814,6 +821,7 @@ static struct ethtool_ops bcmgenet_ethtool_ops = { .set_wol = bcmgenet_set_wol, .get_eee = bcmgenet_get_eee, .set_eee = bcmgenet_set_eee, + .nway_reset = bcmgenet_nway_reset, }; /* Power down the unimac, based on mode. */