Lines Matching refs:rp

105 	fco_handle_t rp;  in fc_ops_alloc_handle()  local
108 rp = kmem_zalloc(sizeof (struct fc_resource_list), KM_SLEEP); in fc_ops_alloc_handle()
109 rp->next_handle = NULL; /* nobody is downstream */ in fc_ops_alloc_handle()
110 rp->ap = ap; in fc_ops_alloc_handle()
111 rp->child = child; in fc_ops_alloc_handle()
112 rp->fcode = fcode; in fc_ops_alloc_handle()
113 rp->fcode_size = fcode_size; in fc_ops_alloc_handle()
117 rp->unit_address = up; in fc_ops_alloc_handle()
119 rp->bus_args = NULL; /* generic module has no bus args */ in fc_ops_alloc_handle()
120 fc_phandle_table_alloc(fc_handle_to_phandle_head(rp)); in fc_ops_alloc_handle()
122 (void) fc_dip_to_phandle(fc_handle_to_phandle_head(rp), ap); in fc_ops_alloc_handle()
127 fc_create_device_tree(ap, &rp->dtree); in fc_ops_alloc_handle()
128 return (rp); in fc_ops_alloc_handle()
135 fc_ops_free_handle(fco_handle_t rp) in fc_ops_free_handle() argument
139 if (rp->unit_address) in fc_ops_free_handle()
140 kmem_free(rp->unit_address, strlen(rp->unit_address) + 1); in fc_ops_free_handle()
142 if (rp->dtree) in fc_ops_free_handle()
143 fc_remove_device_tree(&rp->dtree); in fc_ops_free_handle()
145 fc_phandle_table_free(fc_handle_to_phandle_head(rp)); in fc_ops_free_handle()
147 for (ip = rp->head; ip != NULL; ip = np) { in fc_ops_free_handle()
158 fc_rem_resource(rp, ip); in fc_ops_free_handle()
161 kmem_free(rp, sizeof (struct fc_resource_list)); in fc_ops_free_handle()
201 fco_getproplen(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_getproplen() argument
223 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL) in fco_getproplen()
239 return (fc_success_op(ap, rp, cp)); in fco_getproplen()
248 fco_getprop(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_getprop() argument
270 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL) in fco_getprop()
297 return (fc_success_op(ap, rp, cp)); in fco_getprop()
301 fco_ap_phandle(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_ap_phandle() argument
313 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), ap); in fco_ap_phandle()
316 return (fc_success_op(ap, rp, cp)); in fco_ap_phandle()
320 fco_child(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_child() argument
335 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL) in fco_child()
344 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), dip); in fco_child()
348 return (fc_success_op(ap, rp, cp)); in fco_child()
352 fco_peer(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_peer() argument
367 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL) in fco_peer()
376 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), dip); in fco_peer()
380 return (fc_success_op(ap, rp, cp)); in fco_peer()
384 fco_parent(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_parent() argument
399 if ((dip = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h)) == NULL) in fco_parent()
408 h = fc_dip_to_phandle(fc_handle_to_phandle_head(rp), dip); in fco_parent()
412 return (fc_success_op(ap, rp, cp)); in fco_parent()
419 fco_alloc_phandle(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_alloc_phandle() argument
440 fc_add_resource(rp, ip); in fco_alloc_phandle()
446 return (fc_success_op(ap, rp, cp)); in fco_alloc_phandle()
450 find_nodeid_resource(fco_handle_t rp, int n) in find_nodeid_resource() argument
454 fc_lock_resource_list(rp); in find_nodeid_resource()
455 for (ip = rp->head; ip != NULL; ip = ip->next) { in find_nodeid_resource()
461 fc_unlock_resource_list(rp); in find_nodeid_resource()
470 fco_new_device(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_new_device() argument
487 pdev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), ph); in fco_new_device()
492 cdev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), ch); in fco_new_device()
494 switch (rp->cdip_state) { in fco_new_device()
510 if (rp->child != NULL) { in fco_new_device()
511 if (cdev != rp->child) in fco_new_device()
531 if (fc_find_node(pdev, fc_handle_to_dtree(rp)) == NULL) in fco_new_device()
575 if ((ip = find_nodeid_resource(rp, (int)ch)) == NULL) { in fco_new_device()
602 fc_rem_resource(rp, ip); in fco_new_device()
625 fc_add_dip_to_phandle(fc_handle_to_phandle_head(rp), cdev, ch); in fco_new_device()
630 fc_add_child(cdev, pdev, fc_handle_to_dtree(rp)); in fco_new_device()
632 rp->cdip = cdev; in fco_new_device()
633 rp->cdip_state = FC_CDIP_STARTED; in fco_new_device()
637 return (fc_success_op(ap, rp, cp)); in fco_new_device()
644 fco_finish_device(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_finish_device() argument
652 if (rp->cdip_state != FC_CDIP_STARTED) in fco_finish_device()
656 cdev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h); in fco_finish_device()
657 if (cdev != rp->cdip) in fco_finish_device()
669 if ((ddi_get_parent(cdev) == ap) && (cdev == rp->child)) { in fco_finish_device()
679 rp->cdip_state = FC_CDIP_DONE; in fco_finish_device()
681 return (fc_success_op(ap, rp, cp)); in fco_finish_device()
688 fco_create_property(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_create_property() argument
705 dev = fc_phandle_to_dip(fc_handle_to_phandle_head(rp), h); in fco_create_property()
742 return (fc_success_op(ap, rp, cp)); in fco_create_property()
755 return (fc_success_op(ap, rp, cp)); in fco_create_property()
769 fco_validate(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_validate() argument
771 rp->cdip_state = FC_CDIP_CONFIG; in fco_validate()
774 return (fc_success_op(ap, rp, cp)); in fco_validate()
799 fco_invalidate(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_invalidate() argument
802 struct fc_device_tree *subtree = fc_handle_to_dtree(rp); in fco_invalidate()
803 int configured = (rp->cdip_state == FC_CDIP_CONFIG); in fco_invalidate()
818 root = rp->child ? rp->child : ap; in fco_invalidate()
830 return (fc_success_op(ap, rp, cp)); in fco_invalidate()
834 fco_exit(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_exit() argument
838 return (fc_success_op(ap, rp, cp)); in fco_exit()
846 fco_local_ether_addr(dev_info_t *ap, fco_handle_t rp, fc_ci_t *cp) in fco_local_ether_addr() argument
858 return (fc_success_op(ap, rp, cp)); in fco_local_ether_addr()