Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Oct 2010 13:41:38 +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: r214268 - in stable/8/sys/dev: dc mii
Message-ID:  <201010241341.o9ODfcro029729@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Oct 24 13:41:38 2010
New Revision: 214268
URL: http://svn.freebsd.org/changeset/base/214268

Log:
  MFC: r213384
  
  Consistently always explicitly set IFM_HDX for half-duplex.
  
  Obtained from:	OpenBSD (mostly)

Modified:
  stable/8/sys/dev/dc/dcphy.c
  stable/8/sys/dev/dc/pnphy.c
  stable/8/sys/dev/mii/acphy.c
  stable/8/sys/dev/mii/amphy.c
  stable/8/sys/dev/mii/axphy.c
  stable/8/sys/dev/mii/bmtphy.c
  stable/8/sys/dev/mii/gentbi.c
  stable/8/sys/dev/mii/inphy.c
  stable/8/sys/dev/mii/lxtphy.c
  stable/8/sys/dev/mii/nsphy.c
  stable/8/sys/dev/mii/qsphy.c
  stable/8/sys/dev/mii/rlphy.c
  stable/8/sys/dev/mii/ruephy.c
  stable/8/sys/dev/mii/tdkphy.c
  stable/8/sys/dev/mii/tlphy.c
  stable/8/sys/dev/mii/ukphy_subr.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)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/dc/dcphy.c
==============================================================================
--- stable/8/sys/dev/dc/dcphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/dc/dcphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -341,14 +341,14 @@ dcphy_status(struct mii_softc *sc)
 				mii->mii_media_active |= IFM_100_TX | IFM_FDX;
 			else if (anlpar & ANLPAR_T4 &&
 			    sc->mii_capabilities & BMSR_100T4)
-				mii->mii_media_active |= IFM_100_T4;
+				mii->mii_media_active |= IFM_100_T4 | IFM_HDX;
 			else if (anlpar & ANLPAR_TX &&
 			    sc->mii_capabilities & BMSR_100TXHDX)
-				mii->mii_media_active |= IFM_100_TX;
+				mii->mii_media_active |= IFM_100_TX | IFM_HDX;
 			else if (anlpar & ANLPAR_10_FD)
 				mii->mii_media_active |= IFM_10_T | IFM_FDX;
 			else if (anlpar & ANLPAR_10)
-				mii->mii_media_active |= IFM_10_T;
+				mii->mii_media_active |= IFM_10_T | IFM_HDX;
 			else
 				mii->mii_media_active |= IFM_NONE;
 			if (DC_IS_INTEL(dc_sc))
@@ -366,9 +366,9 @@ dcphy_status(struct mii_softc *sc)
 		 * change the media settings if we're wrong.
 		 */
 		if (!(reg & DC_TSTAT_LS100))
-			mii->mii_media_active |= IFM_100_TX;
+			mii->mii_media_active |= IFM_100_TX | IFM_HDX;
 		else if (!(reg & DC_TSTAT_LS10))
-			mii->mii_media_active |= IFM_10_T;
+			mii->mii_media_active |= IFM_10_T | IFM_HDX;
 		else
 			mii->mii_media_active |= IFM_NONE;
 		if (DC_IS_INTEL(dc_sc))
@@ -383,6 +383,8 @@ skip:
 		mii->mii_media_active |= IFM_100_TX;
 	if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX)
 		mii->mii_media_active |= IFM_FDX;
+	else
+		mii->mii_media_active |= IFM_HDX;
 }
 
 static int

Modified: stable/8/sys/dev/dc/pnphy.c
==============================================================================
--- stable/8/sys/dev/dc/pnphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/dc/pnphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -237,4 +237,6 @@ pnphy_status(struct mii_softc *sc)
 		mii->mii_media_active |= IFM_100_TX;
 	if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX)
 		mii->mii_media_active |= IFM_FDX;
+	else
+		mii->mii_media_active |= IFM_HDX;
 }

Modified: stable/8/sys/dev/mii/acphy.c
==============================================================================
--- stable/8/sys/dev/mii/acphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/acphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -245,6 +245,8 @@ acphy_status(struct mii_softc *sc)
 
 		if (diag & AC_DIAG_DUPLEX)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/amphy.c
==============================================================================
--- stable/8/sys/dev/mii/amphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/amphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -206,13 +206,13 @@ amphy_status(struct mii_softc *sc)
 			if (anlpar & ANLPAR_TX_FD)
 				mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 			else if (anlpar & ANLPAR_T4)
-				mii->mii_media_active |= IFM_100_T4;
+				mii->mii_media_active |= IFM_100_T4|IFM_HDX;
 			else if (anlpar & ANLPAR_TX)
-				mii->mii_media_active |= IFM_100_TX;
+				mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 			else if (anlpar & ANLPAR_10_FD)
 				mii->mii_media_active |= IFM_10_T|IFM_FDX;
 			else if (anlpar & ANLPAR_10)
-				mii->mii_media_active |= IFM_10_T;
+				mii->mii_media_active |= IFM_10_T|IFM_HDX;
 			else
 				mii->mii_media_active |= IFM_NONE;
 			return;
@@ -225,11 +225,11 @@ amphy_status(struct mii_softc *sc)
 		if (par & DSCSR_100FDX)
 			mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 		else if (par & DSCSR_100HDX)
-			mii->mii_media_active |= IFM_100_TX;
+			mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 		else if (par & DSCSR_10FDX)
 			mii->mii_media_active |= IFM_10_T|IFM_HDX;
 		else if (par & DSCSR_10HDX)
-			mii->mii_media_active |= IFM_10_T;
+			mii->mii_media_active |= IFM_10_T|IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/axphy.c
==============================================================================
--- stable/8/sys/dev/mii/axphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/axphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -189,6 +189,8 @@ axphy_status(struct mii_softc *sc)
 			mii->mii_media_active |= IFM_10_T;
 		if (scr & SCR_FDX)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 #endif
 	} else
 		mii->mii_media_active = ife->ifm_media;

Modified: stable/8/sys/dev/mii/bmtphy.c
==============================================================================
--- stable/8/sys/dev/mii/bmtphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/bmtphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -243,6 +243,8 @@ bmtphy_status(struct mii_softc *sc)
 			mii->mii_media_active |= IFM_10_T;
 		if (aux_csr & AUX_CSR_FDX)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/gentbi.c
==============================================================================
--- stable/8/sys/dev/mii/gentbi.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/gentbi.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -263,11 +263,12 @@ gentbi_status(struct mii_softc *sc)
 		 * see if we're doing full-duplex.
 		 */
 		mii->mii_media_active |= IFM_1000_SX;
-
 		anlpar = PHY_READ(sc, MII_ANLPAR);
 		if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0 &&
 		    (anlpar & ANLPAR_X_FD) != 0)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/inphy.c
==============================================================================
--- stable/8/sys/dev/mii/inphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/inphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -197,6 +197,8 @@ inphy_status(struct mii_softc *sc)
 			mii->mii_media_active |= IFM_10_T;
 		if (scr & SCR_FDX)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/lxtphy.c
==============================================================================
--- stable/8/sys/dev/mii/lxtphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/lxtphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -250,6 +250,8 @@ lxtphy_status(struct mii_softc *sc)
 			mii->mii_media_active |= IFM_10_T;
 		if (csr & CSR_DUPLEX)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/nsphy.c
==============================================================================
--- stable/8/sys/dev/mii/nsphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/nsphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -298,13 +298,13 @@ nsphy_status(struct mii_softc *sc)
 			if (anlpar & ANLPAR_TX_FD)
 				mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 			else if (anlpar & ANLPAR_T4)
-				mii->mii_media_active |= IFM_100_T4;
+				mii->mii_media_active |= IFM_100_T4|IFM_HDX;
 			else if (anlpar & ANLPAR_TX)
-				mii->mii_media_active |= IFM_100_TX;
+				mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 			else if (anlpar & ANLPAR_10_FD)
 				mii->mii_media_active |= IFM_10_T|IFM_FDX;
 			else if (anlpar & ANLPAR_10)
-				mii->mii_media_active |= IFM_10_T;
+				mii->mii_media_active |= IFM_10_T|IFM_HDX;
 			else
 				mii->mii_media_active |= IFM_NONE;
 			return;
@@ -320,10 +320,7 @@ nsphy_status(struct mii_softc *sc)
 			mii->mii_media_active |= IFM_10_T;
 		else
 			mii->mii_media_active |= IFM_100_TX;
-#if 0
-		if (par & PAR_FDX)
-			mii->mii_media_active |= IFM_FDX;
-#endif
+		mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/qsphy.c
==============================================================================
--- stable/8/sys/dev/mii/qsphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/qsphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -215,19 +215,19 @@ qsphy_status(struct mii_softc *sc)
 	pctl = PHY_READ(sc, MII_QSPHY_PCTL);
 	switch (pctl & PCTL_OPMASK) {
 	case PCTL_10_T:
-		mii->mii_media_active |= IFM_10_T;
+		mii->mii_media_active |= IFM_10_T|IFM_HDX;
 		break;
 	case PCTL_10_T_FDX:
 		mii->mii_media_active |= IFM_10_T|IFM_FDX;
 		break;
 	case PCTL_100_TX:
-		mii->mii_media_active |= IFM_100_TX;
+		mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 		break;
 	case PCTL_100_TX_FDX:
 		mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 		break;
 	case PCTL_100_T4:
-		mii->mii_media_active |= IFM_100_T4;
+		mii->mii_media_active |= IFM_100_T4|IFM_HDX;
 		break;
 	case PCTL_AN:
 		mii->mii_media_active |= IFM_NONE;

Modified: stable/8/sys/dev/mii/rlphy.c
==============================================================================
--- stable/8/sys/dev/mii/rlphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/rlphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -249,13 +249,13 @@ rlphy_status(struct mii_softc *phy)
 			if (anlpar & ANLPAR_TX_FD)
 				mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 			else if (anlpar & ANLPAR_T4)
-				mii->mii_media_active |= IFM_100_T4;
+				mii->mii_media_active |= IFM_100_T4|IFM_HDX;
 			else if (anlpar & ANLPAR_TX)
-				mii->mii_media_active |= IFM_100_TX;
+				mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 			else if (anlpar & ANLPAR_10_FD)
 				mii->mii_media_active |= IFM_10_T|IFM_FDX;
 			else if (anlpar & ANLPAR_10)
-				mii->mii_media_active |= IFM_10_T;
+				mii->mii_media_active |= IFM_10_T|IFM_HDX;
 			else
 				mii->mii_media_active |= IFM_NONE;
 			return;
@@ -299,6 +299,7 @@ rlphy_status(struct mii_softc *phy)
 			else
 				mii->mii_media_active |= IFM_100_TX;
 		}
+		mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/ruephy.c
==============================================================================
--- stable/8/sys/dev/mii/ruephy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/ruephy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -244,6 +244,8 @@ ruephy_status(struct mii_softc *phy)
 
 		if (msr & RUEPHY_MSR_DUPLEX)
 			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }

Modified: stable/8/sys/dev/mii/tdkphy.c
==============================================================================
--- stable/8/sys/dev/mii/tdkphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/tdkphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -217,13 +217,13 @@ tdkphy_status(struct mii_softc *phy)
 		if (anlpar & ANLPAR_TX_FD)
 			mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 		else if (anlpar & ANLPAR_T4)
-			mii->mii_media_active |= IFM_100_T4;
+			mii->mii_media_active |= IFM_100_T4|IFM_HDX;
 		else if (anlpar & ANLPAR_TX)
-			mii->mii_media_active |= IFM_100_TX;
+			mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 		else if (anlpar & ANLPAR_10_FD)
 			mii->mii_media_active |= IFM_10_T|IFM_FDX;
 		else if (anlpar & ANLPAR_10)
-			mii->mii_media_active |= IFM_10_T;
+			mii->mii_media_active |= IFM_10_T|IFM_HDX;
 		else {
 			/*
 			 * ANLPAR isn't set, which leaves two possibilities:
@@ -234,10 +234,12 @@ tdkphy_status(struct mii_softc *phy)
 			 */
 			diag = PHY_READ(phy, MII_DIAG);
 			if (diag & DIAG_NEGFAIL) /* assume 10baseT if no neg */
-				mii->mii_media_active |= IFM_10_T;
+				mii->mii_media_active |= IFM_10_T|IFM_HDX;
 			else {
 				if (diag & DIAG_DUPLEX)
 					mii->mii_media_active |= IFM_FDX;
+				else
+					mii->mii_media_active |= IFM_HDX;
 				if (diag & DIAG_RATE_100)
 					mii->mii_media_active |= IFM_100_TX;
 				else

Modified: stable/8/sys/dev/mii/tlphy.c
==============================================================================
--- stable/8/sys/dev/mii/tlphy.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/tlphy.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -333,6 +333,8 @@ tlphy_status(struct tlphy_softc *sc)
 	 */
 	if (bmcr & BMCR_FDX)
 		mii->mii_media_active |= IFM_FDX;
+	else
+		mii->mii_media_active |= IFM_HDX;
 	mii->mii_media_active |= IFM_10_T;
 }
 

Modified: stable/8/sys/dev/mii/ukphy_subr.c
==============================================================================
--- stable/8/sys/dev/mii/ukphy_subr.c	Sun Oct 24 13:39:26 2010	(r214267)
+++ stable/8/sys/dev/mii/ukphy_subr.c	Sun Oct 24 13:41:38 2010	(r214268)
@@ -104,17 +104,17 @@ ukphy_status(struct mii_softc *phy)
 			mii->mii_media_active |= IFM_1000_T|IFM_FDX;
 		else if ((gtcr & GTCR_ADV_1000THDX) &&
 		    (gtsr & GTSR_LP_1000THDX))
-			mii->mii_media_active |= IFM_1000_T;
+			mii->mii_media_active |= IFM_1000_T|IFM_HDX;
 		else if (anlpar & ANLPAR_TX_FD)
 			mii->mii_media_active |= IFM_100_TX|IFM_FDX;
 		else if (anlpar & ANLPAR_T4)
-			mii->mii_media_active |= IFM_100_T4;
+			mii->mii_media_active |= IFM_100_T4|IFM_HDX;
 		else if (anlpar & ANLPAR_TX)
-			mii->mii_media_active |= IFM_100_TX;
+			mii->mii_media_active |= IFM_100_TX|IFM_HDX;
 		else if (anlpar & ANLPAR_10_FD)
 			mii->mii_media_active |= IFM_10_T|IFM_FDX;
 		else if (anlpar & ANLPAR_10)
-			mii->mii_media_active |= IFM_10_T;
+			mii->mii_media_active |= IFM_10_T|IFM_HDX;
 		else
 			mii->mii_media_active |= IFM_NONE;
 	} else



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