diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 95 |
1 files changed, 54 insertions, 41 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 4813beaaca8f..283b7d824c34 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -302,10 +302,6 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, | |||
302 | if (lpfc_reg_login(phba, Fabric_DID, (uint8_t *) sp, mbox, 0)) | 302 | if (lpfc_reg_login(phba, Fabric_DID, (uint8_t *) sp, mbox, 0)) |
303 | goto fail_free_mbox; | 303 | goto fail_free_mbox; |
304 | 304 | ||
305 | /* | ||
306 | * set_slim mailbox command needs to execute first, | ||
307 | * queue this command to be processed later. | ||
308 | */ | ||
309 | mbox->mbox_cmpl = lpfc_mbx_cmpl_fabric_reg_login; | 305 | mbox->mbox_cmpl = lpfc_mbx_cmpl_fabric_reg_login; |
310 | mbox->context2 = ndlp; | 306 | mbox->context2 = ndlp; |
311 | 307 | ||
@@ -781,25 +777,26 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | |||
781 | if (disc && phba->num_disc_nodes) { | 777 | if (disc && phba->num_disc_nodes) { |
782 | /* Check to see if there are more PLOGIs to be sent */ | 778 | /* Check to see if there are more PLOGIs to be sent */ |
783 | lpfc_more_plogi(phba); | 779 | lpfc_more_plogi(phba); |
784 | } | ||
785 | 780 | ||
786 | if (phba->num_disc_nodes == 0) { | 781 | if (phba->num_disc_nodes == 0) { |
787 | spin_lock_irq(phba->host->host_lock); | 782 | spin_lock_irq(phba->host->host_lock); |
788 | phba->fc_flag &= ~FC_NDISC_ACTIVE; | 783 | phba->fc_flag &= ~FC_NDISC_ACTIVE; |
789 | spin_unlock_irq(phba->host->host_lock); | 784 | spin_unlock_irq(phba->host->host_lock); |
790 | 785 | ||
791 | lpfc_can_disctmo(phba); | 786 | lpfc_can_disctmo(phba); |
792 | if (phba->fc_flag & FC_RSCN_MODE) { | 787 | if (phba->fc_flag & FC_RSCN_MODE) { |
793 | /* Check to see if more RSCNs came in while we were | 788 | /* |
794 | * processing this one. | 789 | * Check to see if more RSCNs came in while |
795 | */ | 790 | * we were processing this one. |
796 | if ((phba->fc_rscn_id_cnt == 0) && | 791 | */ |
797 | (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { | 792 | if ((phba->fc_rscn_id_cnt == 0) && |
798 | spin_lock_irq(phba->host->host_lock); | 793 | (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { |
799 | phba->fc_flag &= ~FC_RSCN_MODE; | 794 | spin_lock_irq(phba->host->host_lock); |
800 | spin_unlock_irq(phba->host->host_lock); | 795 | phba->fc_flag &= ~FC_RSCN_MODE; |
801 | } else { | 796 | spin_unlock_irq(phba->host->host_lock); |
802 | lpfc_els_handle_rscn(phba); | 797 | } else { |
798 | lpfc_els_handle_rscn(phba); | ||
799 | } | ||
803 | } | 800 | } |
804 | } | 801 | } |
805 | } | 802 | } |
@@ -1263,7 +1260,7 @@ lpfc_issue_els_logo(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, | |||
1263 | psli = &phba->sli; | 1260 | psli = &phba->sli; |
1264 | pring = &psli->ring[LPFC_ELS_RING]; | 1261 | pring = &psli->ring[LPFC_ELS_RING]; |
1265 | 1262 | ||
1266 | cmdsize = 2 * (sizeof (uint32_t) + sizeof (struct lpfc_name)); | 1263 | cmdsize = (2 * sizeof (uint32_t)) + sizeof (struct lpfc_name); |
1267 | elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp, | 1264 | elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp, |
1268 | ndlp->nlp_DID, ELS_CMD_LOGO); | 1265 | ndlp->nlp_DID, ELS_CMD_LOGO); |
1269 | if (!elsiocb) | 1266 | if (!elsiocb) |
@@ -1451,22 +1448,23 @@ lpfc_cancel_retry_delay_tmo(struct lpfc_hba *phba, struct lpfc_nodelist * nlp) | |||
1451 | * PLOGIs to be sent | 1448 | * PLOGIs to be sent |
1452 | */ | 1449 | */ |
1453 | lpfc_more_plogi(phba); | 1450 | lpfc_more_plogi(phba); |
1454 | } | ||
1455 | 1451 | ||
1456 | if (phba->num_disc_nodes == 0) { | 1452 | if (phba->num_disc_nodes == 0) { |
1457 | phba->fc_flag &= ~FC_NDISC_ACTIVE; | 1453 | phba->fc_flag &= ~FC_NDISC_ACTIVE; |
1458 | lpfc_can_disctmo(phba); | 1454 | lpfc_can_disctmo(phba); |
1459 | if (phba->fc_flag & FC_RSCN_MODE) { | 1455 | if (phba->fc_flag & FC_RSCN_MODE) { |
1460 | /* Check to see if more RSCNs | 1456 | /* |
1461 | * came in while we were | 1457 | * Check to see if more RSCNs |
1462 | * processing this one. | 1458 | * came in while we were |
1463 | */ | 1459 | * processing this one. |
1464 | if((phba->fc_rscn_id_cnt==0) && | 1460 | */ |
1465 | (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { | 1461 | if((phba->fc_rscn_id_cnt==0) && |
1466 | phba->fc_flag &= ~FC_RSCN_MODE; | 1462 | !(phba->fc_flag & FC_RSCN_DISCOVERY)) { |
1467 | } | 1463 | phba->fc_flag &= ~FC_RSCN_MODE; |
1468 | else { | 1464 | } |
1469 | lpfc_els_handle_rscn(phba); | 1465 | else { |
1466 | lpfc_els_handle_rscn(phba); | ||
1467 | } | ||
1470 | } | 1468 | } |
1471 | } | 1469 | } |
1472 | } | 1470 | } |
@@ -1872,9 +1870,6 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | |||
1872 | if (mbox) { | 1870 | if (mbox) { |
1873 | if ((rspiocb->iocb.ulpStatus == 0) | 1871 | if ((rspiocb->iocb.ulpStatus == 0) |
1874 | && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { | 1872 | && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { |
1875 | /* set_slim mailbox command needs to execute first, | ||
1876 | * queue this command to be processed later. | ||
1877 | */ | ||
1878 | lpfc_unreg_rpi(phba, ndlp); | 1873 | lpfc_unreg_rpi(phba, ndlp); |
1879 | mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; | 1874 | mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; |
1880 | mbox->context2 = ndlp; | 1875 | mbox->context2 = ndlp; |
@@ -1920,6 +1915,7 @@ lpfc_els_rsp_acc(struct lpfc_hba * phba, uint32_t flag, | |||
1920 | uint8_t *pcmd; | 1915 | uint8_t *pcmd; |
1921 | uint16_t cmdsize; | 1916 | uint16_t cmdsize; |
1922 | int rc; | 1917 | int rc; |
1918 | ELS_PKT *els_pkt_ptr; | ||
1923 | 1919 | ||
1924 | psli = &phba->sli; | 1920 | psli = &phba->sli; |
1925 | pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ | 1921 | pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ |
@@ -1958,6 +1954,23 @@ lpfc_els_rsp_acc(struct lpfc_hba * phba, uint32_t flag, | |||
1958 | pcmd += sizeof (uint32_t); | 1954 | pcmd += sizeof (uint32_t); |
1959 | memcpy(pcmd, &phba->fc_sparam, sizeof (struct serv_parm)); | 1955 | memcpy(pcmd, &phba->fc_sparam, sizeof (struct serv_parm)); |
1960 | break; | 1956 | break; |
1957 | case ELS_CMD_PRLO: | ||
1958 | cmdsize = sizeof (uint32_t) + sizeof (PRLO); | ||
1959 | elsiocb = lpfc_prep_els_iocb(phba, 0, cmdsize, oldiocb->retry, | ||
1960 | ndlp, ndlp->nlp_DID, ELS_CMD_PRLO); | ||
1961 | if (!elsiocb) | ||
1962 | return 1; | ||
1963 | |||
1964 | icmd = &elsiocb->iocb; | ||
1965 | icmd->ulpContext = oldcmd->ulpContext; /* Xri */ | ||
1966 | pcmd = (((struct lpfc_dmabuf *) elsiocb->context2)->virt); | ||
1967 | |||
1968 | memcpy(pcmd, ((struct lpfc_dmabuf *) oldiocb->context2)->virt, | ||
1969 | sizeof (uint32_t) + sizeof (PRLO)); | ||
1970 | *((uint32_t *) (pcmd)) = ELS_CMD_PRLO_ACC; | ||
1971 | els_pkt_ptr = (ELS_PKT *) pcmd; | ||
1972 | els_pkt_ptr->un.prlo.acceptRspCode = PRLO_REQ_EXECUTED; | ||
1973 | break; | ||
1961 | default: | 1974 | default: |
1962 | return 1; | 1975 | return 1; |
1963 | } | 1976 | } |
@@ -2498,7 +2511,7 @@ lpfc_els_rcv_rscn(struct lpfc_hba * phba, | |||
2498 | /* If we are about to begin discovery, just ACC the RSCN. | 2511 | /* If we are about to begin discovery, just ACC the RSCN. |
2499 | * Discovery processing will satisfy it. | 2512 | * Discovery processing will satisfy it. |
2500 | */ | 2513 | */ |
2501 | if (phba->hba_state < LPFC_NS_QRY) { | 2514 | if (phba->hba_state <= LPFC_NS_QRY) { |
2502 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, | 2515 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, |
2503 | newnode); | 2516 | newnode); |
2504 | return 0; | 2517 | return 0; |