summaryrefslogtreecommitdiffstats
path: root/sys/dev/fxp
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-06-11 00:47:34 +0000
committerbrooks <brooks@FreeBSD.org>2005-06-11 00:47:34 +0000
commitc2f70903163ac057238309e32caef49cb822aa95 (patch)
treea517e669adc8325f260cbad0b20af2f76cda7fb3 /sys/dev/fxp
parent96dd58a16b250cc7d1238024cd96d7f4711092cd (diff)
downloadFreeBSD-src-c2f70903163ac057238309e32caef49cb822aa95.zip
FreeBSD-src-c2f70903163ac057238309e32caef49cb822aa95.tar.gz
Move if_alloc() up in fxp_attach() so there's an ifp before
mii_phy_probe() is called. Committed via: fxp0
Diffstat (limited to 'sys/dev/fxp')
-rw-r--r--sys/dev/fxp/if_fxp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 4fd50f9..ca4de5b 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -388,6 +388,13 @@ fxp_attach(device_t dev)
s = splimp();
+ ifp = sc->ifp = if_alloc(IFT_ETHER);
+ if (ifp == NULL) {
+ device_printf(dev, "can not if_alloc()\n");
+ error = ENOSPC;
+ goto fail;
+ }
+
/*
* Enable bus mastering.
*/
@@ -745,12 +752,6 @@ fxp_attach(device_t dev)
}
}
- ifp = sc->ifp = if_alloc(IFT_ETHER);
- if (ifp == NULL) {
- device_printf(dev, "can not if_alloc()\n");
- error = ENOSPC;
- goto fail;
- }
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_baudrate = 100000000;
ifp->if_init = fxp_init;
OpenPOWER on IntegriCloud