Lines Matching refs:pip
273 static mdi_pathinfo_t *i_mdi_enable_disable_path(mdi_pathinfo_t *pip,
715 mdi_pathinfo_t *pip; in mdi_phci_unregister() local
757 for (pip = (mdi_pathinfo_t *)ph->ph_path_head; pip; in mdi_phci_unregister()
758 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link) in mdi_phci_unregister()
759 MDI_PI(pip)->pi_phci = NULL; in mdi_phci_unregister()
1053 i_mdi_phci_lock(mdi_phci_t *ph, mdi_pathinfo_t *pip) in i_mdi_phci_lock() argument
1055 if (pip) { in i_mdi_phci_lock()
1059 MDI_PI_HOLD(pip); in i_mdi_phci_lock()
1060 MDI_PI_UNLOCK(pip); in i_mdi_phci_lock()
1062 MDI_PI_LOCK(pip); in i_mdi_phci_lock()
1063 MDI_PI_RELE(pip); in i_mdi_phci_lock()
1070 MDI_PI_HOLD(pip); in i_mdi_phci_lock()
1071 MDI_PI_UNLOCK(pip); in i_mdi_phci_lock()
1073 MDI_PI_LOCK(pip); in i_mdi_phci_lock()
1074 MDI_PI_RELE(pip); in i_mdi_phci_lock()
1275 i_mdi_client_lock(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_client_lock() argument
1277 if (pip) { in i_mdi_client_lock()
1283 MDI_PI_HOLD(pip); in i_mdi_client_lock()
1284 MDI_PI_UNLOCK(pip); in i_mdi_client_lock()
1286 MDI_PI_LOCK(pip); in i_mdi_client_lock()
1287 MDI_PI_RELE(pip); in i_mdi_client_lock()
1294 MDI_PI_HOLD(pip); in i_mdi_client_lock()
1295 MDI_PI_UNLOCK(pip); in i_mdi_client_lock()
1297 MDI_PI_LOCK(pip); in i_mdi_client_lock()
1298 MDI_PI_RELE(pip); in i_mdi_client_lock()
1556 mdi_pathinfo_t *pip, *next; in i_mdi_client_compute_state() local
1559 pip = ct->ct_path_head; in i_mdi_client_compute_state()
1560 while (pip != NULL) { in i_mdi_client_compute_state()
1561 MDI_PI_LOCK(pip); in i_mdi_client_compute_state()
1562 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_client_compute_state()
1563 if (MDI_PI(pip)->pi_phci == ph) { in i_mdi_client_compute_state()
1564 MDI_PI_UNLOCK(pip); in i_mdi_client_compute_state()
1565 pip = next; in i_mdi_client_compute_state()
1569 if ((MDI_PI(pip)->pi_state & MDI_PATHINFO_STATE_MASK) in i_mdi_client_compute_state()
1572 else if ((MDI_PI(pip)->pi_state & MDI_PATHINFO_STATE_MASK) in i_mdi_client_compute_state()
1575 MDI_PI_UNLOCK(pip); in i_mdi_client_compute_state()
1576 pip = next; in i_mdi_client_compute_state()
1927 mdi_pathinfo_t *pip; in i_mdi_lba_lb() local
1931 pip = ct->ct_path_head; in i_mdi_lba_lb()
1932 while (pip) { in i_mdi_lba_lb()
1933 MDI_PI_LOCK(pip); in i_mdi_lba_lb()
1934 if (MDI_PI(pip)->pi_state == in i_mdi_lba_lb()
1935 MDI_PATHINFO_STATE_ONLINE && MDI_PI(pip)->pi_preferred) { in i_mdi_lba_lb()
1937 } else if (MDI_PI(pip)->pi_state == in i_mdi_lba_lb()
1938 MDI_PATHINFO_STATE_ONLINE && !MDI_PI(pip)->pi_preferred) { in i_mdi_lba_lb()
1942 MDI_PI(pip)->pi_client_link; in i_mdi_lba_lb()
1943 MDI_PI_UNLOCK(pip); in i_mdi_lba_lb()
1944 pip = next; in i_mdi_lba_lb()
1958 pip = ct->ct_path_head; in i_mdi_lba_lb()
1959 while (pip && path_index != -1) { in i_mdi_lba_lb()
1960 MDI_PI_LOCK(pip); in i_mdi_lba_lb()
1962 (MDI_PI(pip)->pi_state == in i_mdi_lba_lb()
1964 MDI_PI(pip)->pi_preferred == preferred) { in i_mdi_lba_lb()
1965 MDI_PI_HOLD(pip); in i_mdi_lba_lb()
1966 MDI_PI_UNLOCK(pip); in i_mdi_lba_lb()
1967 *ret_pip = pip; in i_mdi_lba_lb()
1972 MDI_PI(pip)->pi_client_link; in i_mdi_lba_lb()
1973 MDI_PI_UNLOCK(pip); in i_mdi_lba_lb()
1974 pip = next; in i_mdi_lba_lb()
1978 bp->b_lblkno, mdi_pi_spathname(pip), (void *)pip)); in i_mdi_lba_lb()
2045 mdi_pathinfo_t *pip; in mdi_select_path() local
2132 for (pip = head; in mdi_select_path()
2133 pip && (mdi_pi_get_path_instance(pip) != path_instance); in mdi_select_path()
2134 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link) in mdi_select_path()
2138 if (pip == NULL) { in mdi_select_path()
2153 MDI_PI_LOCK(pip); in mdi_select_path()
2154 if ((MDI_PI(pip)->pi_state == MDI_PATHINFO_STATE_INIT) || in mdi_select_path()
2155 (MDI_PI(pip)->pi_phci == NULL)) { in mdi_select_path()
2156 MDI_PI_UNLOCK(pip); in mdi_select_path()
2162 if (MDI_PI_IS_TRANSIENT(pip)) { in mdi_select_path()
2163 MDI_PI_UNLOCK(pip); in mdi_select_path()
2172 MDI_PI_HOLD(pip); in mdi_select_path()
2173 MDI_PI_UNLOCK(pip); in mdi_select_path()
2174 *ret_pip = pip; in mdi_select_path()
2195 pip = (mdi_pathinfo_t *)ct->ct_path_last; in mdi_select_path()
2196 if (pip == NULL) { in mdi_select_path()
2197 pip = head; in mdi_select_path()
2199 start = pip; in mdi_select_path()
2201 MDI_PI_LOCK(pip); in mdi_select_path()
2207 if ((MDI_PI(pip)->pi_state == in mdi_select_path()
2209 preferred == MDI_PI(pip)->pi_preferred) { in mdi_select_path()
2214 MDI_PI_HOLD(pip); in mdi_select_path()
2215 MDI_PI_UNLOCK(pip); in mdi_select_path()
2216 ct->ct_path_last = pip; in mdi_select_path()
2217 *ret_pip = pip; in mdi_select_path()
2225 if (MDI_PI_IS_DRV_DISABLE_TRANSIENT(pip) || in mdi_select_path()
2226 MDI_PI_IS_TRANSIENT(pip)) in mdi_select_path()
2231 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_select_path()
2235 MDI_PI_UNLOCK(pip); in mdi_select_path()
2236 pip = next; in mdi_select_path()
2237 if (start == pip && preferred) { in mdi_select_path()
2239 } else if (start == pip && !preferred) { in mdi_select_path()
2281 pip = head; in mdi_select_path()
2283 pip = (mdi_pathinfo_t *)MDI_PI(start)->pi_client_link; in mdi_select_path()
2284 if (pip == NULL) { in mdi_select_path()
2313 pip = head; in mdi_select_path()
2316 start = pip; in mdi_select_path()
2318 MDI_PI_LOCK(pip); in mdi_select_path()
2320 cond = ((MDI_PI(pip)->pi_state == in mdi_select_path()
2322 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2326 cond = ((MDI_PI(pip)->pi_state == in mdi_select_path()
2328 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2331 cond = ((MDI_PI(pip)->pi_state == in mdi_select_path()
2333 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2337 cond = (((MDI_PI(pip)->pi_state == in mdi_select_path()
2339 (MDI_PI(pip)->pi_state == in mdi_select_path()
2341 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2347 cond = (((MDI_PI(pip)->pi_state == in mdi_select_path()
2349 (MDI_PI(pip)->pi_state == in mdi_select_path()
2351 (MDI_PI(pip)->pi_state == in mdi_select_path()
2354 (MDI_PI(pip)->pi_state == in mdi_select_path()
2357 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2363 cond = (((MDI_PI(pip)->pi_state == in mdi_select_path()
2365 (MDI_PI(pip)->pi_state == in mdi_select_path()
2382 MDI_PI_HOLD(pip); in mdi_select_path()
2383 MDI_PI_UNLOCK(pip); in mdi_select_path()
2385 ct->ct_path_last = pip; in mdi_select_path()
2386 *ret_pip = pip; in mdi_select_path()
2393 if (MDI_PI_IS_DRV_DISABLE_TRANSIENT(pip) || in mdi_select_path()
2394 MDI_PI_IS_TRANSIENT(pip)) in mdi_select_path()
2401 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_select_path()
2407 MDI_PI_UNLOCK(pip); in mdi_select_path()
2436 MDI_PI_UNLOCK(pip); in mdi_select_path()
2440 pip = next; in mdi_select_path()
2459 if ((start_pip != NULL) && (start_pip == pip) && in mdi_select_path()
2466 MDI_PI_LOCK(pip); in mdi_select_path()
2473 if (start == pip && preferred) { in mdi_select_path()
2476 } else if (start == pip && !preferred) { in mdi_select_path()
2514 mdi_get_next_phci_path(dev_info_t *ct_dip, mdi_pathinfo_t *pip) in mdi_get_next_phci_path() argument
2527 if (pip == NULL) in mdi_get_next_phci_path()
2530 return ((mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link); in mdi_get_next_phci_path()
2538 mdi_get_next_client_path(dev_info_t *ph_dip, mdi_pathinfo_t *pip) in mdi_get_next_client_path() argument
2551 if (pip == NULL) in mdi_get_next_client_path()
2554 return ((mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link); in mdi_get_next_client_path()
2564 mdi_hold_path(mdi_pathinfo_t *pip) in mdi_hold_path() argument
2566 if (pip) { in mdi_hold_path()
2567 MDI_PI_LOCK(pip); in mdi_hold_path()
2568 MDI_PI_HOLD(pip); in mdi_hold_path()
2569 MDI_PI_UNLOCK(pip); in mdi_hold_path()
2583 mdi_rele_path(mdi_pathinfo_t *pip) in mdi_rele_path() argument
2585 if (pip) { in mdi_rele_path()
2586 MDI_PI_LOCK(pip); in mdi_rele_path()
2587 MDI_PI_RELE(pip); in mdi_rele_path()
2588 if (MDI_PI(pip)->pi_ref_cnt == 0) { in mdi_rele_path()
2589 cv_broadcast(&MDI_PI(pip)->pi_ref_cv); in mdi_rele_path()
2591 MDI_PI_UNLOCK(pip); in mdi_rele_path()
2602 mdi_pi_lock(mdi_pathinfo_t *pip) in mdi_pi_lock() argument
2604 ASSERT(pip != NULL); in mdi_pi_lock()
2605 if (pip) { in mdi_pi_lock()
2606 MDI_PI_LOCK(pip); in mdi_pi_lock()
2618 mdi_pi_unlock(mdi_pathinfo_t *pip) in mdi_pi_unlock() argument
2620 ASSERT(pip != NULL); in mdi_pi_unlock()
2621 if (pip) { in mdi_pi_unlock()
2622 MDI_PI_UNLOCK(pip); in mdi_pi_unlock()
2644 mdi_pathinfo_t *pip = NULL; in mdi_pi_find() local
2684 pip = (mdi_pathinfo_t *)ph->ph_path_head; in mdi_pi_find()
2686 while (pip != NULL) { in mdi_pi_find()
2687 if (strcmp(MDI_PI(pip)->pi_addr, paddr) == 0) { in mdi_pi_find()
2690 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_pi_find()
2694 "found %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_find()
2695 return (pip); in mdi_pi_find()
2739 pip = (mdi_pathinfo_t *)ct->ct_path_head; in mdi_pi_find()
2740 while (pip != NULL) { in mdi_pi_find()
2744 if ((MDI_PI(pip)->pi_phci == ph) && in mdi_pi_find()
2745 strcmp(MDI_PI(pip)->pi_addr, paddr) == 0) { in mdi_pi_find()
2748 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_pi_find()
2752 "found: %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_find()
2753 return (pip); in mdi_pi_find()
2784 mdi_pathinfo_t *pip = NULL; in mdi_pi_alloc_compatible() local
2866 pip = (mdi_pathinfo_t *)ct->ct_path_head; in mdi_pi_alloc_compatible()
2867 while (pip != NULL) { in mdi_pi_alloc_compatible()
2871 if ((MDI_PI(pip)->pi_phci == ph) && in mdi_pi_alloc_compatible()
2872 strcmp(MDI_PI(pip)->pi_addr, paddr) == 0) { in mdi_pi_alloc_compatible()
2875 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_pi_alloc_compatible()
2879 if (pip == NULL) { in mdi_pi_alloc_compatible()
2884 pip = i_mdi_pi_alloc(ph, paddr, ct); in mdi_pi_alloc_compatible()
2885 ASSERT(pip != NULL); in mdi_pi_alloc_compatible()
2902 *ret_pip = pip; in mdi_pi_alloc_compatible()
2905 "alloc %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_alloc_compatible()
2908 vhcache_pi_add(vh->vh_config, MDI_PI(pip)); in mdi_pi_alloc_compatible()
2932 mdi_pathinfo_t *pip; in i_mdi_pi_alloc() local
2942 pip = kmem_zalloc(sizeof (struct mdi_pathinfo), KM_SLEEP); in i_mdi_pi_alloc()
2943 mutex_init(&MDI_PI(pip)->pi_mutex, NULL, MUTEX_DEFAULT, NULL); in i_mdi_pi_alloc()
2944 MDI_PI(pip)->pi_state = MDI_PATHINFO_STATE_INIT | in i_mdi_pi_alloc()
2948 MDI_PI_SET_USER_DISABLE(pip); in i_mdi_pi_alloc()
2951 MDI_PI_SET_DRV_DISABLE_TRANS(pip); in i_mdi_pi_alloc()
2954 MDI_PI_SET_DRV_DISABLE(pip); in i_mdi_pi_alloc()
2956 MDI_PI(pip)->pi_old_state = MDI_PATHINFO_STATE_INIT; in i_mdi_pi_alloc()
2957 cv_init(&MDI_PI(pip)->pi_state_cv, NULL, CV_DEFAULT, NULL); in i_mdi_pi_alloc()
2958 MDI_PI(pip)->pi_client = ct; in i_mdi_pi_alloc()
2959 MDI_PI(pip)->pi_phci = ph; in i_mdi_pi_alloc()
2960 MDI_PI(pip)->pi_addr = kmem_alloc(strlen(paddr) + 1, KM_SLEEP); in i_mdi_pi_alloc()
2961 (void) strcpy(MDI_PI(pip)->pi_addr, paddr); in i_mdi_pi_alloc()
2975 mdi_pi_get_node_name(pip), mdi_pi_get_addr(pip)); in i_mdi_pi_alloc()
2992 mdi_pi_get_node_name(pip), mdi_pi_get_addr(pip)); in i_mdi_pi_alloc()
2999 MDI_PI(pip)->pi_path_instance = path_instance; in i_mdi_pi_alloc()
3001 (void) nvlist_alloc(&MDI_PI(pip)->pi_prop, NV_UNIQUE_NAME, KM_SLEEP); in i_mdi_pi_alloc()
3002 ASSERT(MDI_PI(pip)->pi_prop != NULL); in i_mdi_pi_alloc()
3003 MDI_PI(pip)->pi_pprivate = NULL; in i_mdi_pi_alloc()
3004 MDI_PI(pip)->pi_cprivate = NULL; in i_mdi_pi_alloc()
3005 MDI_PI(pip)->pi_vprivate = NULL; in i_mdi_pi_alloc()
3006 MDI_PI(pip)->pi_client_link = NULL; in i_mdi_pi_alloc()
3007 MDI_PI(pip)->pi_phci_link = NULL; in i_mdi_pi_alloc()
3008 MDI_PI(pip)->pi_ref_cnt = 0; in i_mdi_pi_alloc()
3009 MDI_PI(pip)->pi_kstats = NULL; in i_mdi_pi_alloc()
3010 MDI_PI(pip)->pi_preferred = 1; in i_mdi_pi_alloc()
3011 cv_init(&MDI_PI(pip)->pi_ref_cv, NULL, CV_DEFAULT, NULL); in i_mdi_pi_alloc()
3024 i_mdi_phci_add_path(ph, pip); in i_mdi_pi_alloc()
3025 i_mdi_client_add_path(ct, pip); in i_mdi_pi_alloc()
3030 return (pip); in i_mdi_pi_alloc()
3085 i_mdi_phci_add_path(mdi_phci_t *ph, mdi_pathinfo_t *pip) in i_mdi_phci_add_path() argument
3091 ph->ph_path_head = pip; in i_mdi_phci_add_path()
3093 MDI_PI(ph->ph_path_tail)->pi_phci_link = MDI_PI(pip); in i_mdi_phci_add_path()
3095 ph->ph_path_tail = pip; in i_mdi_phci_add_path()
3105 i_mdi_client_add_path(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_client_add_path() argument
3111 ct->ct_path_head = pip; in i_mdi_client_add_path()
3113 MDI_PI(ct->ct_path_tail)->pi_client_link = MDI_PI(pip); in i_mdi_client_add_path()
3115 ct->ct_path_tail = pip; in i_mdi_client_add_path()
3131 mdi_pi_free(mdi_pathinfo_t *pip, int flags) in mdi_pi_free() argument
3140 MDI_PI_LOCK(pip); in mdi_pi_free()
3141 ph = MDI_PI(pip)->pi_phci; in mdi_pi_free()
3149 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3150 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3160 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3161 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3165 ct = MDI_PI(pip)->pi_client; in mdi_pi_free()
3173 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3174 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3183 if (!(MDI_PI_IS_OFFLINE(pip) || MDI_PI_IS_INIT(pip) || in mdi_pi_free()
3184 MDI_PI_IS_INITING(pip))) { in mdi_pi_free()
3189 "!busy: pip %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3190 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3194 while (MDI_PI(pip)->pi_ref_cnt != 0) { in mdi_pi_free()
3200 MDI_PI(pip)->pi_ref_cnt, in mdi_pi_free()
3201 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3202 if (cv_reltimedwait(&MDI_PI(pip)->pi_ref_cv, in mdi_pi_free()
3203 &MDI_PI(pip)->pi_mutex, drv_usectohz(60 * 1000000), in mdi_pi_free()
3211 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3214 MDI_PI(pip)->pi_ref_cnt, in mdi_pi_free()
3215 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3216 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3220 if (MDI_PI(pip)->pi_pm_held) { in mdi_pi_free()
3223 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3225 vhcache_pi_remove(vh->vh_config, MDI_PI(pip)); in mdi_pi_free()
3243 if (!MDI_PI_IS_INITING(pip)) { in mdi_pi_free()
3246 rv = (*f)(vh->vh_dip, pip, 0); in mdi_pi_free()
3260 i_mdi_pi_free(ph, pip, ct); in mdi_pi_free()
3276 vhcache_pi_add(vh->vh_config, MDI_PI(pip)); in mdi_pi_free()
3286 i_mdi_pi_free(mdi_phci_t *ph, mdi_pathinfo_t *pip, mdi_client_t *ct) in i_mdi_pi_free() argument
3296 i_mdi_pi_kstat_destroy(pip); in i_mdi_pi_free()
3302 i_mdi_client_remove_path(ct, pip); in i_mdi_pi_free()
3303 i_mdi_phci_remove_path(ph, pip); in i_mdi_pi_free()
3308 mutex_destroy(&MDI_PI(pip)->pi_mutex); in i_mdi_pi_free()
3309 cv_destroy(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_free()
3310 cv_destroy(&MDI_PI(pip)->pi_ref_cv); in i_mdi_pi_free()
3311 if (MDI_PI(pip)->pi_addr) { in i_mdi_pi_free()
3312 kmem_free(MDI_PI(pip)->pi_addr, in i_mdi_pi_free()
3313 strlen(MDI_PI(pip)->pi_addr) + 1); in i_mdi_pi_free()
3314 MDI_PI(pip)->pi_addr = NULL; in i_mdi_pi_free()
3317 if (MDI_PI(pip)->pi_prop) { in i_mdi_pi_free()
3318 (void) nvlist_free(MDI_PI(pip)->pi_prop); in i_mdi_pi_free()
3319 MDI_PI(pip)->pi_prop = NULL; in i_mdi_pi_free()
3321 kmem_free(pip, sizeof (struct mdi_pathinfo)); in i_mdi_pi_free()
3332 i_mdi_phci_remove_path(mdi_phci_t *ph, mdi_pathinfo_t *pip) in i_mdi_phci_remove_path() argument
3342 if (path == pip) { in i_mdi_phci_remove_path()
3365 MDI_PI(pip)->pi_phci_link = NULL; in i_mdi_phci_remove_path()
3366 MDI_PI(pip)->pi_phci = NULL; in i_mdi_phci_remove_path()
3375 i_mdi_client_remove_path(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_client_remove_path() argument
3385 if (path == pip) { in i_mdi_client_remove_path()
3408 MDI_PI(pip)->pi_client_link = NULL; in i_mdi_client_remove_path()
3409 MDI_PI(pip)->pi_client = NULL; in i_mdi_client_remove_path()
3422 i_mdi_pi_state_change(mdi_pathinfo_t *pip, mdi_pathinfo_state_t state, int flag) in i_mdi_pi_state_change() argument
3431 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3433 ph = MDI_PI(pip)->pi_phci; in i_mdi_pi_state_change()
3439 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3442 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_state_change()
3452 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3455 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_state_change()
3459 ct = MDI_PI(pip)->pi_client; in i_mdi_pi_state_change()
3465 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3468 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_state_change()
3477 if (MDI_PI_IS_INITING(pip)) { in i_mdi_pi_state_change()
3478 MDI_PI_UNLOCK(pip); 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()
3486 (void *)pip)); in i_mdi_pi_state_change()
3490 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3491 MDI_PI_CLEAR_TRANSIENT(pip); in i_mdi_pi_state_change()
3498 i_mdi_phci_lock(ph, pip); in i_mdi_pi_state_change()
3502 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3514 if (MDI_PI_IS_TRANSIENT(pip)) { in i_mdi_pi_state_change()
3515 while (MDI_PI_IS_TRANSIENT(pip)) { in i_mdi_pi_state_change()
3516 cv_wait(&MDI_PI(pip)->pi_state_cv, in i_mdi_pi_state_change()
3517 &MDI_PI(pip)->pi_mutex); in i_mdi_pi_state_change()
3525 i_mdi_client_lock(ct, pip); in i_mdi_pi_state_change()
3526 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3537 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3540 MDI_PI_SET_ONLINING(pip); in i_mdi_pi_state_change()
3544 MDI_PI_SET_STANDBYING(pip); in i_mdi_pi_state_change()
3551 MDI_PI_SET_FAULTING(pip); in i_mdi_pi_state_change()
3552 MDI_PI_ERRSTAT(pip, MDI_PI_HARDERR); in i_mdi_pi_state_change()
3559 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3568 MDI_PI_IS_ONLINE(pip) && in i_mdi_pi_state_change()
3592 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3593 MDI_PI_SET_OFFLINING(pip); in i_mdi_pi_state_change()
3596 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3602 rv = (*f)(vh->vh_dip, pip, state, 0, flag); in i_mdi_pi_state_change()
3605 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3613 if (MDI_PI_IS_TRANSIENT(pip)) { in i_mdi_pi_state_change()
3615 MDI_PI_CLEAR_TRANSIENT(pip); in i_mdi_pi_state_change()
3617 MDI_PI(pip)->pi_state = MDI_PI_OLD_STATE(pip); in i_mdi_pi_state_change()
3624 cv_broadcast(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_state_change()
3625 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3702 i_mdi_report_path_state(ct, pip); in i_mdi_pi_state_change()
3736 mdi_pi_online(mdi_pathinfo_t *pip, int flags) in mdi_pi_online() argument
3738 mdi_client_t *ct = MDI_PI(pip)->pi_client; in mdi_pi_online()
3743 rv = i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_ONLINE, flags); in mdi_pi_online()
3747 MDI_PI_LOCK(pip); in mdi_pi_online()
3748 if (MDI_PI(pip)->pi_pm_held == 0) { in mdi_pi_online()
3750 "i_mdi_pm_hold_pip %p", (void *)pip)); in mdi_pi_online()
3751 i_mdi_pm_hold_pip(pip); in mdi_pi_online()
3754 MDI_PI_UNLOCK(pip); in mdi_pi_online()
3780 mdi_pi_standby(mdi_pathinfo_t *pip, int flags) in mdi_pi_standby() argument
3782 return (i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_STANDBY, flags)); in mdi_pi_standby()
3793 mdi_pi_fault(mdi_pathinfo_t *pip, int flags) in mdi_pi_fault() argument
3795 return (i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_FAULT, flags)); in mdi_pi_fault()
3806 mdi_pi_offline(mdi_pathinfo_t *pip, int flags) in mdi_pi_offline() argument
3821 ret = i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_OFFLINE, flags); in mdi_pi_offline()
3824 MDI_PI_LOCK(pip); in mdi_pi_offline()
3825 if (MDI_PI(pip)->pi_pm_held) { in mdi_pi_offline()
3828 MDI_PI_UNLOCK(pip); in mdi_pi_offline()
3831 ct = MDI_PI(pip)->pi_client; in mdi_pi_offline()
3848 i_mdi_pi_offline(mdi_pathinfo_t *pip, int flags) in i_mdi_pi_offline() argument
3856 MDI_PI_LOCK(pip); in i_mdi_pi_offline()
3857 ct = MDI_PI(pip)->pi_client; in i_mdi_pi_offline()
3860 while (MDI_PI(pip)->pi_ref_cnt != 0) { in i_mdi_pi_offline()
3866 MDI_PI(pip)->pi_ref_cnt, mdi_pi_spathname(pip), in i_mdi_pi_offline()
3867 (void *)pip)); in i_mdi_pi_offline()
3868 if (cv_reltimedwait(&MDI_PI(pip)->pi_ref_cv, in i_mdi_pi_offline()
3869 &MDI_PI(pip)->pi_mutex, drv_usectohz(60 * 1000000), in i_mdi_pi_offline()
3877 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_offline()
3880 MDI_PI(pip)->pi_ref_cnt, in i_mdi_pi_offline()
3881 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_offline()
3894 MDI_PI_UNLOCK(pip); in i_mdi_pi_offline()
3895 if ((rv = (*f)(vdip, pip, MDI_PATHINFO_STATE_OFFLINE, 0, in i_mdi_pi_offline()
3900 (void *)vdip, mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_offline()
3902 MDI_PI_LOCK(pip); in i_mdi_pi_offline()
3908 MDI_PI_SET_OFFLINE(pip); in i_mdi_pi_offline()
3909 cv_broadcast(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_offline()
3910 MDI_PI_UNLOCK(pip); in i_mdi_pi_offline()
3961 i_mdi_report_path_state(ct, pip); in i_mdi_pi_offline()
3970 "ct = %p pip = %p", (void *)ct, (void *)pip)); in i_mdi_pi_offline()
3979 i_mdi_pi_online(mdi_pathinfo_t *pip, int flags) in i_mdi_pi_online() argument
3987 MDI_PI_LOCK(pip); in i_mdi_pi_online()
3988 ph = MDI_PI(pip)->pi_phci; in i_mdi_pi_online()
3990 ct = MDI_PI(pip)->pi_client; in i_mdi_pi_online()
3991 MDI_PI_SET_ONLINING(pip) in i_mdi_pi_online()
3992 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
3995 rv = (*f)(vh->vh_dip, pip, MDI_PATHINFO_STATE_ONLINE, 0, in i_mdi_pi_online()
3998 MDI_PI_LOCK(pip); in i_mdi_pi_online()
3999 cv_broadcast(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_online()
4000 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4019 MDI_PI_LOCK(pip); in i_mdi_pi_online()
4020 MDI_PI(pip)->pi_state = in i_mdi_pi_online()
4021 MDI_PI_OLD_STATE(pip); in i_mdi_pi_online()
4022 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4029 i_mdi_report_path_state(ct, pip); in i_mdi_pi_online()
4041 MDI_PI_LOCK(pip); in i_mdi_pi_online()
4042 MDI_PI(pip)->pi_state = MDI_PI_OLD_STATE(pip); in i_mdi_pi_online()
4043 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4059 mdi_pi_get_node_name(mdi_pathinfo_t *pip) in mdi_pi_get_node_name() argument
4063 if (pip == NULL) in mdi_pi_get_node_name()
4065 ct = MDI_PI(pip)->pi_client; in mdi_pi_get_node_name()
4079 mdi_pi_get_addr(mdi_pathinfo_t *pip) in mdi_pi_get_addr() argument
4081 if (pip == NULL) in mdi_pi_get_addr()
4084 return (MDI_PI(pip)->pi_addr); in mdi_pi_get_addr()
4095 mdi_pi_get_path_instance(mdi_pathinfo_t *pip) in mdi_pi_get_path_instance() argument
4097 if (pip == NULL) in mdi_pi_get_path_instance()
4100 return (MDI_PI(pip)->pi_path_instance); in mdi_pi_get_path_instance()
4108 mdi_pi_pathname(mdi_pathinfo_t *pip) in mdi_pi_pathname() argument
4110 if (pip == NULL) in mdi_pi_pathname()
4112 return (mdi_pi_pathname_by_instance(mdi_pi_get_path_instance(pip))); in mdi_pi_pathname()
4121 mdi_pi_spathname(mdi_pathinfo_t *pip) in mdi_pi_spathname() argument
4125 if (pip) { in mdi_pi_spathname()
4127 mdi_pi_get_path_instance(pip)); in mdi_pi_spathname()
4135 mdi_pi_pathname_obp(mdi_pathinfo_t *pip, char *path) in mdi_pi_pathname_obp() argument
4138 if ((pip == NULL) || (path == NULL)) in mdi_pi_pathname_obp()
4141 if (mdi_prop_lookup_string(pip, "obp-path", &obp_path) == MDI_SUCCESS) { in mdi_pi_pathname_obp()
4151 mdi_pi_pathname_obp_set(mdi_pathinfo_t *pip, char *component) in mdi_pi_pathname_obp_set() argument
4157 if (pip == NULL) in mdi_pi_pathname_obp_set()
4160 pdip = mdi_pi_get_phci(pip); in mdi_pi_pathname_obp_set()
4174 rc = mdi_prop_update_string(pip, "obp-path", obp_path); in mdi_pi_pathname_obp_set()
4189 mdi_pi_get_client(mdi_pathinfo_t *pip) in mdi_pi_get_client() argument
4192 if (pip) { in mdi_pi_get_client()
4193 dip = MDI_PI(pip)->pi_client->ct_dip; in mdi_pi_get_client()
4205 mdi_pi_get_phci(mdi_pathinfo_t *pip) in mdi_pi_get_phci() argument
4210 if (pip) { in mdi_pi_get_phci()
4211 ph = MDI_PI(pip)->pi_phci; in mdi_pi_get_phci()
4224 mdi_pi_get_client_private(mdi_pathinfo_t *pip) in mdi_pi_get_client_private() argument
4227 if (pip) { in mdi_pi_get_client_private()
4228 cprivate = MDI_PI(pip)->pi_cprivate; in mdi_pi_get_client_private()
4238 mdi_pi_set_client_private(mdi_pathinfo_t *pip, void *priv) in mdi_pi_set_client_private() argument
4240 if (pip) { in mdi_pi_set_client_private()
4241 MDI_PI(pip)->pi_cprivate = priv; in mdi_pi_set_client_private()
4251 mdi_pi_get_phci_private(mdi_pathinfo_t *pip) in mdi_pi_get_phci_private() argument
4255 if (pip) { in mdi_pi_get_phci_private()
4256 pprivate = MDI_PI(pip)->pi_pprivate; in mdi_pi_get_phci_private()
4266 mdi_pi_set_phci_private(mdi_pathinfo_t *pip, caddr_t priv) in mdi_pi_set_phci_private() argument
4268 if (pip) { in mdi_pi_set_phci_private()
4269 MDI_PI(pip)->pi_pprivate = priv; in mdi_pi_set_phci_private()
4279 mdi_pi_get_state(mdi_pathinfo_t *pip) in mdi_pi_get_state() argument
4283 if (pip) { in mdi_pi_get_state()
4284 if (MDI_PI_IS_TRANSIENT(pip)) { in mdi_pi_get_state()
4289 state = MDI_PI_OLD_STATE(pip); in mdi_pi_get_state()
4291 state = MDI_PI_STATE(pip); in mdi_pi_get_state()
4302 mdi_pi_get_flags(mdi_pathinfo_t *pip) in mdi_pi_get_flags() argument
4304 return (pip ? MDI_PI(pip)->pi_flags : 0); in mdi_pi_get_flags()
4312 mdi_pi_get_state2(mdi_pathinfo_t *pip, mdi_pathinfo_state_t *state, in mdi_pi_get_state2() argument
4317 if (pip) { in mdi_pi_get_state2()
4318 if (MDI_PI_IS_TRANSIENT(pip)) { in mdi_pi_get_state2()
4323 *state = MDI_PI_OLD_STATE(pip); in mdi_pi_get_state2()
4324 *ext_state = MDI_PI_OLD_EXT_STATE(pip); in mdi_pi_get_state2()
4326 *state = MDI_PI_STATE(pip); in mdi_pi_get_state2()
4327 *ext_state = MDI_PI_EXT_STATE(pip); in mdi_pi_get_state2()
4338 mdi_pi_get_preferred(mdi_pathinfo_t *pip) in mdi_pi_get_preferred() argument
4340 if (pip) { in mdi_pi_get_preferred()
4341 return (MDI_PI(pip)->pi_preferred); in mdi_pi_get_preferred()
4351 mdi_pi_set_preferred(mdi_pathinfo_t *pip, int preferred) in mdi_pi_set_preferred() argument
4353 if (pip) { in mdi_pi_set_preferred()
4354 MDI_PI(pip)->pi_preferred = preferred; in mdi_pi_set_preferred()
4363 mdi_pi_set_state(mdi_pathinfo_t *pip, mdi_pathinfo_state_t state) in mdi_pi_set_state() argument
4367 if (pip) { in mdi_pi_set_state()
4368 ext_state = MDI_PI(pip)->pi_state & MDI_PATHINFO_EXT_STATE_MASK; in mdi_pi_set_state()
4369 MDI_PI(pip)->pi_state = state; in mdi_pi_set_state()
4370 MDI_PI(pip)->pi_state |= ext_state; in mdi_pi_set_state()
4410 mdi_pi_get_next_prop(mdi_pathinfo_t *pip, nvpair_t *prev) in mdi_pi_get_next_prop() argument
4412 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_pi_get_next_prop()
4415 ASSERT(MDI_PI_LOCKED(pip)); in mdi_pi_get_next_prop()
4416 return (nvlist_next_nvpair(MDI_PI(pip)->pi_prop, prev)); in mdi_pi_get_next_prop()
4424 mdi_prop_remove(mdi_pathinfo_t *pip, char *name) in mdi_prop_remove() argument
4426 if (pip == NULL) { in mdi_prop_remove()
4429 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_remove()
4430 MDI_PI_LOCK(pip); in mdi_prop_remove()
4431 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_remove()
4432 MDI_PI_UNLOCK(pip); in mdi_prop_remove()
4436 (void) nvlist_remove_all(MDI_PI(pip)->pi_prop, name); in mdi_prop_remove()
4440 nvp = nvlist_next_nvpair(MDI_PI(pip)->pi_prop, NULL); in mdi_prop_remove()
4443 next = nvlist_next_nvpair(MDI_PI(pip)->pi_prop, nvp); in mdi_prop_remove()
4446 (void) nvlist_remove_all(MDI_PI(pip)->pi_prop, in mdi_prop_remove()
4451 MDI_PI_UNLOCK(pip); in mdi_prop_remove()
4462 mdi_prop_size(mdi_pathinfo_t *pip, size_t *buflenp) in mdi_prop_size() argument
4468 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_size()
4471 ASSERT(MDI_PI_LOCKED(pip)); in mdi_prop_size()
4472 rv = nvlist_size(MDI_PI(pip)->pi_prop, in mdi_prop_size()
4484 mdi_prop_pack(mdi_pathinfo_t *pip, char **bufp, uint_t buflen) in mdi_prop_pack() argument
4489 if ((pip == NULL) || MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_pack()
4493 ASSERT(MDI_PI_LOCKED(pip)); in mdi_prop_pack()
4496 rv = nvlist_pack(MDI_PI(pip)->pi_prop, bufp, (size_t *)&bufsize, in mdi_prop_pack()
4507 mdi_prop_update_byte(mdi_pathinfo_t *pip, char *name, uchar_t data) in mdi_prop_update_byte() argument
4511 if (pip == NULL) { in mdi_prop_update_byte()
4514 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_byte()
4515 MDI_PI_LOCK(pip); in mdi_prop_update_byte()
4516 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_byte()
4517 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte()
4520 rv = nvlist_add_byte(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_update_byte()
4521 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte()
4530 mdi_prop_update_byte_array(mdi_pathinfo_t *pip, char *name, uchar_t *data, in mdi_prop_update_byte_array() argument
4535 if (pip == NULL) { in mdi_prop_update_byte_array()
4538 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_byte_array()
4539 MDI_PI_LOCK(pip); in mdi_prop_update_byte_array()
4540 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_byte_array()
4541 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte_array()
4544 rv = nvlist_add_byte_array(MDI_PI(pip)->pi_prop, name, data, nelements); in mdi_prop_update_byte_array()
4545 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte_array()
4554 mdi_prop_update_int(mdi_pathinfo_t *pip, char *name, int data) in mdi_prop_update_int() argument
4558 if (pip == NULL) { in mdi_prop_update_int()
4561 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_int()
4562 MDI_PI_LOCK(pip); in mdi_prop_update_int()
4563 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_int()
4564 MDI_PI_UNLOCK(pip); in mdi_prop_update_int()
4567 rv = nvlist_add_int32(MDI_PI(pip)->pi_prop, name, (int32_t)data); in mdi_prop_update_int()
4568 MDI_PI_UNLOCK(pip); in mdi_prop_update_int()
4577 mdi_prop_update_int64(mdi_pathinfo_t *pip, char *name, int64_t data) in mdi_prop_update_int64() argument
4581 if (pip == NULL) { in mdi_prop_update_int64()
4584 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_int64()
4585 MDI_PI_LOCK(pip); in mdi_prop_update_int64()
4586 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_int64()
4587 MDI_PI_UNLOCK(pip); in mdi_prop_update_int64()
4590 rv = nvlist_add_int64(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_update_int64()
4591 MDI_PI_UNLOCK(pip); in mdi_prop_update_int64()
4600 mdi_prop_update_int_array(mdi_pathinfo_t *pip, char *name, int *data, in mdi_prop_update_int_array() argument
4605 if (pip == NULL) { in mdi_prop_update_int_array()
4608 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_int_array()
4609 MDI_PI_LOCK(pip); in mdi_prop_update_int_array()
4610 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_int_array()
4611 MDI_PI_UNLOCK(pip); in mdi_prop_update_int_array()
4614 rv = nvlist_add_int32_array(MDI_PI(pip)->pi_prop, name, (int32_t *)data, in mdi_prop_update_int_array()
4616 MDI_PI_UNLOCK(pip); in mdi_prop_update_int_array()
4625 mdi_prop_update_string(mdi_pathinfo_t *pip, char *name, char *data) in mdi_prop_update_string() argument
4629 if (pip == NULL) { in mdi_prop_update_string()
4632 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_string()
4633 MDI_PI_LOCK(pip); in mdi_prop_update_string()
4634 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_string()
4635 MDI_PI_UNLOCK(pip); in mdi_prop_update_string()
4638 rv = nvlist_add_string(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_update_string()
4639 MDI_PI_UNLOCK(pip); in mdi_prop_update_string()
4648 mdi_prop_update_string_array(mdi_pathinfo_t *pip, char *name, char **data, in mdi_prop_update_string_array() argument
4653 if (pip == NULL) { in mdi_prop_update_string_array()
4656 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_string_array()
4657 MDI_PI_LOCK(pip); in mdi_prop_update_string_array()
4658 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_string_array()
4659 MDI_PI_UNLOCK(pip); in mdi_prop_update_string_array()
4662 rv = nvlist_add_string_array(MDI_PI(pip)->pi_prop, name, data, in mdi_prop_update_string_array()
4664 MDI_PI_UNLOCK(pip); in mdi_prop_update_string_array()
4675 mdi_prop_lookup_byte(mdi_pathinfo_t *pip, char *name, uchar_t *data) in mdi_prop_lookup_byte() argument
4679 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_byte()
4682 rv = nvlist_lookup_byte(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_lookup_byte()
4694 mdi_prop_lookup_byte_array(mdi_pathinfo_t *pip, char *name, uchar_t **data, in mdi_prop_lookup_byte_array() argument
4699 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_byte_array()
4702 rv = nvlist_lookup_byte_array(MDI_PI(pip)->pi_prop, name, data, in mdi_prop_lookup_byte_array()
4714 mdi_prop_lookup_int(mdi_pathinfo_t *pip, char *name, int *data) in mdi_prop_lookup_int() argument
4718 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_int()
4721 rv = nvlist_lookup_int32(MDI_PI(pip)->pi_prop, name, (int32_t *)data); in mdi_prop_lookup_int()
4732 mdi_prop_lookup_int64(mdi_pathinfo_t *pip, char *name, int64_t *data) in mdi_prop_lookup_int64() argument
4735 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_int64()
4738 rv = nvlist_lookup_int64(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_lookup_int64()
4749 mdi_prop_lookup_int_array(mdi_pathinfo_t *pip, char *name, int **data, in mdi_prop_lookup_int_array() argument
4754 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_int_array()
4757 rv = nvlist_lookup_int32_array(MDI_PI(pip)->pi_prop, name, in mdi_prop_lookup_int_array()
4769 mdi_prop_lookup_string(mdi_pathinfo_t *pip, char *name, char **data) in mdi_prop_lookup_string() argument
4773 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_string()
4776 rv = nvlist_lookup_string(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_lookup_string()
4787 mdi_prop_lookup_string_array(mdi_pathinfo_t *pip, char *name, char ***data, in mdi_prop_lookup_string_array() argument
4792 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_string_array()
4795 rv = nvlist_lookup_string_array(MDI_PI(pip)->pi_prop, name, data, in mdi_prop_lookup_string_array()
4816 i_mdi_report_path_state(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_report_path_state() argument
4843 if (MDI_PI_FLAGS_IS_DEVICE_REMOVED(pip)) { in i_mdi_report_path_state()
4845 } else if (MDI_PI_IS_OFFLINE(pip)) { in i_mdi_report_path_state()
4847 } else if (MDI_PI_IS_ONLINE(pip)) { in i_mdi_report_path_state()
4850 } else if (MDI_PI_IS_STANDBY(pip)) { in i_mdi_report_path_state()
4852 } else if (MDI_PI_IS_FAULT(pip)) { in i_mdi_report_path_state()
4884 mdi_pi_get_path_instance(pip), in i_mdi_report_path_state()
4885 mdi_pi_spathname(pip), status, lb_buf); in i_mdi_report_path_state()
4892 mdi_pi_get_path_instance(pip), in i_mdi_report_path_state()
4893 mdi_pi_spathname(pip), status); in i_mdi_report_path_state()
5107 mdi_pathinfo_t *pip; in i_mdi_phci_offline() local
5148 pip = ph->ph_path_head; in i_mdi_phci_offline()
5149 while (pip != NULL) { in i_mdi_phci_offline()
5150 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5151 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5157 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_offline()
5158 i_mdi_client_lock(ct, pip); in i_mdi_phci_offline()
5168 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5173 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5198 failed_pip = pip; in i_mdi_phci_offline()
5202 pip = next; in i_mdi_phci_offline()
5206 pip = next; in i_mdi_phci_offline()
5211 pip = ph->ph_path_head; in i_mdi_phci_offline()
5212 while (pip != failed_pip) { in i_mdi_phci_offline()
5213 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5214 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5215 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_offline()
5216 i_mdi_client_lock(ct, pip); in i_mdi_phci_offline()
5222 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5227 pip = next; in i_mdi_phci_offline()
5234 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5240 pip = next; in i_mdi_phci_offline()
5245 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5247 pip = next; in i_mdi_phci_offline()
5261 pip = ph->ph_path_head; in i_mdi_phci_offline()
5262 while (pip != NULL) { in i_mdi_phci_offline()
5263 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5264 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5265 MDI_PI_SET_OFFLINING(pip); in i_mdi_phci_offline()
5266 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5267 pip = next; in i_mdi_phci_offline()
5275 pip = ph->ph_path_head; in i_mdi_phci_offline()
5276 while (pip != NULL) { in i_mdi_phci_offline()
5277 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5278 (void) i_mdi_pi_offline(pip, flags); in i_mdi_phci_offline()
5279 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5280 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_offline()
5281 if (!MDI_PI_IS_OFFLINE(pip)) { in i_mdi_phci_offline()
5286 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5291 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5292 pip = next; in i_mdi_phci_offline()
5304 mdi_pathinfo_t *pip; in mdi_phci_mark_retiring() local
5324 pip = ph->ph_path_head; in mdi_phci_mark_retiring()
5325 while (pip != NULL) { in mdi_phci_mark_retiring()
5326 MDI_PI_LOCK(pip); in mdi_phci_mark_retiring()
5327 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_mark_retiring()
5329 ct = MDI_PI(pip)->pi_client; in mdi_phci_mark_retiring()
5330 i_mdi_client_lock(ct, pip); in mdi_phci_mark_retiring()
5331 MDI_PI_UNLOCK(pip); in mdi_phci_mark_retiring()
5342 pip = next; in mdi_phci_mark_retiring()
5345 pip = next; in mdi_phci_mark_retiring()
5359 mdi_pathinfo_t *pip; in mdi_phci_retire_notify() local
5385 pip = ph->ph_path_head; in mdi_phci_retire_notify()
5386 while (pip != NULL) { in mdi_phci_retire_notify()
5387 MDI_PI_LOCK(pip); in mdi_phci_retire_notify()
5388 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_notify()
5394 ct = MDI_PI(pip)->pi_client; in mdi_phci_retire_notify()
5395 i_mdi_client_lock(ct, pip); in mdi_phci_retire_notify()
5401 MDI_PI_UNLOCK(pip); in mdi_phci_retire_notify()
5407 MDI_PI_UNLOCK(pip); in mdi_phci_retire_notify()
5421 pip = next; in mdi_phci_retire_notify()
5424 pip = next; in mdi_phci_retire_notify()
5448 mdi_pathinfo_t *pip; in mdi_phci_retire_finalize() local
5478 pip = ph->ph_path_head; in mdi_phci_retire_finalize()
5479 while (pip != NULL) { in mdi_phci_retire_finalize()
5480 MDI_PI_LOCK(pip); in mdi_phci_retire_finalize()
5481 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_finalize()
5486 ct = MDI_PI(pip)->pi_client; in mdi_phci_retire_finalize()
5487 i_mdi_client_lock(ct, pip); in mdi_phci_retire_finalize()
5492 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5521 pip = next; in mdi_phci_retire_finalize()
5524 pip = next; in mdi_phci_retire_finalize()
5552 pip = ph->ph_path_head; in mdi_phci_retire_finalize()
5553 while (pip != NULL) { in mdi_phci_retire_finalize()
5554 MDI_PI_LOCK(pip); in mdi_phci_retire_finalize()
5555 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_finalize()
5556 MDI_PI_SET_OFFLINING(pip); in mdi_phci_retire_finalize()
5557 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5558 pip = next; in mdi_phci_retire_finalize()
5566 pip = ph->ph_path_head; in mdi_phci_retire_finalize()
5567 while (pip != NULL) { in mdi_phci_retire_finalize()
5568 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_finalize()
5569 (void) i_mdi_pi_offline(pip, 0); in mdi_phci_retire_finalize()
5570 MDI_PI_LOCK(pip); in mdi_phci_retire_finalize()
5571 ct = MDI_PI(pip)->pi_client; in mdi_phci_retire_finalize()
5572 if (!MDI_PI_IS_OFFLINE(pip)) { in mdi_phci_retire_finalize()
5575 mdi_pi_get_path_instance(pip), in mdi_phci_retire_finalize()
5576 mdi_pi_spathname(pip)); in mdi_phci_retire_finalize()
5577 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5582 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5583 pip = next; in mdi_phci_retire_finalize()
5594 mdi_pathinfo_t *pip; in mdi_phci_unretire() local
5606 pip = ph->ph_path_head; in mdi_phci_unretire()
5607 while (pip != NULL) { in mdi_phci_unretire()
5608 MDI_PI_LOCK(pip); in mdi_phci_unretire()
5609 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_unretire()
5610 MDI_PI_UNLOCK(pip); in mdi_phci_unretire()
5611 (void) i_mdi_pi_online(pip, 0); in mdi_phci_unretire()
5612 pip = next; in mdi_phci_unretire()
5811 mdi_pathinfo_t *pip; in i_mdi_phci_pre_detach() local
5852 pip = ph->ph_path_head; in i_mdi_phci_pre_detach()
5853 while (pip != NULL && rv == DDI_SUCCESS) { in i_mdi_phci_pre_detach()
5855 MDI_PI_LOCK(pip); in i_mdi_phci_pre_detach()
5857 (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_pre_detach()
5858 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_pre_detach()
5859 i_mdi_client_lock(ct, pip); in i_mdi_phci_pre_detach()
5861 MDI_PI_UNLOCK(pip); in i_mdi_phci_pre_detach()
5875 failed_pip = pip; in i_mdi_phci_pre_detach()
5881 pip = next; in i_mdi_phci_pre_detach()
5895 pip = ph->ph_path_head; in i_mdi_phci_pre_detach()
5896 while (pip != failed_pip) { in i_mdi_phci_pre_detach()
5898 MDI_PI_LOCK(pip); in i_mdi_phci_pre_detach()
5900 (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_pre_detach()
5901 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_pre_detach()
5902 i_mdi_client_lock(ct, pip); in i_mdi_phci_pre_detach()
5904 MDI_PI_UNLOCK(pip); in i_mdi_phci_pre_detach()
5911 pip = next; in i_mdi_phci_pre_detach()
6062 mdi_pi_kstat_exists(mdi_pathinfo_t *pip) in mdi_pi_kstat_exists() argument
6064 return (MDI_PI(pip)->pi_kstats ? 1 : 0); in mdi_pi_kstat_exists()
6073 mdi_pi_kstat_create(mdi_pathinfo_t *pip, char *ksname) in mdi_pi_kstat_create() argument
6079 if (MDI_PI(pip)->pi_kstats != NULL) in mdi_pi_kstat_create()
6121 MDI_PI(pip)->pi_kstats = mdi_statp; in mdi_pi_kstat_create()
6129 i_mdi_pi_kstat_destroy(mdi_pathinfo_t *pip) in i_mdi_pi_kstat_destroy() argument
6134 if (MDI_PI(pip)->pi_kstats == NULL) in i_mdi_pi_kstat_destroy()
6136 if ((mdi_statp = MDI_PI(pip)->pi_kstats) == NULL) in i_mdi_pi_kstat_destroy()
6139 MDI_PI(pip)->pi_kstats = NULL; in i_mdi_pi_kstat_destroy()
6159 mdi_pi_kstat_iosupdate(mdi_pathinfo_t *pip, struct buf *bp) in mdi_pi_kstat_iosupdate() argument
6164 ASSERT(pip != NULL); in mdi_pi_kstat_iosupdate()
6170 if (bp != NULL && MDI_PI(pip)->pi_kstats != NULL) { in mdi_pi_kstat_iosupdate()
6171 iostatp = MDI_PI(pip)->pi_kstats->pi_kstat_iostats; in mdi_pi_kstat_iosupdate()
6189 mdi_pi_enable_path(mdi_pathinfo_t *pip, int flags) in mdi_pi_enable_path() argument
6193 ph = MDI_PI(pip)->pi_phci; in mdi_pi_enable_path()
6195 MDI_DEBUG(1, (MDI_NOTE, mdi_pi_get_phci(pip), in mdi_pi_enable_path()
6197 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_enable_path()
6201 (void) i_mdi_enable_disable_path(pip, ph->ph_vhci, flags, in mdi_pi_enable_path()
6205 (void *)pip, (void *)ph)); in mdi_pi_enable_path()
6216 mdi_pi_disable_path(mdi_pathinfo_t *pip, int flags) in mdi_pi_disable_path() argument
6220 ph = MDI_PI(pip)->pi_phci; in mdi_pi_disable_path()
6222 MDI_DEBUG(1, (MDI_NOTE, mdi_pi_get_phci(pip), in mdi_pi_disable_path()
6224 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_disable_path()
6228 (void) i_mdi_enable_disable_path(pip, in mdi_pi_disable_path()
6232 (void *)pip, (void *)ph)); in mdi_pi_disable_path()
6269 i_mdi_enable_disable_path(mdi_pathinfo_t *pip, mdi_vhci_t *vh, int flags, in i_mdi_enable_disable_path() argument
6282 if ((MDI_PI_IS_DISABLE(pip) && op == MDI_DISABLE_OP) || in i_mdi_enable_disable_path()
6283 (!MDI_PI_IS_DISABLE(pip) && op == MDI_ENABLE_OP)) { in i_mdi_enable_disable_path()
6284 MDI_PI_LOCK(pip); in i_mdi_enable_disable_path()
6285 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_enable_disable_path()
6286 MDI_PI_UNLOCK(pip); in i_mdi_enable_disable_path()
6299 rv = (*f)(vh->vh_dip, pip, 0, in i_mdi_enable_disable_path()
6300 MDI_PI_EXT_STATE(pip), in i_mdi_enable_disable_path()
6308 MDI_PI_LOCK(pip); in i_mdi_enable_disable_path()
6309 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_enable_disable_path()
6314 MDI_PI_SET_USER_DISABLE(pip); in i_mdi_enable_disable_path()
6316 MDI_PI_SET_USER_ENABLE(pip); in i_mdi_enable_disable_path()
6321 MDI_PI_SET_DRV_DISABLE(pip); in i_mdi_enable_disable_path()
6323 MDI_PI_SET_DRV_ENABLE(pip); in i_mdi_enable_disable_path()
6328 MDI_PI_SET_DRV_DISABLE_TRANS(pip); in i_mdi_enable_disable_path()
6330 MDI_PI_SET_DRV_ENABLE_TRANS(pip); in i_mdi_enable_disable_path()
6334 MDI_PI_UNLOCK(pip); in i_mdi_enable_disable_path()
6340 rv = (*f)(vh->vh_dip, pip, 0, in i_mdi_enable_disable_path()
6341 MDI_PI_EXT_STATE(pip), in i_mdi_enable_disable_path()
6364 mdi_pathinfo_t *next, *pip; in i_mdi_pi_enable_disable() local
6424 pip = ph->ph_path_head; in i_mdi_pi_enable_disable()
6425 while (pip != NULL) { in i_mdi_pi_enable_disable()
6426 pip = i_mdi_enable_disable_path(pip, vh, flags, op); in i_mdi_pi_enable_disable()
6442 pip = ct->ct_path_head; in i_mdi_pi_enable_disable()
6444 while (pip != NULL) { in i_mdi_pi_enable_disable()
6445 MDI_PI_LOCK(pip); in i_mdi_pi_enable_disable()
6446 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_pi_enable_disable()
6447 if (MDI_PI(pip)->pi_phci == ph) { in i_mdi_pi_enable_disable()
6448 MDI_PI_UNLOCK(pip); in i_mdi_pi_enable_disable()
6452 MDI_PI_UNLOCK(pip); in i_mdi_pi_enable_disable()
6453 pip = next; in i_mdi_pi_enable_disable()
6464 (void) i_mdi_enable_disable_path(pip, vh, flags, op); in i_mdi_pi_enable_disable()
6477 i_mdi_pm_hold_pip(mdi_pathinfo_t *pip) in i_mdi_pm_hold_pip() argument
6481 ASSERT(pip != NULL); in i_mdi_pm_hold_pip()
6482 ASSERT(MDI_PI_LOCKED(pip)); in i_mdi_pm_hold_pip()
6484 if (MDI_PI(pip)->pi_pm_held) { in i_mdi_pm_hold_pip()
6488 ph_dip = mdi_pi_get_phci(pip); in i_mdi_pm_hold_pip()
6490 "%s %p", mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pm_hold_pip()
6495 MDI_PI_UNLOCK(pip); in i_mdi_pm_hold_pip()
6501 MDI_PI_LOCK(pip); in i_mdi_pm_hold_pip()
6505 MDI_PI(pip)->pi_pm_held = 1; in i_mdi_pm_hold_pip()
6512 i_mdi_pm_rele_pip(mdi_pathinfo_t *pip) in i_mdi_pm_rele_pip() argument
6516 ASSERT(pip != NULL); in i_mdi_pm_rele_pip()
6517 ASSERT(MDI_PI_LOCKED(pip)); in i_mdi_pm_rele_pip()
6519 if (MDI_PI(pip)->pi_pm_held == 0) { in i_mdi_pm_rele_pip()
6523 ph_dip = mdi_pi_get_phci(pip); in i_mdi_pm_rele_pip()
6527 "%s %p", mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pm_rele_pip()
6529 MDI_PI_UNLOCK(pip); in i_mdi_pm_rele_pip()
6535 MDI_PI_LOCK(pip); in i_mdi_pm_rele_pip()
6537 MDI_PI(pip)->pi_pm_held = 0; in i_mdi_pm_rele_pip()
6555 mdi_pathinfo_t *pip; in i_mdi_rele_all_phci() local
6558 pip = (mdi_pathinfo_t *)ct->ct_path_head; in i_mdi_rele_all_phci()
6559 while (pip != NULL) { in i_mdi_rele_all_phci()
6560 mdi_hold_path(pip); in i_mdi_rele_all_phci()
6561 MDI_PI_LOCK(pip); in i_mdi_rele_all_phci()
6562 i_mdi_pm_rele_pip(pip); in i_mdi_rele_all_phci()
6563 MDI_PI_UNLOCK(pip); in i_mdi_rele_all_phci()
6564 mdi_rele_path(pip); in i_mdi_rele_all_phci()
6565 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_rele_all_phci()
6602 i_mdi_power_one_phci(mdi_pathinfo_t *pip) in i_mdi_power_one_phci() argument
6607 MDI_PI_LOCK(pip); in i_mdi_power_one_phci()
6608 i_mdi_pm_hold_pip(pip); in i_mdi_power_one_phci()
6610 ph_dip = mdi_pi_get_phci(pip); in i_mdi_power_one_phci()
6611 MDI_PI_UNLOCK(pip); in i_mdi_power_one_phci()
6616 ddi_get_instance(ph_dip), (void *)pip)); in i_mdi_power_one_phci()
6624 (void *)pip)); in i_mdi_power_one_phci()
6626 MDI_PI_LOCK(pip); in i_mdi_power_one_phci()
6627 i_mdi_pm_rele_pip(pip); in i_mdi_power_one_phci()
6628 MDI_PI_UNLOCK(pip); in i_mdi_power_one_phci()
6638 mdi_pathinfo_t *pip; in i_mdi_power_all_phci() local
6642 pip = (mdi_pathinfo_t *)ct->ct_path_head; in i_mdi_power_all_phci()
6643 while (pip != NULL) { in i_mdi_power_all_phci()
6648 if (MDI_PI_IS_INIT(pip) || in i_mdi_power_all_phci()
6649 MDI_PI_IS_ONLINE(pip) || MDI_PI_IS_STANDBY(pip)) { in i_mdi_power_all_phci()
6650 mdi_hold_path(pip); in i_mdi_power_all_phci()
6652 if (i_mdi_power_one_phci(pip) == MDI_SUCCESS) in i_mdi_power_all_phci()
6655 ASSERT(ct == MDI_PI(pip)->pi_client); in i_mdi_power_all_phci()
6657 mdi_rele_path(pip); in i_mdi_power_all_phci()
6659 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_power_all_phci()
7005 mdi_pathinfo_t *pip, *next; in i_mdi_pm_post_config_one() local
7009 pip = ct->ct_path_head; in i_mdi_pm_post_config_one()
7010 while (pip != NULL) { in i_mdi_pm_post_config_one()
7011 MDI_PI_LOCK(pip); in i_mdi_pm_post_config_one()
7012 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_pm_post_config_one()
7013 if (MDI_PI_IS_ONLINE(pip) || MDI_PI_IS_STANDBY(pip)) in i_mdi_pm_post_config_one()
7015 MDI_PI_UNLOCK(pip); in i_mdi_pm_post_config_one()
7016 pip = next; in i_mdi_pm_post_config_one()
7078 mdi_pathinfo_t *pip, *next; in i_mdi_pm_post_unconfig_one() local
7082 pip = ct->ct_path_head; in i_mdi_pm_post_unconfig_one()
7083 while (pip != NULL) { in i_mdi_pm_post_unconfig_one()
7084 MDI_PI_LOCK(pip); in i_mdi_pm_post_unconfig_one()
7085 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_pm_post_unconfig_one()
7086 if (MDI_PI_IS_ONLINE(pip) || MDI_PI_IS_STANDBY(pip)) in i_mdi_pm_post_unconfig_one()
7088 MDI_PI_UNLOCK(pip); in i_mdi_pm_post_unconfig_one()
7089 pip = next; in i_mdi_pm_post_unconfig_one()
7289 mdi_pi_get_vhci_private(mdi_pathinfo_t *pip) in mdi_pi_get_vhci_private() argument
7292 if (pip) { in mdi_pi_get_vhci_private()
7293 vprivate = MDI_PI(pip)->pi_vprivate; in mdi_pi_get_vhci_private()
7303 mdi_pi_set_vhci_private(mdi_pathinfo_t *pip, void *priv) in mdi_pi_set_vhci_private() argument
7305 if (pip) { in mdi_pi_set_vhci_private()
7306 MDI_PI(pip)->pi_vprivate = priv; in mdi_pi_set_vhci_private()
7343 mdi_pi_ishidden(mdi_pathinfo_t *pip) in mdi_pi_ishidden() argument
7345 return (MDI_PI_FLAGS_IS_HIDDEN(pip)); in mdi_pi_ishidden()
7349 mdi_pi_device_isremoved(mdi_pathinfo_t *pip) in mdi_pi_device_isremoved() argument
7351 return (MDI_PI_FLAGS_IS_DEVICE_REMOVED(pip)); in mdi_pi_device_isremoved()
7358 mdi_pathinfo_t *pip; in i_mdi_client_all_devices_removed() local
7362 for (pip = ct->ct_path_head; pip; in i_mdi_client_all_devices_removed()
7363 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link) { in i_mdi_client_all_devices_removed()
7364 if (!mdi_pi_device_isremoved(pip)) { in i_mdi_client_all_devices_removed()
7377 mdi_pi_device_remove(mdi_pathinfo_t *pip) in mdi_pi_device_remove() argument
7381 MDI_PI_LOCK(pip); in mdi_pi_device_remove()
7382 if (mdi_pi_device_isremoved(pip)) { in mdi_pi_device_remove()
7383 MDI_PI_UNLOCK(pip); in mdi_pi_device_remove()
7386 MDI_PI_FLAGS_SET_DEVICE_REMOVED(pip); in mdi_pi_device_remove()
7387 MDI_PI_FLAGS_SET_HIDDEN(pip); in mdi_pi_device_remove()
7388 MDI_PI_UNLOCK(pip); in mdi_pi_device_remove()
7394 ct = MDI_PI(pip)->pi_client; in mdi_pi_device_remove()
7408 mdi_pi_device_insert(mdi_pathinfo_t *pip) in mdi_pi_device_insert() argument
7410 MDI_PI_LOCK(pip); in mdi_pi_device_insert()
7411 if (!mdi_pi_device_isremoved(pip)) { in mdi_pi_device_insert()
7412 MDI_PI_UNLOCK(pip); in mdi_pi_device_insert()
7415 MDI_PI_FLAGS_CLR_DEVICE_REMOVED(pip); in mdi_pi_device_insert()
7416 MDI_PI_FLAGS_CLR_HIDDEN(pip); in mdi_pi_device_insert()
7417 MDI_PI_UNLOCK(pip); in mdi_pi_device_insert()
8194 vhcache_pi_add(mdi_vhci_config_t *vhc, struct mdi_pathinfo *pip) in vhcache_pi_add() argument
8199 mdi_phci_t *ph = pip->pi_phci; in vhcache_pi_add()
8200 mdi_client_t *ct = pip->pi_client; in vhcache_pi_add()
8219 strcmp(cpi->cpi_addr, pip->pi_addr) == 0) { in vhcache_pi_add()
8220 cpi->cpi_pip = pip; in vhcache_pi_add()
8233 cpi->cpi_addr = i_ddi_strdup(pip->pi_addr, KM_SLEEP); in vhcache_pi_add()
8236 cpi->cpi_pip = pip; in vhcache_pi_add()
8251 vhcache_pi_remove(mdi_vhci_config_t *vhc, struct mdi_pathinfo *pip) in vhcache_pi_remove() argument
8254 mdi_client_t *ct = pip->pi_client; in vhcache_pi_remove()
8263 if (cpi->cpi_pip == pip) { in vhcache_pi_remove()
9708 mdi_dc_return_dev_state(mdi_pathinfo_t *pip, struct devctl_iocdata *dcp) in mdi_dc_return_dev_state() argument
9713 if ((pip == NULL) || (dcp == NULL)) in mdi_dc_return_dev_state()
9716 cdip = mdi_pi_get_client(pip); in mdi_dc_return_dev_state()
9718 switch (mdi_pi_get_state(pip)) { in mdi_dc_return_dev_state()
9737 ASSERT(MDI_PI(pip)->pi_state); in mdi_dc_return_dev_state()