summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2021-11-27 14:15:19 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-01-18 10:17:25 +0000
commitb5ddce00072d1f88fc18fa4d11f1982e462d2d02 (patch)
treec4e4738d6e9f296a5c3e66d75032dfaac172dfa1
parent947953b05c93aa94ab6a5da82806d74e09b5071a (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.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index e6422e42c7d7..96c91be166eb 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.