]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: phy: Add phy_ethtool_nway_reset
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 15 Nov 2016 18:06:30 +0000 (10:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Nov 2016 21:33:35 +0000 (16:33 -0500)
This function just calls into genphy_restart_aneg() to perform an
autonegotation restart.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c
include/linux/phy.h

index e6dd222fddb15c5c6ffecf016f4b544823a90319..73adbaa9ac861fed89775672cf05c272e9644bce 100644 (file)
@@ -1441,3 +1441,14 @@ int phy_ethtool_set_link_ksettings(struct net_device *ndev,
        return phy_ethtool_ksettings_set(phydev, cmd);
 }
 EXPORT_SYMBOL(phy_ethtool_set_link_ksettings);
+
+int phy_ethtool_nway_reset(struct net_device *ndev)
+{
+       struct phy_device *phydev = ndev->phydev;
+
+       if (!phydev)
+               return -ENODEV;
+
+       return genphy_restart_aneg(phydev);
+}
+EXPORT_SYMBOL(phy_ethtool_nway_reset);
index 9880d73a2c3d6340717bd2a56bbb253d9ecb0218..b9bd3b4f4ea13baab2b5adcbcfe4d90f036697f1 100644 (file)
@@ -860,6 +860,7 @@ int phy_ethtool_get_link_ksettings(struct net_device *ndev,
                                   struct ethtool_link_ksettings *cmd);
 int phy_ethtool_set_link_ksettings(struct net_device *ndev,
                                   const struct ethtool_link_ksettings *cmd);
+int phy_ethtool_nway_reset(struct net_device *ndev);
 
 int __init mdio_bus_init(void);
 void mdio_bus_exit(void);