Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if.c
Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | restart: | ||||
IFNET_WUNLOCK(); | IFNET_WUNLOCK(); | ||||
ifp->if_index = idx; | ifp->if_index = idx; | ||||
ifp->if_type = type; | ifp->if_type = type; | ||||
ifp->if_alloctype = type; | ifp->if_alloctype = type; | ||||
ifp->if_numa_domain = numa_domain; | ifp->if_numa_domain = numa_domain; | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
ifp->if_vnet = curvnet; | ifp->if_vnet = curvnet; | ||||
#endif | #endif | ||||
/* XXX */ | |||||
ifp->if_flags |= IFF_NEEDSEPOCH; | |||||
if (if_com_alloc[type] != NULL) { | if (if_com_alloc[type] != NULL) { | ||||
ifp->if_l2com = if_com_alloc[type](type, ifp); | ifp->if_l2com = if_com_alloc[type](type, ifp); | ||||
if (ifp->if_l2com == NULL) { | if (ifp->if_l2com == NULL) { | ||||
free(ifp, M_IFNET); | free(ifp, M_IFNET); | ||||
ifindex_free(idx); | ifindex_free(idx); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,590 Lines • ▼ Show 20 Lines | if_setdrvflags(if_t ifp, int flags) | ||||
((struct ifnet *)ifp)->if_drv_flags = flags; | ((struct ifnet *)ifp)->if_drv_flags = flags; | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
if_setflags(if_t ifp, int flags) | if_setflags(if_t ifp, int flags) | ||||
{ | { | ||||
/* XXX Temporary */ | |||||
((struct ifnet *)ifp)->if_flags = flags | IFF_NEEDSEPOCH; | ifp->if_flags = flags; | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
if_setflagbits(if_t ifp, int set, int clear) | if_setflagbits(if_t ifp, int set, int clear) | ||||
{ | { | ||||
((struct ifnet *)ifp)->if_flags |= set; | ((struct ifnet *)ifp)->if_flags |= set; | ||||
((struct ifnet *)ifp)->if_flags &= ~clear; | ((struct ifnet *)ifp)->if_flags &= ~clear; | ||||
▲ Show 20 Lines • Show All 396 Lines • Show Last 20 Lines |