Lines Matching refs:rp

104 	fco_handle_t rp;
107 rp = kmem_zalloc(sizeof (struct fc_resource_list), KM_SLEEP);
108 rp->next_handle = NULL; /* nobody is downstream */
109 rp->ap = ap;
110 rp->child = child;
111 rp->fcode = fcode;
112 rp->fcode_size = fcode_size;
116 rp->unit_address = up;
118 rp->bus_args = NULL; /* generic module has no bus args */
119 fc_phandle_table_alloc(fc_handle_to_phandle_head(rp));
121 (void) fc_dip_to_phandle(fc_handle_to_phandle_head(rp), ap);
126 fc_create_device_tree(ap, &rp->dtree);
127 return (rp);
134 fc_ops_free_handle(fco_handle_t rp)
138 if (rp->unit_address)
139 kmem_free(rp->unit_address, strlen(rp->unit_address) + 1);
141 if (rp->dtree)
142 fc_remove_device_tree(&rp->dtree);
144 fc_phandle_table_free(fc_handle_to_phandle_head(rp));
146 for (ip = rp->head; ip != NULL; ip = np) {
157 fc_rem_resource(rp, ip);
160 kmem_free(rp, sizeof (struct fc_resource_list));
200 fco_getproplen(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
222 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL)
238 return (fc_success_op(ap, rp, cp));
247 fco_getprop(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
269 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL)
296 return (fc_success_op(ap, rp, cp));
300 fco_ap_phandle(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
312 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), ap);
315 return (fc_success_op(ap, rp, cp));
319 fco_child(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
334 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL)
343 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), dip);
347 return (fc_success_op(ap, rp, cp));
351 fco_peer(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
366 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL)
375 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), dip);
379 return (fc_success_op(ap, rp, cp));
383 fco_parent(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
398 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL)
407 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), dip);
411 return (fc_success_op(ap, rp, cp));
418 fco_alloc_phandle(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
439 fc_add_resource(rp, ip);
445 return (fc_success_op(ap, rp, cp));
449 find_nodeid_resource(fco_handle_t rp, int n)
453 fc_lock_resource_list(rp);
454 for (ip = rp->head; ip != NULL; ip = ip->next) {
460 fc_unlock_resource_list(rp);
469 fco_new_device(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
486 pdev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), ph);
491 cdev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), ch);
493 switch (rp->cdip_state) {
509 if (rp->child != NULL) {
510 if (cdev != rp->child)
530 if (fc_find_node(pdev, fc_handle_to_dtree(rp)) == NULL)
574 if ((ip = find_nodeid_resource(rp, (int)ch)) == NULL) {
601 fc_rem_resource(rp, ip);
624 fc_add_dip_to_phandle(fc_handle_to_phandle_head(rp), cdev, ch);
629 fc_add_child(cdev, pdev, fc_handle_to_dtree(rp));
631 rp->cdip = cdev;
632 rp->cdip_state = FC_CDIP_STARTED;
636 return (fc_success_op(ap, rp, cp));
643 fco_finish_device(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
651 if (rp->cdip_state != FC_CDIP_STARTED)
655 cdev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h);
656 if (cdev != rp->cdip)
668 if ((ddi_get_parent(cdev) == ap) && (cdev == rp->child)) {
678 rp->cdip_state = FC_CDIP_DONE;
680 return (fc_success_op(ap, rp, cp));
687 fco_create_property(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
704 dev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h);
741 return (fc_success_op(ap, rp, cp));
754 return (fc_success_op(ap, rp, cp));
768 fco_validate(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
770 rp->cdip_state = FC_CDIP_CONFIG;
773 return (fc_success_op(ap, rp, cp));
798 fco_invalidate(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
801 struct fc_device_tree *subtree = fc_handle_to_dtree(rp);
802 int configured = (rp->cdip_state == FC_CDIP_CONFIG);
817 root = rp->child ? rp->child : ap;
829 return (fc_success_op(ap, rp, cp));
833 fco_exit(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
837 return (fc_success_op(ap, rp, cp));
845 fco_local_ether_addr(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp)
857 return (fc_success_op(ap, rp, cp));