Changeset View
Changeset View
Standalone View
Standalone View
sys/net/iflib.c
Show First 20 Lines • Show All 4,752 Lines • ▼ Show 20 Lines | iflib_register(if_ctx_t ctx) | ||||
if_shared_ctx_t sctx = ctx->ifc_sctx; | if_shared_ctx_t sctx = ctx->ifc_sctx; | ||||
driver_t *driver = sctx->isc_driver; | driver_t *driver = sctx->isc_driver; | ||||
device_t dev = ctx->ifc_dev; | device_t dev = ctx->ifc_dev; | ||||
if_t ifp; | if_t ifp; | ||||
_iflib_assert(sctx); | _iflib_assert(sctx); | ||||
CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); | CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); | ||||
STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); | |||||
ifp = ctx->ifc_ifp = if_alloc(IFT_ETHER); | ifp = ctx->ifc_ifp = if_alloc(IFT_ETHER); | ||||
if (ifp == NULL) { | if (ifp == NULL) { | ||||
device_printf(dev, "can not allocate ifnet structure\n"); | device_printf(dev, "can not allocate ifnet structure\n"); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 1,301 Lines • Show Last 20 Lines |