diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2021-11-21 13:02:03 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-01-18 10:17:07 +0000 |
commit | 9125aca9991a6e0ebe4585bb1f22815b3f00a390 (patch) | |
tree | dd791e2e7a870813a5c612f768adf6465df5393c /include | |
parent | 804f0d381ce1096fa648821a15a5a0e2e43fc29b (diff) |
net: phylink: add phylink_pcs_inband()
Add phylink_pcs_inband() to indicate whether the PCS should be using
inband signalling.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/phylink.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/phylink.h b/include/linux/phylink.h index a98065f5c8f6..3cb90a378a79 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -51,6 +51,26 @@ static inline bool phylink_autoneg_inband(unsigned int mode) } /** + * phylink_pcs_inband() - helper to indicate whether to enable inband signalling + * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND. + * @interface: interface mode to be used + * @advertising: adertisement ethtool link mode mask + * + * Returns true if the mode/interface/advertising mask indicates that we + * should be using inband signalling at the PCS block, false otherwise. + */ +static inline bool phylink_pcs_inband(unsigned int mode, + phy_interface_t interface, + const unsigned long *advertising) +{ + if (phylink_autoneg_inband(mode) && + linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)) + return true; + else + return false; +} + +/** * struct phylink_link_state - link state structure * @advertising: ethtool bitmask containing advertised link modes * @lp_advertising: ethtool bitmask containing link partner advertised link |