Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2012 04:47:32 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244481 - head/sys/dev/mii
Message-ID:  <201212200447.qBK4lWMg071454@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Thu Dec 20 04:47:31 2012
New Revision: 244481
URL: http://svnweb.freebsd.org/changeset/base/244481

Log:
  For fiber PHYs, BRGPHY_MII_1000CTL register is not defined at all
  so do not touch it.

Modified:
  head/sys/dev/mii/brgphy.c

Modified: head/sys/dev/mii/brgphy.c
==============================================================================
--- head/sys/dev/mii/brgphy.c	Thu Dec 20 04:32:02 2012	(r244480)
+++ head/sys/dev/mii/brgphy.c	Thu Dec 20 04:47:31 2012	(r244481)
@@ -608,6 +608,11 @@ brgphy_mii_phy_auto(struct mii_softc *sc
 		    (sc->mii_flags & MIIF_FORCEPAUSE) != 0)
 			anar |= BRGPHY_ANAR_PC | BRGPHY_ANAR_ASP;
 		PHY_WRITE(sc, BRGPHY_MII_ANAR, anar);
+		ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD;
+		if (sc->mii_mpd_model == MII_MODEL_BROADCOM_BCM5701)
+			ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC;
+		PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr);
+		PHY_READ(sc, BRGPHY_MII_1000CTL);
 	} else {
 		anar = BRGPHY_SERDES_ANAR_FDX | BRGPHY_SERDES_ANAR_HDX;
 		if ((media & IFM_FLOW) != 0 ||
@@ -616,12 +621,6 @@ brgphy_mii_phy_auto(struct mii_softc *sc
 		PHY_WRITE(sc, BRGPHY_SERDES_ANAR, anar);
 	}
 
-	ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD;
-	if (sc->mii_mpd_model == MII_MODEL_BROADCOM_BCM5701)
-		ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC;
-	PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr);
-	ktcr = PHY_READ(sc, BRGPHY_MII_1000CTL);
-
 	PHY_WRITE(sc, BRGPHY_MII_BMCR, BRGPHY_BMCR_AUTOEN |
 	    BRGPHY_BMCR_STARTNEG);
 	PHY_WRITE(sc, BRGPHY_MII_IMR, 0xFF00);



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