Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Mar 2009 22:08: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-7@freebsd.org
Subject:   svn commit: r190294 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/dc
Message-ID:  <200903222208.n2MM8Uu4085419@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Mar 22 22:08:30 2009
New Revision: 190294
URL: http://svn.freebsd.org/changeset/base/190294

Log:
  MFC: r190117
  
  - Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't
    supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers
    nothing but hopefully will be respected by mii_phy_setmedia() later on.
  - Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs.
  - Use mii_phy_add_media() instead of mii_add_media() so the latter can
    be eventually retired.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/dc/dcphy.c
  stable/7/sys/dev/dc/pnphy.c

Modified: stable/7/sys/dev/dc/dcphy.c
==============================================================================
--- stable/7/sys/dev/dc/dcphy.c	Sun Mar 22 22:07:52 2009	(r190293)
+++ stable/7/sys/dev/dc/dcphy.c	Sun Mar 22 22:08:30 2009	(r190294)
@@ -154,13 +154,12 @@ dcphy_attach(device_t dev)
 	sc->mii_service = dcphy_service;
 	sc->mii_pdata = mii;
 
-	sc->mii_flags |= MIIF_NOISOLATE;
-	mii->mii_instance++;
-
-#define	ADD(m, c)	ifmedia_add(&mii->mii_media, (m), (c), NULL)
+	/*
+	 * Apparently, we can neither isolate nor do loopback.
+	 */
+	sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
 
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),
-	    BMCR_ISO);
+	mii->mii_instance++;
 
 	/*dcphy_reset(sc);*/
 	dc_sc = mii->mii_ifp->if_softc;
@@ -186,9 +185,8 @@ dcphy_attach(device_t dev)
 
 	sc->mii_capabilities &= ma->mii_capmask;
 	device_printf(dev, " ");
-	mii_add_media(sc);
+	mii_phy_add_media(sc);
 	printf("\n");
-#undef ADD
 
 	MIIBUS_MEDIAINIT(sc->mii_dev);
 	return (0);

Modified: stable/7/sys/dev/dc/pnphy.c
==============================================================================
--- stable/7/sys/dev/dc/pnphy.c	Sun Mar 22 22:07:52 2009	(r190293)
+++ stable/7/sys/dev/dc/pnphy.c	Sun Mar 22 22:08:30 2009	(r190294)
@@ -137,24 +137,19 @@ pnphy_attach(device_t dev)
 	sc->mii_service = pnphy_service;
 	sc->mii_pdata = mii;
 
-	sc->mii_flags |= MIIF_NOISOLATE;
-	mii->mii_instance++;
+	/*
+	 * Apparently, we can neither isolate nor do loopback.
+	 */
+	sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP;
 
-#define	ADD(m, c)	ifmedia_add(&mii->mii_media, (m), (c), NULL)
+	mii->mii_instance++;
 
 	sc->mii_capabilities =
 	    BMSR_100TXFDX | BMSR_100TXHDX | BMSR_10TFDX | BMSR_10THDX;
 	sc->mii_capabilities &= ma->mii_capmask;
 	device_printf(dev, " ");
-	mii_add_media(sc);
+	mii_phy_add_media(sc);
 	printf("\n");
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst),
-	    BMCR_ISO);
-
-	ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst),
-	    BMCR_LOOP|BMCR_S100);
-
-#undef ADD
 
 	MIIBUS_MEDIAINIT(sc->mii_dev);
 	return (0);



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