diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2025-02-18 18:07:10 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-18 18:07:10 -0800 |
| commit | 59ed446bc4eb793114dc879767406cf9550e157d (patch) | |
| tree | 5cbbdaaed414d6ca3279eb0588a10cfc19e8e68e /include | |
| parent | fabcfd6d10999024a721ae1b965b57eb8a305ace (diff) | |
| parent | 809265fe96fe3eb7a85a9260356767587c482cb7 (diff) | |
Merge branch 'net-phy-improve-and-simplify-eee-handling-in-phylib'
Heiner Kallweit says:
====================
net: phy: improve and simplify EEE handling in phylib
This series improves and simplifies phylib's EEE handling.
====================
Link: https://patch.msgid.link/3caa3151-13ac-44a8-9bb6-20f82563f698@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/phy.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 70c632799082..584710e084eb 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1340,22 +1340,25 @@ void of_set_phy_timing_role(struct phy_device *phydev); int phy_speed_down_core(struct phy_device *phydev); /** - * phy_disable_eee_mode - Don't advertise an EEE mode. + * phy_is_started - Convenience function to check whether PHY is started * @phydev: The phy_device struct - * @link_mode: The EEE mode to be disabled */ -static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode) +static inline bool phy_is_started(struct phy_device *phydev) { - linkmode_set_bit(link_mode, phydev->eee_disabled_modes); + return phydev->state >= PHY_UP; } /** - * phy_is_started - Convenience function to check whether PHY is started + * phy_disable_eee_mode - Don't advertise an EEE mode. * @phydev: The phy_device struct + * @link_mode: The EEE mode to be disabled */ -static inline bool phy_is_started(struct phy_device *phydev) +static inline void phy_disable_eee_mode(struct phy_device *phydev, u32 link_mode) { - return phydev->state >= PHY_UP; + WARN_ON(phy_is_started(phydev)); + + linkmode_set_bit(link_mode, phydev->eee_disabled_modes); + linkmode_clear_bit(link_mode, phydev->advertising_eee); } void phy_resolve_aneg_pause(struct phy_device *phydev); @@ -2029,8 +2032,7 @@ int genphy_c45_plca_set_cfg(struct phy_device *phydev, const struct phy_plca_cfg *plca_cfg); int genphy_c45_plca_get_status(struct phy_device *phydev, struct phy_plca_status *plca_st); -int genphy_c45_eee_is_active(struct phy_device *phydev, unsigned long *adv, - unsigned long *lp); +int genphy_c45_eee_is_active(struct phy_device *phydev, unsigned long *lp); int genphy_c45_ethtool_get_eee(struct phy_device *phydev, struct ethtool_keee *data); int genphy_c45_ethtool_set_eee(struct phy_device *phydev, |
