Skip to contentSkip to conversation

Make 10Mbit/s work with lan8720a

PATCH New David Dueck 1 participant 3 messages Nov 5, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Make 10Mbit/s work with lan8720a

smsc_parse_status does not check the partner abilities.

Use the general phy code after a fix.

David Dueck (2):
phy: Use supported field during autonegotiation
phy: Use general phy code for smsc lan8720a

 drivers/net/phy/phy.c  | 5 +++--
 drivers/net/phy/smsc.c | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/2 phy: Use supported field during autonegotiation

The current code incorrectly detects gigabit capabilities for some 100Mbit/s phys. (lan8720a)

---
 drivers/net/phy/phy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/phy/phy.c +3 -2
index 62925bb..c691fbb 100644
@@ -275,13 +275,14 @@ int genphy_parse_link(struct phy_device *phydev)
 	int mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMSR);
 
 	/* We're using autonegotiation */
-	if (mii_reg & BMSR_ANEGCAPABLE) {
+	if (phydev->supported & SUPPORTED_Autoneg) {
 		u32 lpa = 0;
 		int gblpa = 0;
 		u32 estatus = 0;
 
 		/* Check for gigabit capability */
-		if (mii_reg & BMSR_ERCAP) {
+		if (phydev->supported & (SUPPORTED_1000baseT_Full |
+					SUPPORTED_1000baseT_Half)) {
 			/* We want a list of states supported by
 			 * both PHYs in the link
 			 */
Signature · 1 line
1.8.4.rc3
#2 lore raw

PATCH 2/2 phy: Use general phy code for smsc lan8720a

In reply to David Dueck
---
 drivers/net/phy/smsc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/smsc.c +2 -1
index 60ed92d..bfd9815 100644
@@ -12,6 +12,7 @@
  */
 #include <miiphy.h>
 
+/* This code does not check the partner abilities. */
 static int smsc_parse_status(struct phy_device *phydev)
 {
 	int mii_reg;
@@ -64,7 +65,7 @@ static struct phy_driver lan8710_driver = {
 	.mask = 0xffff0,
 	.features = PHY_BASIC_FEATURES,
 	.config = &genphy_config_aneg,
-	.startup = &smsc_startup,
+	.startup = &genphy_startup,
 	.shutdown = &genphy_shutdown,
 };
 
Signature · 1 line
1.8.4.rc3