summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorVelempati Chiranjeevi <c_cvelem@qualcomm.com>2009-10-21 09:53:10 +0530
committerGary King <gking@nvidia.com>2010-05-23 14:43:07 -0700
commit85092e2d33bccbc1c9128ad6ba2005619e6d17f2 (patch)
treea01594777d281237a17d5d9c0dddebb20089ec5a /drivers/usb
parenta68f3f12b488f78b8d522f0b44b042b643df6f4f (diff)
USB: android gadget: mass storage: Fix format issue for Vista Host
As part of formating the mass storage device, Host sends the INQUIRY scsi command. As per the standard, the command length for this command should be 6 bytes, whereas the Vista host sends 12 bytes. When the command length of the command is not equal to the standard length, the device sends a phase error as part of the status phase. When the host receives a phase error, it re-enumerates, hence the error. If the command is INQUIRY, and the command length is 12 bytes, treating this as a good command and not sending the phase error to the host fixes this issue. Signed-off-by: Velempati Chiranjeevi <c_cvelem@qualcomm.com> Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 450d4791f333..845d98c0b5c6 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -1740,9 +1740,10 @@ static int check_command(struct fsg_dev *fsg, int cmnd_size,
/* Verify the length of the command itself */
if (cmnd_size != fsg->cmnd_size) {
- /* Special case workaround: MS-Windows issues REQUEST SENSE
- * with cbw->Length == 12 (it should be 6). */
- if (fsg->cmnd[0] == SC_REQUEST_SENSE && fsg->cmnd_size == 12)
+ /* Special case workaround: MS-Windows issues REQUEST_SENSE
+ * and INQUIRY commands with cbw->Length == 12 (it should be 6). */
+ if ((fsg->cmnd[0] == SC_REQUEST_SENSE && fsg->cmnd_size == 12)
+ || (fsg->cmnd[0] == SC_INQUIRY && fsg->cmnd_size == 12))
cmnd_size = fsg->cmnd_size;
else {
fsg->phase_error = 1;