public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: usb storage traces
Date: Thu, 4 Dec 2003 10:44:28 -0800	[thread overview]
Message-ID: <20031204184428.GA17116@one-eyed-alien.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0312041329450.994-100000@ida.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 5346 bytes --]

Did the device advertise 'generic scsi' or one of the other protocol codes?

Microsoft has published information that indicates that they 'translate'
the mode-sense commands into the 10-byte variants for everything bug
'transparent scsi' -- I think actually seeing that information would be
necessary in constructing a new algorithm for Linux.

Matt

On Thu, Dec 04, 2003 at 01:30:16PM -0500, Alan Stern wrote:
> Here is a digested version of a log trace contributed by Alex Sanks.  It 
> was collected from a generic USB Bulk-only storage device (actually the 
> g_file_storage file-backed storage gadget) attached to a host running 
> Windows XP SP1.  It agrees quite well with the results of my own tests 
> using USB Snoopy on a Windows 2000 host.
> 
> In this trace, the number following the command name is the command length
> in decimal; following it are the command bytes in hex, then the direction
> and transfer length in decimal.
> 
> 
> INQUIRY		6: 12 00 00 00 24 00  In 36
> Vendor-specific	10: 23 00 00 00 00 00 00 00 fc 00  In 252
> 	Provokes an Invalid Command error
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> 	Bug in Windows: REQUEST-SENSE is really a 6-byte command
> 
> Vendor-specific	10: 23 00 00 00 00 00 00 00 fc 00  In 252
> 	Retry previous failed command; it still doesn't work
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> Vendor-specific	10: 23 00 00 00 00 00 00 00 fc 00  In 252
> 	Another futile retry
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> 
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 	Provokes Unit Attention: Reset Occurred
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 	This time it works
> 
> READ		10: 28 00 00 00 00 00 00 00 01 00  In 512
> 	Read the first sector
> READ		10: 28 00 00 00 00 00 00 00 01 00  In 512
> 	Windows likes reading the first sector
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 	It also likes reading the disk capacity
> 
> MODE-SENSE	6: 1a 00 1c 00 c0 00  In 192
> 	Page 1c is listed as reserved; I don't know what it is;
> 	provokes Invalid Field in CDB error
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> 
> MODE-SENSE	6: 1a 00 3f 00 c0 00  In 192
> 	So page 3f should work if we request 192 bytes!
> 
> MODE-SENSE	6: 1a 00 08 00 c0 00  In 192
> 	And so should page 08!
> 
> MODE-SELECT	6: 15 10 00 00 18 00  Out 24
> 	Although not shown here, a USB Snoopy trace reveals that this
> 	attempts to set the WCE (write cache enable) bit in page 8;
> 	here it provokes Invalid Field in CDB error
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> 
> MODE-SELECT	6: 15 10 00 00 18 00  Out 24
> 	Retry of previous failed command; it fails again
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> 
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 	Windows really likes to get the capacity!
> READ		10: 28 00 00 00 00 00 00 00 01 00  In 512
> 	And it really likes to read the first sector!
> READ		10: 28 00 00 00 00 00 00 00 01 00  In 512
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> READ		10: 28 00 00 00 00 00 00 00 01 00  In 512
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 	Ommitted: this command was repeated 8 times
> 
> TEST-UNIT-READY	6: 00 00 00 00 00 00  
> MODE-SENSE	6: 1a 00 00 00 0c 00  In 12
> 	I don't know what Windows expects to find in page 0;
> 	but this fails
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> 
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 	Ommitted: this command was repeated 3 times
> 
> TEST-UNIT-READY	6: 00 00 00 00 00 00  
> MODE-SENSE	6: 1a 00 00 00 0c 00  In 12
> 	Fails again
> REQUEST-SENSE	12: 03 00 00 00 12 00 00 00 00 00 00 00  In 18
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> READ-CAPACITY	10: 25 00 00 00 00 00 00 00 00 00  In 8
> 
> 
> Some of the activity may depend on the contents of the partition table
> stored in the first sector.  But it seems clear that, subject to the
> unknown function of command x23 and of mode page x1c, we might be able to
> work with devices that advertise themselves as Bulk-only by requesting 192
> bytes from page x3f and page 8.
> 
> Does anybody know what command x23 and mode page x1c do?  Although 
> nominally vendor-specific, they must be reasonably standardized if Windows 
> can get away with using them on a generic device.
> 
> Unfortunately, there's nothing to stop a manufacturer from supplying their
> own driver which would avoid reading those pages.  So even an apparently
> normal device might react badly to these commands.  However I think it's 
> still worth a try.
> 
> Alan Stern
> 
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Hey Chief.  We've figured out how to save the technical department.  We 
need to be committed.
					-- The Techs
User Friendly, 1/22/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-12-04 18:44 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-04 18:30 usb storage traces Alan Stern
2003-12-04 18:44 ` Matthew Dharm [this message]
2003-12-04 20:59   ` Alan Stern
2003-12-04 21:27     ` Matthew Dharm
2003-12-04 21:33     ` Pat LaVarre
2003-12-04 21:34     ` Pat LaVarre
2003-12-04 21:37     ` Pat LaVarre
2003-12-04 21:38     ` Pat LaVarre
2003-12-04 22:24       ` Pat LaVarre
2003-12-04 22:28         ` Pat LaVarre
2003-12-05  3:56         ` Informational Exception mpage [was: usb storage traces] Douglas Gilbert
2003-12-05 15:32           ` Alan Stern
2003-12-05 16:02             ` Pat LaVarre
2003-12-05 15:01         ` usb storage traces Alan Stern
2003-12-05 17:18           ` bCWBCBLength is cb length no when Pat LaVarre
2003-12-05 18:55             ` Alan Stern
2003-12-05 19:29               ` Pat LaVarre
2003-12-05 17:19           ` usb storage traces Pat LaVarre
2003-12-05 18:22             ` Alan Stern
2003-12-05  5:08     ` Patrick Mansfield
2003-12-05 16:01       ` Alan Stern
2003-12-05 16:11         ` Pat LaVarre
2003-12-05 17:14           ` David Brownell
2003-12-05 17:35             ` Pat LaVarre
2003-12-05 18:21               ` Alan Stern
2003-12-05 18:41                 ` Pat LaVarre
2003-12-05 18:24               ` David Brownell
2003-12-16 17:00             ` Randy.Dunlap
2003-12-16 17:07               ` Pat LaVarre
2003-12-05  4:31 ` Douglas Gilbert
     [not found] <20031219091450.GC828@one-eyed-alien.net>
2003-12-19 14:51 ` Alan Stern
2003-12-19 16:21   ` Pat LaVarre
2003-12-20 23:56   ` Matthew Dharm
2003-12-21  2:26     ` Alan Stern
     [not found] <1070649445.12411.347.camel@patibmrh9>
2003-12-05 19:27 ` Alan Stern
2003-12-05 20:27   ` Pat LaVarre
  -- strict thread matches above, loose matches on Subject: below --
2003-12-04 16:13 Pat LaVarre
2003-11-10 22:04 Pat LaVarre
2003-11-11 21:59 ` Pat LaVarre
2003-11-13 18:42   ` Pat LaVarre
2003-09-22 23:07 [linux-usb-devel] Re: USB storage problems on OHCI Andries.Brouwer
2003-09-22 23:25 ` usb storage traces Pat LaVarre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031204184428.GA17116@one-eyed-alien.net \
    --to=mdharm-scsi@one-eyed-alien.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox