diff options
author | James Smart <james.smart@emulex.com> | 2013-10-10 12:22:38 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 04:58:17 -0400 |
commit | 0ba4b2199f6e9a8689849c10331e006b99ed83f6 (patch) | |
tree | 972e201bdbd49ee45b48748d572e01d5e026d951 /drivers/scsi/lpfc | |
parent | e8d3c3b14b9aba6adfd5a86d2ea88d4a7b185f24 (diff) |
[SCSI] lpfc 8.3.43: Fixed invalid fcp_rsp length fir FCP_ICMND
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 24 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 19 |
2 files changed, 35 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 086c3f28caa6..205b4e38030e 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -3584,7 +3584,13 @@ struct abort_cmd_wqe { | |||
3584 | 3584 | ||
3585 | struct fcp_iwrite64_wqe { | 3585 | struct fcp_iwrite64_wqe { |
3586 | struct ulp_bde64 bde; | 3586 | struct ulp_bde64 bde; |
3587 | uint32_t payload_offset_len; | 3587 | uint32_t word3; |
3588 | #define cmd_buff_len_SHIFT 16 | ||
3589 | #define cmd_buff_len_MASK 0x00000ffff | ||
3590 | #define cmd_buff_len_WORD word3 | ||
3591 | #define payload_offset_len_SHIFT 0 | ||
3592 | #define payload_offset_len_MASK 0x0000ffff | ||
3593 | #define payload_offset_len_WORD word3 | ||
3588 | uint32_t total_xfer_len; | 3594 | uint32_t total_xfer_len; |
3589 | uint32_t initial_xfer_len; | 3595 | uint32_t initial_xfer_len; |
3590 | struct wqe_common wqe_com; /* words 6-11 */ | 3596 | struct wqe_common wqe_com; /* words 6-11 */ |
@@ -3594,7 +3600,13 @@ struct fcp_iwrite64_wqe { | |||
3594 | 3600 | ||
3595 | struct fcp_iread64_wqe { | 3601 | struct fcp_iread64_wqe { |
3596 | struct ulp_bde64 bde; | 3602 | struct ulp_bde64 bde; |
3597 | uint32_t payload_offset_len; /* word 3 */ | 3603 | uint32_t word3; |
3604 | #define cmd_buff_len_SHIFT 16 | ||
3605 | #define cmd_buff_len_MASK 0x00000ffff | ||
3606 | #define cmd_buff_len_WORD word3 | ||
3607 | #define payload_offset_len_SHIFT 0 | ||
3608 | #define payload_offset_len_MASK 0x0000ffff | ||
3609 | #define payload_offset_len_WORD word3 | ||
3598 | uint32_t total_xfer_len; /* word 4 */ | 3610 | uint32_t total_xfer_len; /* word 4 */ |
3599 | uint32_t rsrvd5; /* word 5 */ | 3611 | uint32_t rsrvd5; /* word 5 */ |
3600 | struct wqe_common wqe_com; /* words 6-11 */ | 3612 | struct wqe_common wqe_com; /* words 6-11 */ |
@@ -3604,7 +3616,13 @@ struct fcp_iread64_wqe { | |||
3604 | 3616 | ||
3605 | struct fcp_icmnd64_wqe { | 3617 | struct fcp_icmnd64_wqe { |
3606 | struct ulp_bde64 bde; /* words 0-2 */ | 3618 | struct ulp_bde64 bde; /* words 0-2 */ |
3607 | uint32_t rsrvd3; /* word 3 */ | 3619 | uint32_t word3; |
3620 | #define cmd_buff_len_SHIFT 16 | ||
3621 | #define cmd_buff_len_MASK 0x00000ffff | ||
3622 | #define cmd_buff_len_WORD word3 | ||
3623 | #define payload_offset_len_SHIFT 0 | ||
3624 | #define payload_offset_len_MASK 0x0000ffff | ||
3625 | #define payload_offset_len_WORD word3 | ||
3608 | uint32_t rsrvd4; /* word 4 */ | 3626 | uint32_t rsrvd4; /* word 4 */ |
3609 | uint32_t rsrvd5; /* word 5 */ | 3627 | uint32_t rsrvd5; /* word 5 */ |
3610 | struct wqe_common wqe_com; /* words 6-11 */ | 3628 | struct wqe_common wqe_com; /* words 6-11 */ |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index b48c5504f573..3850949c8a79 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -8232,8 +8232,10 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8232 | command_type = FCP_COMMAND_DATA_OUT; | 8232 | command_type = FCP_COMMAND_DATA_OUT; |
8233 | /* word3 iocb=iotag wqe=payload_offset_len */ | 8233 | /* word3 iocb=iotag wqe=payload_offset_len */ |
8234 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ | 8234 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ |
8235 | wqe->fcp_iwrite.payload_offset_len = | 8235 | bf_set(payload_offset_len, &wqe->fcp_iwrite, |
8236 | xmit_len + sizeof(struct fcp_rsp); | 8236 | xmit_len + sizeof(struct fcp_rsp)); |
8237 | bf_set(cmd_buff_len, &wqe->fcp_iwrite, | ||
8238 | 0); | ||
8237 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ | 8239 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ |
8238 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ | 8240 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ |
8239 | bf_set(wqe_erp, &wqe->fcp_iwrite.wqe_com, | 8241 | bf_set(wqe_erp, &wqe->fcp_iwrite.wqe_com, |
@@ -8251,8 +8253,10 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8251 | case CMD_FCP_IREAD64_CR: | 8253 | case CMD_FCP_IREAD64_CR: |
8252 | /* word3 iocb=iotag wqe=payload_offset_len */ | 8254 | /* word3 iocb=iotag wqe=payload_offset_len */ |
8253 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ | 8255 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ |
8254 | wqe->fcp_iread.payload_offset_len = | 8256 | bf_set(payload_offset_len, &wqe->fcp_iread, |
8255 | xmit_len + sizeof(struct fcp_rsp); | 8257 | xmit_len + sizeof(struct fcp_rsp)); |
8258 | bf_set(cmd_buff_len, &wqe->fcp_iread, | ||
8259 | 0); | ||
8256 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ | 8260 | /* word4 iocb=parameter wqe=total_xfer_length memcpy */ |
8257 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ | 8261 | /* word5 iocb=initial_xfer_len wqe=initial_xfer_len memcpy */ |
8258 | bf_set(wqe_erp, &wqe->fcp_iread.wqe_com, | 8262 | bf_set(wqe_erp, &wqe->fcp_iread.wqe_com, |
@@ -8268,8 +8272,13 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
8268 | bf_set(wqe_dbde, &wqe->fcp_iread.wqe_com, 1); | 8272 | bf_set(wqe_dbde, &wqe->fcp_iread.wqe_com, 1); |
8269 | break; | 8273 | break; |
8270 | case CMD_FCP_ICMND64_CR: | 8274 | case CMD_FCP_ICMND64_CR: |
8275 | /* word3 iocb=iotag wqe=payload_offset_len */ | ||
8276 | /* Add the FCP_CMD and FCP_RSP sizes to get the offset */ | ||
8277 | bf_set(payload_offset_len, &wqe->fcp_icmd, | ||
8278 | xmit_len + sizeof(struct fcp_rsp)); | ||
8279 | bf_set(cmd_buff_len, &wqe->fcp_icmd, | ||
8280 | 0); | ||
8271 | /* word3 iocb=IO_TAG wqe=reserved */ | 8281 | /* word3 iocb=IO_TAG wqe=reserved */ |
8272 | wqe->fcp_icmd.rsrvd3 = 0; | ||
8273 | bf_set(wqe_pu, &wqe->fcp_icmd.wqe_com, 0); | 8282 | bf_set(wqe_pu, &wqe->fcp_icmd.wqe_com, 0); |
8274 | /* Always open the exchange */ | 8283 | /* Always open the exchange */ |
8275 | bf_set(wqe_xc, &wqe->fcp_icmd.wqe_com, 0); | 8284 | bf_set(wqe_xc, &wqe->fcp_icmd.wqe_com, 0); |