--- drivers/usb/storage/protocol.c.orig	Thu Feb  7 10:34:06 2002
+++ drivers/usb/storage/protocol.c	Thu Feb  7 11:11:49 2002
@@ -53,6 +53,11 @@
  * Helper routines
  ***********************************************************************/
 
+#define GET_SRB_REQUEST_BUFFER(srb,ptr,type) \
+        ptr = (type*) srb->request_buffer; \
+        if (srb->use_sg) \
+                ptr = (type*) ((struct scatterlist *) ptr)[0].address;
+
 /* Fix-up the return data from an INQUIRY command to show 
  * ANSI SCSI rev 2 so we don't confuse the SCSI layers above us
  */
@@ -67,13 +72,7 @@
 	US_DEBUGP("Fixing INQUIRY data to show SCSI rev 2\n");
 
 	/* find the location of the data */
-	if (srb->use_sg) {
-		struct scatterlist *sg;
-
-		sg = (struct scatterlist *) srb->request_buffer;
-		data_ptr = (unsigned char *) sg[0].address;
-	} else
-		data_ptr = (unsigned char *)srb->request_buffer;
+        GET_SRB_REQUEST_BUFFER (srb, data_ptr, unsigned char);
 
 	/* Change the SCSI revision number */
 	data_ptr[2] |= 0x2;
@@ -275,6 +274,13 @@
 void usb_stor_transparent_scsi_command(Scsi_Cmnd *srb, struct us_data *us)
 {
 	int old_cmnd = 0;
+        unsigned char old_size = 0;
+
+        if (srb->cmnd[0] == INQUIRY) {
+                /* Fix INQUIRY length */
+                old_size = srb->cmnd[4];
+                srb->cmnd[4] = 36;
+        }
 
 	/* This code supports devices which do not support {READ|WRITE}_6
 	 * Apparently, neither Windows or MacOS will use these commands,
@@ -335,6 +341,18 @@
 	if ((us->flags & US_FL_MODE_XLATE) && (old_cmnd == MODE_SENSE)
 			&& (status_byte(srb->result) == GOOD))
 		usb_stor_scsiSense10to6(srb);
+
+        if (old_size) {
+                unsigned char new_size, *data;
+
+                GET_SRB_REQUEST_BUFFER (srb, data, unsigned char); 
+                new_size = data[4] + 4;     /* "Additional length" reported by device */ 
+                if (new_size > old_size) {
+                        srb->cmnd[4] = new_size;
+                        usb_stor_invoke_transport(srb, us);
+                }
+        }
+
 
 	/* fix the INQUIRY data if necessary */
 	fix_inquiry_data(srb);
