Lines Matching defs:node

68  ** This node implements a Bluetooth HCI UART transport layer as per chapter
70 ** discipline that is also a netgraph node. Installing this line discipline
71 ** on a terminal device instantiates a new netgraph node of this type, which
72 ** allows access to the device via the "hook" hook of the node.
75 ** corresponding netgraph node via a NGIOCGINFO ioctl().
81 MALLOC_DEFINE(M_NETGRAPH_H4, "netgraph_h4", "Netgraph Bluetooth H4 node");
121 /* Netgraph node type descriptor */
175 mtx_init(&sc->outq.ifq_mtx, "ng_h4 node+queue", NULL, MTX_DEF);
181 /* Setup netgraph node */
182 error = ng_make_node_common(&typestruct, &sc->node);
186 printf("%s: Unable to create new node!\n", __func__);
195 /* Assign node its name */
198 error = ng_name_node(sc->node, name);
202 printf("%s: %s - node name exists?\n", __func__, name);
204 NG_NODE_UNREF(sc->node);
213 NG_NODE_SET_PRIVATE(sc->node, sc);
216 /* The node has to be a WRITER because data can change node status */
217 NG_NODE_FORCE_WRITER(sc->node);
237 * and from ttioctl. This causes the node to be destroyed as well.
252 ng_uncallout(&sc->timo, sc->node);
259 ng_rmnode_self(sc->node);
266 * Once the device has been turned into a node, we don't allow reading.
276 * Once the device has been turned into a node, we don't allow writing.
308 if (NG_NODE_HAS_NAME(sc->node))
309 strncpy(NI(data)->name, NG_NODE_NAME(sc->node),
312 strncpy(NI(data)->type, sc->node->nd_type->name,
315 NI(data)->id = (u_int32_t) ng_node2ID(sc->node);
316 NI(data)->hooks = NG_NODE_NUMHOOKS(sc->node);
340 sc->node == NULL || NG_NODE_NOT_VALID(sc->node))
348 NG_NODE_NAME(sc->node));
362 NG_NODE_NAME(sc->node), c & TTY_ERRORMASK,
381 __func__, NG_NODE_NAME(sc->node), c & TTY_CHARMASK,
398 NG_NODE_NAME(sc->node), c, sc->want, sc->got);
410 NG_NODE_NAME(sc->node), sc->ibuf[0]);
434 "type=%#x\n", __func__, NG_NODE_NAME(sc->node),
472 NG_NODE_NAME(sc->node), sc->ibuf[0], sc->got, c);
497 NG_NODE_NAME(sc->node), sc->ibuf[0],
523 NG_NODE_NAME(sc->node), sc->ibuf[0], sc->got);
539 __func__, NG_NODE_NAME(sc->node));
553 KASSERT((0), ("Invalid H4 node state=%d", sc->state));
575 sc->node == NULL || NG_NODE_NOT_VALID(sc->node))
632 ng_callout(&sc->timo, sc->node, NULL, 1,
642 ** Netgraph node methods
647 * Initialize a new node of this type. We only allow nodes to be created as
653 ng_h4_constructor(node_p node)
663 ng_h4_newhook(node_p node, hook_p hook, const char *name)
665 ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(node);
723 ng_uncallout(&sc->timo, sc->node);
740 * Remove this node. The does the netgraph portion of the shutdown.
745 ng_h4_shutdown(node_p node)
747 ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(node);
754 NG_NODE_REVIVE(node); /* we will persist */
761 NG_NODE_SET_PRIVATE(node, NULL);
765 NG_NODE_UNREF(node);
798 NG_NODE_NAME(sc->node), m->m_pkthdr.len);
810 NG_NODE_NAME(sc->node), m->m_pkthdr.len);
835 ng_h4_rcvmsg(node_p node, item_p item, hook_p lasthook)
837 ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(node);
960 NG_RESPOND_MSG(error, node, item, resp);
972 ng_h4_process_timeout(node_p node, hook_p hook, void *arg1, int arg2)
974 ng_h4_info_p sc = (ng_h4_info_p) NG_NODE_PRIVATE(node);
982 * Handle loading and unloading for this node type