MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_device_disconnect

Function ng_device_disconnect

freebsd/netgraph/ng_device.c:297–317  ·  view source on GitHub ↗

* Removal of the hook destroys the node. */

Source from the content-addressed store, hash-verified

295 * Removal of the hook destroys the node.
296 */
297static int
298ng_device_disconnect(hook_p hook)
299{
300 priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
301
302 DBG;
303
304 destroy_dev(priv->ngddev);
305 mtx_destroy(&priv->ngd_mtx);
306
307 IF_DRAIN(&priv->readq);
308 mtx_destroy(&(priv)->readq.ifq_mtx);
309
310 free_unr(ngd_unit, priv->unit);
311
312 free(priv, M_NETGRAPH);
313
314 ng_rmnode_self(NG_HOOK_NODE(hook));
315
316 return(0);
317}
318
319/*
320 * Node shutdown. Everything is already done in disconnect method.

Callers

nothing calls this directly

Calls 4

destroy_devFunction · 0.85
free_unrFunction · 0.85
ng_rmnode_selfFunction · 0.70
freeFunction · 0.50

Tested by

no test coverage detected