diff options
author | David Howells <dhowells@redhat.com> | 2019-09-02 11:43:44 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-09-02 11:43:44 +0100 |
commit | f16180739cd18a39a1a45516ac0e65d18a9f100e (patch) | |
tree | 22d1135650f8ddb25707c788cd4846c77b428ff0 /drivers/net/phy | |
parent | 9f159ae07f07fc540290f21937231034f554bdd7 (diff) | |
parent | e1e54ec7fb55501c33b117c111cb0a045b8eded2 (diff) | |
download | kernel_replicant_linux-f16180739cd18a39a1a45516ac0e65d18a9f100e.tar.gz kernel_replicant_linux-f16180739cd18a39a1a45516ac0e65d18a9f100e.tar.bz2 kernel_replicant_linux-f16180739cd18a39a1a45516ac0e65d18a9f100e.zip |
Merge remote-tracking branch 'net/master' into afs-next
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy-c45.c | 26 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 58bb25e4af10..7935593debb1 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -523,6 +523,32 @@ int genphy_c45_read_status(struct phy_device *phydev) } EXPORT_SYMBOL_GPL(genphy_c45_read_status); +/** + * genphy_c45_config_aneg - restart auto-negotiation or forced setup + * @phydev: target phy_device struct + * + * Description: If auto-negotiation is enabled, we configure the + * advertising, and then restart auto-negotiation. If it is not + * enabled, then we force a configuration. + */ +int genphy_c45_config_aneg(struct phy_device *phydev) +{ + bool changed = false; + int ret; + + if (phydev->autoneg == AUTONEG_DISABLE) + return genphy_c45_pma_setup_forced(phydev); + + ret = genphy_c45_an_config_aneg(phydev); + if (ret < 0) + return ret; + if (ret > 0) + changed = true; + + return genphy_c45_check_and_restart_aneg(phydev, changed); +} +EXPORT_SYMBOL_GPL(genphy_c45_config_aneg); + /* The gen10g_* functions are the old Clause 45 stub */ int gen10g_config_aneg(struct phy_device *phydev) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index ef7aa738e0dc..6b0f89369b46 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -507,7 +507,7 @@ static int phy_config_aneg(struct phy_device *phydev) * allowed to call genphy_config_aneg() */ if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0))) - return -EOPNOTSUPP; + return genphy_c45_config_aneg(phydev); return genphy_config_aneg(phydev); } |