Thread (8 messages) 8 messages, 3 authors, 2019-12-18
STALE2408d

[PATCH v2 1/4] micrel: fix config_aneg for ksz886x

From: Michael Grzeschik <hidden>
Date: 2019-12-18 20:08:42
Subsystem: ethernet phy library, networking drivers, the rest · Maintainers: Andrew Lunn, Heiner Kallweit, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

The third port of the ksz886x is fixed to be connected to the
cpu. This port has no possibility to do auto negotiation.

Signed-off-by: Michael Grzeschik <redacted>
---
 drivers/net/phy/micrel.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 63dedec0433de..913a8b68da350 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -841,6 +841,16 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev)
 	return 0;
 }
 
+static int ksz886x_config_aneg(struct phy_device *phydev)
+{
+	if (phydev->mdio.addr == 3) {
+		phydev->autoneg = AUTONEG_DISABLE;
+		genphy_read_status(phydev);
+	}
+
+	return genphy_config_aneg(phydev);
+}
+
 static int kszphy_get_sset_count(struct phy_device *phydev)
 {
 	return ARRAY_SIZE(kszphy_hw_stats);
@@ -1171,6 +1181,7 @@ static struct phy_driver ksphy_driver[] = {
 	.name		= "Micrel KSZ886X Switch",
 	/* PHY_BASIC_FEATURES */
 	.config_init	= kszphy_config_init,
+	.config_aneg	= ksz886x_config_aneg,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 }, {
-- 
2.24.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help