From ee53a122a4590d88fbe365184964666535b0ae1c Mon Sep 17 00:00:00 2001 From: "Russell King (Oracle)" Date: Sat, 27 Nov 2021 14:15:19 +0000 Subject: 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) --- include/linux/phylink.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 10c0d4728391..e8f80a3d2b19 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -50,11 +50,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); +} + /** * phylink_pcs_inband() - helper to indicate whether to enable inband signalling * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND. -- cgit