summaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2019-08-09 14:43:50 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-12 00:24:32 -0400
commitf4069cd7fa6583e7094001c6fce6f426d17a4c76 (patch)
tree943918e8d6d99d2ad989d17e8ff790c668c279ac /include/linux/phy.h
parent3eef8689325e6358a0c51d2ef8c6a689b2f22d48 (diff)
net: phy: prepare phylib to deal with PHY's extending Clause 22
The integrated PHY in 2.5Gbps chip RTL8125 is the first (known to me) PHY that uses standard Clause 22 for all modes up to 1Gbps and adds 2.5Gbps control using vendor-specific registers. To use phylib for the standard part little extensions are needed: - Move most of genphy_config_aneg to a new function __genphy_config_aneg that takes a parameter whether restarting auto-negotiation is needed (depending on whether content of vendor-specific advertisement register changed). - Don't clear phydev->lp_advertising in genphy_read_status so that we can set non-C22 mode flags before. Basically both changes mimic the behavior of the equivalent Clause 45 functions. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 462b90b73f93..7117825ee57a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1069,7 +1069,7 @@ int genphy_read_abilities(struct phy_device *phydev);
1069int genphy_setup_forced(struct phy_device *phydev); 1069int genphy_setup_forced(struct phy_device *phydev);
1070int genphy_restart_aneg(struct phy_device *phydev); 1070int genphy_restart_aneg(struct phy_device *phydev);
1071int genphy_config_eee_advert(struct phy_device *phydev); 1071int genphy_config_eee_advert(struct phy_device *phydev);
1072int genphy_config_aneg(struct phy_device *phydev); 1072int __genphy_config_aneg(struct phy_device *phydev, bool changed);
1073int genphy_aneg_done(struct phy_device *phydev); 1073int genphy_aneg_done(struct phy_device *phydev);
1074int genphy_update_link(struct phy_device *phydev); 1074int genphy_update_link(struct phy_device *phydev);
1075int genphy_read_status(struct phy_device *phydev); 1075int genphy_read_status(struct phy_device *phydev);
@@ -1077,6 +1077,12 @@ int genphy_suspend(struct phy_device *phydev);
1077int genphy_resume(struct phy_device *phydev); 1077int genphy_resume(struct phy_device *phydev);
1078int genphy_loopback(struct phy_device *phydev, bool enable); 1078int genphy_loopback(struct phy_device *phydev, bool enable);
1079int genphy_soft_reset(struct phy_device *phydev); 1079int genphy_soft_reset(struct phy_device *phydev);
1080
1081static inline int genphy_config_aneg(struct phy_device *phydev)
1082{
1083 return __genphy_config_aneg(phydev, false);
1084}
1085
1080static inline int genphy_no_soft_reset(struct phy_device *phydev) 1086static inline int genphy_no_soft_reset(struct phy_device *phydev)
1081{ 1087{
1082 return 0; 1088 return 0;