Lines Matching refs:moduleid
166 netstack_register(int moduleid, in netstack_register() argument
174 ASSERT(moduleid >= 0 && moduleid < NS_MAX); in netstack_register()
182 ASSERT(ns_reg[moduleid].nr_create == NULL); in netstack_register()
183 ASSERT(ns_reg[moduleid].nr_flags == 0); in netstack_register()
184 ns_reg[moduleid].nr_create = module_create; in netstack_register()
185 ns_reg[moduleid].nr_shutdown = module_shutdown; in netstack_register()
186 ns_reg[moduleid].nr_destroy = module_destroy; in netstack_register()
187 ns_reg[moduleid].nr_flags = NRF_REGISTERED; in netstack_register()
196 nm_state_t *nms = &ns->netstack_m_state[moduleid]; in netstack_register()
203 netstack_t *, ns, int, moduleid); in netstack_register()
215 apply_all_netstacks(moduleid, netstack_apply_create); in netstack_register()
219 netstack_unregister(int moduleid) in netstack_unregister() argument
223 ASSERT(moduleid >= 0 && moduleid < NS_MAX); in netstack_unregister()
225 ASSERT(ns_reg[moduleid].nr_create != NULL); in netstack_unregister()
226 ASSERT(ns_reg[moduleid].nr_flags & NRF_REGISTERED); in netstack_unregister()
238 nm_state_t *nms = &ns->netstack_m_state[moduleid]; in netstack_unregister()
267 if (ns_reg[moduleid].nr_shutdown != NULL && created && in netstack_unregister()
272 netstack_t *, ns, int, moduleid); in netstack_unregister()
274 if ((ns_reg[moduleid].nr_flags & NRF_REGISTERED) && in netstack_unregister()
275 ns_reg[moduleid].nr_destroy != NULL && created && in netstack_unregister()
279 netstack_t *, ns, int, moduleid); in netstack_unregister()
288 ns_reg[moduleid].nr_flags |= NRF_DYING; in netstack_unregister()
291 apply_all_netstacks(moduleid, netstack_apply_shutdown); in netstack_unregister()
292 apply_all_netstacks(moduleid, netstack_apply_destroy); in netstack_unregister()
300 ASSERT(ns_reg[moduleid].nr_flags & NRF_REGISTERED); in netstack_unregister()
301 ASSERT(ns_reg[moduleid].nr_flags & NRF_DYING); in netstack_unregister()
303 nm_state_t *nms = &ns->netstack_m_state[moduleid]; in netstack_unregister()
309 netstack_t *, ns, int, moduleid); in netstack_unregister()
314 ns_reg[moduleid].nr_create = NULL; in netstack_unregister()
315 ns_reg[moduleid].nr_shutdown = NULL; in netstack_unregister()
316 ns_reg[moduleid].nr_destroy = NULL; in netstack_unregister()
317 ns_reg[moduleid].nr_flags = 0; in netstack_unregister()
619 apply_all_netstacks(int moduleid, applyfn_t *applyfn) in apply_all_netstacks() argument
629 } else if ((applyfn)(&netstack_g_lock, ns, moduleid)) { in apply_all_netstacks()
690 netstack_apply_create(kmutex_t *lockp, netstack_t *ns, int moduleid) in netstack_apply_create() argument
694 nm_state_t *nms = &ns->netstack_m_state[moduleid]; in netstack_apply_create()
707 netstack_t *, ns, int, moduleid); in netstack_apply_create()
712 ASSERT(ns_reg[moduleid].nr_create != NULL); in netstack_apply_create()
717 result = (ns_reg[moduleid].nr_create)(stackid, ns); in netstack_apply_create()
724 ns->netstack_modules[moduleid] = result; in netstack_apply_create()
729 netstack_t *, ns, int, moduleid); in netstack_apply_create()
750 netstack_apply_shutdown(kmutex_t *lockp, netstack_t *ns, int moduleid) in netstack_apply_shutdown() argument
754 nm_state_t *nms = &ns->netstack_m_state[moduleid]; in netstack_apply_shutdown()
767 netstack_t *, ns, int, moduleid); in netstack_apply_shutdown()
772 ASSERT(ns_reg[moduleid].nr_shutdown != NULL); in netstack_apply_shutdown()
774 netstack_module = ns->netstack_modules[moduleid]; in netstack_apply_shutdown()
778 (ns_reg[moduleid].nr_shutdown)(stackid, netstack_module); in netstack_apply_shutdown()
788 netstack_t *, ns, int, moduleid); in netstack_apply_shutdown()
809 netstack_apply_destroy(kmutex_t *lockp, netstack_t *ns, int moduleid) in netstack_apply_destroy() argument
813 nm_state_t *nms = &ns->netstack_m_state[moduleid]; in netstack_apply_destroy()
826 netstack_t *, ns, int, moduleid); in netstack_apply_destroy()
831 ASSERT(ns_reg[moduleid].nr_destroy != NULL); in netstack_apply_destroy()
833 netstack_module = ns->netstack_modules[moduleid]; in netstack_apply_destroy()
837 (ns_reg[moduleid].nr_destroy)(stackid, netstack_module); in netstack_apply_destroy()
843 ns->netstack_modules[moduleid] = NULL; in netstack_apply_destroy()
848 netstack_t *, ns, int, moduleid); in netstack_apply_destroy()