* Remove this node. The does the netgraph portion of the shutdown. */
| 222 | * Remove this node. The does the netgraph portion of the shutdown. |
| 223 | */ |
| 224 | static int |
| 225 | ngt_shutdown(node_p node) |
| 226 | { |
| 227 | const sc_p sc = NG_NODE_PRIVATE(node); |
| 228 | struct tty *tp; |
| 229 | |
| 230 | tp = sc->tp; |
| 231 | if (tp != NULL) { |
| 232 | tty_lock(tp); |
| 233 | ttyhook_unregister(tp); |
| 234 | } |
| 235 | /* Free resources */ |
| 236 | IF_DRAIN(&sc->outq); |
| 237 | mtx_destroy(&(sc)->outq.ifq_mtx); |
| 238 | NG_NODE_UNREF(sc->node); |
| 239 | free(sc, M_NETGRAPH); |
| 240 | |
| 241 | return (0); |
| 242 | } |
| 243 | |
| 244 | /* |
| 245 | * Receive control message |
nothing calls this directly
no test coverage detected