Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/if.c
Show First 20 Lines • Show All 479 Lines • ▼ Show 20 Lines | #ifdef MAC | ||||
mac_ifnet_init(ifp); | mac_ifnet_init(ifp); | ||||
#endif | #endif | ||||
ifq_init(&ifp->if_snd, ifp); | ifq_init(&ifp->if_snd, ifp); | ||||
refcount_init(&ifp->if_refcount, 1); /* Index reference. */ | refcount_init(&ifp->if_refcount, 1); /* Index reference. */ | ||||
for (int i = 0; i < IFCOUNTERS; i++) | for (int i = 0; i < IFCOUNTERS; i++) | ||||
ifp->if_counters[i] = counter_u64_alloc(M_WAITOK); | ifp->if_counters[i] = counter_u64_alloc(M_WAITOK); | ||||
ifp->if_get_counter = if_get_counter_default; | ifp->if_get_counter = if_get_counter_default; | ||||
ifp->if_pcp = IFNET_PCP_NONE; | |||||
ifnet_setbyindex(ifp->if_index, ifp); | ifnet_setbyindex(ifp->if_index, ifp); | ||||
return (ifp); | return (ifp); | ||||
} | } | ||||
/* | /* | ||||
* Do the actual work of freeing a struct ifnet, and layer 2 common | * Do the actual work of freeing a struct ifnet, and layer 2 common | ||||
* structure. This call is made when the last reference to an | * structure. This call is made when the last reference to an | ||||
* interface is released. | * interface is released. | ||||
▲ Show 20 Lines • Show All 3,742 Lines • Show Last 20 Lines |