diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2021-11-27 14:15:19 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-02-27 15:38:01 +0000 |
commit | ec16e9fa2e03032a77150d690ca35e16272a21b9 (patch) | |
tree | a970050287a3f4d193255c33378e290d00cb61fa | |
parent | c02c5a81ebe01512819ab94ede02cb6580a1449c (diff) |
net: phylink: add helpers for decoding mode
Add helpers to decode the mode argument passed to the various MAC and
PCS functions.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | include/linux/phylink.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/phylink.h b/include/linux/phylink.h index e1fa495c6f70..b2619cde64f5 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -95,11 +95,26 @@ enum { MAC_400000FD = BIT(18), }; -static inline bool phylink_autoneg_inband(unsigned int mode) +static inline bool phylink_mode_inband(unsigned int mode) { return mode == MLO_AN_INBAND; } +static inline bool phylink_mode_fixed(unsigned int mode) +{ + return mode == MLO_AN_FIXED; +} + +static inline bool phylink_mode_phy(unsigned int mode) +{ + return mode == MLO_AN_PHY; +} + +static inline bool phylink_autoneg_inband(unsigned int mode) +{ + return phylink_mode_inband(mode); +} + /** * struct phylink_link_state - link state structure * @advertising: ethtool bitmask containing advertised link modes |