Lines Matching refs:dp
66 static void in_hashdrv(in_drv_t *dp);
69 static void in_endrv(in_node_t *np, in_drv_t *dp);
147 struct in_drv *dp; in e_ddi_instance_init() local
174 dp = in_alloc_drv("rootnex"); in e_ddi_instance_init()
175 in_endrv(e_ddi_inst_state.ins_root, dp); in e_ddi_instance_init()
341 in_set_instance(dev_info_t *dip, in_drv_t *dp, major_t major) in in_set_instance() argument
345 dp->ind_instance = DEVI(dip)->devi_instance; in in_set_instance()
347 dp->ind_instance = in_next_instance(major); in in_set_instance()
545 in_drv_t *dp; in e_ddi_assign_instance() local
601 dp = in_drvwalk(np, bname); in e_ddi_assign_instance()
602 if (dp == NULL) { in e_ddi_assign_instance()
608 if ((dp = in_drvwalk(np, bname)) == NULL) { in e_ddi_assign_instance()
609 dp = in_alloc_drv(bname); in e_ddi_assign_instance()
610 ASSERT(dp != NULL); in e_ddi_assign_instance()
613 in_endrv(np, dp); in e_ddi_assign_instance()
614 in_set_instance(dip, dp, major); in e_ddi_assign_instance()
615 dp->ind_state = IN_PROVISIONAL; in e_ddi_assign_instance()
616 in_hashdrv(dp); in e_ddi_assign_instance()
618 dp->ind_state = IN_BORROWED; in e_ddi_assign_instance()
622 ret = dp->ind_instance; in e_ddi_assign_instance()
669 in_drv_t *dp; in e_ddi_instance_majorinstance_to_path() local
676 for (dp = dnp->dn_inlist; dp != NULL; dp = dp->ind_next) in e_ddi_instance_majorinstance_to_path()
677 if (dp->ind_instance == inst) in e_ddi_instance_majorinstance_to_path()
681 if (dp) { in e_ddi_instance_majorinstance_to_path()
683 ret = mkpathname(path, dp->ind_node, MAXPATHLEN); in e_ddi_instance_majorinstance_to_path()
706 in_drv_t *dp; in in_next_instance_block() local
725 for (dp = dnp->dn_inlist; dp; dp = dp->ind_next) in in_next_instance_block()
726 if (dp->ind_instance >= dnp->dn_pinstance) in in_next_instance_block()
730 if (dp == NULL) { in in_next_instance_block()
738 prev = dp->ind_instance; in in_next_instance_block()
743 for (dp = dp->ind_next, hole = 0; dp; dp = dp->ind_next) { in in_next_instance_block()
744 if (dp->ind_instance != (prev + 1)) in in_next_instance_block()
746 if (dp->ind_instance >= (prev + block_size + 1)) in in_next_instance_block()
748 prev = dp->ind_instance; in in_next_instance_block()
781 in_drv_t *dp; /* in_drv entry */ in e_ddi_free_instance() local
819 dp = in_drvwalk(np, name); in e_ddi_free_instance()
820 ASSERT(dp); in e_ddi_free_instance()
821 if (dp->ind_state == IN_PROVISIONAL) { in e_ddi_free_instance()
822 in_removedrv(dnp, dp); in e_ddi_free_instance()
823 } else if (dp->ind_state == IN_BORROWED) { in e_ddi_free_instance()
824 dp->ind_state = IN_PERMANENT; in e_ddi_free_instance()
840 in_drv_t *dp; in e_ddi_keep_instance() local
865 dp = in_drvwalk(np, (char *)ddi_driver_name(dip)); in e_ddi_keep_instance()
866 ASSERT(dp); in e_ddi_keep_instance()
869 if (dp->ind_state == IN_PROVISIONAL || dp->ind_state == IN_BORROWED) { in e_ddi_keep_instance()
870 dp->ind_state = IN_PERMANENT; in e_ddi_keep_instance()
885 in_drv_t *dp, *ndp; in e_ddi_unorphan_instance_nos() local
906 dp = e_ddi_inst_state.ins_no_major; in e_ddi_unorphan_instance_nos()
908 while (dp) { in e_ddi_unorphan_instance_nos()
909 ndp = dp->ind_next; in e_ddi_unorphan_instance_nos()
910 ASSERT(dp->ind_state != IN_UNKNOWN); in e_ddi_unorphan_instance_nos()
911 dp->ind_next = NULL; in e_ddi_unorphan_instance_nos()
912 in_hashdrv(dp); in e_ddi_unorphan_instance_nos()
913 dp = ndp; in e_ddi_unorphan_instance_nos()
1002 in_drv_t *dp; in in_pathin() local
1025 dp = in_drvwalk(np, bname); in in_pathin()
1026 if (dp != NULL) { in in_pathin()
1030 cp, bname, dp->ind_instance); in in_pathin()
1040 dp = in_alloc_drv(bname); in in_pathin()
1041 in_endrv(np, dp); in in_pathin()
1042 dp->ind_instance = instance; in in_pathin()
1043 dp->ind_state = IN_PERMANENT; in in_pathin()
1044 in_hashdrv(dp); in in_pathin()
1138 in_endrv(in_node_t *np, in_drv_t *dp) in in_endrv() argument
1142 ASSERT(np && dp); in in_endrv()
1144 np->in_drivers = dp; in in_endrv()
1145 dp->ind_next_drv = mp; in in_endrv()
1146 dp->ind_node = np; in in_endrv()
1226 in_drv_t *dp; in in_alloc_drv() local
1240 dp = (in_drv_t *)cp; in in_alloc_drv()
1242 dp->ind_driver_name = cp + sizeof (in_drv_t); in in_alloc_drv()
1243 (void) strcpy(dp->ind_driver_name, bindingname); in in_alloc_drv()
1245 dp->ind_state = IN_UNKNOWN; in in_alloc_drv()
1246 dp->ind_instance = -1; in in_alloc_drv()
1247 return (dp); in in_alloc_drv()
1263 in_dealloc_drv(in_drv_t *dp) in in_dealloc_drv() argument
1265 ASSERT(dp->ind_driver_name); in in_dealloc_drv()
1267 kmem_free(dp, sizeof (in_drv_t) + strlen(dp->ind_driver_name) in in_dealloc_drv()
1295 in_drv_t *dp; in in_inuse() local
1309 dp = dnp->dn_inlist; in in_inuse()
1310 while (dp) { in in_inuse()
1311 if (dp->ind_instance == instance) in in_inuse()
1313 dp = dp->ind_next; in in_inuse()
1319 in_hashdrv(in_drv_t *dp) in in_hashdrv() argument
1326 major = ddi_name_to_major(dp->ind_driver_name); in in_hashdrv()
1328 dp->ind_next = e_ddi_inst_state.ins_no_major; in in_hashdrv()
1329 e_ddi_inst_state.ins_no_major = dp; in in_hashdrv()
1341 if (mp == NULL || dp->ind_instance < mp->ind_instance) { in in_hashdrv()
1344 dp->ind_next = mp; in in_hashdrv()
1345 dnp->dn_inlist = dp; in in_hashdrv()
1349 ASSERT(mp->ind_instance != dp->ind_instance); in in_hashdrv()
1350 while (mp->ind_instance < dp->ind_instance && mp->ind_next) { in in_hashdrv()
1353 ASSERT(mp->ind_instance != dp->ind_instance); in in_hashdrv()
1356 if (mp->ind_instance < dp->ind_instance) { /* end of list */ in in_hashdrv()
1357 dp->ind_next = NULL; in in_hashdrv()
1358 mp->ind_next = dp; in in_hashdrv()
1360 dp->ind_next = pp->ind_next; in in_hashdrv()
1361 pp->ind_next = dp; in in_hashdrv()
1371 in_drv_t *dp; in in_removedrv() local
1382 for (dp = prevp->ind_next; dp; dp = dp->ind_next) { in in_removedrv()
1383 if (dp == mp) { /* found it */ in in_removedrv()
1386 prevp = dp; in in_removedrv()
1389 ASSERT(dp == mp); in in_removedrv()
1423 in_drv_t *dp = np->in_drivers; in in_drvwalk() local
1424 while (dp) { in in_drvwalk()
1425 if ((name = i_binding_to_drv_name(dp->ind_driver_name)) in in_drvwalk()
1427 name = dp->ind_driver_name; in in_drvwalk()
1432 dp = dp->ind_next_drv; in in_drvwalk()
1434 return (dp); in in_drvwalk()
1520 in_drv_t *dp; in in_walk_instances() local
1533 for (dp = np->in_drivers; dp; dp = dp->ind_next_drv) { in in_walk_instances()
1534 if (dp->ind_state == IN_PERMANENT) { in in_walk_instances()
1535 rval = (*f)(path, np, dp, arg); in in_walk_instances()