diff options
author | James Smart <james.smart@emulex.com> | 2010-12-15 17:58:10 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:37:24 -0500 |
commit | 4042629e426da5ff0c793276a61103bd3f6b2183 (patch) | |
tree | 7e7337e1349da7854b45cdf436258dd91b29b59f /drivers/scsi/lpfc/lpfc_bsg.c | |
parent | 2fcee4bf874a8ae72ada68b62728d1fdeb30e3d4 (diff) |
[SCSI] lpfc 8.3.20: Updates to FC discovery commands
Updated commands used for ELS to utilize VPI
Allocate RPI at node creation time and pass in ELS commnads.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_bsg.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_bsg.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index 3330d7951b42..0dd43bb91618 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c | |||
@@ -1619,7 +1619,7 @@ job_error: | |||
1619 | * This function obtains a remote port login id so the diag loopback test | 1619 | * This function obtains a remote port login id so the diag loopback test |
1620 | * can send and receive its own unsolicited CT command. | 1620 | * can send and receive its own unsolicited CT command. |
1621 | **/ | 1621 | **/ |
1622 | static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t * rpi) | 1622 | static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t *rpi) |
1623 | { | 1623 | { |
1624 | LPFC_MBOXQ_t *mbox; | 1624 | LPFC_MBOXQ_t *mbox; |
1625 | struct lpfc_dmabuf *dmabuff; | 1625 | struct lpfc_dmabuf *dmabuff; |
@@ -1629,10 +1629,14 @@ static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t * rpi) | |||
1629 | if (!mbox) | 1629 | if (!mbox) |
1630 | return -ENOMEM; | 1630 | return -ENOMEM; |
1631 | 1631 | ||
1632 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
1633 | *rpi = lpfc_sli4_alloc_rpi(phba); | ||
1632 | status = lpfc_reg_rpi(phba, 0, phba->pport->fc_myDID, | 1634 | status = lpfc_reg_rpi(phba, 0, phba->pport->fc_myDID, |
1633 | (uint8_t *)&phba->pport->fc_sparam, mbox, 0); | 1635 | (uint8_t *)&phba->pport->fc_sparam, mbox, *rpi); |
1634 | if (status) { | 1636 | if (status) { |
1635 | mempool_free(mbox, phba->mbox_mem_pool); | 1637 | mempool_free(mbox, phba->mbox_mem_pool); |
1638 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
1639 | lpfc_sli4_free_rpi(phba, *rpi); | ||
1636 | return -ENOMEM; | 1640 | return -ENOMEM; |
1637 | } | 1641 | } |
1638 | 1642 | ||
@@ -1646,6 +1650,8 @@ static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t * rpi) | |||
1646 | kfree(dmabuff); | 1650 | kfree(dmabuff); |
1647 | if (status != MBX_TIMEOUT) | 1651 | if (status != MBX_TIMEOUT) |
1648 | mempool_free(mbox, phba->mbox_mem_pool); | 1652 | mempool_free(mbox, phba->mbox_mem_pool); |
1653 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
1654 | lpfc_sli4_free_rpi(phba, *rpi); | ||
1649 | return -ENODEV; | 1655 | return -ENODEV; |
1650 | } | 1656 | } |
1651 | 1657 | ||
@@ -1682,8 +1688,9 @@ static int lpfcdiag_loop_self_unreg(struct lpfc_hba *phba, uint16_t rpi) | |||
1682 | mempool_free(mbox, phba->mbox_mem_pool); | 1688 | mempool_free(mbox, phba->mbox_mem_pool); |
1683 | return -EIO; | 1689 | return -EIO; |
1684 | } | 1690 | } |
1685 | |||
1686 | mempool_free(mbox, phba->mbox_mem_pool); | 1691 | mempool_free(mbox, phba->mbox_mem_pool); |
1692 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
1693 | lpfc_sli4_free_rpi(phba, rpi); | ||
1687 | return 0; | 1694 | return 0; |
1688 | } | 1695 | } |
1689 | 1696 | ||
@@ -2080,7 +2087,7 @@ lpfc_bsg_diag_test(struct fc_bsg_job *job) | |||
2080 | uint32_t size; | 2087 | uint32_t size; |
2081 | uint32_t full_size; | 2088 | uint32_t full_size; |
2082 | size_t segment_len = 0, segment_offset = 0, current_offset = 0; | 2089 | size_t segment_len = 0, segment_offset = 0, current_offset = 0; |
2083 | uint16_t rpi; | 2090 | uint16_t rpi = 0; |
2084 | struct lpfc_iocbq *cmdiocbq, *rspiocbq; | 2091 | struct lpfc_iocbq *cmdiocbq, *rspiocbq; |
2085 | IOCB_t *cmd, *rsp; | 2092 | IOCB_t *cmd, *rsp; |
2086 | struct lpfc_sli_ct_request *ctreq; | 2093 | struct lpfc_sli_ct_request *ctreq; |
@@ -2167,7 +2174,6 @@ lpfc_bsg_diag_test(struct fc_bsg_job *job) | |||
2167 | sg_copy_to_buffer(job->request_payload.sg_list, | 2174 | sg_copy_to_buffer(job->request_payload.sg_list, |
2168 | job->request_payload.sg_cnt, | 2175 | job->request_payload.sg_cnt, |
2169 | ptr, size); | 2176 | ptr, size); |
2170 | |||
2171 | rc = lpfcdiag_loop_self_reg(phba, &rpi); | 2177 | rc = lpfcdiag_loop_self_reg(phba, &rpi); |
2172 | if (rc) | 2178 | if (rc) |
2173 | goto loopback_test_exit; | 2179 | goto loopback_test_exit; |