diff options
author | James.Smart@Emulex.Com <James.Smart@Emulex.Com> | 2005-06-25 10:34:30 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-07-02 19:57:22 -0400 |
commit | 5eb95af086f5d2e554bb119f3cb71f7ca38bfe85 (patch) | |
tree | d969d2f0e53b4c5289ff2acc4c141bf246866ac2 /drivers/scsi | |
parent | 1f679cafd2d02b7076e9045d9c4fb77ef8d059f2 (diff) |
[SCSI] lpfc: Add completion handler to the abort iocbs
Add completion handler to the abort iocbs to close a hole where we
could reuse an iotag.
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_crtn.h | 3 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 14 |
3 files changed, 16 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index c504477a6a5d..ba6728831eab 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h | |||
@@ -195,6 +195,9 @@ int lpfc_sli_issue_iocb_wait_high_priority(struct lpfc_hba * phba, | |||
195 | void lpfc_sli_wake_iocb_high_priority(struct lpfc_hba * phba, | 195 | void lpfc_sli_wake_iocb_high_priority(struct lpfc_hba * phba, |
196 | struct lpfc_iocbq * queue1, | 196 | struct lpfc_iocbq * queue1, |
197 | struct lpfc_iocbq * queue2); | 197 | struct lpfc_iocbq * queue2); |
198 | void lpfc_sli_abort_fcp_cmpl(struct lpfc_hba * phba, | ||
199 | struct lpfc_iocbq * cmdiocb, | ||
200 | struct lpfc_iocbq * rspiocb); | ||
198 | 201 | ||
199 | void *lpfc_mbuf_alloc(struct lpfc_hba *, int, dma_addr_t *); | 202 | void *lpfc_mbuf_alloc(struct lpfc_hba *, int, dma_addr_t *); |
200 | void lpfc_mbuf_free(struct lpfc_hba *, void *, dma_addr_t); | 203 | void lpfc_mbuf_free(struct lpfc_hba *, void *, dma_addr_t); |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 4c1ab21f3071..c1692e69e755 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -874,6 +874,7 @@ __lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
874 | else | 874 | else |
875 | icmd->ulpCommand = CMD_CLOSE_XRI_CN; | 875 | icmd->ulpCommand = CMD_CLOSE_XRI_CN; |
876 | 876 | ||
877 | abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; | ||
877 | if (lpfc_sli_issue_iocb(phba, pring, abtsiocb, 0) == | 878 | if (lpfc_sli_issue_iocb(phba, pring, abtsiocb, 0) == |
878 | IOCB_ERROR) { | 879 | IOCB_ERROR) { |
879 | list_add_tail(&abtsiocb->list, lpfc_iocb_list); | 880 | list_add_tail(&abtsiocb->list, lpfc_iocb_list); |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index e01428895823..048447ac4ca0 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -2077,8 +2077,6 @@ lpfc_sli_issue_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
2077 | switch (piocb->iocb.ulpCommand) { | 2077 | switch (piocb->iocb.ulpCommand) { |
2078 | case CMD_QUE_RING_BUF_CN: | 2078 | case CMD_QUE_RING_BUF_CN: |
2079 | case CMD_QUE_RING_BUF64_CN: | 2079 | case CMD_QUE_RING_BUF64_CN: |
2080 | case CMD_CLOSE_XRI_CN: | ||
2081 | case CMD_ABORT_XRI_CN: | ||
2082 | /* | 2080 | /* |
2083 | * For IOCBs, like QUE_RING_BUF, that have no rsp ring | 2081 | * For IOCBs, like QUE_RING_BUF, that have no rsp ring |
2084 | * completion, iocb_cmpl MUST be 0. | 2082 | * completion, iocb_cmpl MUST be 0. |
@@ -2561,6 +2559,16 @@ lpfc_sli_sum_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
2561 | return sum; | 2559 | return sum; |
2562 | } | 2560 | } |
2563 | 2561 | ||
2562 | void | ||
2563 | lpfc_sli_abort_fcp_cmpl(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | ||
2564 | struct lpfc_iocbq * rspiocb) | ||
2565 | { | ||
2566 | spin_lock_irq(phba->host->host_lock); | ||
2567 | list_add_tail(&cmdiocb->list, &phba->lpfc_iocb_list); | ||
2568 | spin_unlock_irq(phba->host->host_lock); | ||
2569 | return; | ||
2570 | } | ||
2571 | |||
2564 | int | 2572 | int |
2565 | lpfc_sli_abort_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | 2573 | lpfc_sli_abort_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, |
2566 | uint16_t tgt_id, uint64_t lun_id, uint32_t ctx, | 2574 | uint16_t tgt_id, uint64_t lun_id, uint32_t ctx, |
@@ -2610,6 +2618,8 @@ lpfc_sli_abort_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
2610 | else | 2618 | else |
2611 | abtsiocb->iocb.ulpCommand = CMD_CLOSE_XRI_CN; | 2619 | abtsiocb->iocb.ulpCommand = CMD_CLOSE_XRI_CN; |
2612 | 2620 | ||
2621 | /* Setup callback routine and issue the command. */ | ||
2622 | abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; | ||
2613 | ret_val = lpfc_sli_issue_iocb(phba, pring, abtsiocb, 0); | 2623 | ret_val = lpfc_sli_issue_iocb(phba, pring, abtsiocb, 0); |
2614 | if (ret_val == IOCB_ERROR) { | 2624 | if (ret_val == IOCB_ERROR) { |
2615 | list_add_tail(&abtsiocb->list, lpfc_iocb_list); | 2625 | list_add_tail(&abtsiocb->list, lpfc_iocb_list); |