aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 259eeb161b82..a1f751e79405 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -1017,12 +1017,7 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
1017 rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn); 1017 rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn);
1018 rport_ids.port_id = ndlp->nlp_DID; 1018 rport_ids.port_id = ndlp->nlp_DID;
1019 rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; 1019 rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
1020 if (ndlp->nlp_type & NLP_FCP_TARGET)
1021 rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET;
1022 if (ndlp->nlp_type & NLP_FCP_INITIATOR)
1023 rport_ids.roles |= FC_RPORT_ROLE_FCP_INITIATOR;
1024 1020
1025 scsi_block_requests(phba->host);
1026 ndlp->rport = rport = fc_remote_port_add(phba->host, 0, &rport_ids); 1021 ndlp->rport = rport = fc_remote_port_add(phba->host, 0, &rport_ids);
1027 if (!rport) { 1022 if (!rport) {
1028 dev_printk(KERN_WARNING, &phba->pcidev->dev, 1023 dev_printk(KERN_WARNING, &phba->pcidev->dev,
@@ -1039,7 +1034,16 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
1039 } 1034 }
1040 rdata = rport->dd_data; 1035 rdata = rport->dd_data;
1041 rdata->pnode = ndlp; 1036 rdata->pnode = ndlp;
1042 scsi_unblock_requests(phba->host); 1037
1038 if (ndlp->nlp_type & NLP_FCP_TARGET)
1039 rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET;
1040 if (ndlp->nlp_type & NLP_FCP_INITIATOR)
1041 rport_ids.roles |= FC_RPORT_ROLE_FCP_INITIATOR;
1042
1043
1044 if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN)
1045 fc_remote_port_rolechg(rport, rport_ids.roles);
1046
1043 1047
1044 return; 1048 return;
1045} 1049}
@@ -1053,9 +1057,7 @@ lpfc_unregister_remote_port(struct lpfc_hba * phba,
1053 1057
1054 ndlp->rport = NULL; 1058 ndlp->rport = NULL;
1055 rdata->pnode = NULL; 1059 rdata->pnode = NULL;
1056 scsi_block_requests(phba->host);
1057 fc_remote_port_delete(rport); 1060 fc_remote_port_delete(rport);
1058 scsi_unblock_requests(phba->host);
1059 1061
1060 return; 1062 return;
1061} 1063}