Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2010 14:43:28 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203070 - head/sys/dev/nve
Message-ID:  <201001271443.o0REhS0B043115@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Jan 27 14:43:28 2010
New Revision: 203070
URL: http://svn.freebsd.org/changeset/base/203070

Log:
  Initialize the ifnet before calling mii_phy_probe() as some phy drivers
  (e.g. e1000phy(4)) expect if_dname to be valid when they are probed.
  
  MFC after:	3 days

Modified:
  head/sys/dev/nve/if_nve.c

Modified: head/sys/dev/nve/if_nve.c
==============================================================================
--- head/sys/dev/nve/if_nve.c	Wed Jan 27 14:17:33 2010	(r203069)
+++ head/sys/dev/nve/if_nve.c	Wed Jan 27 14:43:28 2010	(r203070)
@@ -526,14 +526,6 @@ nve_attach(device_t dev)
 		goto fail;
 	}
 
-	/* Probe device for MII interface to PHY */
-	DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n");
-	if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) {
-		device_printf(dev, "MII without any phy!\n");
-		error = ENXIO;
-		goto fail;
-	}
-
 	/* Setup interface parameters */
 	ifp->if_softc = sc;
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
@@ -549,6 +541,14 @@ nve_attach(device_t dev)
 	ifp->if_capabilities |= IFCAP_VLAN_MTU;
 	ifp->if_capenable |= IFCAP_VLAN_MTU;
 
+	/* Probe device for MII interface to PHY */
+	DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n");
+	if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) {
+		device_printf(dev, "MII without any phy!\n");
+		error = ENXIO;
+		goto fail;
+	}
+
 	/* Attach to OS's managers. */
 	ether_ifattach(ifp, eaddr);
 



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