summaryrefslogtreecommitdiff
path: root/include/linux
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>2024-04-27 16:55:07 +0100
commit51dbce21b02ad335fc6cbf64fa2253eaab584d70 (patch)
treec5b894c6bb8d0215d51b96537606cc4e9462602b /include/linux
parent338a60c57d4cd93a06091616323db3a899da75e1 (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>
Diffstat (limited to 'include/linux')
-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 924cfdcc73f2..40324cdb4353 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