summaryrefslogtreecommitdiffstats
path: root/sys/dev/hptiop/hptiop.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hptiop/hptiop.c')
-rw-r--r--sys/dev/hptiop/hptiop.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c
index 49ffcef..c4e2427 100644
--- a/sys/dev/hptiop/hptiop.c
+++ b/sys/dev/hptiop/hptiop.c
@@ -424,6 +424,13 @@ srb_complete:
ccb->ccb_h.status = CAM_BUSY;
break;
case IOP_RESULT_CHECK_CONDITION:
+ memset(&ccb->csio.sense_data, 0,
+ sizeof(ccb->csio.sense_data));
+ if (dxfer < ccb->csio.sense_len)
+ ccb->csio.sense_resid = ccb->csio.sense_len -
+ dxfer;
+ else
+ ccb->csio.sense_resid = 0;
if (srb->srb_flag & HPT_SRB_FLAG_HIGH_MEM_ACESS) {/*iop*/
bus_space_read_region_1(hba->bar0t, hba->bar0h,
index + offsetof(struct hpt_iop_request_scsi_command,
@@ -573,6 +580,13 @@ static void hptiop_request_callback_mv(struct hpt_iop_hba * hba,
ccb->ccb_h.status = CAM_BUSY;
break;
case IOP_RESULT_CHECK_CONDITION:
+ memset(&ccb->csio.sense_data, 0,
+ sizeof(ccb->csio.sense_data));
+ if (req->dataxfer_length < ccb->csio.sense_len)
+ ccb->csio.sense_resid = ccb->csio.sense_len -
+ req->dataxfer_length;
+ else
+ ccb->csio.sense_resid = 0;
memcpy(&ccb->csio.sense_data, &req->sg_list,
MIN(req->dataxfer_length, sizeof(ccb->csio.sense_data)));
ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR;
OpenPOWER on IntegriCloud