Skip to content

Commit db1bb77

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: realtek: add 5Gbps support to rtl822x_config_aneg()
RTL8126 as an evolution of RTL8125 supports 5Gbps. rtl822x_config_aneg() is used by the PHY driver for the integrated PHY, therefore add 5Gbps support to it. Signed-off-by: Heiner Kallweit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2b9ec5d commit db1bb77

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/net/phy/realtek.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,15 +680,19 @@ static int rtl822x_config_aneg(struct phy_device *phydev)
680680
int ret = 0;
681681

682682
if (phydev->autoneg == AUTONEG_ENABLE) {
683-
u16 adv2500 = 0;
683+
u16 adv = 0;
684684

685685
if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
686686
phydev->advertising))
687-
adv2500 = MDIO_AN_10GBT_CTRL_ADV2_5G;
687+
adv |= MDIO_AN_10GBT_CTRL_ADV2_5G;
688+
if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
689+
phydev->advertising))
690+
adv |= MDIO_AN_10GBT_CTRL_ADV5G;
688691

689692
ret = phy_modify_paged_changed(phydev, 0xa5d, 0x12,
690-
MDIO_AN_10GBT_CTRL_ADV2_5G,
691-
adv2500);
693+
MDIO_AN_10GBT_CTRL_ADV2_5G |
694+
MDIO_AN_10GBT_CTRL_ADV5G,
695+
adv);
692696
if (ret < 0)
693697
return ret;
694698
}

0 commit comments

Comments
 (0)