Lines Matching refs:cpi
7562 mdi_vhcache_pathinfo_t *cpi, *cpi_next; in destroy_vhci_cache() local
7580 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi_next) { in destroy_vhci_cache()
7581 cpi_next = cpi->cpi_next; in destroy_vhci_cache()
7582 free_vhcache_pathinfo(cpi); in destroy_vhci_cache()
7689 mdi_vhcache_pathinfo_t *cpi) in enqueue_tail_vhcache_pathinfo() argument
7691 cpi->cpi_next = NULL; in enqueue_tail_vhcache_pathinfo()
7693 cct->cct_cpi_head = cpi; in enqueue_tail_vhcache_pathinfo()
7695 cct->cct_cpi_tail->cpi_next = cpi; in enqueue_tail_vhcache_pathinfo()
7696 cct->cct_cpi_tail = cpi; in enqueue_tail_vhcache_pathinfo()
7709 mdi_vhcache_pathinfo_t *cpi, *prev_cpi; in enqueue_vhcache_pathinfo() local
7715 for (cpi = cct->cct_cpi_head, prev_cpi = NULL; cpi != NULL && in enqueue_vhcache_pathinfo()
7716 !(cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST); in enqueue_vhcache_pathinfo()
7717 prev_cpi = cpi, cpi = cpi->cpi_next) in enqueue_vhcache_pathinfo()
7725 newcpi->cpi_next = cpi; in enqueue_vhcache_pathinfo()
7727 if (cpi == NULL) in enqueue_vhcache_pathinfo()
7769 free_vhcache_pathinfo(mdi_vhcache_pathinfo_t *cpi) in free_vhcache_pathinfo() argument
7771 kmem_free(cpi->cpi_addr, strlen(cpi->cpi_addr) + 1); in free_vhcache_pathinfo()
7772 kmem_free(cpi, sizeof (*cpi)); in free_vhcache_pathinfo()
7807 mdi_vhcache_pathinfo_t *cpi; in paddrnvl_to_vhcache() local
7813 cpi = kmem_zalloc(sizeof (*cpi), KM_SLEEP); in paddrnvl_to_vhcache()
7814 cpi->cpi_addr = i_ddi_strdup(nvpair_name(nvp), KM_SLEEP); in paddrnvl_to_vhcache()
7817 cpi->cpi_cphci = cphci_list[val[0]]; in paddrnvl_to_vhcache()
7818 cpi->cpi_flags = val[1]; in paddrnvl_to_vhcache()
7819 enqueue_tail_vhcache_pathinfo(cct, cpi); in paddrnvl_to_vhcache()
7938 mdi_vhcache_pathinfo_t *cpi; in vhcache_to_paddrnvl() local
7948 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in vhcache_to_paddrnvl()
7949 val[0] = cpi->cpi_cphci->cphci_id; in vhcache_to_paddrnvl()
7950 val[1] = cpi->cpi_flags; in vhcache_to_paddrnvl()
7951 if ((err = nvlist_add_uint32_array(nvl, cpi->cpi_addr, val, 2)) in vhcache_to_paddrnvl()
8210 mdi_vhcache_pathinfo_t *cpi; in vhcache_pi_add() local
8229 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in vhcache_pi_add()
8230 if (cpi->cpi_cphci->cphci_phci == ph && in vhcache_pi_add()
8231 strcmp(cpi->cpi_addr, pip->pi_addr) == 0) { in vhcache_pi_add()
8232 cpi->cpi_pip = pip; in vhcache_pi_add()
8233 if (cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST) { in vhcache_pi_add()
8234 cpi->cpi_flags &= in vhcache_pi_add()
8243 if (cpi == NULL) { in vhcache_pi_add()
8244 cpi = kmem_zalloc(sizeof (*cpi), KM_SLEEP); in vhcache_pi_add()
8245 cpi->cpi_addr = i_ddi_strdup(pip->pi_addr, KM_SLEEP); in vhcache_pi_add()
8246 cpi->cpi_cphci = lookup_vhcache_phci_by_addr(vhcache, ph); in vhcache_pi_add()
8247 ASSERT(cpi->cpi_cphci != NULL); in vhcache_pi_add()
8248 cpi->cpi_pip = pip; in vhcache_pi_add()
8249 enqueue_vhcache_pathinfo(cct, cpi); in vhcache_pi_add()
8268 mdi_vhcache_pathinfo_t *cpi; in vhcache_pi_remove() local
8273 for (cpi = cct->cct_cpi_head; cpi != NULL; in vhcache_pi_remove()
8274 cpi = cpi->cpi_next) { in vhcache_pi_remove()
8275 if (cpi->cpi_pip == pip) { in vhcache_pi_remove()
8276 cpi->cpi_pip = NULL; in vhcache_pi_remove()
8614 mdi_vhcache_pathinfo_t *cpi; in build_phclient_path_list() local
8618 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in build_phclient_path_list()
8623 if (cpi->cpi_pip == NULL) in build_phclient_path_list()
8626 MDI_PI_LOCK(cpi->cpi_pip); in build_phclient_path_list()
8627 if (MDI_PI_IS_INIT(cpi->cpi_pip)) in build_phclient_path_list()
8629 MDI_PI_UNLOCK(cpi->cpi_pip); in build_phclient_path_list()
8634 len = strlen(cpi->cpi_cphci->cphci_path) + in build_phclient_path_list()
8635 strlen(ct_name) + strlen(cpi->cpi_addr) + 3; in build_phclient_path_list()
8638 cpi->cpi_cphci->cphci_path, ct_name, in build_phclient_path_list()
8639 cpi->cpi_addr); in build_phclient_path_list()
8708 mdi_vhcache_pathinfo_t *cpi, *cpi_next, *cpi_head; in sort_vhcache_paths() local
8712 for (cpi = cpi_head; cpi != NULL; cpi = cpi_next) { in sort_vhcache_paths()
8713 cpi_next = cpi->cpi_next; in sort_vhcache_paths()
8714 enqueue_vhcache_pathinfo(cct, cpi); in sort_vhcache_paths()
8733 mdi_vhcache_pathinfo_t *cpi; in adjust_sort_vhcache_paths() local
8746 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in adjust_sort_vhcache_paths()
8747 if ((cpi->cpi_pip != NULL && in adjust_sort_vhcache_paths()
8748 (cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST)) || in adjust_sort_vhcache_paths()
8749 (cpi->cpi_pip == NULL && in adjust_sort_vhcache_paths()
8750 !(cpi->cpi_flags & MDI_CPI_HINT_PATH_DOES_NOT_EXIST))) { in adjust_sort_vhcache_paths()
8754 if (cpi == NULL) { in adjust_sort_vhcache_paths()
8769 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in adjust_sort_vhcache_paths()
8770 if (cpi->cpi_pip != NULL) in adjust_sort_vhcache_paths()
8771 cpi->cpi_flags &= ~MDI_CPI_HINT_PATH_DOES_NOT_EXIST; in adjust_sort_vhcache_paths()
8773 cpi->cpi_flags |= MDI_CPI_HINT_PATH_DOES_NOT_EXIST; in adjust_sort_vhcache_paths()
8907 mdi_vhcache_pathinfo_t *cpi; in nonline_paths() local
8910 for (cpi = cct->cct_cpi_head; cpi != NULL; cpi = cpi->cpi_next) { in nonline_paths()
8911 if (cpi->cpi_pip != NULL) { in nonline_paths()
8912 MDI_PI_LOCK(cpi->cpi_pip); in nonline_paths()
8913 if (cpi->cpi_pip->pi_state == MDI_PATHINFO_STATE_ONLINE) in nonline_paths()
8915 MDI_PI_UNLOCK(cpi->cpi_pip); in nonline_paths()