On Fri, 24 Aug 2007, Samuel Hangouët wrote: > Thanks for your answer. > > So this HiFi sends garbage ! > I suppose that common USB keys are much more permissive that your driver is.
Probably they are. My driver deliberately does lots of checking, because part of its purpose is to test mass-storage host drivers. For ordinary use all that extra checking isn't needed. > Well, it really works when replacing this 6 by 1 : > when I plug it, the HiFi detect the volume and starts playing the mp3 > song I put in it. > > > Well, I'm forced to confess I do not know well the USB and SCSI protocols. > > As the error is caught later in your code, it seems that an error status is > send to the host which can go on and retry in an other way... > > Below is beginning of the dump. ... > g_file_storage gadget: SCSI command: INQUIRY; Dc=6, Di=36; Hc=6, Hi=36 > g_file_storage gadget: bulk-in, length 36: > 0: 00 00 02 02 1f 00 00 00 4c 69 6e 75 78 20 20 20 > 10: 46 69 6c 65 2d 53 74 6f 72 20 47 61 64 67 65 74 > 20: 30 33 30 33 > g_file_storage gadget: bulk-in, length 13: > 0: 55 53 42 53 00 00 00 00 00 00 00 00 00 > g_file_storage gadget: bulk-out, length 31: > 0: 55 53 42 43 01 00 00 00 10 00 00 00 80 00 0c 23 > 10: 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 > g_file_storage gadget: SCSI command: READ FORMAT CAPACITIES; Dc=10, > Di=16; Hc=12, Hi=16 > g_file_storage gadget: bulk-in, length 16: > 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > g_file_storage gadget: sending phase-error status > g_file_storage gadget: bulk-in, length 13: > 0: 55 53 42 53 01 00 00 00 10 00 00 00 02 It's interesting to see that the READ FORMAT CAPACITIES command is garbage also. The HiFi set the command length to 12 but it really ought to be 10. That's what the "Dc=10" and "Hc=12" in the "SCSI command" line mean. g_file_storage rejected it with a phase-error status. > g_file_storage gadget: bulk-out, length 31: > 0: 55 53 42 43 02 00 00 00 00 00 00 00 80 00 06 00 > 10: 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 > g_file_storage gadget: SCSI command: TEST UNIT READY; Dc=6, Dn=0; > Hc=6, Hn=0 > g_file_storage gadget: sending command-failure status > g_file_storage gadget: sense data: SK x06, ASC x29, ASCQ x00; info x0 > g_file_storage gadget: bulk-in, length 13: > 0: 55 53 42 53 02 00 00 00 00 00 00 00 01 > g_file_storage gadget: bulk-out, length 31: > 0: 55 53 42 43 03 00 00 00 12 00 00 00 80 00 05 03 > 10: 00 00 00 12 00 00 00 10 00 00 00 00 00 00 00 > g_file_storage gadget: SCSI command: REQUEST SENSE; Dc=6, Di=18; > Hc=5, Hi=18 > g_file_storage gadget: bulk-in, length 18: > 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 10: 00 00 > g_file_storage gadget: sending phase-error status > g_file_storage gadget: bulk-in, length 13: > 0: 55 53 42 53 03 00 00 00 12 00 00 00 02 And here, with your change, the bogus REQUEST SENSE is also rejected with a phase error. I don't mind changing the test from 6 to 1, since the second test will catch any bad commands. Sound okay? Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users