Lines Matching refs:cpi
7551 mdi_vhcache_pathinfo_t *cpi, *cpi_next; in destroy_vhci_cache() local
7569 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi_next) { in destroy_vhci_cache()
7570 cpi_next = cpi->cpi_next; in destroy_vhci_cache()
7571 free_vhcache_pathinfo(cpi); in destroy_vhci_cache()
7678 mdi_vhcache_pathinfo_t *cpi) in enqueue_tail_vhcache_pathinfo() argument
7680 cpi->cpi_next = NULL; in enqueue_tail_vhcache_pathinfo()
7682 cct->cct_cpi_head = cpi; in enqueue_tail_vhcache_pathinfo()
7684 cct->cct_cpi_tail->cpi_next = cpi; in enqueue_tail_vhcache_pathinfo()
7685 cct->cct_cpi_tail = cpi; in enqueue_tail_vhcache_pathinfo()
7698 mdi_vhcache_pathinfo_t *cpi, *prev_cpi; in enqueue_vhcache_pathinfo() local
7704 for (cpi = cct->cct_cpi_head, prev_cpi = NULL; cpi != NULL && in enqueue_vhcache_pathinfo()
7705 !(cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST); in enqueue_vhcache_pathinfo()
7706 prev_cpi = cpi, cpi = cpi->cpi_next) in enqueue_vhcache_pathinfo()
7714 newcpi->cpi_next = cpi; in enqueue_vhcache_pathinfo()
7716 if (cpi == NULL) in enqueue_vhcache_pathinfo()
7758 free_vhcache_pathinfo(mdi_vhcache_pathinfo_t *cpi) in free_vhcache_pathinfo() argument
7760 kmem_free(cpi->cpi_addr, strlen(cpi->cpi_addr) + 1); in free_vhcache_pathinfo()
7761 kmem_free(cpi, sizeof (*cpi)); in free_vhcache_pathinfo()
7796 mdi_vhcache_pathinfo_t *cpi; in paddrnvl_to_vhcache() local
7802 cpi = kmem_zalloc(sizeof (*cpi), KM_SLEEP); in paddrnvl_to_vhcache()
7803 cpi->cpi_addr = i_ddi_strdup(nvpair_name(nvp), KM_SLEEP); in paddrnvl_to_vhcache()
7806 cpi->cpi_cphci = cphci_list[val[0]]; in paddrnvl_to_vhcache()
7807 cpi->cpi_flags = val[1]; in paddrnvl_to_vhcache()
7808 enqueue_tail_vhcache_pathinfo(cct, cpi); in paddrnvl_to_vhcache()
7927 mdi_vhcache_pathinfo_t *cpi; in vhcache_to_paddrnvl() local
7937 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in vhcache_to_paddrnvl()
7938 val[0] = cpi->cpi_cphci->cphci_id; in vhcache_to_paddrnvl()
7939 val[1] = cpi->cpi_flags; in vhcache_to_paddrnvl()
7940 if ((err = nvlist_add_uint32_array(nvl, cpi->cpi_addr, val, 2)) in vhcache_to_paddrnvl()
8198 mdi_vhcache_pathinfo_t *cpi; in vhcache_pi_add() local
8217 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in vhcache_pi_add()
8218 if (cpi->cpi_cphci->cphci_phci == ph && 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()
8221 if (cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST) { in vhcache_pi_add()
8222 cpi->cpi_flags &= in vhcache_pi_add()
8231 if (cpi == NULL) { in vhcache_pi_add()
8232 cpi = kmem_zalloc(sizeof (*cpi), KM_SLEEP); in vhcache_pi_add()
8233 cpi->cpi_addr = i_ddi_strdup(pip->pi_addr, KM_SLEEP); in vhcache_pi_add()
8234 cpi->cpi_cphci = lookup_vhcache_phci_by_addr(vhcache, ph); in vhcache_pi_add()
8235 ASSERT(cpi->cpi_cphci != NULL); in vhcache_pi_add()
8236 cpi->cpi_pip = pip; in vhcache_pi_add()
8237 enqueue_vhcache_pathinfo(cct, cpi); in vhcache_pi_add()
8256 mdi_vhcache_pathinfo_t *cpi; in vhcache_pi_remove() local
8261 for (cpi = cct->cct_cpi_head; cpi != NULL; in vhcache_pi_remove()
8262 cpi = cpi->cpi_next) { in vhcache_pi_remove()
8263 if (cpi->cpi_pip == pip) { in vhcache_pi_remove()
8264 cpi->cpi_pip = NULL; in vhcache_pi_remove()
8602 mdi_vhcache_pathinfo_t *cpi; in build_phclient_path_list() local
8606 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in build_phclient_path_list()
8611 if (cpi->cpi_pip == NULL) in build_phclient_path_list()
8614 MDI_PI_LOCK(cpi->cpi_pip); in build_phclient_path_list()
8615 if (MDI_PI_IS_INIT(cpi->cpi_pip)) in build_phclient_path_list()
8617 MDI_PI_UNLOCK(cpi->cpi_pip); in build_phclient_path_list()
8622 len = strlen(cpi->cpi_cphci->cphci_path) + in build_phclient_path_list()
8623 strlen(ct_name) + strlen(cpi->cpi_addr) + 3; in build_phclient_path_list()
8626 cpi->cpi_cphci->cphci_path, ct_name, in build_phclient_path_list()
8627 cpi->cpi_addr); in build_phclient_path_list()
8696 mdi_vhcache_pathinfo_t *cpi, *cpi_next, *cpi_head; in sort_vhcache_paths() local
8700 for (cpi = cpi_head; cpi != NULL; cpi = cpi_next) { in sort_vhcache_paths()
8701 cpi_next = cpi->cpi_next; in sort_vhcache_paths()
8702 enqueue_vhcache_pathinfo(cct, cpi); in sort_vhcache_paths()
8721 mdi_vhcache_pathinfo_t *cpi; in adjust_sort_vhcache_paths() local
8734 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in adjust_sort_vhcache_paths()
8735 if ((cpi->cpi_pip != NULL && in adjust_sort_vhcache_paths()
8736 (cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST)) || in adjust_sort_vhcache_paths()
8737 (cpi->cpi_pip == NULL && in adjust_sort_vhcache_paths()
8738 !(cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST))) { in adjust_sort_vhcache_paths()
8742 if (cpi == NULL) { in adjust_sort_vhcache_paths()
8757 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in adjust_sort_vhcache_paths()
8758 if (cpi->cpi_pip != NULL) in adjust_sort_vhcache_paths()
8759 cpi->cpi_flags &= ~MDI_CPI_HINT_PATH_DOES_NOT_EXIST; in adjust_sort_vhcache_paths()
8761 cpi->cpi_flags |= MDI_CPI_HINT_PATH_DOES_NOT_EXIST; in adjust_sort_vhcache_paths()
8895 mdi_vhcache_pathinfo_t *cpi; in nonline_paths() local
8898 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in nonline_paths()
8899 if (cpi->cpi_pip != NULL) { in nonline_paths()
8900 MDI_PI_LOCK(cpi->cpi_pip); in nonline_paths()
8901 if (cpi->cpi_pip->pi_state == MDI_PATHINFO_STATE_ONLINE) in nonline_paths()
8903 MDI_PI_UNLOCK(cpi->cpi_pip); in nonline_paths()