提交 acb8c5ae 编写于 作者: O Oleksij Rempel 提交者: David S. Miller

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: NOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b9a366f3
无相关合并请求
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部