Lines Matching defs:node

92 	phandle_t 	node;
108 * As soon as we are able to use malloc(), walk the node tree and build a list
109 * of info that cross-references node handles, xref handles, and device_t
112 * and node handles. Before malloc() is available we have to recursively search
113 * the node tree each time we want to translate between a node and xref handle.
117 xrefinfo_create(phandle_t node)
125 * such node found create an entry in the xreflist.
127 for (child = OF_child(node); child != 0; child = OF_peer(child)) {
135 xi->node = child;
165 (find_by == FIND_BY_NODE && (phandle_t)key == xi->node) ||
176 xrefinfo_add(phandle_t node, phandle_t xref, device_t dev)
181 xi->node = node;
320 /* Return the next sibling of this node or 0. */
322 OF_peer(phandle_t node)
328 return (OFW_PEER(ofw_obj, node));
331 /* Return the first child of this node or 0. */
333 OF_child(phandle_t node)
339 return (OFW_CHILD(ofw_obj, node));
342 /* Return the parent of this node or 0. */
344 OF_parent(phandle_t node)
350 return (OFW_PARENT(ofw_obj, node));
395 OF_getencprop(phandle_t node, const char *propname, pcell_t *buf, size_t len)
402 retval = OF_getprop(node, propname, buf, len);
413 * Recursively search the node and its parent for the given property, working
414 * downward from the node to the device tree root. Returns the value of the
418 OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len)
422 for (; node != 0; node = OF_parent(node))
423 if ((rv = OF_getprop(node, propname, buf, len)) != -1)
429 OF_searchencprop(phandle_t node, const char *propname, void *buf, size_t len)
433 for (; node != 0; node = OF_parent(node))
434 if ((rv = OF_getencprop(node, propname, buf, len)) != -1)
566 * Recursively descend from parent, looking for a node with a property
593 phandle_t node;
598 return (xi->node);
601 if ((node = OF_child_xref_phandle(OF_peer(0), xref)) == -1)
603 return (node);
607 OF_xref_from_node(phandle_t node)
613 if ((xi = xrefinfo_find(node, FIND_BY_NODE)) == NULL)
614 return (node);
618 if (OF_getencprop(node, "phandle", &xref, sizeof(xref)) == -1 &&
619 OF_getencprop(node, "ibm,phandle", &xref, sizeof(xref)) == -1 &&
620 OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1)
621 return (node);
659 * nodes don't contain phandle properties and xref and node handles are
660 * synonymous, so the xref handle is added as the node handle as well.