Skip to content

Commit ac0c530

Browse files
Dimitri Fedraukuba-moo
authored andcommitted
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: Andrew Lunn <[email protected]> Signed-off-by: Dimitri Fedrau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 953cc64 commit ac0c530

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/linux/mdio.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ static inline void mii_t1_adv_m_mod_linkmode_t(unsigned long *advertising, u32 l
373373
{
374374
linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
375375
advertising, lpa & MDIO_AN_T1_ADV_M_B10L);
376+
linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
377+
advertising, lpa & MDIO_AN_T1_ADV_M_100BT1);
378+
linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
379+
advertising, lpa & MDIO_AN_T1_ADV_M_1000BT1);
376380
}
377381

378382
/**
@@ -409,6 +413,10 @@ static inline u32 linkmode_adv_to_mii_t1_adv_m_t(unsigned long *advertising)
409413

410414
if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, advertising))
411415
result |= MDIO_AN_T1_ADV_M_B10L;
416+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_100baseT1_Full_BIT, advertising))
417+
result |= MDIO_AN_T1_ADV_M_100BT1;
418+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT1_Full_BIT, advertising))
419+
result |= MDIO_AN_T1_ADV_M_1000BT1;
412420

413421
return result;
414422
}

0 commit comments

Comments
 (0)