diff options
Diffstat (limited to 'include/linux/phylink.h')
-rw-r--r-- | include/linux/phylink.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 6d06896fc20d..e7bc8d4b306e 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -51,6 +51,25 @@ 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) +{ + return phylink_autoneg_inband(mode) && + (interface == PHY_INTERFACE_MODE_SGMII || + interface == PHY_INTERFACE_MODE_QSGMII || + linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)); +} + +/** * struct phylink_link_state - link state structure * @advertising: ethtool bitmask containing advertised link modes * @lp_advertising: ethtool bitmask containing link partner advertised link |