summaryrefslogtreecommitdiffstats
path: root/sys/dev/hptiop
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-10-13 20:06:19 +0000
committermarius <marius@FreeBSD.org>2011-10-13 20:06:19 +0000
commit03f042f32ea4a1b4d4867c8d56885f1f29f8b5b0 (patch)
treec06ee1d9af97642c074b8b2f67c22e536ea6a8fb /sys/dev/hptiop
parent9d926ddf66d0bdefacfd2f642dd15d42f3a2194b (diff)
downloadFreeBSD-src-03f042f32ea4a1b4d4867c8d56885f1f29f8b5b0.zip
FreeBSD-src-03f042f32ea4a1b4d4867c8d56885f1f29f8b5b0.tar.gz
Merge from r225950:
Set the sense residual properly. Reviewed by: ken
Diffstat (limited to 'sys/dev/hptiop')
-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