From: Stefan Eichenberger Date: Wed, 19 Jul 2023 06:42:57 +0000 (+0200) Subject: net: phy: c45: detect the BASE-T1 speed from the ability register X-Git-Tag: v6.6.7~2079^2~361^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a60eb72066af272c2891c6685b9a082dde69198c;p=platform%2Fkernel%2Flinux-starfive.git net: phy: c45: detect the BASE-T1 speed from the ability register Read the ability to do 100BASE-T1 and 1000BASE-T1 from the extended BASE-T1 ability register of the PHY. Signed-off-by: Stefan Eichenberger Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 58a6bbb..8e6fd49 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -899,6 +899,14 @@ int genphy_c45_pma_baset1_read_abilities(struct phy_device *phydev) phydev->supported, val & MDIO_PMA_PMD_BT1_B10L_ABLE); + linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT1_Full_BIT, + phydev->supported, + val & MDIO_PMA_PMD_BT1_B100_ABLE); + + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT1_Full_BIT, + phydev->supported, + val & MDIO_PMA_PMD_BT1_B1000_ABLE); + val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_T1_STAT); if (val < 0) return val;