public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Time to allow MODE SENSE for USB disk-type storage devices?
@ 2004-03-08 16:05 Alan Stern
  2004-03-08 17:55 ` [usb-storage] Time to allow MODE SENSE for USB disk-type storage de vices? Pat LaVarre
  2004-03-08 20:13 ` [usb-storage] Time to allow MODE SENSE for USB disk-type storage devices? Andries Brouwer
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Stern @ 2004-03-08 16:05 UTC (permalink / raw)
  To: Matthew Dharm, Patrick Mansfield; +Cc: USB Storage List, SCSI development list

Matt & Patrick:

Maybe it's time to think about improving the situation with MODE SENSE for 
USB devices.  I don't know that page 0x08 is particularly crucial for USB 
devices, but page 0x3f (for the write-protect setting) certainly would be 
good to have.

Traces taken from various Windows systems show that Windows 2000
consistently issues MODE SENSE for page 0x3f, while Windows XP does both
page 0x3f and page 0x08.  Now it's entirely possible that certain
vendor-specific drivers cause Windows to skip those steps, but on the
whole we ought to be pretty safe if we do them in exactly the same way as
Windows.  For page 0x3f, anyway.  (If necessary, we can add an
unusual_devs flag bit to usb-storage for devices that can't handle page
0x3f.)

There are two important things to note.  First, Windows _always_ uses a
transfer length of 192 for these commands.  None of this "Let's just get
the header" or "Only request as much as we need" wishy-washiness.  
Second, Windows uses MODE SENSE(6) for Transparent Scsi (USB SubClass =
0x06) and MODE SENSE(10) for everything else -- according to Pat LaVarre
anyway, and it agrees with the trace data.  (MODE SELECT is treated the
same way, but that's irrelevant for our purposes.)

The usb-storage driver can fix the 6-byte vs. 10-byte issue by clearing or
setting the appropriate flag during the slave_configure() callback.  Is it 
possible to force the 192-byte transfer lengths in a similar way?

On a related note, we've run across reports from several users indicating 
that their USB devices die when handed a PREVENT-ALLOW MEDIUM REMOVAL 
command, even though they set the Removable-Medium flag in their INQUIRY 
data.  Could there be a device flag that would cause the sd driver to 
avoid these commands?

Alan Stern


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-03-10 22:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-08 16:05 Time to allow MODE SENSE for USB disk-type storage devices? Alan Stern
2004-03-08 17:55 ` [usb-storage] Time to allow MODE SENSE for USB disk-type storage de vices? Pat LaVarre
2004-03-08 21:16   ` [usb-storage] Time to allow MODE SENSE for USB disk-typestorage " Pat LaVarre
2004-03-08 20:13 ` [usb-storage] Time to allow MODE SENSE for USB disk-type storage devices? Andries Brouwer
2004-03-10  1:43   ` Patrick Mansfield
2004-03-10  9:13     ` Andries Brouwer
2004-03-10 16:56       ` Alan Stern
2004-03-10 18:53       ` [usb-storage] Time to allow MODE SENSE for USB disk-type storag edevices? Pat LaVarre
2004-03-10 20:24         ` Alan Stern
2004-03-10 20:58           ` Pat LaVarre
2004-03-10 22:43             ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox