diff options
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index f72b56abe0fe..cff7107fcafa 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -135,6 +135,24 @@ static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts) return 0; } +/** + * phy_restart_aneg - restart auto-negotiation + * @phydev: target phy_device struct + * + * Restart the autonegotiation on @phydev. Returns >= 0 on success or + * negative errno on error. + */ +static int phy_restart_aneg(struct phy_device *phydev) +{ + int ret; + + if (phydev->is_c45) + ret = genphy_c45_restart_aneg(phydev); + else + ret = genphy_restart_aneg(phydev); + + return ret; +} /** * phy_aneg_done - return auto-negotiation status @@ -1427,6 +1445,6 @@ int phy_ethtool_nway_reset(struct net_device *ndev) if (!phydev) return -ENODEV; - return genphy_restart_aneg(phydev); + return phy_restart_aneg(phydev); } EXPORT_SYMBOL(phy_ethtool_nway_reset); |