1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Move if_alloc() higher in the attach function so sc->ifp is populated

early.  I've moved it all the way to the top rather than part way up as
the submitter did.

Submitted by:	Jung-uk Kim <jkim at niksun dot com>
Reported by:	submitter, le, dougb
Approved by:	re (ifnet blanket)
This commit is contained in:
Brooks Davis 2005-06-14 17:47:31 +00:00
parent 5b9f3a50a0
commit bc3552517b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147386

View File

@ -467,6 +467,12 @@ ndis_attach(dev)
int i;
sc = device_get_softc(dev);
ifp = sc->ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
error = ENOSPC;
goto fail;
}
ifp->if_softc = sc;
mtx_init(&sc->ndis_mtx, "ndis softc lock",
MTX_NETWORK_LOCK, MTX_DEF);
@ -612,12 +618,6 @@ ndis_attach(dev)
/* Check for task offload support. */
ndis_probe_offload(sc);
ifp = sc->ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
error = ENOSPC;
goto fail;
}
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;