PERFORCE change 71289 for review

Scott Long scottl at FreeBSD.org
Fri Feb 18 20:17:34 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=71289

Change 71289 by scottl at scottl-junior on 2005/02/19 04:17:00

	Finish integrating cam_xpt.c rev 1.144 and 1.145

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_probe.c#4 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_probe.c#4 (text+ko) ====

@@ -376,7 +376,18 @@
 		if (softc->action == PROBE_INQUIRY)
 			inquiry_len = SHORT_INQUIRY_LENGTH;
 		else
-			inquiry_len = inq_buf->additional_length + 4;
+			inquiry_len = inq_buf->additional_length
+				    + offsetof(struct scsi_inquiry_data,
+						additional_length) + 1;
+
+		/*
+		 * Some parallel SCSI devices fail to send an
+		 * ignore wide residue message when dealing with
+		 * odd length inquiry requests.  Round up to be
+		 * safe.
+		 */
+		inquiry_len = roundup2(inquiry_len, 2);
+
 	
 		scsi_inquiry(csio,
 			     /*retries*/4,
@@ -529,7 +540,7 @@
 			switch(periph_qual) {
 			case SID_QUAL_LU_CONNECTED:
 			{
-				u_int8_t alen;
+				u_int8_t len;
 
 				/*
 				 * We conservatively request only
@@ -541,9 +552,11 @@
 				 * the amount of information the device
 				 * is willing to give.
 				 */
-				alen = inq_buf->additional_length;
+				len = inq_buf->additional_length
+				    + offsetof(struct scsi_inquiry_data,
+						additional_length) + 1;
 				if (softc->action == PROBE_INQUIRY
-				 && alen > (SHORT_INQUIRY_LENGTH - 4)) {
+				 && len > SHORT_INQUIRY_LENGTH) {
 					softc->action = PROBE_FULL_INQUIRY;
 					xpt_release_ccb(done_ccb);
 					probereschedule(periph, priority);


More information about the p4-projects mailing list