From 03f042f32ea4a1b4d4867c8d56885f1f29f8b5b0 Mon Sep 17 00:00:00 2001 From: marius Date: Thu, 13 Oct 2011 20:06:19 +0000 Subject: Merge from r225950: Set the sense residual properly. Reviewed by: ken --- sys/dev/mfi/mfi_cam.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/dev/mfi') diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c index 747b6c0..c49daff 100644 --- a/sys/dev/mfi/mfi_cam.c +++ b/sys/dev/mfi/mfi_cam.c @@ -354,7 +354,13 @@ mfip_done(struct mfi_command *cm) ccbh->status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; csio->scsi_status = pt->header.scsi_status; - sense_len = min(pt->header.sense_len, sizeof(struct scsi_sense_data)); + if (pt->header.sense_len < csio->sense_len) + csio->sense_resid = csio->sense_len - + pt->header.sense_len; + else + csio->sense_resid = 0; + sense_len = min(pt->header.sense_len, + sizeof(struct scsi_sense_data)); bzero(&csio->sense_data, sizeof(struct scsi_sense_data)); bcopy(&cm->cm_sense->data[0], &csio->sense_data, sense_len); break; -- cgit v1.1