Re: [usb-storage] Re: [PATCH] fix Sony USB mass storage - pass larger receive buffer

Dmitri Katchalov
2003-11-14T00:13:28Z

Quoting Pat LaVarre <p.lavarre@ieee.org>:

> Alan S:
>
> > > > > We may as well fix SCSI over IDE and SCSI over 1394/FireWire/iLink
> at
> > > > > the same time we fix SCSI over USB, yes?
> > > >
> > > > Are they broken?
> > >
> > > Aye, in much the same way: nothing but Talk Like Windows actually works
> > > well ...
> >
> > Those sound like different issues from the one we've been discussing in
> > this thread, namely: how should sd.c try to determine the read/write
> > status and cache-type of a disk device?
>
> I mean to be saying sd.c should by default send the CDB's associated
> with buffer lengths that produce the same BBB CBW's as Windows XP/2K,
> and then determine the read/write status and cache-type from that info
> alone.
>
> Do you agree that works for generic USB storage i.e. bInterfaceClass
> ...SubClass ...Protocol = x 08 (02|05|06) 50?
>
> Do you disagree that is what we should do in sd for generic USB storage?
>
> I'm confident Win XP/2K sometimes sends mode select to PDT x00
> HDD/Flash, because I remember some months back a friend fixed some
> firmware that didn't interpret mode select like Win wants nowadays.
>
> I imagine that means Win sends mode sense too.
>
> I haven't yet seen a trace of Win XP/2K.

I don't have W2K. I tried to get a trace on XP, it didn't work.
USB Snoopy does not seem to work on XP. Let me know if you know
of a better tool.

Note that Win98 did not support my Sony Handycam Memory Stick out of
the box, I had to install drivers from Sony installation CD.
Obviously these drivers do not attempt to issue any commands that
the device does not understand. XP did detect Sony out of the box but
it is very likely that it still loaded proprietary Sony driver based
on USB Device/Vendor ID.

Also note: the device does not claim any SCSI compliance as indicated
by reserved values in its device descriptor and by scsi version being
set to 0 in reply to INQUIRY. It is a miracle it worked at all.

IMHO the solution is either or both of:
* Blacklist it
* Define an absolute bare minimum safe subset of SCSI commands and
fall back to it whenever you see a non-compliant device like this one.

Regards,
Dmitri