diff options
author | Daniel Drake <dsd@gentoo.org> | 2005-09-28 19:14:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 19:47:43 -0400 |
commit | a8798533c1f876b97566588cf2bf52458cb4a35d (patch) | |
tree | 076e498708a5efeb3e9234facb86ed15bc5a2dd0 /drivers/usb/storage | |
parent | d40ece1dc8dcc89ab921755cbc93a5cfb46d0766 (diff) |
[PATCH] USB Storage: HP8200: Another device type detection fix
There appears to be one more case where the HP8200 CD writer devices are
detected as flash readers - when the USB cable is replugged after use, with
the power cable still connected.
Oddly enough, the identify device command appears to 'fall through' when the
devices are in this state, the status register reading exactly the same opcode
as the command (0xA1) that was just executed.
I think it's safe to label this behaviour as specific to HP8200 devices, I
can't get the flash devices to respond like this.
This patch should solve the last of the HP8200 issues which have cropped up
recently.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/shuttle_usbat.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/shuttle_usbat.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c index 356342c6e7a2..bd448d6c3185 100644 --- a/drivers/usb/storage/shuttle_usbat.c +++ b/drivers/usb/storage/shuttle_usbat.c | |||
@@ -855,15 +855,15 @@ static int usbat_identify_device(struct us_data *us, | |||
855 | if (rc != USB_STOR_XFER_GOOD) | 855 | if (rc != USB_STOR_XFER_GOOD) |
856 | return USB_STOR_TRANSPORT_ERROR; | 856 | return USB_STOR_TRANSPORT_ERROR; |
857 | 857 | ||
858 | // Check for error bit | 858 | // Check for error bit, or if the command 'fell through' |
859 | if (status & 0x01) { | 859 | if (status == 0xA1 || !(status & 0x01)) { |
860 | // Device is a CompactFlash reader/writer | ||
861 | US_DEBUGP("usbat_identify_device: Detected Flash reader/writer\n"); | ||
862 | info->devicetype = USBAT_DEV_FLASH; | ||
863 | } else { | ||
864 | // Device is HP 8200 | 860 | // Device is HP 8200 |
865 | US_DEBUGP("usbat_identify_device: Detected HP8200 CDRW\n"); | 861 | US_DEBUGP("usbat_identify_device: Detected HP8200 CDRW\n"); |
866 | info->devicetype = USBAT_DEV_HP8200; | 862 | info->devicetype = USBAT_DEV_HP8200; |
863 | } else { | ||
864 | // Device is a CompactFlash reader/writer | ||
865 | US_DEBUGP("usbat_identify_device: Detected Flash reader/writer\n"); | ||
866 | info->devicetype = USBAT_DEV_FLASH; | ||
867 | } | 867 | } |
868 | 868 | ||
869 | return USB_STOR_TRANSPORT_GOOD; | 869 | return USB_STOR_TRANSPORT_GOOD; |