diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-01-22 10:58:52 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-02-13 09:16:26 +0000 |
commit | 6d28787ba8b7e08e9947e806babe3f3d15719d23 (patch) | |
tree | b94c98c64367b9a471b3c16bc7911efe307c576a /include | |
parent | 17ec7453a76e1198c02054d7877fe18b052a1b4a (diff) |
net: phylink: provide phylink_mac_implements_lpi()
Provide a helper to determine whether the MAC operations structure
implements the LPI operations, which will be used by both phylink and
DSA.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/phylink.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 898b00451bbf..0de78673172d 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -737,6 +737,18 @@ static inline int phylink_get_link_timer_ns(phy_interface_t interface) } } +/** + * phylink_mac_implements_lpi() - determine if MAC implements LPI ops + * @ops: phylink_mac_ops structure + * + * Returns true if the phylink MAC operations structure indicates that the + * LPI operations have been implemented, false otherwise. + */ +static inline bool phylink_mac_implements_lpi(const struct phylink_mac_ops *ops) +{ + return ops && ops->mac_disable_tx_lpi && ops->mac_enable_tx_lpi; +} + void phylink_mii_c22_pcs_decode_state(struct phylink_link_state *state, unsigned int neg_mode, u16 bmsr, u16 lpa); void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs, |