summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-01-27 14:43:28 +0000
committerjhb <jhb@FreeBSD.org>2010-01-27 14:43:28 +0000
commitc75f72dd7c93d46f29e0e0a7b6fce9f5104ae43c (patch)
tree6d1a4b6f3e572fdbef49d12d21ff8404c3026237
parent93642d99973a88335db8126f637ce0b2ef249f6d (diff)
downloadFreeBSD-src-c75f72dd7c93d46f29e0e0a7b6fce9f5104ae43c.zip
FreeBSD-src-c75f72dd7c93d46f29e0e0a7b6fce9f5104ae43c.tar.gz
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
-rw-r--r--sys/dev/nve/if_nve.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c
index 121389c..6179869 100644
--- a/sys/dev/nve/if_nve.c
+++ b/sys/dev/nve/if_nve.c
@@ -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);
OpenPOWER on IntegriCloud