Hi,
Javier-Elias Vasquez-Vivas wrote:
So I guess the odd detection method must be used... Please let me
know if more trials are required... For the final fix, probably a
separated unified patch would be worthy?
Something like this should do it. According to another reporter, who made a
similar change, there is another bug (kernel oops) which appears later on in
driver usage. Please keep debug logs enabled and let me know how you get on
with this.
Thanks!
Daniel
--- linux-2.6.13-rc4-gentoo/drivers/usb/storage/shuttle_usbat.c.orig 2005-07-30 14:48:17.000000000 +0100
+++ linux-2.6.13-rc4-gentoo/drivers/usb/storage/shuttle_usbat.c 2005-07-30 14:53:56.000000000 +0100
@@ -825,7 +825,6 @@ static int usbat_flash_check_media(struc
/*
* Determine whether we are controlling a flash-based reader/writer,
* or a HP8200-based CD drive.
- * Sets transport functions as appropriate.
*/
static int usbat_identify_device(struct us_data *us,
struct usbat_info *info)
@@ -836,30 +835,17 @@ static int usbat_identify_device(struct
if (!us || !info)
return USB_STOR_TRANSPORT_ERROR;
- rc = usbat_device_reset(us);
- if (rc != USB_STOR_TRANSPORT_GOOD)
- return rc;
-
/*
- * By examining the device signature after a reset, we can identify
- * whether the device supports the ATAPI packet interface.
- * The flash-devices do not support this, whereas the HP CDRW's obviously
- * do.
- *
- * This method is not ideal, but works because no other devices have been
- * produced based on the USBAT/USBAT02.
- *
- * Section 9.1 of the ATAPI-4 spec states (amongst other things) that
- * after a device reset, a Cylinder low of 0x14 indicates that the device
- * does support packet commands.
+ * This is ugly, but as the HP8200 drives do not correctly provide the
+ * ATAPI device signature, there's not much other choice.
+ * We distinguish between flash and cdrom by examining the device
+ * status at this stage during initialization.
*/
- rc = usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, &status);
+ rc = usbat_get_status(us, &status);
if (rc != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
- US_DEBUGP("usbat_identify_device: Cylinder low is %02X\n", status);
-
- if (status == 0x14) {
+ if (status == 0x00) {
// Device is HP 8200
US_DEBUGP("usbat_identify_device: Detected HP8200 CDRW\n");
info->devicetype = USBAT_DEV_HP8200;