Lines Matching defs:pnp
60 static int getproplen(prom_node_t *pnp, char *name);
61 static void *getprop(prom_node_t *pnp, char *name);
62 static char *nextprop(prom_node_t *pnp, char *name);
65 static void create_prop(prom_node_t *pnp, char *name, void *val, int len);
67 static void create_peers(prom_node_t *pnp, pnode_t node);
68 static void create_children(prom_node_t *pnp, pnode_t parent);
101 prom_node_t *pnp;
103 pnp = find_node(nodeid);
104 if (pnp && pnp->pn_parent) {
105 return (pnp->pn_parent->pn_nodeid);
114 prom_node_t *pnp;
116 pnp = find_node(nodeid);
117 if (pnp && pnp->pn_child)
118 return (pnp->pn_child->pn_nodeid);
126 prom_node_t *pnp;
131 pnp = find_node(nodeid);
132 if (pnp && (nodeid == OBP_NONODE))
133 return (pnp->pn_nodeid);
134 if (pnp && pnp->pn_sibling)
135 return (pnp->pn_sibling->pn_nodeid);
143 prom_node_t *pnp;
145 pnp = find_node(nodeid);
146 if (pnp == NULL)
149 return (getproplen(pnp, name));
155 prom_node_t *pnp;
159 pnp = find_node(nodeid);
160 if (pnp == NULL) {
165 len = getproplen(pnp, name);
167 prop = getprop(pnp, name);
179 prom_node_t *pnp;
184 pnp = find_node(nodeid);
185 if (pnp == NULL)
188 propname = nextprop(pnp, name);
229 getproplen(prom_node_t *pnp, char *name)
233 for (propp = pnp->pn_propp; propp != NULL; propp = propp->pp_next)
253 nextprop(prom_node_t *pnp, char *name)
261 if (pnp->pn_propp)
262 return (pnp->pn_propp->pp_name);
264 for (propp = pnp->pn_propp; propp != NULL; propp = propp->pp_next)
277 prom_node_t *pnp;
280 pnp = find_node(nodeid);
281 if (pnp == NULL) {
290 for (prop = pnp->pn_propp; prop; prop = prop->pp_next)
320 prom_node_t *pnp;
323 promif_root = pnp = create_node(OBP_NONODE, node);
325 create_peers(pnp, node);
326 create_children(pnp, node);
330 create_children(prom_node_t *pnp, pnode_t parent)
344 cnp = create_node(pnp, child);
345 pnp->pn_child = cnp;
347 pnp = cnp;
355 prom_node_t *pnp;
367 pnp = create_node(np->pn_parent, peer);
368 np->pn_sibling = pnp;
369 create_children(pnp, peer);
370 np = pnp;
378 prom_node_t *pnp;
390 pnp = kmem_zalloc(sizeof (prom_node_t), KM_SLEEP);
391 pnp->pn_nodeid = node;
392 pnp->pn_parent = parent;
408 create_prop(pnp, propname, propval, proplen);
415 return (pnp);
419 create_prop(prom_node_t *pnp, char *name, void *val, int len)
437 if (pnp->pn_propp == NULL) {
438 pnp->pn_propp = newprop;
443 for (prop = pnp->pn_propp; prop->pp_next != NULL; prop = prop->pp_next)
451 promif_dump_tree(prom_node_t *pnp)
456 if (pnp == NULL)
463 prom_printf("Node 0x%x (parent=0x%x, sibling=0x%x)\n", pnp->pn_nodeid,
464 (pnp->pn_parent) ? pnp->pn_parent->pn_nodeid : 0,
465 (pnp->pn_sibling) ? pnp->pn_sibling->pn_nodeid : 0);
467 if (pnp->pn_child != NULL) {
469 promif_dump_tree(pnp->pn_child);
473 if (pnp->pn_sibling != NULL)
474 promif_dump_tree(pnp->pn_sibling);