Commit ac0c5306 authored by Dimitri Fedrau's avatar Dimitri Fedrau Committed by Jakub Kicinski

net: phy: Support 100/1000BT1 linkmode advertisements

Extend helper functions mii_t1_adv_m_mod_linkmode_t and
linkmode_adv_to_mii_t1_adv_m_t to support 100BT1 and 1000BT1 linkmode
advertisements.
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDimitri Fedrau <dima.fedrau@gmail.com>
Link: https://lore.kernel.org/r/20240218075753.18067-3-dima.fedrau@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 953cc643
...@@ -373,6 +373,10 @@ static inline void mii_t1_adv_m_mod_linkmode_t(unsigned long *advertising, u32 l ...@@ -373,6 +373,10 @@ static inline void mii_t1_adv_m_mod_linkmode_t(unsigned long *advertising, u32 l
{ {
linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
advertising, lpa & MDIO_AN_T1_ADV_M_B10L); advertising, lpa & MDIO_AN_T1_ADV_M_B10L);
linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
advertising, lpa & MDIO_AN_T1_ADV_M_100BT1);
linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
advertising, lpa & MDIO_AN_T1_ADV_M_1000BT1);
} }
/** /**
...@@ -409,6 +413,10 @@ static inline u32 linkmode_adv_to_mii_t1_adv_m_t(unsigned long *advertising) ...@@ -409,6 +413,10 @@ static inline u32 linkmode_adv_to_mii_t1_adv_m_t(unsigned long *advertising)
if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, advertising)) if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, advertising))
result |= MDIO_AN_T1_ADV_M_B10L; result |= MDIO_AN_T1_ADV_M_B10L;
if (linkmode_test_bit(ETHTOOL_LINK_MODE_100baseT1_Full_BIT, advertising))
result |= MDIO_AN_T1_ADV_M_100BT1;
if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT1_Full_BIT, advertising))
result |= MDIO_AN_T1_ADV_M_1000BT1;
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment