diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-05-22 14:52:59 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 12:25:24 -0400 |
commit | 6fb120a7ed882aae9636545142a51cf3182a3ace (patch) | |
tree | 7e830b09907286288f20f60c0f104d5fbec9998d /drivers/scsi/lpfc/lpfc_nportdisc.c | |
parent | 04c684968487eb4f98728363a97b8da48f3bb958 (diff) |
[SCSI] lpfc 8.3.2 : Addition of SLI4 Interface - FCOE Discovery support
SLI4 supports both FC and FCOE, with some extended topology objects.
This patch adss support for the objects, and updates the disovery
engines for their use.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_nportdisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nportdisc.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 6efe459e8ddf..2c7eba686262 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c | |||
@@ -363,7 +363,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
363 | if (!mbox) | 363 | if (!mbox) |
364 | goto out; | 364 | goto out; |
365 | 365 | ||
366 | rc = lpfc_reg_login(phba, vport->vpi, icmd->un.rcvels.remoteID, | 366 | rc = lpfc_reg_rpi(phba, vport->vpi, icmd->un.rcvels.remoteID, |
367 | (uint8_t *) sp, mbox, 0); | 367 | (uint8_t *) sp, mbox, 0); |
368 | if (rc) { | 368 | if (rc) { |
369 | mempool_free(mbox, phba->mbox_mem_pool); | 369 | mempool_free(mbox, phba->mbox_mem_pool); |
@@ -497,11 +497,19 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
497 | lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); | 497 | lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); |
498 | else | 498 | else |
499 | lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); | 499 | lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); |
500 | if ((ndlp->nlp_type & NLP_FABRIC) && | ||
501 | vport->port_type == LPFC_NPIV_PORT) { | ||
502 | lpfc_linkdown_port(vport); | ||
503 | mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); | ||
504 | spin_lock_irq(shost->host_lock); | ||
505 | ndlp->nlp_flag |= NLP_DELAY_TMO; | ||
506 | spin_unlock_irq(shost->host_lock); | ||
500 | 507 | ||
501 | if ((!(ndlp->nlp_type & NLP_FABRIC) && | 508 | ndlp->nlp_last_elscmd = ELS_CMD_FDISC; |
502 | ((ndlp->nlp_type & NLP_FCP_TARGET) || | 509 | } else if ((!(ndlp->nlp_type & NLP_FABRIC) && |
503 | !(ndlp->nlp_type & NLP_FCP_INITIATOR))) || | 510 | ((ndlp->nlp_type & NLP_FCP_TARGET) || |
504 | (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { | 511 | !(ndlp->nlp_type & NLP_FCP_INITIATOR))) || |
512 | (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { | ||
505 | /* Only try to re-login if this is NOT a Fabric Node */ | 513 | /* Only try to re-login if this is NOT a Fabric Node */ |
506 | mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); | 514 | mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); |
507 | spin_lock_irq(shost->host_lock); | 515 | spin_lock_irq(shost->host_lock); |
@@ -569,7 +577,7 @@ lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
569 | { | 577 | { |
570 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | 578 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); |
571 | 579 | ||
572 | if (!ndlp->nlp_rpi) { | 580 | if (!(ndlp->nlp_flag & NLP_RPI_VALID)) { |
573 | ndlp->nlp_flag &= ~NLP_NPR_ADISC; | 581 | ndlp->nlp_flag &= ~NLP_NPR_ADISC; |
574 | return 0; | 582 | return 0; |
575 | } | 583 | } |
@@ -859,7 +867,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, | |||
859 | 867 | ||
860 | lpfc_unreg_rpi(vport, ndlp); | 868 | lpfc_unreg_rpi(vport, ndlp); |
861 | 869 | ||
862 | if (lpfc_reg_login(phba, vport->vpi, irsp->un.elsreq64.remoteID, | 870 | if (lpfc_reg_rpi(phba, vport->vpi, irsp->un.elsreq64.remoteID, |
863 | (uint8_t *) sp, mbox, 0) == 0) { | 871 | (uint8_t *) sp, mbox, 0) == 0) { |
864 | switch (ndlp->nlp_DID) { | 872 | switch (ndlp->nlp_DID) { |
865 | case NameServer_DID: | 873 | case NameServer_DID: |
@@ -1070,6 +1078,7 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport, | |||
1070 | struct lpfc_iocbq *cmdiocb, *rspiocb; | 1078 | struct lpfc_iocbq *cmdiocb, *rspiocb; |
1071 | IOCB_t *irsp; | 1079 | IOCB_t *irsp; |
1072 | ADISC *ap; | 1080 | ADISC *ap; |
1081 | int rc; | ||
1073 | 1082 | ||
1074 | cmdiocb = (struct lpfc_iocbq *) arg; | 1083 | cmdiocb = (struct lpfc_iocbq *) arg; |
1075 | rspiocb = cmdiocb->context_un.rsp_iocb; | 1084 | rspiocb = cmdiocb->context_un.rsp_iocb; |
@@ -1095,6 +1104,15 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport, | |||
1095 | return ndlp->nlp_state; | 1104 | return ndlp->nlp_state; |
1096 | } | 1105 | } |
1097 | 1106 | ||
1107 | if (phba->sli_rev == LPFC_SLI_REV4) { | ||
1108 | rc = lpfc_sli4_resume_rpi(ndlp); | ||
1109 | if (rc) { | ||
1110 | /* Stay in state and retry. */ | ||
1111 | ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; | ||
1112 | return ndlp->nlp_state; | ||
1113 | } | ||
1114 | } | ||
1115 | |||
1098 | if (ndlp->nlp_type & NLP_FCP_TARGET) { | 1116 | if (ndlp->nlp_type & NLP_FCP_TARGET) { |
1099 | ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; | 1117 | ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; |
1100 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); | 1118 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); |
@@ -1102,6 +1120,7 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport, | |||
1102 | ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; | 1120 | ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; |
1103 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); | 1121 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
1104 | } | 1122 | } |
1123 | |||
1105 | return ndlp->nlp_state; | 1124 | return ndlp->nlp_state; |
1106 | } | 1125 | } |
1107 | 1126 | ||
@@ -1285,6 +1304,7 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, | |||
1285 | } | 1304 | } |
1286 | 1305 | ||
1287 | ndlp->nlp_rpi = mb->un.varWords[0]; | 1306 | ndlp->nlp_rpi = mb->un.varWords[0]; |
1307 | ndlp->nlp_flag |= NLP_RPI_VALID; | ||
1288 | 1308 | ||
1289 | /* Only if we are not a fabric nport do we issue PRLI */ | 1309 | /* Only if we are not a fabric nport do we issue PRLI */ |
1290 | if (!(ndlp->nlp_type & NLP_FABRIC)) { | 1310 | if (!(ndlp->nlp_type & NLP_FABRIC)) { |