Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jan 2011 19:33:58 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217414 - head/sys/dev/mii
Message-ID:  <201101141933.p0EJXwhn098368@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Fri Jan 14 19:33:58 2011
New Revision: 217414
URL: http://svn.freebsd.org/changeset/base/217414

Log:
  - Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is
    set.
  - Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX.
  
  MFC after:	1 week

Modified:
  head/sys/dev/mii/jmphy.c
  head/sys/dev/mii/mii_physubr.c

Modified: head/sys/dev/mii/jmphy.c
==============================================================================
--- head/sys/dev/mii/jmphy.c	Fri Jan 14 19:29:53 2011	(r217413)
+++ head/sys/dev/mii/jmphy.c	Fri Jan 14 19:33:58 2011	(r217414)
@@ -373,10 +373,10 @@ jmphy_setmedia(struct mii_softc *sc, str
 		bmcr |= BMCR_LOOP;
 
 	anar = jmphy_anar(ife);
-	if (((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO ||
+	if ((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO ||
 	    (ife->ifm_media & IFM_FDX) != 0) &&
-	    (ife->ifm_media & IFM_FLOW) != 0) ||
-	    (sc->mii_flags & MIIF_FORCEPAUSE) != 0)
+	    ((ife->ifm_media & IFM_FLOW) != 0 ||
+	    (sc->mii_flags & MIIF_FORCEPAUSE) != 0))
 		anar |= ANAR_PAUSE_TOWARDS;
 
 	if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) {

Modified: head/sys/dev/mii/mii_physubr.c
==============================================================================
--- head/sys/dev/mii/mii_physubr.c	Fri Jan 14 19:29:53 2011	(r217413)
+++ head/sys/dev/mii/mii_physubr.c	Fri Jan 14 19:33:58 2011	(r217414)
@@ -135,8 +135,9 @@ mii_phy_setmedia(struct mii_softc *sc)
 			gtcr |= GTCR_ADV_MS;
 	}
 
-	if ((ife->ifm_media & IFM_GMASK) == (IFM_FDX | IFM_FLOW) ||
-	    (sc->mii_flags & MIIF_FORCEPAUSE) != 0) {
+	if ((ife->ifm_media & IFM_FDX) != 0 &&
+	    ((ife->ifm_media & IFM_FLOW) != 0 ||
+	    (sc->mii_flags & MIIF_FORCEPAUSE) != 0)) {
 		if ((sc->mii_flags & MIIF_IS_1000X) != 0)
 			anar |= ANAR_X_PAUSE_TOWARDS;
 		else {
@@ -184,7 +185,8 @@ mii_phy_auto(struct mii_softc *sc)
 		    ANAR_CSMA;
 		if ((ife->ifm_media & IFM_FLOW) != 0 ||
 		    (sc->mii_flags & MIIF_FORCEPAUSE) != 0) {
-			if ((sc->mii_capabilities & BMSR_100TXFDX) != 0)
+			if ((sc->mii_capabilities &
+			    (BMSR_10TFDX | BMSR_100TXFDX)) != 0)
 				anar |= ANAR_FC;
 			/* XXX Only 1000BASE-T has PAUSE_ASYM? */
 			if (((sc->mii_flags & MIIF_HAVE_GTCR) != 0) &&



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