Lines Matching defs:pd

822  * increment of the reference count for said pd.  When the packet is freed,
824 * combination with the PD_GIVEN_TO_ULPS flag guarantees that the pd
829 * to hold a mutex across this call to ensure that the pd in question
848 fc_remote_port_t *pd;
852 pd = pkt->pkt_pd;
857 if ((rval == FC_SUCCESS) && (pd != NULL)) {
859 * A !NULL pd here must still be a valid
862 mutex_enter(&pd->pd_mutex);
863 ASSERT(pd->pd_ref_count >= 0);
864 pd->pd_ref_count++;
865 mutex_exit(&pd->pd_mutex);
886 fc_remote_port_t *pd;
890 pd = pkt->pkt_pd;
895 if ((rval == FC_SUCCESS) && (pd != NULL)) {
896 mutex_enter(&pd->pd_mutex);
898 ASSERT(pd->pd_ref_count > 0);
899 pd->pd_ref_count--;
908 if (pd->pd_state == PORT_DEVICE_INVALID &&
909 pd->pd_ref_count == 0) {
910 fc_remote_node_t *node = pd->pd_remote_nodep;
912 mutex_exit(&pd->pd_mutex);
919 if ((fctl_destroy_remote_port(port, pd) == 0) &&
926 mutex_exit(&pd->pd_mutex);
1016 * we'd better make sure every pd in that map has the
1025 fc_remote_port_t *pd =
1027 mutex_enter(&pd->pd_mutex);
1028 pd->pd_aux_flags |= PD_GIVEN_TO_ULPS;
1029 mutex_exit(&pd->pd_mutex);
1160 fc_remote_port_t *pd;
1163 pd = fctl_get_remote_port_by_pwwn(port, pwwn);
1165 if (pd != NULL) {
1168 * A ULP now knows about this pd, so mark it
1170 mutex_enter(&pd->pd_mutex);
1171 pd->pd_aux_flags |= PD_GIVEN_TO_ULPS;
1172 mutex_exit(&pd->pd_mutex);
1173 return (pd);
1187 return (pd);
1197 return (pd);
1212 return (pd);
1238 return (pd);
1245 pd = fctl_get_remote_port_by_pwwn(port, pwwn);
1247 if (pd == NULL) {
1253 * A ULP now knows about this pd, so mark it
1255 mutex_enter(&pd->pd_mutex);
1256 pd->pd_aux_flags |= PD_GIVEN_TO_ULPS;
1257 mutex_exit(&pd->pd_mutex);
1264 return (pd);
1275 fc_ulp_port_ns(opaque_t port_handle, opaque_t pd, fc_ns_cmd_t *ns_req)
1290 if (!fabric && pd) {
1295 if (pd == NULL) {
1363 fc_remote_port_t *pd, *newpd;
1399 pd = pkt->pkt_pd;
1400 if (pd) {
1401 if (pd->pd_type == PORT_DEVICE_OLD ||
1402 pd->pd_state == PORT_DEVICE_INVALID) {
1405 &pd->pd_port_name);
1408 * The remote port (pd) in the packet is no longer
1409 * usable, as the old pd still exists we can use the
1410 * WWN to check if we have a current pd for the device
1412 * whether we have a new pd or not, as the new pd
1415 if ((newpd) && (newpd != pd)) {
1418 * There is a better remote port (pd) to try,
1426 mutex_enter(&pd->pd_mutex);
1427 pd->pd_ref_count--;
1428 if ((pd->pd_state == PORT_DEVICE_INVALID) &&
1429 (pd->pd_ref_count == 0)) {
1431 pd->pd_remote_nodep;
1433 mutex_exit(&pd->pd_mutex);
1438 * where we have a reference to a pd,
1441 if ((fctl_destroy_remote_port(port, pd)
1447 mutex_exit(&pd->pd_mutex);
1449 pd = newpd;
1453 if (pd->pd_state != PORT_DEVICE_LOGGED_IN) {
1454 rval = (pd->pd_state == PORT_DEVICE_VALID) ?
1460 if (pd->pd_flags != PD_IDLE) {
1465 if (pd->pd_type == PORT_DEVICE_OLD ||
1466 pd->pd_state == PORT_DEVICE_INVALID) {
1486 fc_remote_port_t *pd;
1521 if ((pd = pkt->pkt_pd) != NULL) {
1522 mutex_enter(&pd->pd_mutex);
1523 if (pd->pd_state != PORT_DEVICE_LOGGED_IN) {
1524 rval = (pd->pd_state == PORT_DEVICE_VALID) ?
1526 mutex_exit(&pd->pd_mutex);
1530 if (pd->pd_flags != PD_IDLE) {
1531 mutex_exit(&pd->pd_mutex);
1534 if (pd->pd_type == PORT_DEVICE_OLD ||
1535 pd->pd_state == PORT_DEVICE_INVALID) {
1536 mutex_exit(&pd->pd_mutex);
1539 mutex_exit(&pd->pd_mutex);
1787 fc_remote_port_t *pd;
1790 pd = fctl_get_remote_port_by_did(port, d_id.port_id);
1791 if (pd != NULL) {
1792 mutex_enter(&pd->pd_mutex);
1793 *pwwn = pd->pd_port_name;
1794 mutex_exit(&pd->pd_mutex);
1810 fc_remote_port_t *pd;
1812 pd = fctl_get_remote_port_by_pwwn(port, bytes);
1813 if (pd == NULL) {
1817 mutex_enter(&pd->pd_mutex);
1818 map->map_pwwn = pd->pd_port_name;
1819 map->map_did = pd->pd_port_id;
1820 map->map_hard_addr = pd->pd_hard_addr;
1821 map->map_state = pd->pd_state;
1822 map->map_type = pd->pd_type;
1827 bcopy(pd->pd_fc4types, map->map_fc4_types, sizeof (pd->pd_fc4types));
1829 node = pd->pd_remote_nodep;
1830 mutex_exit(&pd->pd_mutex);
1837 map->map_pd = pd;
1883 fc_remote_port_t *pd =
1886 if (pd) {
1887 mutex_enter(&pd->pd_mutex);
1888 pd->pd_aux_flags |= PD_DISABLE_RELOGIN;
1889 mutex_exit(&pd->pd_mutex);
1897 fc_remote_port_t *pd =
1900 if (pd) {
1901 mutex_enter(&pd->pd_mutex);
1902 pd->pd_aux_flags &= ~PD_DISABLE_RELOGIN;
1903 mutex_exit(&pd->pd_mutex);
3042 fc_remote_port_t *pd;
3051 pd = clist->clist_map[count].map_pd;
3052 if (pd != NULL) {
3053 mutex_enter(&pd->pd_mutex);
3054 pwwn = pd->pd_port_name;
3055 d_id = pd->pd_port_id;
3056 mutex_exit(&pd->pd_mutex);
3058 pd = fctl_get_remote_port_by_pwwn(port,
3061 ASSERT(pd != clist->clist_map[count].
3064 pd = fctl_get_remote_port_by_did(port,
3066 ASSERT(pd != clist->clist_map[count].
3167 fc_remote_port_t *pd;
3172 if ((pd = clist->clist_map[count].map_pd) == NULL) {
3176 mutex_enter(&pd->pd_mutex);
3178 pd->pd_ref_count--;
3179 ASSERT(pd->pd_ref_count >= 0);
3183 mutex_exit(&pd->pd_mutex);
3187 node = pd->pd_remote_nodep;
3188 pd->pd_aux_flags &= ~PD_GIVEN_TO_ULPS;
3190 mutex_exit(&pd->pd_mutex);
3197 if ((fctl_destroy_remote_port(port, pd) == 0) &&
3457 fc_remote_port_t *pd;
3462 if ((pd = kmem_zalloc(sizeof (*pd), sleep)) == NULL) {
3465 fctl_tc_constructor(&pd->pd_logo_tc, FC_LOGO_TOLERANCE_LIMIT,
3468 mutex_init(&pd->pd_mutex, NULL, MUTEX_DRIVER, NULL);
3470 pd->pd_port_id.port_id = d_id;
3471 pd->pd_port_name = *port_wwn;
3472 pd->pd_port = port;
3473 pd->pd_state = PORT_DEVICE_VALID;
3474 pd->pd_type = PORT_DEVICE_NEW;
3475 pd->pd_recepient = recepient;
3477 return (pd);
3485 fctl_dealloc_remote_port(fc_remote_port_t *pd)
3487 ASSERT(!MUTEX_HELD(&pd->pd_mutex));
3489 fctl_tc_destructor(&pd->pd_logo_tc);
3490 mutex_destroy(&pd->pd_mutex);
3491 kmem_free(pd, sizeof (*pd));
3501 fc_remote_port_t *pd)
3511 if (ports == pd) {
3524 last->pd_port_next = pd;
3526 rnodep->fd_portlistp = pd;
3528 pd->pd_port_next = NULL;
3533 mutex_enter(&pd->pd_mutex);
3534 pd->pd_remote_nodep = rnodep;
3535 mutex_exit(&pd->pd_mutex);
3555 fc_remote_port_t *pd)
3562 ASSERT(!MUTEX_HELD(&pd->pd_mutex));
3572 * fc_remote_node_t; try to find the specified fc_remote_port_t (pd).
3576 if (ports == pd) {
3590 last->pd_port_next = pd->pd_port_next;
3592 rnodep->fd_portlistp = pd->pd_port_next;
3594 mutex_enter(&pd->pd_mutex);
3595 pd->pd_remote_nodep = NULL;
3596 mutex_exit(&pd->pd_mutex);
3599 pd->pd_port_next = NULL;
3610 * fc_local_port_t struct. Hashes based upon the pd->pd_port_id.port_id in the
3614 * (pd->pd_aux_flags & PD_IN_DID_QUEUE) to keep duplicates off the list.
3619 fctl_enlist_did_table(fc_local_port_t *port, fc_remote_port_t *pd)
3624 ASSERT(MUTEX_HELD(&pd->pd_mutex));
3626 if (pd->pd_aux_flags & PD_IN_DID_QUEUE) {
3630 head = &port->fp_did_table[D_ID_HASH_FUNC(pd->pd_port_id.port_id,
3640 * Search down in each bucket for a duplicate pd
3650 ASSERT(tmp_pd != pd);
3655 pd->pd_port_id.port_id);
3663 bzero(pd->pd_d_stack, sizeof (pd->pd_d_stack));
3664 pd->pd_d_depth = getpcstack(pd->pd_d_stack, FC_STACK_DEPTH);
3667 pd->pd_did_hnext = head->d_id_head;
3668 head->d_id_head = pd;
3670 pd->pd_aux_flags |= PD_IN_DID_QUEUE;
3677 * fc_local_port_t struct. Hashes based upon the pd->pd_port_id.port_id in the
3683 fctl_delist_did_table(fc_local_port_t *port, fc_remote_port_t *pd)
3691 ASSERT(MUTEX_HELD(&pd->pd_mutex));
3693 d_id = pd->pd_port_id.port_id;
3699 if (pd == pd_next) {
3713 head->d_id_head = pd->pd_did_hnext;
3715 last->pd_did_hnext = pd->pd_did_hnext;
3717 pd->pd_aux_flags &= ~PD_IN_DID_QUEUE;
3718 pd->pd_did_hnext = NULL;
3725 * fc_local_port_t struct. Hashes based upon the pd->pd_port_name.raw_wwn
3731 fctl_enlist_pwwn_table(fc_local_port_t *port, fc_remote_port_t *pd)
3737 ASSERT(MUTEX_HELD(&pd->pd_mutex));
3739 ASSERT(fctl_is_wwn_zero(&pd->pd_port_name) == FC_FAILURE);
3741 index = HASH_FUNC(WWN_HASH_KEY(pd->pd_port_name.raw_wwn),
3753 * Search down in each bucket for a duplicate pd
3762 ASSERT(tmp_pd != pd);
3768 &pd->pd_port_name) != 0);
3776 bzero(pd->pd_w_stack, sizeof (pd->pd_w_stack));
3777 pd->pd_w_depth = getpcstack(pd->pd_w_stack, FC_STACK_DEPTH);
3780 pd->pd_wwn_hnext = head->pwwn_head;
3781 head->pwwn_head = pd;
3794 * fc_local_port_t struct. Hashes based upon the pd->pd_port_name.raw_wwn
3800 fctl_delist_pwwn_table(fc_local_port_t *port, fc_remote_port_t *pd)
3809 ASSERT(MUTEX_HELD(&pd->pd_mutex));
3811 pwwn = pd->pd_port_name;
3819 if (pd_next == pd) {
3838 head->pwwn_head = pd->pd_wwn_hnext;
3840 last->pd_wwn_hnext = pd->pd_wwn_hnext;
3842 pd->pd_wwn_hnext = NULL;
3859 fc_remote_port_t *pd;
3867 pd = head->d_id_head;
3868 while (pd != NULL) {
3869 mutex_enter(&pd->pd_mutex);
3870 if (pd->pd_port_id.port_id == d_id) {
3872 mutex_exit(&pd->pd_mutex);
3875 mutex_exit(&pd->pd_mutex);
3876 pd = pd->pd_did_hnext;
3881 return (pd);
3890 fc_remote_port_t *pd = port_handle;
3892 mutex_enter(&pd->pd_mutex);
3893 pd->pd_ref_count++;
3894 mutex_exit(&pd->pd_mutex);
3912 fc_remote_port_t *pd;
3920 pd = head->d_id_head;
3921 while (pd != NULL) {
3922 mutex_enter(&pd->pd_mutex);
3923 if (pd->pd_port_id.port_id == d_id && pd->pd_state !=
3924 PORT_DEVICE_INVALID && pd->pd_type != PORT_DEVICE_OLD) {
3925 ASSERT(pd->pd_ref_count >= 0);
3926 pd->pd_ref_count++;
3927 mutex_exit(&pd->pd_mutex);
3930 mutex_exit(&pd->pd_mutex);
3931 pd = pd->pd_did_hnext;
3936 return (pd);
3953 fc_remote_port_t *pd;
3962 pd = head->pwwn_head;
3963 while (pd != NULL) {
3964 mutex_enter(&pd->pd_mutex);
3965 if (fctl_wwn_cmp(&pd->pd_port_name, pwwn) == 0) {
3966 mutex_exit(&pd->pd_mutex);
3969 mutex_exit(&pd->pd_mutex);
3970 pd = pd->pd_wwn_hnext;
3975 return (pd);
3988 fc_remote_port_t *pd;
3995 pd = head->pwwn_head;
3996 while (pd != NULL) {
3997 mutex_enter(&pd->pd_mutex);
3998 if (fctl_wwn_cmp(&pd->pd_port_name, pwwn) == 0) {
3999 mutex_exit(&pd->pd_mutex);
4002 mutex_exit(&pd->pd_mutex);
4003 pd = pd->pd_wwn_hnext;
4006 return (pd);
4026 fc_remote_port_t *pd;
4035 pd = head->pwwn_head;
4036 while (pd != NULL) {
4037 mutex_enter(&pd->pd_mutex);
4038 if (fctl_wwn_cmp(&pd->pd_port_name, pwwn) == 0 &&
4039 pd->pd_state != PORT_DEVICE_INVALID &&
4040 pd->pd_type != PORT_DEVICE_OLD) {
4041 ASSERT(pd->pd_ref_count >= 0);
4042 pd->pd_ref_count++;
4043 mutex_exit(&pd->pd_mutex);
4046 mutex_exit(&pd->pd_mutex);
4047 pd = pd->pd_wwn_hnext;
4052 return (pd);
4070 fctl_release_remote_port(fc_remote_port_t *pd)
4076 mutex_enter(&pd->pd_mutex);
4077 port = pd->pd_port;
4079 ASSERT(pd->pd_ref_count > 0);
4080 pd->pd_ref_count--;
4081 if (pd->pd_ref_count == 0 &&
4082 (pd->pd_aux_flags & PD_NEEDS_REMOVAL) &&
4083 (pd->pd_flags != PD_ELS_IN_PROGRESS) &&
4084 (pd->pd_flags != PD_ELS_MARK)) {
4086 pd->pd_aux_flags &= ~PD_NEEDS_REMOVAL;
4088 node = pd->pd_remote_nodep;
4091 mutex_exit(&pd->pd_mutex);
4099 if (fctl_destroy_remote_port(port, pd) == 0) {
4123 fc_remote_port_t *pd;
4141 pd = head->pwwn_head;
4142 while (pd != NULL) {
4144 mutex_enter(&pd->pd_mutex);
4145 if (pd->pd_type != PORT_DEVICE_NOCHANGE) {
4148 mutex_exit(&pd->pd_mutex);
4149 pd = pd->pd_wwn_hnext;
4199 pd = head->pwwn_head;
4200 while (pd != NULL) {
4201 mutex_enter(&pd->pd_mutex);
4203 pd->pd_type == PORT_DEVICE_NOCHANGE) ||
4204 pd->pd_state == PORT_DEVICE_INVALID) {
4205 mutex_exit(&pd->pd_mutex);
4206 last_pd = pd;
4207 pd = pd->pd_wwn_hnext;
4210 mutex_exit(&pd->pd_mutex);
4212 fctl_copy_portmap(listptr, pd);
4215 last_pd = pd;
4216 pd = pd->pd_wwn_hnext;
4221 mutex_enter(&pd->pd_mutex);
4222 ASSERT(pd->pd_state != PORT_DEVICE_INVALID);
4223 if (pd->pd_type == PORT_DEVICE_OLD) {
4224 listptr->map_pd = pd;
4225 listptr->map_state = pd->pd_state =
4230 old_pd = pd;
4231 pd = old_pd->pd_wwn_hnext;
4236 head->pwwn_head = pd;
4238 last_pd->pd_wwn_hnext = pd;
4280 listptr->map_pd = pd;
4281 pd->pd_type = PORT_DEVICE_NOCHANGE;
4282 mutex_exit(&pd->pd_mutex);
4283 last_pd = pd;
4284 pd = pd->pd_wwn_hnext;
4523 fc_remote_port_t *pd;
4554 pd = fctl_get_remote_port_by_pwwn_mutex_held(port, port_wwn);
4555 if (pd) {
4561 mutex_enter(&pd->pd_mutex);
4562 invalid = (pd->pd_state == PORT_DEVICE_INVALID) ? 1 : 0;
4563 mutex_exit(&pd->pd_mutex);
4566 if (pd == NULL || invalid) {
4574 if ((pd = fctl_alloc_remote_port(port, port_wwn, d_id,
4579 return (pd);
4586 mutex_enter(&pd->pd_mutex);
4587 pd->pd_remote_nodep = rnodep;
4588 fctl_enlist_did_table(port, pd);
4589 fctl_enlist_pwwn_table(port, pd);
4590 mutex_exit(&pd->pd_mutex);
4607 mutex_enter(&pd->pd_mutex);
4608 ASSERT(pd->pd_remote_nodep != NULL);
4610 if (pd->pd_port_id.port_id != d_id) {
4627 old_id = pd->pd_port_id.port_id;
4629 fctl_delist_did_table(port, pd);
4636 pd->pd_port_id.port_id = d_id;
4644 pd->pd_type = PORT_DEVICE_CHANGED;
4647 fctl_enlist_did_table(port, pd);
4649 } else if (pd->pd_type == PORT_DEVICE_OLD) {
4657 pd->pd_type = PORT_DEVICE_NOCHANGE;
4658 pd->pd_state = PORT_DEVICE_VALID;
4660 fctl_enlist_did_table(port, pd);
4671 pd->pd_type = PORT_DEVICE_NOCHANGE;
4672 pd->pd_state = PORT_DEVICE_VALID;
4675 mutex_exit(&pd->pd_mutex);
4678 if (rnodep != pd->pd_remote_nodep) {
4680 (fctl_wwn_cmp(&pd->pd_remote_nodep->fd_node_name,
4694 &pd->pd_remote_nodep->fd_node_name,
4711 fctl_link_remote_port_to_remote_node(rnodep, pd);
4713 return (pd);
4727 * function just sets the pd->pd_aux_flags |= PD_NEEDS_REMOVAL and the
4728 * pd->pd_type = PORT_DEVICE_OLD and lets some other function(s) worry about
4736 fctl_destroy_remote_port(fc_local_port_t *port, fc_remote_port_t *pd)
4741 mutex_enter(&pd->pd_mutex);
4751 if ((pd->pd_ref_count > 0) ||
4752 (pd->pd_aux_flags & PD_GIVEN_TO_ULPS)) {
4753 pd->pd_aux_flags |= PD_NEEDS_REMOVAL;
4754 pd->pd_type = PORT_DEVICE_OLD;
4755 mutex_exit(&pd->pd_mutex);
4759 pd->pd_type = PORT_DEVICE_OLD;
4761 rnodep = pd->pd_remote_nodep;
4763 mutex_exit(&pd->pd_mutex);
4771 rcount = fctl_unlink_remote_port_from_remote_node(rnodep, pd);
4775 mutex_enter(&pd->pd_mutex);
4777 fctl_delist_did_table(port, pd);
4778 fctl_delist_pwwn_table(port, pd);
4780 mutex_exit(&pd->pd_mutex);
4786 fctl_dealloc_remote_port(pd);
4815 fc_remote_port_t *pd;
4826 pd = head->d_id_head;
4831 * pd->pd_remote_nodep pointer.
4833 mutex_enter(&pd->pd_mutex);
4834 rnodep = pd->pd_remote_nodep;
4835 mutex_exit(&pd->pd_mutex);
4844 rnodep, pd) == 0) {
4866 * table for the given fc_remote_port_t (i.e., the pd).
4868 mutex_enter(&pd->pd_mutex);
4869 fctl_delist_pwwn_table(port, pd);
4870 pd->pd_aux_flags &= ~PD_IN_DID_QUEUE;
4871 mutex_exit(&pd->pd_mutex);
4876 head->d_id_head = pd->pd_did_hnext;
4879 * Deconstruct & free the fc_remote_port_t (pd)
4883 fctl_dealloc_remote_port(pd);
5011 fctl_copy_portmap_held(fc_portmap_t *map, fc_remote_port_t *pd)
5015 ASSERT(MUTEX_HELD(&pd->pd_mutex));
5017 map->map_pwwn = pd->pd_port_name;
5018 map->map_did = pd->pd_port_id;
5019 map->map_hard_addr = pd->pd_hard_addr;
5020 map->map_state = pd->pd_state;
5021 map->map_type = pd->pd_type;
5026 bcopy(pd->pd_fc4types, map->map_fc4_types, sizeof (pd->pd_fc4types));
5028 node = pd->pd_remote_nodep;
5035 map->map_pd = pd;
5039 fctl_copy_portmap(fc_portmap_t *map, fc_remote_port_t *pd)
5043 ASSERT(!MUTEX_HELD(&pd->pd_mutex));
5045 mutex_enter(&pd->pd_mutex);
5046 map->map_pwwn = pd->pd_port_name;
5047 map->map_did = pd->pd_port_id;
5048 map->map_hard_addr = pd->pd_hard_addr;
5049 map->map_state = pd->pd_state;
5050 map->map_type = pd->pd_type;
5055 bcopy(pd->pd_fc4types, map->map_fc4_types, sizeof (pd->pd_fc4types));
5057 node = pd->pd_remote_nodep;
5058 mutex_exit(&pd->pd_mutex);
5065 map->map_pd = pd;
5366 fc_ulp_copy_portmap(fc_portmap_t *map, opaque_t pd)
5368 fctl_copy_portmap(map, (fc_remote_port_t *)pd);
5607 * that the fp_mutex and pd_mutex of the pd passed in are held coming in.
5610 * since this function could be called with a different pd's pd_mutex held, we
5614 fctl_add_orphan_held(fc_local_port_t *port, fc_remote_port_t *pd)
5622 ASSERT(MUTEX_HELD(&pd->pd_mutex));
5624 pwwn = pd->pd_port_name;
5651 fctl_add_orphan(fc_local_port_t *port, fc_remote_port_t *pd, int sleep)
5660 mutex_enter(&pd->pd_mutex);
5661 pwwn = pd->pd_port_name;
5662 mutex_exit(&pd->pd_mutex);
5727 fctl_print_if_not_orphan(fc_local_port_t *port, fc_remote_port_t *pd)
5735 mutex_enter(&pd->pd_mutex);
5736 pwwn = pd->pd_port_name;
5737 mutex_exit(&pd->pd_mutex);
5751 pd->pd_port_id.port_id, ww_name);
5871 fc_remote_port_t *pd;
5883 pd = head->pwwn_head;
5885 while (pd != NULL) {
5886 mutex_enter(&pd->pd_mutex);
5887 if (pd->pd_type != PORT_DEVICE_OLD) {
5888 mutex_exit(&pd->pd_mutex);
5889 last_pd = pd;
5890 pd = pd->pd_wwn_hnext;
5897 old_pd = pd;
5898 pd = old_pd->pd_wwn_hnext;
5902 head->pwwn_head = pd;
5904 last_pd->pd_wwn_hnext = pd;
5947 fctl_check_alpa_list(fc_local_port_t *port, fc_remote_port_t *pd)
5952 if (fctl_is_alpa_present(port, pd->pd_port_id.port_id) == FC_SUCCESS) {
5957 port->fp_instance, pd->pd_port_id.port_id);
5984 fc_remote_port_t *pd;
5990 pd = head->pwwn_head;
5992 while (pd != NULL) {
5993 mutex_enter(&pd->pd_mutex);
5994 if (pd->pd_port_id.port_id == d_id) {
5995 mutex_exit(&pd->pd_mutex);
5996 return (pd);
5998 mutex_exit(&pd->pd_mutex);
5999 pd = pd->pd_wwn_hnext;
6003 return (pd);
6205 fc_remote_port_t *pd;
6213 pd = head->pwwn_head;
6214 if (pd != NULL) match ++;
6216 while (pd != NULL && match <= index) {
6217 pd = pd->pd_wwn_hnext;
6218 if (pd != NULL) match ++;
6222 return (pd);
6233 fc_remote_port_t *pd;
6239 pd = head->pwwn_head;
6241 while (pd != NULL) {
6242 mutex_enter(&pd->pd_mutex);
6243 if (bcmp(pd->pd_port_name.raw_wwn, wwn.raw_wwn,
6245 mutex_exit(&pd->pd_mutex);
6246 return (pd);
6248 if (bcmp(pd->pd_remote_nodep->fd_node_name.raw_wwn,
6250 mutex_exit(&pd->pd_mutex);
6251 return (pd);
6253 mutex_exit(&pd->pd_mutex);
6254 pd = pd->pd_wwn_hnext;