Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 May 2011 16:17:30 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r222159 - stable/8/sys/dev/mii
Message-ID:  <201105211617.p4LGHUEb036917@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sat May 21 16:17:30 2011
New Revision: 222159
URL: http://svn.freebsd.org/changeset/base/222159

Log:
  MFC: r221812
  
  Some PHYs like the Level One LXT970 optionally can default to isolation
  after rest, in which case we may need to deisolate them.
  Tested by:	nwhitehorn

Modified:
  stable/8/sys/dev/mii/mii_physubr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/mii/mii_physubr.c
==============================================================================
--- stable/8/sys/dev/mii/mii_physubr.c	Sat May 21 14:52:26 2011	(r222158)
+++ stable/8/sys/dev/mii/mii_physubr.c	Sat May 21 16:17:30 2011	(r222159)
@@ -260,7 +260,7 @@ void
 mii_phy_reset(struct mii_softc *sc)
 {
 	struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur;
-	int reg, i;
+	int i, reg;
 
 	if ((sc->mii_flags & MIIF_NOISOLATE) != 0)
 		reg = BMCR_RESET;
@@ -276,11 +276,14 @@ mii_phy_reset(struct mii_softc *sc)
 		DELAY(1000);
 	}
 
-	if ((sc->mii_flags & MIIF_NOISOLATE) == 0) {
-		if ((ife == NULL && sc->mii_inst != 0) ||
-		    (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst))
-			PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO);
-	}
+	/* NB: a PHY may default to isolation. */
+	reg &= ~BMCR_ISO;
+	if ((sc->mii_flags & MIIF_NOISOLATE) == 0 &&
+	    ((ife == NULL && sc->mii_inst != 0) ||
+	    (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst)))
+		reg |= BMCR_ISO;
+	if (PHY_READ(sc, MII_BMCR) != reg)
+		PHY_WRITE(sc, MII_BMCR, reg);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105211617.p4LGHUEb036917>