]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: phy: add phy_set_eee_broken
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 8 Nov 2024 07:07:10 +0000 (08:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Nov 2024 02:01:37 +0000 (18:01 -0800)
Add an accessor for eee_broken_modes, so that drivers
don't have to deal with phylib internals.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/0f8ee279-d40d-4489-a3b0-d993472d744a@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/phy.h

index a6622f873d0315d251c084dc533dd22aec26248d..b8346db4272702d6564e93271e451146a2821dfe 100644 (file)
@@ -1263,6 +1263,16 @@ void of_set_phy_eee_broken(struct phy_device *phydev);
 void of_set_phy_timing_role(struct phy_device *phydev);
 int phy_speed_down_core(struct phy_device *phydev);
 
+/**
+ * phy_set_eee_broken - Mark an EEE mode as broken so that it isn't advertised.
+ * @phydev: The phy_device struct
+ * @link_mode: The broken EEE mode
+ */
+static inline void phy_set_eee_broken(struct phy_device *phydev, u32 link_mode)
+{
+       linkmode_set_bit(link_mode, phydev->eee_broken_modes);
+}
+
 /**
  * phy_is_started - Convenience function to check whether PHY is started
  * @phydev: The phy_device struct