Lines Matching refs:vh
274 mdi_vhci_t *vh, int flags, int op);
383 mdi_vhci_t *vh = NULL; in mdi_vhci_register() local
409 for (vh = mdi_vhci_head; vh != NULL; vh = vh->vh_next) { in mdi_vhci_register()
410 if (strcmp(vh->vh_class, class) == 0) { in mdi_vhci_register()
416 if (vh->vh_ops != NULL) { in mdi_vhci_register()
428 if (vh == NULL) { in mdi_vhci_register()
435 vh = kmem_zalloc(sizeof (mdi_vhci_t), KM_SLEEP); in mdi_vhci_register()
438 vh->vh_client_table = hash; in mdi_vhci_register()
439 vh->vh_class = kmem_zalloc(strlen(class) + 1, KM_SLEEP); in mdi_vhci_register()
440 (void) strcpy(vh->vh_class, class); in mdi_vhci_register()
441 vh->vh_lb = LOAD_BALANCE_RR; in mdi_vhci_register()
445 vh->vh_lb = LOAD_BALANCE_NONE; in mdi_vhci_register()
448 vh->vh_lb = LOAD_BALANCE_LBA; in mdi_vhci_register()
453 mutex_init(&vh->vh_phci_mutex, NULL, MUTEX_DEFAULT, NULL); in mdi_vhci_register()
454 mutex_init(&vh->vh_client_mutex, NULL, MUTEX_DEFAULT, NULL); in mdi_vhci_register()
459 vh->vh_dip = vdip; in mdi_vhci_register()
460 vh->vh_ops = vops; in mdi_vhci_register()
462 setup_vhci_cache(vh); in mdi_vhci_register()
465 mdi_vhci_head = vh; in mdi_vhci_register()
468 mdi_vhci_tail->vh_next = vh; in mdi_vhci_register()
470 mdi_vhci_tail = vh; in mdi_vhci_register()
482 DEVI(vdip)->devi_mdi_xhci = (caddr_t)vh; in mdi_vhci_register()
500 mdi_vhci_t *found, *vh, *prev = NULL; in mdi_vhci_unregister() local
507 if ((vh = i_devi_get_vhci(vdip)) == NULL) in mdi_vhci_unregister()
515 if (found == vh) in mdi_vhci_unregister()
530 MDI_VHCI_PHCI_LOCK(vh); in mdi_vhci_unregister()
531 if (vh->vh_refcnt || vh->vh_phci_count || vh->vh_client_count) { in mdi_vhci_unregister()
532 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_vhci_unregister()
536 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_vhci_unregister()
538 if (destroy_vhci_cache(vh) != MDI_SUCCESS) { in mdi_vhci_unregister()
546 if (vh == mdi_vhci_head) { in mdi_vhci_unregister()
547 mdi_vhci_head = vh->vh_next; in mdi_vhci_unregister()
549 prev->vh_next = vh->vh_next; in mdi_vhci_unregister()
551 if (vh == mdi_vhci_tail) { in mdi_vhci_unregister()
557 vh->vh_ops = NULL; in mdi_vhci_unregister()
560 kmem_free(vh->vh_class, strlen(vh->vh_class)+1); in mdi_vhci_unregister()
561 kmem_free(vh->vh_client_table, in mdi_vhci_unregister()
563 mutex_destroy(&vh->vh_phci_mutex); in mdi_vhci_unregister()
564 mutex_destroy(&vh->vh_client_mutex); in mdi_vhci_unregister()
566 kmem_free(vh, sizeof (mdi_vhci_t)); in mdi_vhci_unregister()
580 mdi_vhci_t *vh = NULL; in i_mdi_vhci_class2vhci() local
585 for (vh = mdi_vhci_head; vh != NULL; vh = vh->vh_next) { in i_mdi_vhci_class2vhci()
586 if (strcmp(vh->vh_class, class) == 0) { in i_mdi_vhci_class2vhci()
591 return (vh); in i_mdi_vhci_class2vhci()
604 mdi_vhci_t *vh = NULL; in i_devi_get_vhci() local
606 vh = (mdi_vhci_t *)DEVI(vdip)->devi_mdi_xhci; in i_devi_get_vhci()
608 return (vh); in i_devi_get_vhci()
627 mdi_vhci_t *vh; in mdi_phci_register() local
660 vh = (mdi_vhci_t *)i_mdi_vhci_class2vhci(class); in mdi_phci_register()
661 if (vh == NULL) { in mdi_phci_register()
668 ph->ph_vhci = vh; in mdi_phci_register()
680 vhcache_phci_add(vh->vh_config, ph); in mdi_phci_register()
682 MDI_VHCI_PHCI_LOCK(vh); in mdi_phci_register()
683 if (vh->vh_phci_head == NULL) { in mdi_phci_register()
684 vh->vh_phci_head = ph; in mdi_phci_register()
686 if (vh->vh_phci_tail) { in mdi_phci_register()
687 vh->vh_phci_tail->ph_next = ph; in mdi_phci_register()
689 vh->vh_phci_tail = ph; in mdi_phci_register()
690 vh->vh_phci_count++; in mdi_phci_register()
691 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_phci_register()
711 mdi_vhci_t *vh; in mdi_phci_unregister() local
725 vh = ph->ph_vhci; in mdi_phci_unregister()
726 ASSERT(vh != NULL); in mdi_phci_unregister()
727 if (vh == NULL) { in mdi_phci_unregister()
732 MDI_VHCI_PHCI_LOCK(vh); in mdi_phci_unregister()
733 tmp = vh->vh_phci_head; in mdi_phci_unregister()
742 if (ph == vh->vh_phci_head) { in mdi_phci_unregister()
743 vh->vh_phci_head = ph->ph_next; in mdi_phci_unregister()
748 if (ph == vh->vh_phci_tail) { in mdi_phci_unregister()
749 vh->vh_phci_tail = prev; in mdi_phci_unregister()
752 vh->vh_phci_count--; in mdi_phci_unregister()
753 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_phci_unregister()
764 vhcache_phci_remove(vh->vh_config, ph); in mdi_phci_unregister()
958 mdi_vhci_t *vh; in mdi_devi_pdip_entered() local
961 vh = i_devi_get_vhci(vdip); in mdi_devi_pdip_entered()
962 if (vh == NULL) in mdi_devi_pdip_entered()
965 MDI_VHCI_PHCI_LOCK(vh); in mdi_devi_pdip_entered()
966 ph = vh->vh_phci_head; in mdi_devi_pdip_entered()
969 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_devi_pdip_entered()
974 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_devi_pdip_entered()
987 mdi_vhci_t *vh; in mdi_phci_path2devinfo() local
991 vh = i_devi_get_vhci(vdip); in mdi_phci_path2devinfo()
992 ASSERT(vh != NULL); in mdi_phci_path2devinfo()
994 if (vh == NULL) { in mdi_phci_path2devinfo()
1002 MDI_VHCI_PHCI_LOCK(vh); in mdi_phci_path2devinfo()
1003 ph = vh->vh_phci_head; in mdi_phci_path2devinfo()
1017 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_phci_path2devinfo()
1101 i_mdi_devinfo_create(mdi_vhci_t *vh, char *name, char *guid, in i_mdi_devinfo_create() argument
1106 ASSERT(MDI_VHCI_CLIENT_LOCKED(vh)); in i_mdi_devinfo_create()
1109 cdip = i_mdi_devinfo_find(vh, name, guid); in i_mdi_devinfo_create()
1117 ndi_devi_alloc_sleep(vh->vh_dip, name, DEVI_SID_NODEID, &cdip); in i_mdi_devinfo_create()
1155 i_mdi_devinfo_find(mdi_vhci_t *vh, caddr_t name, char *guid) in i_mdi_devinfo_find() argument
1162 ndi_devi_enter(vh->vh_dip, &circular); in i_mdi_devinfo_find()
1163 ndip = (dev_info_t *)DEVI(vh->vh_dip)->devi_child; in i_mdi_devinfo_find()
1184 ndi_devi_exit(vh->vh_dip, circular); in i_mdi_devinfo_find()
1325 i_mdi_client_alloc(mdi_vhci_t *vh, char *name, char *lguid) in i_mdi_client_alloc() argument
1329 ASSERT(MDI_VHCI_CLIENT_LOCKED(vh)); in i_mdi_client_alloc()
1339 ct->ct_vhci = vh; in i_mdi_client_alloc()
1359 ct->ct_lb = vh->vh_lb; in i_mdi_client_alloc()
1370 i_mdi_client_enlist_table(vh, ct); in i_mdi_client_alloc()
1380 i_mdi_client_enlist_table(mdi_vhci_t *vh, mdi_client_t *ct) in i_mdi_client_enlist_table() argument
1385 ASSERT(MDI_VHCI_CLIENT_LOCKED(vh)); in i_mdi_client_enlist_table()
1388 head = &vh->vh_client_table[index]; in i_mdi_client_enlist_table()
1392 vh->vh_client_count++; in i_mdi_client_enlist_table()
1401 i_mdi_client_delist_table(mdi_vhci_t *vh, mdi_client_t *ct) in i_mdi_client_delist_table() argument
1409 ASSERT(MDI_VHCI_CLIENT_LOCKED(vh)); in i_mdi_client_delist_table()
1413 head = &vh->vh_client_table[index]; in i_mdi_client_delist_table()
1433 vh->vh_client_count--; in i_mdi_client_delist_table()
1443 i_mdi_client_free(mdi_vhci_t *vh, mdi_client_t *ct) in i_mdi_client_free() argument
1450 ASSERT(MDI_VHCI_CLIENT_LOCKED(vh)); in i_mdi_client_free()
1452 vdip = vh->vh_dip; in i_mdi_client_free()
1467 i_mdi_client_delist_table(vh, ct); in i_mdi_client_free()
1482 MDI_VHCI_CLIENT_UNLOCK(vh); in i_mdi_client_free()
1484 MDI_VHCI_CLIENT_LOCK(vh); in i_mdi_client_free()
1495 i_mdi_client_find(mdi_vhci_t *vh, char *cname, char *guid) in i_mdi_client_find() argument
1501 ASSERT(MDI_VHCI_CLIENT_LOCKED(vh)); in i_mdi_client_find()
1504 head = &vh->vh_client_table[index]; in i_mdi_client_find()
1879 mdi_vhci_t *vh = ct->ct_vhci; in i_mdi_failover() local
1883 if (vh->vh_ops->vo_failover != NULL) { in i_mdi_failover()
1887 rv = (*vh->vh_ops->vo_failover)(vh->vh_dip, ct->ct_dip, in i_mdi_failover()
2642 mdi_vhci_t *vh; in mdi_pi_find() local
2660 vh = ph->ph_vhci; in mdi_pi_find()
2661 if (vh == NULL) { in mdi_pi_find()
2709 MDI_VHCI_CLIENT_LOCK(vh); in mdi_pi_find()
2715 ct = i_mdi_client_find(vh, NULL, caddr); in mdi_pi_find()
2721 MDI_VHCI_CLIENT_UNLOCK(vh); in mdi_pi_find()
2737 MDI_VHCI_CLIENT_UNLOCK(vh); in mdi_pi_find()
2781 mdi_vhci_t *vh; in mdi_pi_alloc_compatible() local
2819 vh = ph->ph_vhci; in mdi_pi_alloc_compatible()
2820 if (vh == NULL) { in mdi_pi_alloc_compatible()
2842 MDI_VHCI_CLIENT_LOCK(vh); in mdi_pi_alloc_compatible()
2843 ct = i_mdi_client_find(vh, cname, caddr); in mdi_pi_alloc_compatible()
2845 ct = i_mdi_client_alloc(vh, cname, caddr); in mdi_pi_alloc_compatible()
2853 ct->ct_dip = i_mdi_devinfo_create(vh, cname, caddr, in mdi_pi_alloc_compatible()
2856 (void) i_mdi_client_free(vh, ct); in mdi_pi_alloc_compatible()
2894 MDI_VHCI_CLIENT_UNLOCK(vh); in mdi_pi_alloc_compatible()
2908 vhcache_pi_add(vh->vh_config, MDI_PI(pip)); in mdi_pi_alloc_compatible()
3134 mdi_vhci_t *vh; in mdi_pi_free() local
3154 vh = ph->ph_vhci; in mdi_pi_free()
3155 ASSERT(vh != NULL); in mdi_pi_free()
3156 if (vh == NULL) { in mdi_pi_free()
3225 vhcache_pi_remove(vh->vh_config, MDI_PI(pip)); in mdi_pi_free()
3239 MDI_VHCI_CLIENT_LOCK(vh); in mdi_pi_free()
3244 f = vh->vh_ops->vo_pi_uninit; in mdi_pi_free()
3246 rv = (*f)(vh->vh_dip, pip, 0); in mdi_pi_free()
3268 MDI_VHCI_CLIENT_UNLOCK(vh); in mdi_pi_free()
3273 MDI_VHCI_CLIENT_UNLOCK(vh); in mdi_pi_free()
3276 vhcache_pi_add(vh->vh_config, MDI_PI(pip)); in mdi_pi_free()
3425 mdi_vhci_t *vh; in i_mdi_pi_state_change() local
3446 vh = ph->ph_vhci; in i_mdi_pi_state_change()
3447 ASSERT(vh); in i_mdi_pi_state_change()
3448 if (vh == NULL) { in i_mdi_pi_state_change()
3479 f = vh->vh_ops->vo_pi_init; in i_mdi_pi_state_change()
3481 rv = (*f)(vh->vh_dip, pip, 0); in i_mdi_pi_state_change()
3485 (void *)vh, mdi_pi_spathname(pip), in i_mdi_pi_state_change()
3600 f = vh->vh_ops->vo_pi_state_change; in i_mdi_pi_state_change()
3602 rv = (*f)(vh->vh_dip, pip, state, 0, flag); in i_mdi_pi_state_change()
3851 mdi_vhci_t *vh = NULL; in i_mdi_pi_offline() local
3884 vh = ct->ct_vhci; in i_mdi_pi_offline()
3885 vdip = vh->vh_dip; in i_mdi_pi_offline()
3890 ASSERT(vh->vh_ops); in i_mdi_pi_offline()
3891 f = vh->vh_ops->vo_pi_state_change; in i_mdi_pi_offline()
3981 mdi_vhci_t *vh = NULL; in i_mdi_pi_online() local
3989 vh = ph->ph_vhci; in i_mdi_pi_online()
3993 f = vh->vh_ops->vo_pi_state_change; in i_mdi_pi_online()
3995 rv = (*f)(vh->vh_dip, pip, MDI_PATHINFO_STATE_ONLINE, 0, in i_mdi_pi_online()
5698 mdi_vhci_t *vh; in mdi_post_attach() local
5759 vh = ct->ct_vhci; in mdi_post_attach()
5760 if (vh->vh_ops->vo_client_attached) in mdi_post_attach()
5761 (*vh->vh_ops->vo_client_attached)(dip); in mdi_post_attach()
6269 i_mdi_enable_disable_path(mdi_pathinfo_t *pip, mdi_vhci_t *vh, int flags, in i_mdi_enable_disable_path() argument
6290 f = vh->vh_ops->vo_pi_state_change; in i_mdi_enable_disable_path()
6299 rv = (*f)(vh->vh_dip, pip, 0, in i_mdi_enable_disable_path()
6304 MDI_DEBUG(2, (MDI_WARN, vh->vh_dip, in i_mdi_enable_disable_path()
6340 rv = (*f)(vh->vh_dip, pip, 0, in i_mdi_enable_disable_path()
6345 MDI_DEBUG(2, (MDI_WARN, vh->vh_dip, in i_mdi_enable_disable_path()
6362 mdi_vhci_t *vh = NULL; in i_mdi_pi_enable_disable() local
6383 vh = ph->ph_vhci; in i_mdi_pi_enable_disable()
6426 pip = i_mdi_enable_disable_path(pip, vh, flags, op); in i_mdi_pi_enable_disable()
6464 (void) i_mdi_enable_disable_path(pip, vh, flags, op); in i_mdi_pi_enable_disable()
7475 setup_vhci_cache(mdi_vhci_t *vh) in setup_vhci_cache() argument
7483 vh->vh_config = vhc; in setup_vhci_cache()
7486 vhc->vhc_vhcache_filename = vhclass2vhcache_filename(vh->vh_class); in setup_vhci_cache()
7497 vhcache->vhcache_client_hash = mod_hash_create_extended(vh->vh_class, in setup_vhci_cache()
7507 if (strcmp(vhci_class_list[i], vh->vh_class) == 0) { in setup_vhci_cache()
7519 nvl = read_on_disk_vhci_cache(vh->vh_class); in setup_vhci_cache()
7545 destroy_vhci_cache(mdi_vhci_t *vh) in destroy_vhci_cache() argument
7547 mdi_vhci_config_t *vhc = vh->vh_config; in destroy_vhci_cache()
9166 build_vhci_cache(mdi_vhci_t *vh) in build_vhci_cache() argument
9168 mdi_vhci_config_t *vhc = vh->vh_config; in build_vhci_cache()
9181 attach_phci_drivers(vh->vh_class); in build_vhci_cache()
9237 vhcache_discover_paths(mdi_vhci_t *vh) in vhcache_discover_paths() argument
9239 mdi_vhci_config_t *vhc = vh->vh_config; in vhcache_discover_paths()
9246 attach_phci_drivers(vh->vh_class); in vhcache_discover_paths()
9290 mdi_vhci_t *vh = i_devi_get_vhci(vdip); in mdi_vhci_bus_config() local
9291 mdi_vhci_config_t *vhc = vh->vh_config; in mdi_vhci_bus_config()
9315 rv = build_vhci_cache(vh); in mdi_vhci_bus_config()
9368 if (vhcache_discover_paths(vh) && in mdi_vhci_bus_config()
9478 mdi_vhci_t *vh; in mdi_clean_vhcache() local
9481 for (vh = mdi_vhci_head; vh != NULL; vh = vh->vh_next) { in mdi_clean_vhcache()
9482 vh->vh_refcnt++; in mdi_clean_vhcache()
9484 clean_vhcache(vh->vh_config); in mdi_clean_vhcache()
9486 vh->vh_refcnt--; in mdi_clean_vhcache()
9502 mdi_vhci_t *vh = i_devi_get_vhci(vdip); in mdi_vhci_walk_clients() local
9506 MDI_VHCI_CLIENT_LOCK(vh); in mdi_vhci_walk_clients()
9519 MDI_VHCI_CLIENT_UNLOCK(vh); in mdi_vhci_walk_clients()
9530 mdi_vhci_t *vh = i_devi_get_vhci(vdip); in mdi_vhci_walk_phcis() local
9533 MDI_VHCI_PHCI_LOCK(vh); in mdi_vhci_walk_phcis()
9534 ph = vh->vh_phci_head; in mdi_vhci_walk_phcis()
9546 MDI_VHCI_PHCI_UNLOCK(vh); in mdi_vhci_walk_phcis()
9557 mdi_vhci_t *vh = NULL; in mdi_walk_vhcis() local
9563 for (vh = mdi_vhci_head; vh != NULL; vh = vh->vh_next) { in mdi_walk_vhcis()
9564 vh->vh_refcnt++; in mdi_walk_vhcis()
9566 if (((*f)(vh->vh_dip, arg)) != DDI_WALK_CONTINUE) { in mdi_walk_vhcis()
9568 vh->vh_refcnt--; in mdi_walk_vhcis()
9572 vh->vh_refcnt--; in mdi_walk_vhcis()
9683 mdi_vhci_t *vh; in mdi_is_dev_supported() local
9698 vh = (mdi_vhci_t *)i_mdi_vhci_class2vhci(class); in mdi_is_dev_supported()
9699 if ((vh == NULL) || (vh->vh_ops->vo_is_dev_supported == NULL)) { in mdi_is_dev_supported()
9704 return (vh->vh_ops->vo_is_dev_supported(vh->vh_dip, pdip, cinfo)); in mdi_is_dev_supported()