summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-05-06 07:23:55 +0300
committerDavid S. Miller <davem@davemloft.net>2022-05-09 14:09:29 +0300
commitacb8c5aec2b13dab96f0be33feb10a5b1213f113 (patch)
treeba692b33a5900b8121c4a3e2c6c085e35f7a6019 /drivers
parentb9a366f3d874ce1c9c0148ec399f2ce4ab05a467 (diff)
downloadlinux-acb8c5aec2b13dab96f0be33feb10a5b1213f113.tar.xz
net: phy: genphy_c45_pma_baset1_read_master_slave: read actual configuration
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/phy-c45.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index d440b76a18b4..a0684c716a2e 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -560,15 +560,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;
}