Patch for USB 2.4.26 - jumpshot's capacity

From: Pete Zaitcev
Date: Fri Jun 18 2004 - 13:38:54 EST


Yet another victim of SCSI standards which make devices return
the address of the last sector instead of the number of sectors.
Just about every other driver which emulates SCSI fails to report
capacity right. I blame Shurgart & Associates for this.

Made from a 2.6 patch by Alan Stern.

-- Pete

diff -urp -X dontdiff linux-2.4.27-pre6/drivers/usb/storage/jumpshot.c linux-2.4.27-pre5-usbx/drivers/usb/storage/jumpshot.c
--- linux-2.4.27-pre6/drivers/usb/storage/jumpshot.c 2003-06-13 07:51:37.000000000 -0700
+++ linux-2.4.27-pre5-usbx/drivers/usb/storage/jumpshot.c 2004-06-17 22:21:12.000000000 -0700
@@ -710,15 +710,8 @@ int jumpshot_transport(Scsi_Cmnd * srb,

// build the reply
//
- ptr[0] = (info->sectors >> 24) & 0xFF;
- ptr[1] = (info->sectors >> 16) & 0xFF;
- ptr[2] = (info->sectors >> 8) & 0xFF;
- ptr[3] = (info->sectors) & 0xFF;
-
- ptr[4] = (info->ssize >> 24) & 0xFF;
- ptr[5] = (info->ssize >> 16) & 0xFF;
- ptr[6] = (info->ssize >> 8) & 0xFF;
- ptr[7] = (info->ssize) & 0xFF;
+ ((u32 *) ptr)[0] = cpu_to_be32(info->sectors - 1);
+ ((u32 *) ptr)[1] = cpu_to_be32(info->ssize);

return USB_STOR_TRANSPORT_GOOD;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/