Changeset View
Changeset View
Standalone View
Standalone View
sys/net/iflib_clone.c
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
iflib_pseudo_detach(device_t dev) | iflib_pseudo_detach(device_t dev) | ||||
{ | { | ||||
if_ctx_t ctx; | if_ctx_t ctx; | ||||
uint32_t ifc_flags; | |||||
ctx = device_get_softc(dev); | ctx = device_get_softc(dev); | ||||
ifc_flags = iflib_get_flags(ctx); | if ((iflib_get_flags(ctx) & IFC_IN_DETACH) == 0) | ||||
if ((ifc_flags & IFC_INIT_DONE) == 0) | return (EBUSY); | ||||
return (0); | return (0); | ||||
return (IFDI_DETACH(ctx)); | |||||
} | } | ||||
static device_t iflib_pseudodev; | static device_t iflib_pseudodev; | ||||
static struct mtx pseudoif_mtx; | static struct mtx pseudoif_mtx; | ||||
MTX_SYSINIT(pseudoif_mtx, &pseudoif_mtx, "pseudoif_mtx", MTX_DEF); | MTX_SYSINIT(pseudoif_mtx, &pseudoif_mtx, "pseudoif_mtx", MTX_DEF); | ||||
#define PSEUDO_LOCK() mtx_lock(&pseudoif_mtx); | #define PSEUDO_LOCK() mtx_lock(&pseudoif_mtx); | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |