Message ID | 20220505063318.296280-6-o.rempel@pengutronix.de (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | add ti dp83td510 support | expand |
On Thu, May 05, 2022 at 08:33:16AM +0200, Oleksij Rempel wrote: > Since MDIO_PMA_PMD_BT1_CTRL register shows actual configuration (and > forced state configuration is equal to the state), we should show > this configuration for ethtool. > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 6f7a03318d42..40620e3c9467 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -559,15 +559,19 @@ int genphy_c45_pma_baset1_read_master_slave(struct phy_device *phydev) int val; phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN; + phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN; val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_PMD_BT1_CTRL); if (val < 0) return val; - if (val & MDIO_PMA_PMD_BT1_CTRL_CFG_MST) + if (val & MDIO_PMA_PMD_BT1_CTRL_CFG_MST) { + phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE; phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER; - else + } else { + phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE; phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE; + } return 0; }
Since MDIO_PMA_PMD_BT1_CTRL register shows actual configuration (and forced state configuration is equal to the state), we should show this configuration for ethtool. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> --- drivers/net/phy/phy-c45.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)