Lines Matching refs:pip

272 static mdi_pathinfo_t 	*i_mdi_enable_disable_path(mdi_pathinfo_t *pip,
714 mdi_pathinfo_t *pip; in mdi_phci_unregister() local
756 for (pip = (mdi_pathinfo_t *)ph->ph_path_head; pip; in mdi_phci_unregister()
757 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link) in mdi_phci_unregister()
758 MDI_PI(pip)->pi_phci = NULL; in mdi_phci_unregister()
1052 i_mdi_phci_lock(mdi_phci_t *ph, mdi_pathinfo_t *pip) in i_mdi_phci_lock() argument
1054 if (pip) { in i_mdi_phci_lock()
1058 MDI_PI_HOLD(pip); in i_mdi_phci_lock()
1059 MDI_PI_UNLOCK(pip); in i_mdi_phci_lock()
1061 MDI_PI_LOCK(pip); in i_mdi_phci_lock()
1062 MDI_PI_RELE(pip); in i_mdi_phci_lock()
1069 MDI_PI_HOLD(pip); in i_mdi_phci_lock()
1070 MDI_PI_UNLOCK(pip); in i_mdi_phci_lock()
1072 MDI_PI_LOCK(pip); in i_mdi_phci_lock()
1073 MDI_PI_RELE(pip); in i_mdi_phci_lock()
1274 i_mdi_client_lock(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_client_lock() argument
1276 if (pip) { in i_mdi_client_lock()
1282 MDI_PI_HOLD(pip); in i_mdi_client_lock()
1283 MDI_PI_UNLOCK(pip); in i_mdi_client_lock()
1285 MDI_PI_LOCK(pip); in i_mdi_client_lock()
1286 MDI_PI_RELE(pip); in i_mdi_client_lock()
1293 MDI_PI_HOLD(pip); in i_mdi_client_lock()
1294 MDI_PI_UNLOCK(pip); in i_mdi_client_lock()
1296 MDI_PI_LOCK(pip); in i_mdi_client_lock()
1297 MDI_PI_RELE(pip); in i_mdi_client_lock()
1555 mdi_pathinfo_t *pip, *next; in i_mdi_client_compute_state() local
1558 pip = ct->ct_path_head; in i_mdi_client_compute_state()
1559 while (pip != NULL) { in i_mdi_client_compute_state()
1560 MDI_PI_LOCK(pip); in i_mdi_client_compute_state()
1561 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_client_compute_state()
1562 if (MDI_PI(pip)->pi_phci == ph) { in i_mdi_client_compute_state()
1563 MDI_PI_UNLOCK(pip); in i_mdi_client_compute_state()
1564 pip = next; in i_mdi_client_compute_state()
1568 if ((MDI_PI(pip)->pi_state & MDI_PATHINFO_STATE_MASK) in i_mdi_client_compute_state()
1571 else if ((MDI_PI(pip)->pi_state & MDI_PATHINFO_STATE_MASK) in i_mdi_client_compute_state()
1574 MDI_PI_UNLOCK(pip); in i_mdi_client_compute_state()
1575 pip = next; in i_mdi_client_compute_state()
1926 mdi_pathinfo_t *pip; in i_mdi_lba_lb() local
1930 pip = ct->ct_path_head; in i_mdi_lba_lb()
1931 while (pip) { in i_mdi_lba_lb()
1932 MDI_PI_LOCK(pip); in i_mdi_lba_lb()
1933 if (MDI_PI(pip)->pi_state == in i_mdi_lba_lb()
1934 MDI_PATHINFO_STATE_ONLINE && MDI_PI(pip)->pi_preferred) { in i_mdi_lba_lb()
1936 } else if (MDI_PI(pip)->pi_state == in i_mdi_lba_lb()
1937 MDI_PATHINFO_STATE_ONLINE && !MDI_PI(pip)->pi_preferred) { in i_mdi_lba_lb()
1941 MDI_PI(pip)->pi_client_link; in i_mdi_lba_lb()
1942 MDI_PI_UNLOCK(pip); in i_mdi_lba_lb()
1943 pip = next; in i_mdi_lba_lb()
1957 pip = ct->ct_path_head; in i_mdi_lba_lb()
1958 while (pip && path_index != -1) { in i_mdi_lba_lb()
1959 MDI_PI_LOCK(pip); in i_mdi_lba_lb()
1961 (MDI_PI(pip)->pi_state == in i_mdi_lba_lb()
1963 MDI_PI(pip)->pi_preferred == preferred) { in i_mdi_lba_lb()
1964 MDI_PI_HOLD(pip); in i_mdi_lba_lb()
1965 MDI_PI_UNLOCK(pip); in i_mdi_lba_lb()
1966 *ret_pip = pip; in i_mdi_lba_lb()
1971 MDI_PI(pip)->pi_client_link; in i_mdi_lba_lb()
1972 MDI_PI_UNLOCK(pip); in i_mdi_lba_lb()
1973 pip = next; in i_mdi_lba_lb()
1977 bp->b_lblkno, mdi_pi_spathname(pip), (void *)pip)); in i_mdi_lba_lb()
2044 mdi_pathinfo_t *pip; in mdi_select_path() local
2131 for (pip = head; in mdi_select_path()
2132 pip && (mdi_pi_get_path_instance(pip) != path_instance); in mdi_select_path()
2133 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link) in mdi_select_path()
2137 if (pip == NULL) { in mdi_select_path()
2152 MDI_PI_LOCK(pip); in mdi_select_path()
2153 if ((MDI_PI(pip)->pi_state == MDI_PATHINFO_STATE_INIT) || in mdi_select_path()
2154 (MDI_PI(pip)->pi_phci == NULL)) { in mdi_select_path()
2155 MDI_PI_UNLOCK(pip); in mdi_select_path()
2161 if (MDI_PI_IS_TRANSIENT(pip)) { in mdi_select_path()
2162 MDI_PI_UNLOCK(pip); in mdi_select_path()
2171 MDI_PI_HOLD(pip); in mdi_select_path()
2172 MDI_PI_UNLOCK(pip); in mdi_select_path()
2173 *ret_pip = pip; in mdi_select_path()
2194 pip = (mdi_pathinfo_t *)ct->ct_path_last; in mdi_select_path()
2195 if (pip == NULL) { in mdi_select_path()
2196 pip = head; in mdi_select_path()
2198 start = pip; in mdi_select_path()
2200 MDI_PI_LOCK(pip); in mdi_select_path()
2206 if ((MDI_PI(pip)->pi_state == in mdi_select_path()
2208 preferred == MDI_PI(pip)->pi_preferred) { in mdi_select_path()
2213 MDI_PI_HOLD(pip); in mdi_select_path()
2214 MDI_PI_UNLOCK(pip); in mdi_select_path()
2215 ct->ct_path_last = pip; in mdi_select_path()
2216 *ret_pip = pip; in mdi_select_path()
2224 if (MDI_PI_IS_DRV_DISABLE_TRANSIENT(pip) || in mdi_select_path()
2225 MDI_PI_IS_TRANSIENT(pip)) in mdi_select_path()
2230 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_select_path()
2234 MDI_PI_UNLOCK(pip); in mdi_select_path()
2235 pip = next; in mdi_select_path()
2236 if (start == pip && preferred) { in mdi_select_path()
2238 } else if (start == pip && !preferred) { in mdi_select_path()
2280 pip = head; in mdi_select_path()
2282 pip = (mdi_pathinfo_t *)MDI_PI(start)->pi_client_link; in mdi_select_path()
2283 if (pip == NULL) { in mdi_select_path()
2312 pip = head; in mdi_select_path()
2315 start = pip; in mdi_select_path()
2317 MDI_PI_LOCK(pip); in mdi_select_path()
2319 cond = ((MDI_PI(pip)->pi_state == in mdi_select_path()
2321 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2325 cond = ((MDI_PI(pip)->pi_state == in mdi_select_path()
2327 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2330 cond = ((MDI_PI(pip)->pi_state == in mdi_select_path()
2332 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2336 cond = (((MDI_PI(pip)->pi_state == in mdi_select_path()
2338 (MDI_PI(pip)->pi_state == in mdi_select_path()
2340 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2346 cond = (((MDI_PI(pip)->pi_state == in mdi_select_path()
2348 (MDI_PI(pip)->pi_state == in mdi_select_path()
2350 (MDI_PI(pip)->pi_state == in mdi_select_path()
2353 (MDI_PI(pip)->pi_state == in mdi_select_path()
2356 MDI_PI(pip)->pi_preferred == in mdi_select_path()
2362 cond = (((MDI_PI(pip)->pi_state == in mdi_select_path()
2364 (MDI_PI(pip)->pi_state == in mdi_select_path()
2381 MDI_PI_HOLD(pip); in mdi_select_path()
2382 MDI_PI_UNLOCK(pip); in mdi_select_path()
2384 ct->ct_path_last = pip; in mdi_select_path()
2385 *ret_pip = pip; in mdi_select_path()
2392 if (MDI_PI_IS_DRV_DISABLE_TRANSIENT(pip) || in mdi_select_path()
2393 MDI_PI_IS_TRANSIENT(pip)) in mdi_select_path()
2400 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_select_path()
2406 MDI_PI_UNLOCK(pip); in mdi_select_path()
2435 MDI_PI_UNLOCK(pip); in mdi_select_path()
2439 pip = next; in mdi_select_path()
2458 if ((start_pip != NULL) && (start_pip == pip) && in mdi_select_path()
2465 MDI_PI_LOCK(pip); in mdi_select_path()
2472 if (start == pip && preferred) { in mdi_select_path()
2475 } else if (start == pip && !preferred) { in mdi_select_path()
2513 mdi_get_next_phci_path(dev_info_t *ct_dip, mdi_pathinfo_t *pip) in mdi_get_next_phci_path() argument
2526 if (pip == NULL) in mdi_get_next_phci_path()
2529 return ((mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link); in mdi_get_next_phci_path()
2537 mdi_get_next_client_path(dev_info_t *ph_dip, mdi_pathinfo_t *pip) in mdi_get_next_client_path() argument
2550 if (pip == NULL) in mdi_get_next_client_path()
2553 return ((mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link); in mdi_get_next_client_path()
2563 mdi_hold_path(mdi_pathinfo_t *pip) in mdi_hold_path() argument
2565 if (pip) { in mdi_hold_path()
2566 MDI_PI_LOCK(pip); in mdi_hold_path()
2567 MDI_PI_HOLD(pip); in mdi_hold_path()
2568 MDI_PI_UNLOCK(pip); in mdi_hold_path()
2582 mdi_rele_path(mdi_pathinfo_t *pip) in mdi_rele_path() argument
2584 if (pip) { in mdi_rele_path()
2585 MDI_PI_LOCK(pip); in mdi_rele_path()
2586 MDI_PI_RELE(pip); in mdi_rele_path()
2587 if (MDI_PI(pip)->pi_ref_cnt == 0) { in mdi_rele_path()
2588 cv_broadcast(&MDI_PI(pip)->pi_ref_cv); in mdi_rele_path()
2590 MDI_PI_UNLOCK(pip); in mdi_rele_path()
2601 mdi_pi_lock(mdi_pathinfo_t *pip) in mdi_pi_lock() argument
2603 ASSERT(pip != NULL); in mdi_pi_lock()
2604 if (pip) { in mdi_pi_lock()
2605 MDI_PI_LOCK(pip); in mdi_pi_lock()
2617 mdi_pi_unlock(mdi_pathinfo_t *pip) in mdi_pi_unlock() argument
2619 ASSERT(pip != NULL); in mdi_pi_unlock()
2620 if (pip) { in mdi_pi_unlock()
2621 MDI_PI_UNLOCK(pip); in mdi_pi_unlock()
2643 mdi_pathinfo_t *pip = NULL; in mdi_pi_find() local
2683 pip = (mdi_pathinfo_t *)ph->ph_path_head; in mdi_pi_find()
2685 while (pip != NULL) { in mdi_pi_find()
2686 if (strcmp(MDI_PI(pip)->pi_addr, paddr) == 0) { in mdi_pi_find()
2689 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_pi_find()
2693 "found %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_find()
2694 return (pip); in mdi_pi_find()
2738 pip = (mdi_pathinfo_t *)ct->ct_path_head; in mdi_pi_find()
2739 while (pip != NULL) { in mdi_pi_find()
2743 if ((MDI_PI(pip)->pi_phci == ph) && in mdi_pi_find()
2744 strcmp(MDI_PI(pip)->pi_addr, paddr) == 0) { in mdi_pi_find()
2747 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_pi_find()
2751 "found: %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_find()
2752 return (pip); in mdi_pi_find()
2783 mdi_pathinfo_t *pip = NULL; in mdi_pi_alloc_compatible() local
2865 pip = (mdi_pathinfo_t *)ct->ct_path_head; in mdi_pi_alloc_compatible()
2866 while (pip != NULL) { in mdi_pi_alloc_compatible()
2870 if ((MDI_PI(pip)->pi_phci == ph) && in mdi_pi_alloc_compatible()
2871 strcmp(MDI_PI(pip)->pi_addr, paddr) == 0) { in mdi_pi_alloc_compatible()
2874 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in mdi_pi_alloc_compatible()
2878 if (pip == NULL) { in mdi_pi_alloc_compatible()
2883 pip = i_mdi_pi_alloc(ph, paddr, ct); in mdi_pi_alloc_compatible()
2884 ASSERT(pip != NULL); in mdi_pi_alloc_compatible()
2901 *ret_pip = pip; in mdi_pi_alloc_compatible()
2904 "alloc %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_alloc_compatible()
2907 vhcache_pi_add(vh->vh_config, MDI_PI(pip)); in mdi_pi_alloc_compatible()
2931 mdi_pathinfo_t *pip; in i_mdi_pi_alloc() local
2941 pip = kmem_zalloc(sizeof (struct mdi_pathinfo), KM_SLEEP); in i_mdi_pi_alloc()
2942 mutex_init(&MDI_PI(pip)->pi_mutex, NULL, MUTEX_DEFAULT, NULL); in i_mdi_pi_alloc()
2943 MDI_PI(pip)->pi_state = MDI_PATHINFO_STATE_INIT | in i_mdi_pi_alloc()
2947 MDI_PI_SET_USER_DISABLE(pip); in i_mdi_pi_alloc()
2950 MDI_PI_SET_DRV_DISABLE_TRANS(pip); in i_mdi_pi_alloc()
2953 MDI_PI_SET_DRV_DISABLE(pip); in i_mdi_pi_alloc()
2955 MDI_PI(pip)->pi_old_state = MDI_PATHINFO_STATE_INIT; in i_mdi_pi_alloc()
2956 cv_init(&MDI_PI(pip)->pi_state_cv, NULL, CV_DEFAULT, NULL); in i_mdi_pi_alloc()
2957 MDI_PI(pip)->pi_client = ct; in i_mdi_pi_alloc()
2958 MDI_PI(pip)->pi_phci = ph; in i_mdi_pi_alloc()
2959 MDI_PI(pip)->pi_addr = kmem_alloc(strlen(paddr) + 1, KM_SLEEP); in i_mdi_pi_alloc()
2960 (void) strcpy(MDI_PI(pip)->pi_addr, paddr); in i_mdi_pi_alloc()
2974 mdi_pi_get_node_name(pip), mdi_pi_get_addr(pip)); in i_mdi_pi_alloc()
2991 mdi_pi_get_node_name(pip), mdi_pi_get_addr(pip)); in i_mdi_pi_alloc()
2998 MDI_PI(pip)->pi_path_instance = path_instance; in i_mdi_pi_alloc()
3000 (void) nvlist_alloc(&MDI_PI(pip)->pi_prop, NV_UNIQUE_NAME, KM_SLEEP); in i_mdi_pi_alloc()
3001 ASSERT(MDI_PI(pip)->pi_prop != NULL); in i_mdi_pi_alloc()
3002 MDI_PI(pip)->pi_pprivate = NULL; in i_mdi_pi_alloc()
3003 MDI_PI(pip)->pi_cprivate = NULL; in i_mdi_pi_alloc()
3004 MDI_PI(pip)->pi_vprivate = NULL; in i_mdi_pi_alloc()
3005 MDI_PI(pip)->pi_client_link = NULL; in i_mdi_pi_alloc()
3006 MDI_PI(pip)->pi_phci_link = NULL; in i_mdi_pi_alloc()
3007 MDI_PI(pip)->pi_ref_cnt = 0; in i_mdi_pi_alloc()
3008 MDI_PI(pip)->pi_kstats = NULL; in i_mdi_pi_alloc()
3009 MDI_PI(pip)->pi_preferred = 1; in i_mdi_pi_alloc()
3010 cv_init(&MDI_PI(pip)->pi_ref_cv, NULL, CV_DEFAULT, NULL); in i_mdi_pi_alloc()
3023 i_mdi_phci_add_path(ph, pip); in i_mdi_pi_alloc()
3024 i_mdi_client_add_path(ct, pip); in i_mdi_pi_alloc()
3029 return (pip); in i_mdi_pi_alloc()
3084 i_mdi_phci_add_path(mdi_phci_t *ph, mdi_pathinfo_t *pip) in i_mdi_phci_add_path() argument
3090 ph->ph_path_head = pip; in i_mdi_phci_add_path()
3092 MDI_PI(ph->ph_path_tail)->pi_phci_link = MDI_PI(pip); in i_mdi_phci_add_path()
3094 ph->ph_path_tail = pip; in i_mdi_phci_add_path()
3104 i_mdi_client_add_path(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_client_add_path() argument
3110 ct->ct_path_head = pip; in i_mdi_client_add_path()
3112 MDI_PI(ct->ct_path_tail)->pi_client_link = MDI_PI(pip); in i_mdi_client_add_path()
3114 ct->ct_path_tail = pip; in i_mdi_client_add_path()
3130 mdi_pi_free(mdi_pathinfo_t *pip, int flags) in mdi_pi_free() argument
3139 MDI_PI_LOCK(pip); in mdi_pi_free()
3140 ph = MDI_PI(pip)->pi_phci; in mdi_pi_free()
3148 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3149 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3159 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3160 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3164 ct = MDI_PI(pip)->pi_client; in mdi_pi_free()
3172 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3173 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3182 if (!(MDI_PI_IS_OFFLINE(pip) || MDI_PI_IS_INIT(pip) || in mdi_pi_free()
3183 MDI_PI_IS_INITING(pip))) { in mdi_pi_free()
3188 "!busy: pip %s %p", mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3189 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3193 while (MDI_PI(pip)->pi_ref_cnt != 0) { in mdi_pi_free()
3199 MDI_PI(pip)->pi_ref_cnt, in mdi_pi_free()
3200 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3201 if (cv_reltimedwait(&MDI_PI(pip)->pi_ref_cv, in mdi_pi_free()
3202 &MDI_PI(pip)->pi_mutex, drv_usectohz(60 * 1000000), in mdi_pi_free()
3210 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3213 MDI_PI(pip)->pi_ref_cnt, in mdi_pi_free()
3214 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_free()
3215 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3219 if (MDI_PI(pip)->pi_pm_held) { in mdi_pi_free()
3222 MDI_PI_UNLOCK(pip); in mdi_pi_free()
3224 vhcache_pi_remove(vh->vh_config, MDI_PI(pip)); in mdi_pi_free()
3242 if (!MDI_PI_IS_INITING(pip)) { in mdi_pi_free()
3245 rv = (*f)(vh->vh_dip, pip, 0); in mdi_pi_free()
3259 i_mdi_pi_free(ph, pip, ct); in mdi_pi_free()
3275 vhcache_pi_add(vh->vh_config, MDI_PI(pip)); in mdi_pi_free()
3285 i_mdi_pi_free(mdi_phci_t *ph, mdi_pathinfo_t *pip, mdi_client_t *ct) in i_mdi_pi_free() argument
3295 i_mdi_pi_kstat_destroy(pip); in i_mdi_pi_free()
3301 i_mdi_client_remove_path(ct, pip); in i_mdi_pi_free()
3302 i_mdi_phci_remove_path(ph, pip); in i_mdi_pi_free()
3307 mutex_destroy(&MDI_PI(pip)->pi_mutex); in i_mdi_pi_free()
3308 cv_destroy(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_free()
3309 cv_destroy(&MDI_PI(pip)->pi_ref_cv); in i_mdi_pi_free()
3310 if (MDI_PI(pip)->pi_addr) { in i_mdi_pi_free()
3311 kmem_free(MDI_PI(pip)->pi_addr, in i_mdi_pi_free()
3312 strlen(MDI_PI(pip)->pi_addr) + 1); in i_mdi_pi_free()
3313 MDI_PI(pip)->pi_addr = NULL; in i_mdi_pi_free()
3316 if (MDI_PI(pip)->pi_prop) { in i_mdi_pi_free()
3317 (void) nvlist_free(MDI_PI(pip)->pi_prop); in i_mdi_pi_free()
3318 MDI_PI(pip)->pi_prop = NULL; in i_mdi_pi_free()
3320 kmem_free(pip, sizeof (struct mdi_pathinfo)); in i_mdi_pi_free()
3331 i_mdi_phci_remove_path(mdi_phci_t *ph, mdi_pathinfo_t *pip) in i_mdi_phci_remove_path() argument
3341 if (path == pip) { in i_mdi_phci_remove_path()
3364 MDI_PI(pip)->pi_phci_link = NULL; in i_mdi_phci_remove_path()
3365 MDI_PI(pip)->pi_phci = NULL; in i_mdi_phci_remove_path()
3374 i_mdi_client_remove_path(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_client_remove_path() argument
3384 if (path == pip) { in i_mdi_client_remove_path()
3407 MDI_PI(pip)->pi_client_link = NULL; in i_mdi_client_remove_path()
3408 MDI_PI(pip)->pi_client = NULL; in i_mdi_client_remove_path()
3421 i_mdi_pi_state_change(mdi_pathinfo_t *pip, mdi_pathinfo_state_t state, int flag) in i_mdi_pi_state_change() argument
3430 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3432 ph = MDI_PI(pip)->pi_phci; in i_mdi_pi_state_change()
3438 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3441 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_state_change()
3451 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3454 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_state_change()
3458 ct = MDI_PI(pip)->pi_client; in i_mdi_pi_state_change()
3464 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3467 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_state_change()
3476 if (MDI_PI_IS_INITING(pip)) { in i_mdi_pi_state_change()
3477 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3480 rv = (*f)(vh->vh_dip, pip, 0); in i_mdi_pi_state_change()
3484 (void *)vh, mdi_pi_spathname(pip), in i_mdi_pi_state_change()
3485 (void *)pip)); in i_mdi_pi_state_change()
3489 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3490 MDI_PI_CLEAR_TRANSIENT(pip); in i_mdi_pi_state_change()
3497 i_mdi_phci_lock(ph, pip); in i_mdi_pi_state_change()
3501 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3513 if (MDI_PI_IS_TRANSIENT(pip)) { in i_mdi_pi_state_change()
3514 while (MDI_PI_IS_TRANSIENT(pip)) { in i_mdi_pi_state_change()
3515 cv_wait(&MDI_PI(pip)->pi_state_cv, in i_mdi_pi_state_change()
3516 &MDI_PI(pip)->pi_mutex); in i_mdi_pi_state_change()
3524 i_mdi_client_lock(ct, pip); in i_mdi_pi_state_change()
3525 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3536 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3539 MDI_PI_SET_ONLINING(pip); in i_mdi_pi_state_change()
3543 MDI_PI_SET_STANDBYING(pip); in i_mdi_pi_state_change()
3550 MDI_PI_SET_FAULTING(pip); in i_mdi_pi_state_change()
3551 MDI_PI_ERRSTAT(pip, MDI_PI_HARDERR); in i_mdi_pi_state_change()
3558 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3567 MDI_PI_IS_ONLINE(pip) && in i_mdi_pi_state_change()
3591 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3592 MDI_PI_SET_OFFLINING(pip); in i_mdi_pi_state_change()
3595 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3601 rv = (*f)(vh->vh_dip, pip, state, 0, flag); in i_mdi_pi_state_change()
3604 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3612 if (MDI_PI_IS_TRANSIENT(pip)) { in i_mdi_pi_state_change()
3614 MDI_PI_CLEAR_TRANSIENT(pip); in i_mdi_pi_state_change()
3616 MDI_PI(pip)->pi_state = MDI_PI_OLD_STATE(pip); in i_mdi_pi_state_change()
3623 cv_broadcast(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_state_change()
3624 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3671 MDI_PI_LOCK(pip); in i_mdi_pi_state_change()
3672 MDI_PI(pip)->pi_state = in i_mdi_pi_state_change()
3673 MDI_PI_OLD_STATE(pip); in i_mdi_pi_state_change()
3674 MDI_PI_UNLOCK(pip); in i_mdi_pi_state_change()
3713 i_mdi_report_path_state(ct, pip); in i_mdi_pi_state_change()
3747 mdi_pi_online(mdi_pathinfo_t *pip, int flags) in mdi_pi_online() argument
3749 mdi_client_t *ct = MDI_PI(pip)->pi_client; in mdi_pi_online()
3754 rv = i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_ONLINE, flags); in mdi_pi_online()
3758 MDI_PI_LOCK(pip); in mdi_pi_online()
3759 if (MDI_PI(pip)->pi_pm_held == 0) { in mdi_pi_online()
3761 "i_mdi_pm_hold_pip %p", (void *)pip)); in mdi_pi_online()
3762 i_mdi_pm_hold_pip(pip); in mdi_pi_online()
3765 MDI_PI_UNLOCK(pip); in mdi_pi_online()
3791 mdi_pi_standby(mdi_pathinfo_t *pip, int flags) in mdi_pi_standby() argument
3793 return (i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_STANDBY, flags)); in mdi_pi_standby()
3804 mdi_pi_fault(mdi_pathinfo_t *pip, int flags) in mdi_pi_fault() argument
3806 return (i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_FAULT, flags)); in mdi_pi_fault()
3817 mdi_pi_offline(mdi_pathinfo_t *pip, int flags) in mdi_pi_offline() argument
3832 ret = i_mdi_pi_state_change(pip, MDI_PATHINFO_STATE_OFFLINE, flags); in mdi_pi_offline()
3835 MDI_PI_LOCK(pip); in mdi_pi_offline()
3836 if (MDI_PI(pip)->pi_pm_held) { in mdi_pi_offline()
3839 MDI_PI_UNLOCK(pip); in mdi_pi_offline()
3842 ct = MDI_PI(pip)->pi_client; in mdi_pi_offline()
3859 i_mdi_pi_offline(mdi_pathinfo_t *pip, int flags) in i_mdi_pi_offline() argument
3867 MDI_PI_LOCK(pip); in i_mdi_pi_offline()
3868 ct = MDI_PI(pip)->pi_client; in i_mdi_pi_offline()
3871 while (MDI_PI(pip)->pi_ref_cnt != 0) { in i_mdi_pi_offline()
3877 MDI_PI(pip)->pi_ref_cnt, mdi_pi_spathname(pip), in i_mdi_pi_offline()
3878 (void *)pip)); in i_mdi_pi_offline()
3879 if (cv_reltimedwait(&MDI_PI(pip)->pi_ref_cv, in i_mdi_pi_offline()
3880 &MDI_PI(pip)->pi_mutex, drv_usectohz(60 * 1000000), in i_mdi_pi_offline()
3888 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_offline()
3891 MDI_PI(pip)->pi_ref_cnt, in i_mdi_pi_offline()
3892 mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_offline()
3905 MDI_PI_UNLOCK(pip); in i_mdi_pi_offline()
3906 if ((rv = (*f)(vdip, pip, MDI_PATHINFO_STATE_OFFLINE, 0, in i_mdi_pi_offline()
3911 (void *)vdip, mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pi_offline()
3913 MDI_PI_LOCK(pip); in i_mdi_pi_offline()
3919 MDI_PI_SET_OFFLINE(pip); in i_mdi_pi_offline()
3920 cv_broadcast(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_offline()
3921 MDI_PI_UNLOCK(pip); in i_mdi_pi_offline()
3972 i_mdi_report_path_state(ct, pip); in i_mdi_pi_offline()
3981 "ct = %p pip = %p", (void *)ct, (void *)pip)); in i_mdi_pi_offline()
3990 i_mdi_pi_online(mdi_pathinfo_t *pip, int flags) in i_mdi_pi_online() argument
3998 MDI_PI_LOCK(pip); in i_mdi_pi_online()
3999 ph = MDI_PI(pip)->pi_phci; in i_mdi_pi_online()
4001 ct = MDI_PI(pip)->pi_client; in i_mdi_pi_online()
4002 MDI_PI_SET_ONLINING(pip) in i_mdi_pi_online()
4003 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4006 rv = (*f)(vh->vh_dip, pip, MDI_PATHINFO_STATE_ONLINE, 0, in i_mdi_pi_online()
4009 MDI_PI_LOCK(pip); in i_mdi_pi_online()
4010 cv_broadcast(&MDI_PI(pip)->pi_state_cv); in i_mdi_pi_online()
4011 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4030 MDI_PI_LOCK(pip); in i_mdi_pi_online()
4031 MDI_PI(pip)->pi_state = in i_mdi_pi_online()
4032 MDI_PI_OLD_STATE(pip); in i_mdi_pi_online()
4033 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4040 i_mdi_report_path_state(ct, pip); in i_mdi_pi_online()
4052 MDI_PI_LOCK(pip); in i_mdi_pi_online()
4053 MDI_PI(pip)->pi_state = MDI_PI_OLD_STATE(pip); in i_mdi_pi_online()
4054 MDI_PI_UNLOCK(pip); in i_mdi_pi_online()
4070 mdi_pi_get_node_name(mdi_pathinfo_t *pip) in mdi_pi_get_node_name() argument
4074 if (pip == NULL) in mdi_pi_get_node_name()
4076 ct = MDI_PI(pip)->pi_client; in mdi_pi_get_node_name()
4090 mdi_pi_get_addr(mdi_pathinfo_t *pip) in mdi_pi_get_addr() argument
4092 if (pip == NULL) in mdi_pi_get_addr()
4095 return (MDI_PI(pip)->pi_addr); in mdi_pi_get_addr()
4106 mdi_pi_get_path_instance(mdi_pathinfo_t *pip) in mdi_pi_get_path_instance() argument
4108 if (pip == NULL) in mdi_pi_get_path_instance()
4111 return (MDI_PI(pip)->pi_path_instance); in mdi_pi_get_path_instance()
4119 mdi_pi_pathname(mdi_pathinfo_t *pip) in mdi_pi_pathname() argument
4121 if (pip == NULL) in mdi_pi_pathname()
4123 return (mdi_pi_pathname_by_instance(mdi_pi_get_path_instance(pip))); in mdi_pi_pathname()
4132 mdi_pi_spathname(mdi_pathinfo_t *pip) in mdi_pi_spathname() argument
4136 if (pip) { in mdi_pi_spathname()
4138 mdi_pi_get_path_instance(pip)); in mdi_pi_spathname()
4146 mdi_pi_pathname_obp(mdi_pathinfo_t *pip, char *path) in mdi_pi_pathname_obp() argument
4149 if ((pip == NULL) || (path == NULL)) in mdi_pi_pathname_obp()
4152 if (mdi_prop_lookup_string(pip, "obp-path", &obp_path) == MDI_SUCCESS) { in mdi_pi_pathname_obp()
4162 mdi_pi_pathname_obp_set(mdi_pathinfo_t *pip, char *component) in mdi_pi_pathname_obp_set() argument
4168 if (pip == NULL) in mdi_pi_pathname_obp_set()
4171 pdip = mdi_pi_get_phci(pip); in mdi_pi_pathname_obp_set()
4185 rc = mdi_prop_update_string(pip, "obp-path", obp_path); in mdi_pi_pathname_obp_set()
4200 mdi_pi_get_client(mdi_pathinfo_t *pip) in mdi_pi_get_client() argument
4203 if (pip) { in mdi_pi_get_client()
4204 dip = MDI_PI(pip)->pi_client->ct_dip; in mdi_pi_get_client()
4216 mdi_pi_get_phci(mdi_pathinfo_t *pip) in mdi_pi_get_phci() argument
4221 if (pip) { in mdi_pi_get_phci()
4222 ph = MDI_PI(pip)->pi_phci; in mdi_pi_get_phci()
4235 mdi_pi_get_client_private(mdi_pathinfo_t *pip) in mdi_pi_get_client_private() argument
4238 if (pip) { in mdi_pi_get_client_private()
4239 cprivate = MDI_PI(pip)->pi_cprivate; in mdi_pi_get_client_private()
4249 mdi_pi_set_client_private(mdi_pathinfo_t *pip, void *priv) in mdi_pi_set_client_private() argument
4251 if (pip) { in mdi_pi_set_client_private()
4252 MDI_PI(pip)->pi_cprivate = priv; in mdi_pi_set_client_private()
4262 mdi_pi_get_phci_private(mdi_pathinfo_t *pip) in mdi_pi_get_phci_private() argument
4266 if (pip) { in mdi_pi_get_phci_private()
4267 pprivate = MDI_PI(pip)->pi_pprivate; in mdi_pi_get_phci_private()
4277 mdi_pi_set_phci_private(mdi_pathinfo_t *pip, caddr_t priv) in mdi_pi_set_phci_private() argument
4279 if (pip) { in mdi_pi_set_phci_private()
4280 MDI_PI(pip)->pi_pprivate = priv; in mdi_pi_set_phci_private()
4290 mdi_pi_get_state(mdi_pathinfo_t *pip) in mdi_pi_get_state() argument
4294 if (pip) { in mdi_pi_get_state()
4295 if (MDI_PI_IS_TRANSIENT(pip)) { in mdi_pi_get_state()
4300 state = MDI_PI_OLD_STATE(pip); in mdi_pi_get_state()
4302 state = MDI_PI_STATE(pip); in mdi_pi_get_state()
4313 mdi_pi_get_flags(mdi_pathinfo_t *pip) in mdi_pi_get_flags() argument
4315 return (pip ? MDI_PI(pip)->pi_flags : 0); in mdi_pi_get_flags()
4323 mdi_pi_get_state2(mdi_pathinfo_t *pip, mdi_pathinfo_state_t *state, in mdi_pi_get_state2() argument
4328 if (pip) { in mdi_pi_get_state2()
4329 if (MDI_PI_IS_TRANSIENT(pip)) { in mdi_pi_get_state2()
4334 *state = MDI_PI_OLD_STATE(pip); in mdi_pi_get_state2()
4335 *ext_state = MDI_PI_OLD_EXT_STATE(pip); in mdi_pi_get_state2()
4337 *state = MDI_PI_STATE(pip); in mdi_pi_get_state2()
4338 *ext_state = MDI_PI_EXT_STATE(pip); in mdi_pi_get_state2()
4349 mdi_pi_get_preferred(mdi_pathinfo_t *pip) in mdi_pi_get_preferred() argument
4351 if (pip) { in mdi_pi_get_preferred()
4352 return (MDI_PI(pip)->pi_preferred); in mdi_pi_get_preferred()
4362 mdi_pi_set_preferred(mdi_pathinfo_t *pip, int preferred) in mdi_pi_set_preferred() argument
4364 if (pip) { in mdi_pi_set_preferred()
4365 MDI_PI(pip)->pi_preferred = preferred; in mdi_pi_set_preferred()
4374 mdi_pi_set_state(mdi_pathinfo_t *pip, mdi_pathinfo_state_t state) in mdi_pi_set_state() argument
4378 if (pip) { in mdi_pi_set_state()
4379 ext_state = MDI_PI(pip)->pi_state & MDI_PATHINFO_EXT_STATE_MASK; in mdi_pi_set_state()
4380 MDI_PI(pip)->pi_state = state; in mdi_pi_set_state()
4381 MDI_PI(pip)->pi_state |= ext_state; in mdi_pi_set_state()
4421 mdi_pi_get_next_prop(mdi_pathinfo_t *pip, nvpair_t *prev) in mdi_pi_get_next_prop() argument
4423 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_pi_get_next_prop()
4426 ASSERT(MDI_PI_LOCKED(pip)); in mdi_pi_get_next_prop()
4427 return (nvlist_next_nvpair(MDI_PI(pip)->pi_prop, prev)); in mdi_pi_get_next_prop()
4435 mdi_prop_remove(mdi_pathinfo_t *pip, char *name) in mdi_prop_remove() argument
4437 if (pip == NULL) { in mdi_prop_remove()
4440 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_remove()
4441 MDI_PI_LOCK(pip); in mdi_prop_remove()
4442 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_remove()
4443 MDI_PI_UNLOCK(pip); in mdi_prop_remove()
4447 (void) nvlist_remove_all(MDI_PI(pip)->pi_prop, name); in mdi_prop_remove()
4451 nvp = nvlist_next_nvpair(MDI_PI(pip)->pi_prop, NULL); in mdi_prop_remove()
4454 next = nvlist_next_nvpair(MDI_PI(pip)->pi_prop, nvp); in mdi_prop_remove()
4457 (void) nvlist_remove_all(MDI_PI(pip)->pi_prop, in mdi_prop_remove()
4462 MDI_PI_UNLOCK(pip); in mdi_prop_remove()
4473 mdi_prop_size(mdi_pathinfo_t *pip, size_t *buflenp) in mdi_prop_size() argument
4479 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_size()
4482 ASSERT(MDI_PI_LOCKED(pip)); in mdi_prop_size()
4483 rv = nvlist_size(MDI_PI(pip)->pi_prop, in mdi_prop_size()
4495 mdi_prop_pack(mdi_pathinfo_t *pip, char **bufp, uint_t buflen) in mdi_prop_pack() argument
4500 if ((pip == NULL) || MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_pack()
4504 ASSERT(MDI_PI_LOCKED(pip)); in mdi_prop_pack()
4507 rv = nvlist_pack(MDI_PI(pip)->pi_prop, bufp, (size_t *)&bufsize, in mdi_prop_pack()
4518 mdi_prop_update_byte(mdi_pathinfo_t *pip, char *name, uchar_t data) in mdi_prop_update_byte() argument
4522 if (pip == NULL) { in mdi_prop_update_byte()
4525 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_byte()
4526 MDI_PI_LOCK(pip); in mdi_prop_update_byte()
4527 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_byte()
4528 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte()
4531 rv = nvlist_add_byte(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_update_byte()
4532 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte()
4541 mdi_prop_update_byte_array(mdi_pathinfo_t *pip, char *name, uchar_t *data, in mdi_prop_update_byte_array() argument
4546 if (pip == NULL) { in mdi_prop_update_byte_array()
4549 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_byte_array()
4550 MDI_PI_LOCK(pip); in mdi_prop_update_byte_array()
4551 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_byte_array()
4552 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte_array()
4555 rv = nvlist_add_byte_array(MDI_PI(pip)->pi_prop, name, data, nelements); in mdi_prop_update_byte_array()
4556 MDI_PI_UNLOCK(pip); in mdi_prop_update_byte_array()
4565 mdi_prop_update_int(mdi_pathinfo_t *pip, char *name, int data) in mdi_prop_update_int() argument
4569 if (pip == NULL) { in mdi_prop_update_int()
4572 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_int()
4573 MDI_PI_LOCK(pip); in mdi_prop_update_int()
4574 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_int()
4575 MDI_PI_UNLOCK(pip); in mdi_prop_update_int()
4578 rv = nvlist_add_int32(MDI_PI(pip)->pi_prop, name, (int32_t)data); in mdi_prop_update_int()
4579 MDI_PI_UNLOCK(pip); in mdi_prop_update_int()
4588 mdi_prop_update_int64(mdi_pathinfo_t *pip, char *name, int64_t data) in mdi_prop_update_int64() argument
4592 if (pip == NULL) { in mdi_prop_update_int64()
4595 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_int64()
4596 MDI_PI_LOCK(pip); in mdi_prop_update_int64()
4597 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_int64()
4598 MDI_PI_UNLOCK(pip); in mdi_prop_update_int64()
4601 rv = nvlist_add_int64(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_update_int64()
4602 MDI_PI_UNLOCK(pip); in mdi_prop_update_int64()
4611 mdi_prop_update_int_array(mdi_pathinfo_t *pip, char *name, int *data, in mdi_prop_update_int_array() argument
4616 if (pip == NULL) { in mdi_prop_update_int_array()
4619 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_int_array()
4620 MDI_PI_LOCK(pip); in mdi_prop_update_int_array()
4621 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_int_array()
4622 MDI_PI_UNLOCK(pip); in mdi_prop_update_int_array()
4625 rv = nvlist_add_int32_array(MDI_PI(pip)->pi_prop, name, (int32_t *)data, in mdi_prop_update_int_array()
4627 MDI_PI_UNLOCK(pip); in mdi_prop_update_int_array()
4636 mdi_prop_update_string(mdi_pathinfo_t *pip, char *name, char *data) in mdi_prop_update_string() argument
4640 if (pip == NULL) { in mdi_prop_update_string()
4643 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_string()
4644 MDI_PI_LOCK(pip); in mdi_prop_update_string()
4645 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_string()
4646 MDI_PI_UNLOCK(pip); in mdi_prop_update_string()
4649 rv = nvlist_add_string(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_update_string()
4650 MDI_PI_UNLOCK(pip); in mdi_prop_update_string()
4659 mdi_prop_update_string_array(mdi_pathinfo_t *pip, char *name, char **data, in mdi_prop_update_string_array() argument
4664 if (pip == NULL) { in mdi_prop_update_string_array()
4667 ASSERT(!MDI_PI_LOCKED(pip)); in mdi_prop_update_string_array()
4668 MDI_PI_LOCK(pip); in mdi_prop_update_string_array()
4669 if (MDI_PI(pip)->pi_prop == NULL) { in mdi_prop_update_string_array()
4670 MDI_PI_UNLOCK(pip); in mdi_prop_update_string_array()
4673 rv = nvlist_add_string_array(MDI_PI(pip)->pi_prop, name, data, in mdi_prop_update_string_array()
4675 MDI_PI_UNLOCK(pip); in mdi_prop_update_string_array()
4686 mdi_prop_lookup_byte(mdi_pathinfo_t *pip, char *name, uchar_t *data) in mdi_prop_lookup_byte() argument
4690 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_byte()
4693 rv = nvlist_lookup_byte(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_lookup_byte()
4705 mdi_prop_lookup_byte_array(mdi_pathinfo_t *pip, char *name, uchar_t **data, in mdi_prop_lookup_byte_array() argument
4710 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_byte_array()
4713 rv = nvlist_lookup_byte_array(MDI_PI(pip)->pi_prop, name, data, in mdi_prop_lookup_byte_array()
4725 mdi_prop_lookup_int(mdi_pathinfo_t *pip, char *name, int *data) in mdi_prop_lookup_int() argument
4729 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_int()
4732 rv = nvlist_lookup_int32(MDI_PI(pip)->pi_prop, name, (int32_t *)data); in mdi_prop_lookup_int()
4743 mdi_prop_lookup_int64(mdi_pathinfo_t *pip, char *name, int64_t *data) in mdi_prop_lookup_int64() argument
4746 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_int64()
4749 rv = nvlist_lookup_int64(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_lookup_int64()
4760 mdi_prop_lookup_int_array(mdi_pathinfo_t *pip, char *name, int **data, in mdi_prop_lookup_int_array() argument
4765 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_int_array()
4768 rv = nvlist_lookup_int32_array(MDI_PI(pip)->pi_prop, name, in mdi_prop_lookup_int_array()
4780 mdi_prop_lookup_string(mdi_pathinfo_t *pip, char *name, char **data) in mdi_prop_lookup_string() argument
4784 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_string()
4787 rv = nvlist_lookup_string(MDI_PI(pip)->pi_prop, name, data); in mdi_prop_lookup_string()
4798 mdi_prop_lookup_string_array(mdi_pathinfo_t *pip, char *name, char ***data, in mdi_prop_lookup_string_array() argument
4803 if ((pip == NULL) || (MDI_PI(pip)->pi_prop == NULL)) { in mdi_prop_lookup_string_array()
4806 rv = nvlist_lookup_string_array(MDI_PI(pip)->pi_prop, name, data, in mdi_prop_lookup_string_array()
4827 i_mdi_report_path_state(mdi_client_t *ct, mdi_pathinfo_t *pip) in i_mdi_report_path_state() argument
4854 if (MDI_PI_FLAGS_IS_DEVICE_REMOVED(pip)) { in i_mdi_report_path_state()
4856 } else if (MDI_PI_IS_OFFLINE(pip)) { in i_mdi_report_path_state()
4858 } else if (MDI_PI_IS_ONLINE(pip)) { in i_mdi_report_path_state()
4861 } else if (MDI_PI_IS_STANDBY(pip)) { in i_mdi_report_path_state()
4863 } else if (MDI_PI_IS_FAULT(pip)) { in i_mdi_report_path_state()
4895 mdi_pi_get_path_instance(pip), in i_mdi_report_path_state()
4896 mdi_pi_spathname(pip), status, lb_buf); in i_mdi_report_path_state()
4903 mdi_pi_get_path_instance(pip), in i_mdi_report_path_state()
4904 mdi_pi_spathname(pip), status); in i_mdi_report_path_state()
5118 mdi_pathinfo_t *pip; in i_mdi_phci_offline() local
5159 pip = ph->ph_path_head; in i_mdi_phci_offline()
5160 while (pip != NULL) { in i_mdi_phci_offline()
5161 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5162 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5168 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_offline()
5169 i_mdi_client_lock(ct, pip); in i_mdi_phci_offline()
5179 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5184 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5209 failed_pip = pip; in i_mdi_phci_offline()
5213 pip = next; in i_mdi_phci_offline()
5217 pip = next; in i_mdi_phci_offline()
5222 pip = ph->ph_path_head; in i_mdi_phci_offline()
5223 while (pip != failed_pip) { in i_mdi_phci_offline()
5224 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5225 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5226 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_offline()
5227 i_mdi_client_lock(ct, pip); in i_mdi_phci_offline()
5233 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5238 pip = next; in i_mdi_phci_offline()
5245 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5251 pip = next; in i_mdi_phci_offline()
5256 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5258 pip = next; in i_mdi_phci_offline()
5272 pip = ph->ph_path_head; in i_mdi_phci_offline()
5273 while (pip != NULL) { in i_mdi_phci_offline()
5274 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5275 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5276 MDI_PI_SET_OFFLINING(pip); in i_mdi_phci_offline()
5277 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5278 pip = next; in i_mdi_phci_offline()
5286 pip = ph->ph_path_head; in i_mdi_phci_offline()
5287 while (pip != NULL) { in i_mdi_phci_offline()
5288 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_offline()
5289 (void) i_mdi_pi_offline(pip, flags); in i_mdi_phci_offline()
5290 MDI_PI_LOCK(pip); in i_mdi_phci_offline()
5291 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_offline()
5292 if (!MDI_PI_IS_OFFLINE(pip)) { in i_mdi_phci_offline()
5297 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5302 MDI_PI_UNLOCK(pip); in i_mdi_phci_offline()
5303 pip = next; in i_mdi_phci_offline()
5315 mdi_pathinfo_t *pip; in mdi_phci_mark_retiring() local
5335 pip = ph->ph_path_head; in mdi_phci_mark_retiring()
5336 while (pip != NULL) { in mdi_phci_mark_retiring()
5337 MDI_PI_LOCK(pip); in mdi_phci_mark_retiring()
5338 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_mark_retiring()
5340 ct = MDI_PI(pip)->pi_client; in mdi_phci_mark_retiring()
5341 i_mdi_client_lock(ct, pip); in mdi_phci_mark_retiring()
5342 MDI_PI_UNLOCK(pip); in mdi_phci_mark_retiring()
5353 pip = next; in mdi_phci_mark_retiring()
5356 pip = next; in mdi_phci_mark_retiring()
5370 mdi_pathinfo_t *pip; in mdi_phci_retire_notify() local
5396 pip = ph->ph_path_head; in mdi_phci_retire_notify()
5397 while (pip != NULL) { in mdi_phci_retire_notify()
5398 MDI_PI_LOCK(pip); in mdi_phci_retire_notify()
5399 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_notify()
5405 ct = MDI_PI(pip)->pi_client; in mdi_phci_retire_notify()
5406 i_mdi_client_lock(ct, pip); in mdi_phci_retire_notify()
5412 MDI_PI_UNLOCK(pip); in mdi_phci_retire_notify()
5418 MDI_PI_UNLOCK(pip); in mdi_phci_retire_notify()
5432 pip = next; in mdi_phci_retire_notify()
5435 pip = next; in mdi_phci_retire_notify()
5459 mdi_pathinfo_t *pip; in mdi_phci_retire_finalize() local
5489 pip = ph->ph_path_head; in mdi_phci_retire_finalize()
5490 while (pip != NULL) { in mdi_phci_retire_finalize()
5491 MDI_PI_LOCK(pip); in mdi_phci_retire_finalize()
5492 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_finalize()
5497 ct = MDI_PI(pip)->pi_client; in mdi_phci_retire_finalize()
5498 i_mdi_client_lock(ct, pip); in mdi_phci_retire_finalize()
5503 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5532 pip = next; in mdi_phci_retire_finalize()
5535 pip = next; in mdi_phci_retire_finalize()
5563 pip = ph->ph_path_head; in mdi_phci_retire_finalize()
5564 while (pip != NULL) { in mdi_phci_retire_finalize()
5565 MDI_PI_LOCK(pip); in mdi_phci_retire_finalize()
5566 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_finalize()
5567 MDI_PI_SET_OFFLINING(pip); in mdi_phci_retire_finalize()
5568 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5569 pip = next; in mdi_phci_retire_finalize()
5577 pip = ph->ph_path_head; in mdi_phci_retire_finalize()
5578 while (pip != NULL) { in mdi_phci_retire_finalize()
5579 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_retire_finalize()
5580 (void) i_mdi_pi_offline(pip, 0); in mdi_phci_retire_finalize()
5581 MDI_PI_LOCK(pip); in mdi_phci_retire_finalize()
5582 ct = MDI_PI(pip)->pi_client; in mdi_phci_retire_finalize()
5583 if (!MDI_PI_IS_OFFLINE(pip)) { in mdi_phci_retire_finalize()
5586 mdi_pi_get_path_instance(pip), in mdi_phci_retire_finalize()
5587 mdi_pi_spathname(pip)); in mdi_phci_retire_finalize()
5588 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5593 MDI_PI_UNLOCK(pip); in mdi_phci_retire_finalize()
5594 pip = next; in mdi_phci_retire_finalize()
5605 mdi_pathinfo_t *pip; in mdi_phci_unretire() local
5617 pip = ph->ph_path_head; in mdi_phci_unretire()
5618 while (pip != NULL) { in mdi_phci_unretire()
5619 MDI_PI_LOCK(pip); in mdi_phci_unretire()
5620 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in mdi_phci_unretire()
5621 MDI_PI_UNLOCK(pip); in mdi_phci_unretire()
5622 (void) i_mdi_pi_online(pip, 0); in mdi_phci_unretire()
5623 pip = next; in mdi_phci_unretire()
5822 mdi_pathinfo_t *pip; in i_mdi_phci_pre_detach() local
5863 pip = ph->ph_path_head; in i_mdi_phci_pre_detach()
5864 while (pip != NULL && rv == DDI_SUCCESS) { in i_mdi_phci_pre_detach()
5866 MDI_PI_LOCK(pip); in i_mdi_phci_pre_detach()
5868 (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_pre_detach()
5869 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_pre_detach()
5870 i_mdi_client_lock(ct, pip); in i_mdi_phci_pre_detach()
5872 MDI_PI_UNLOCK(pip); in i_mdi_phci_pre_detach()
5886 failed_pip = pip; in i_mdi_phci_pre_detach()
5892 pip = next; in i_mdi_phci_pre_detach()
5906 pip = ph->ph_path_head; in i_mdi_phci_pre_detach()
5907 while (pip != failed_pip) { in i_mdi_phci_pre_detach()
5909 MDI_PI_LOCK(pip); in i_mdi_phci_pre_detach()
5911 (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_phci_pre_detach()
5912 ct = MDI_PI(pip)->pi_client; in i_mdi_phci_pre_detach()
5913 i_mdi_client_lock(ct, pip); in i_mdi_phci_pre_detach()
5915 MDI_PI_UNLOCK(pip); in i_mdi_phci_pre_detach()
5922 pip = next; in i_mdi_phci_pre_detach()
6073 mdi_pi_kstat_exists(mdi_pathinfo_t *pip) in mdi_pi_kstat_exists() argument
6075 return (MDI_PI(pip)->pi_kstats ? 1 : 0); in mdi_pi_kstat_exists()
6084 mdi_pi_kstat_create(mdi_pathinfo_t *pip, char *ksname) in mdi_pi_kstat_create() argument
6090 if (MDI_PI(pip)->pi_kstats != NULL) in mdi_pi_kstat_create()
6132 MDI_PI(pip)->pi_kstats = mdi_statp; in mdi_pi_kstat_create()
6140 i_mdi_pi_kstat_destroy(mdi_pathinfo_t *pip) in i_mdi_pi_kstat_destroy() argument
6145 if (MDI_PI(pip)->pi_kstats == NULL) in i_mdi_pi_kstat_destroy()
6147 if ((mdi_statp = MDI_PI(pip)->pi_kstats) == NULL) in i_mdi_pi_kstat_destroy()
6150 MDI_PI(pip)->pi_kstats = NULL; in i_mdi_pi_kstat_destroy()
6170 mdi_pi_kstat_iosupdate(mdi_pathinfo_t *pip, struct buf *bp) in mdi_pi_kstat_iosupdate() argument
6175 ASSERT(pip != NULL); in mdi_pi_kstat_iosupdate()
6181 if (bp != NULL && MDI_PI(pip)->pi_kstats != NULL) { in mdi_pi_kstat_iosupdate()
6182 iostatp = MDI_PI(pip)->pi_kstats->pi_kstat_iostats; in mdi_pi_kstat_iosupdate()
6200 mdi_pi_enable_path(mdi_pathinfo_t *pip, int flags) in mdi_pi_enable_path() argument
6204 ph = MDI_PI(pip)->pi_phci; in mdi_pi_enable_path()
6206 MDI_DEBUG(1, (MDI_NOTE, mdi_pi_get_phci(pip), in mdi_pi_enable_path()
6208 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_enable_path()
6212 (void) i_mdi_enable_disable_path(pip, ph->ph_vhci, flags, in mdi_pi_enable_path()
6216 (void *)pip, (void *)ph)); in mdi_pi_enable_path()
6227 mdi_pi_disable_path(mdi_pathinfo_t *pip, int flags) in mdi_pi_disable_path() argument
6231 ph = MDI_PI(pip)->pi_phci; in mdi_pi_disable_path()
6233 MDI_DEBUG(1, (MDI_NOTE, mdi_pi_get_phci(pip), in mdi_pi_disable_path()
6235 mdi_pi_spathname(pip), (void *)pip)); in mdi_pi_disable_path()
6239 (void) i_mdi_enable_disable_path(pip, in mdi_pi_disable_path()
6243 (void *)pip, (void *)ph)); in mdi_pi_disable_path()
6280 i_mdi_enable_disable_path(mdi_pathinfo_t *pip, mdi_vhci_t *vh, int flags, in i_mdi_enable_disable_path() argument
6293 if ((MDI_PI_IS_DISABLE(pip) && op == MDI_DISABLE_OP) || in i_mdi_enable_disable_path()
6294 (!MDI_PI_IS_DISABLE(pip) && op == MDI_ENABLE_OP)) { in i_mdi_enable_disable_path()
6295 MDI_PI_LOCK(pip); in i_mdi_enable_disable_path()
6296 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_enable_disable_path()
6297 MDI_PI_UNLOCK(pip); in i_mdi_enable_disable_path()
6310 rv = (*f)(vh->vh_dip, pip, 0, in i_mdi_enable_disable_path()
6311 MDI_PI_EXT_STATE(pip), in i_mdi_enable_disable_path()
6319 MDI_PI_LOCK(pip); in i_mdi_enable_disable_path()
6320 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_phci_link; in i_mdi_enable_disable_path()
6325 MDI_PI_SET_USER_DISABLE(pip); in i_mdi_enable_disable_path()
6327 MDI_PI_SET_USER_ENABLE(pip); in i_mdi_enable_disable_path()
6332 MDI_PI_SET_DRV_DISABLE(pip); in i_mdi_enable_disable_path()
6334 MDI_PI_SET_DRV_ENABLE(pip); in i_mdi_enable_disable_path()
6339 MDI_PI_SET_DRV_DISABLE_TRANS(pip); in i_mdi_enable_disable_path()
6341 MDI_PI_SET_DRV_ENABLE_TRANS(pip); in i_mdi_enable_disable_path()
6345 MDI_PI_UNLOCK(pip); in i_mdi_enable_disable_path()
6351 rv = (*f)(vh->vh_dip, pip, 0, in i_mdi_enable_disable_path()
6352 MDI_PI_EXT_STATE(pip), in i_mdi_enable_disable_path()
6375 mdi_pathinfo_t *next, *pip; in i_mdi_pi_enable_disable() local
6435 pip = ph->ph_path_head; in i_mdi_pi_enable_disable()
6436 while (pip != NULL) { in i_mdi_pi_enable_disable()
6437 pip = i_mdi_enable_disable_path(pip, vh, flags, op); in i_mdi_pi_enable_disable()
6453 pip = ct->ct_path_head; in i_mdi_pi_enable_disable()
6455 while (pip != NULL) { in i_mdi_pi_enable_disable()
6456 MDI_PI_LOCK(pip); in i_mdi_pi_enable_disable()
6457 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_pi_enable_disable()
6458 if (MDI_PI(pip)->pi_phci == ph) { in i_mdi_pi_enable_disable()
6459 MDI_PI_UNLOCK(pip); in i_mdi_pi_enable_disable()
6463 MDI_PI_UNLOCK(pip); in i_mdi_pi_enable_disable()
6464 pip = next; in i_mdi_pi_enable_disable()
6475 (void) i_mdi_enable_disable_path(pip, vh, flags, op); in i_mdi_pi_enable_disable()
6488 i_mdi_pm_hold_pip(mdi_pathinfo_t *pip) in i_mdi_pm_hold_pip() argument
6492 ASSERT(pip != NULL); in i_mdi_pm_hold_pip()
6493 ASSERT(MDI_PI_LOCKED(pip)); in i_mdi_pm_hold_pip()
6495 if (MDI_PI(pip)->pi_pm_held) { in i_mdi_pm_hold_pip()
6499 ph_dip = mdi_pi_get_phci(pip); in i_mdi_pm_hold_pip()
6501 "%s %p", mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pm_hold_pip()
6506 MDI_PI_UNLOCK(pip); in i_mdi_pm_hold_pip()
6512 MDI_PI_LOCK(pip); in i_mdi_pm_hold_pip()
6516 MDI_PI(pip)->pi_pm_held = 1; in i_mdi_pm_hold_pip()
6523 i_mdi_pm_rele_pip(mdi_pathinfo_t *pip) in i_mdi_pm_rele_pip() argument
6527 ASSERT(pip != NULL); in i_mdi_pm_rele_pip()
6528 ASSERT(MDI_PI_LOCKED(pip)); in i_mdi_pm_rele_pip()
6530 if (MDI_PI(pip)->pi_pm_held == 0) { in i_mdi_pm_rele_pip()
6534 ph_dip = mdi_pi_get_phci(pip); in i_mdi_pm_rele_pip()
6538 "%s %p", mdi_pi_spathname(pip), (void *)pip)); in i_mdi_pm_rele_pip()
6540 MDI_PI_UNLOCK(pip); in i_mdi_pm_rele_pip()
6546 MDI_PI_LOCK(pip); in i_mdi_pm_rele_pip()
6548 MDI_PI(pip)->pi_pm_held = 0; in i_mdi_pm_rele_pip()
6566 mdi_pathinfo_t *pip; in i_mdi_rele_all_phci() local
6569 pip = (mdi_pathinfo_t *)ct->ct_path_head; in i_mdi_rele_all_phci()
6570 while (pip != NULL) { in i_mdi_rele_all_phci()
6571 mdi_hold_path(pip); in i_mdi_rele_all_phci()
6572 MDI_PI_LOCK(pip); in i_mdi_rele_all_phci()
6573 i_mdi_pm_rele_pip(pip); in i_mdi_rele_all_phci()
6574 MDI_PI_UNLOCK(pip); in i_mdi_rele_all_phci()
6575 mdi_rele_path(pip); in i_mdi_rele_all_phci()
6576 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_rele_all_phci()
6613 i_mdi_power_one_phci(mdi_pathinfo_t *pip) in i_mdi_power_one_phci() argument
6618 MDI_PI_LOCK(pip); in i_mdi_power_one_phci()
6619 i_mdi_pm_hold_pip(pip); in i_mdi_power_one_phci()
6621 ph_dip = mdi_pi_get_phci(pip); in i_mdi_power_one_phci()
6622 MDI_PI_UNLOCK(pip); in i_mdi_power_one_phci()
6627 ddi_get_instance(ph_dip), (void *)pip)); in i_mdi_power_one_phci()
6635 (void *)pip)); in i_mdi_power_one_phci()
6637 MDI_PI_LOCK(pip); in i_mdi_power_one_phci()
6638 i_mdi_pm_rele_pip(pip); in i_mdi_power_one_phci()
6639 MDI_PI_UNLOCK(pip); in i_mdi_power_one_phci()
6649 mdi_pathinfo_t *pip; in i_mdi_power_all_phci() local
6653 pip = (mdi_pathinfo_t *)ct->ct_path_head; in i_mdi_power_all_phci()
6654 while (pip != NULL) { in i_mdi_power_all_phci()
6659 if (MDI_PI_IS_INIT(pip) || in i_mdi_power_all_phci()
6660 MDI_PI_IS_ONLINE(pip) || MDI_PI_IS_STANDBY(pip)) { in i_mdi_power_all_phci()
6661 mdi_hold_path(pip); in i_mdi_power_all_phci()
6663 if (i_mdi_power_one_phci(pip) == MDI_SUCCESS) in i_mdi_power_all_phci()
6666 ASSERT(ct == MDI_PI(pip)->pi_client); in i_mdi_power_all_phci()
6668 mdi_rele_path(pip); in i_mdi_power_all_phci()
6670 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_power_all_phci()
7016 mdi_pathinfo_t *pip, *next; in i_mdi_pm_post_config_one() local
7020 pip = ct->ct_path_head; in i_mdi_pm_post_config_one()
7021 while (pip != NULL) { in i_mdi_pm_post_config_one()
7022 MDI_PI_LOCK(pip); in i_mdi_pm_post_config_one()
7023 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_pm_post_config_one()
7024 if (MDI_PI_IS_ONLINE(pip) || MDI_PI_IS_STANDBY(pip)) in i_mdi_pm_post_config_one()
7026 MDI_PI_UNLOCK(pip); in i_mdi_pm_post_config_one()
7027 pip = next; in i_mdi_pm_post_config_one()
7089 mdi_pathinfo_t *pip, *next; in i_mdi_pm_post_unconfig_one() local
7093 pip = ct->ct_path_head; in i_mdi_pm_post_unconfig_one()
7094 while (pip != NULL) { in i_mdi_pm_post_unconfig_one()
7095 MDI_PI_LOCK(pip); in i_mdi_pm_post_unconfig_one()
7096 next = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link; in i_mdi_pm_post_unconfig_one()
7097 if (MDI_PI_IS_ONLINE(pip) || MDI_PI_IS_STANDBY(pip)) in i_mdi_pm_post_unconfig_one()
7099 MDI_PI_UNLOCK(pip); in i_mdi_pm_post_unconfig_one()
7100 pip = next; in i_mdi_pm_post_unconfig_one()
7300 mdi_pi_get_vhci_private(mdi_pathinfo_t *pip) in mdi_pi_get_vhci_private() argument
7303 if (pip) { in mdi_pi_get_vhci_private()
7304 vprivate = MDI_PI(pip)->pi_vprivate; in mdi_pi_get_vhci_private()
7314 mdi_pi_set_vhci_private(mdi_pathinfo_t *pip, void *priv) in mdi_pi_set_vhci_private() argument
7316 if (pip) { in mdi_pi_set_vhci_private()
7317 MDI_PI(pip)->pi_vprivate = priv; in mdi_pi_set_vhci_private()
7354 mdi_pi_ishidden(mdi_pathinfo_t *pip) in mdi_pi_ishidden() argument
7356 return (MDI_PI_FLAGS_IS_HIDDEN(pip)); in mdi_pi_ishidden()
7360 mdi_pi_device_isremoved(mdi_pathinfo_t *pip) in mdi_pi_device_isremoved() argument
7362 return (MDI_PI_FLAGS_IS_DEVICE_REMOVED(pip)); in mdi_pi_device_isremoved()
7369 mdi_pathinfo_t *pip; in i_mdi_client_all_devices_removed() local
7373 for (pip = ct->ct_path_head; pip; in i_mdi_client_all_devices_removed()
7374 pip = (mdi_pathinfo_t *)MDI_PI(pip)->pi_client_link) { in i_mdi_client_all_devices_removed()
7375 if (!mdi_pi_device_isremoved(pip)) { in i_mdi_client_all_devices_removed()
7388 mdi_pi_device_remove(mdi_pathinfo_t *pip) in mdi_pi_device_remove() argument
7392 MDI_PI_LOCK(pip); in mdi_pi_device_remove()
7393 if (mdi_pi_device_isremoved(pip)) { in mdi_pi_device_remove()
7394 MDI_PI_UNLOCK(pip); in mdi_pi_device_remove()
7397 MDI_PI_FLAGS_SET_DEVICE_REMOVED(pip); in mdi_pi_device_remove()
7398 MDI_PI_FLAGS_SET_HIDDEN(pip); in mdi_pi_device_remove()
7399 MDI_PI_UNLOCK(pip); in mdi_pi_device_remove()
7405 ct = MDI_PI(pip)->pi_client; in mdi_pi_device_remove()
7419 mdi_pi_device_insert(mdi_pathinfo_t *pip) in mdi_pi_device_insert() argument
7421 MDI_PI_LOCK(pip); in mdi_pi_device_insert()
7422 if (!mdi_pi_device_isremoved(pip)) { in mdi_pi_device_insert()
7423 MDI_PI_UNLOCK(pip); in mdi_pi_device_insert()
7426 MDI_PI_FLAGS_CLR_DEVICE_REMOVED(pip); in mdi_pi_device_insert()
7427 MDI_PI_FLAGS_CLR_HIDDEN(pip); in mdi_pi_device_insert()
7428 MDI_PI_UNLOCK(pip); in mdi_pi_device_insert()
8205 vhcache_pi_add(mdi_vhci_config_t *vhc, struct mdi_pathinfo *pip) in vhcache_pi_add() argument
8210 mdi_phci_t *ph = pip->pi_phci; in vhcache_pi_add()
8211 mdi_client_t *ct = pip->pi_client; in vhcache_pi_add()
8230 strcmp(cpi->cpi_addr, pip->pi_addr) == 0) { in vhcache_pi_add()
8231 cpi->cpi_pip = pip; in vhcache_pi_add()
8244 cpi->cpi_addr = i_ddi_strdup(pip->pi_addr, KM_SLEEP); in vhcache_pi_add()
8247 cpi->cpi_pip = pip; in vhcache_pi_add()
8262 vhcache_pi_remove(mdi_vhci_config_t *vhc, struct mdi_pathinfo *pip) in vhcache_pi_remove() argument
8265 mdi_client_t *ct = pip->pi_client; in vhcache_pi_remove()
8274 if (cpi->cpi_pip == pip) { in vhcache_pi_remove()
9719 mdi_dc_return_dev_state(mdi_pathinfo_t *pip, struct devctl_iocdata *dcp) in mdi_dc_return_dev_state() argument
9724 if ((pip == NULL) || (dcp == NULL)) in mdi_dc_return_dev_state()
9727 cdip = mdi_pi_get_client(pip); in mdi_dc_return_dev_state()
9729 switch (mdi_pi_get_state(pip)) { in mdi_dc_return_dev_state()
9748 ASSERT(MDI_PI(pip)->pi_state); in mdi_dc_return_dev_state()