On Tue, 8 Aug 2006, Klaus Muth wrote:

> Hi!
> 
> Am Montag, 7. August 2006 08:43 schrieb Klaus Muth:
> > I'm trying to read from an Stoneridge Optac Download tool (vend/prod
> > 0x557/0x2008) for this European digital tachograph thing (see e.g.
> > www.digitaltachograph.gov.uk/).
> >
> > The Optac tool is recognized correctly by the kernel as mass storage and
> > usb-storage is loaded. Then all goes wrong:
> I retry, since Adam Stern told me to try again on 2.6. Additionally, I 
> recompiled 2.6.16 with CONFIG_USB_DEBUG=y
> 
> The dmesg output is now _very_ verbose, but hopefully somebody can help me.

Yes, unforunately usb-storage produces a _lot_ of debugging output.  I 
think in this case it will help.

I've skipped the unimportant sections of your log.

> Plugin OPTAC Tool
> -----------------
> usb 1-1: new full speed USB device using uhci_hcd and address 2
> usb 1-1: configuration #1 chosen from 1 choice
> Initializing USB Mass Storage driver...
> usb-storage: USB Mass Storage device detected
> usb-storage: -- associate_dev
> usb-storage: Vendor: 0x0000, Product: 0x0000, Revision: 0x0100
> usb-storage: Interface Subclass: 0x06, Protocol: 0x50
> usb-storage: Transport: Bulk
> usb-storage: Protocol: Transparent SCSI

Interesting.  You said above that the vendor and product IDs are 0x557 and 
0x2008.  How come they show up here as 0x0000 and 0x0000?

> usb-storage: Command TEST_UNIT_READY (6 bytes)
> usb-storage:  00 00 00 00 00 00
> usb-storage: Bulk Command S 0x43425355 T 0x5 L 0 F 0 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0
> usb-storage: scsi cmd done, result=0x0
> usb-storage: *** thread sleeping.
> usb-storage: queuecommand called
> usb-storage: *** thread awakened.

The TEST UNIT READY command succeeded.  By definition, that means the 
device is capable of reading data.

> usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
> usb-storage:  1e 00 00 00 01 00
> usb-storage: Bulk Command S 0x43425355 T 0x6 L 0 F 0 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x1
> usb-storage: -- transport indicates command failure
> usb-storage: Issuing auto-REQUEST_SENSE
> usb-storage: Bulk Command S 0x43425355 T 0x7 L 18 F 128 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: usb_stor_bulk_transfer_buf: xfer 18 bytes
> usb-storage: Status code 0; transferred 18/18
> usb-storage: -- transfer complete
> usb-storage: Bulk data transfer result 0x0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x7 R 0 Stat 0x0
> usb-storage: -- Result from auto-sense is 0
> usb-storage: -- code: 0x70, key: 0x6, ASC: 0x3a, ASCQ: 0x0
> usb-storage: (Unknown Key): (unknown ASC/ASCQ)
> usb-storage: scsi cmd done, result=0x2
> usb-storage: *** thread sleeping.

PREVENT-ALLOW MEDIUM REMOVAL failed, and the sense info says: key = 6
(Unit Attention), ASC=0x3a (Medium Not Present).  This response contains
three errors:

First, the sense key is wrong.  Unit Attention should be used to report 
changes in the device's state.  The key probably should have been 5 
(Illegal Request).

Second, the ASC code is wrong.  If the device doesn't understand the 
command then it should set ASC=0x24 (Invalid Field in CDB).

Third, the information is inconsistent with the success of the preceding 
TEST UNIT READY.  How can the device be ready to read if no medium is 
present?


> The debug output of the mount command does not fit into the kernel ring 
> buffer, but there are several blocks of this form:
> -----------------
> SCSI device sda: 31744 512-byte hdwr sectors (16 MB)
> usb-storage: queuecommand called
> usb-storage: *** thread awakened.
> usb-storage: Command MODE_SENSE (6 bytes)
> usb-storage:  1a 00 3f 00 c0 00
> usb-storage: Bulk Command S 0x43425355 T 0x2b L 192 F 128 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: usb_stor_bulk_transfer_sglist: xfer 192 bytes, 1 entries
> usb-storage: Status code -121; transferred 4/192
> usb-storage: -- short read transfer
> usb-storage: Bulk data transfer result 0x1
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x2b R 0 Stat 0x0
> usb-storage: scsi cmd done, result=0x0
> usb-storage: *** thread sleeping.
> sda: Write Protect is off
> sda: Mode Sense: 03 00 00 00
> sda: assuming drive cache: write through
>  sda: unable to read partition table
> FAT: unable to read boot sector
> usb-storage: queuecommand called
> usb-storage: *** thread awakened.
> usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
> usb-storage:  1e 00 00 00 00 00
> usb-storage: Bulk Command S 0x43425355 T 0x2c L 0 F 0 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x2c R 0 Stat 0x1
> usb-storage: -- transport indicates command failure
> usb-storage: Issuing auto-REQUEST_SENSE
> usb-storage: Bulk Command S 0x43425355 T 0x2d L 18 F 128 Trg 0 LUN 0 CL 6
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: usb_stor_bulk_transfer_buf: xfer 18 bytes
> usb-storage: Status code 0; transferred 18/18
> usb-storage: -- transfer complete
> usb-storage: Bulk data transfer result 0x0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 13/13
> usb-storage: -- transfer complete
> usb-storage: Bulk status result = 0
> usb-storage: Bulk Status S 0x53425355 T 0x2d R 0 Stat 0x0
> usb-storage: -- Result from auto-sense is 0
> usb-storage: -- code: 0x70, key: 0x6, ASC: 0x3a, ASCQ: 0x0
> usb-storage: (Unknown Key): (unknown ASC/ASCQ)
> usb-storage: scsi cmd done, result=0x2
> usb-storage: *** thread sleeping.
> -----------------
> 
> dd if=/dev/sda of=bla does about the same an fdisk -l /dev/sda produces some 
> very weird output.
> 
> Please help me to get this thing to work!

It looks as though this device simply cannot handle the PREVENT-ALLOW 
MEDIUM REMOVAL command properly.  Luckily it's possible to create a 
blacklist entry for the device that will prevent the kernel from issuing 
that command.  But only if the correct vendor and product IDs are present.

What shows up in /proc/bus/usb/devices when you plug in the device?  And
what does "lsusb -v" say?

Alan Stern


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to