Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2011 16:10:08 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r220838 - stable/8/sys/cam
Message-ID:  <201104191610.p3JGA8t3013131@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Apr 19 16:10:08 2011
New Revision: 220838
URL: http://svn.freebsd.org/changeset/base/220838

Log:
  MFC r214989:
  When requesting sense data for SIM not doing it automatically (such as
  ATAPI or USB), request only as much data as requested by consumer.
  On the way back -- report how much sense data we have actually received.

Modified:
  stable/8/sys/cam/cam_periph.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cam/cam_periph.c
==============================================================================
--- stable/8/sys/cam/cam_periph.c	Tue Apr 19 15:06:33 2011	(r220837)
+++ stable/8/sys/cam/cam_periph.c	Tue Apr 19 16:10:08 2011	(r220838)
@@ -1055,6 +1055,7 @@ camperiphsensedone(struct cam_periph *pe
 			saved_ccb->ccb_h.status |=
 			    CAM_AUTOSENSE_FAIL;
 		}
+		saved_ccb->csio.sense_resid = done_ccb->csio.resid;
 		bcopy(saved_ccb, done_ccb, sizeof(union ccb));
 		xpt_free_ccb(saved_ccb);
 		break;
@@ -1211,7 +1212,7 @@ camperiphdone(struct cam_periph *periph,
 			scsi_request_sense(&done_ccb->csio, /*retries*/1,
 					   camperiphsensedone,
 					   &save_ccb->csio.sense_data,
-					   sizeof(save_ccb->csio.sense_data),
+					   save_ccb->csio.sense_len,
 					   CAM_TAG_ACTION_NONE,
 					   /*sense_len*/SSD_FULL_SIZE,
 					   /*timeout*/5000);
@@ -1602,7 +1603,7 @@ camperiphscsisenseerror(union ccb *ccb, 
 			scsi_request_sense(&ccb->csio, /*retries*/1,
 					   camperiphsensedone,
 					   &orig_ccb->csio.sense_data,
-					   sizeof(orig_ccb->csio.sense_data),
+					   orig_ccb->csio.sense_len,
 					   CAM_TAG_ACTION_NONE,
 					   /*sense_len*/SSD_FULL_SIZE,
 					   /*timeout*/5000);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104191610.p3JGA8t3013131>