David Brownell wrote:
On Thursday 13 January 2005 7:01 am, Alan Stern wrote:
On Thu, 13 Jan 2005, Vladimir Trukhin wrote:
Well, it seems I've found the source of this problem.
Today I checked usb traffic on Windows side using SnoopyPro tool ...
But g_file_storage driver always sends only one packet. So all further communication on the bus are frozen since Windows has sent the 2nd data request untill the timeout occurs. After timeout and the failed response from the device Windows sends usb reset.
Actually g_file_storage does queue two packets. Here's an extract from your own log:
<7>g_file_storage gadget: SCSI command: READ FORMAT CAPACITIES; Dc=10, Di=252; Hc=10, Hi=252 <7>g_file_storage gadget: bulk-in, length 0: <7>udc: ep1in-bulk queue req c03d34a0, len 0 buf c03ec000 <7>udc: wrote ep1in-bulk 0 bytes/L/S 0 left c03d34a0
That's the first packet; it has length 0.
<7>g_file_storage gadget: bulk-in set halt <7>udc: ep1in-bulk halt
Then the endpoint is halted.
And wierdness can easily ensue ... especially after writing a zero length packet on that rather quarrelsome hardware.
One useful experiment might be disabling the call to halt that
endpoint, to see if that makes MS-Windows happier.
That's it!
That was the source of my problem. But actually it doesn't matter whether or not it's a zero length packet. Anyway, the usb controller doesn't send a packet if halt has been called (at least, I can't see it on Windows side with sniffer).
When I disabled halting it passed READ FORMAT CAPACITIES command but stopped at some others.
Unfortunately, I have no time now to debug it deeply.
But with 'removable' option and disabled halting it connects and works fine with both Linux and Windows.
Anyway, for my immediate aim it's more than enough.
By and large, to make it works I just made the following change:
--- file_storage.c 2004-12-25 06:36:01.000000000 +0900 +++ file_storage.c 2005-01-14 14:18:51.000000000 +0900 @@ -3714,7 +3714,7 @@ mod_data.protocol_type = USB_SC_SCSI; mod_data.protocol_name = "Transparent SCSI";
- if (gadget_is_sh(fsg->gadget)) + if (gadget_is_sh(fsg->gadget) || gadget_is_pxa(fsg->gadget)) mod_data.can_stall = 0;
if (mod_data.release == 0xffff) { // Parameter wasn't set
And specified 'removable' option for correct connection to Windows.
May be this info will be helpful for someone who works with pxa :)
Thanks a lot for your help!
Best regards, Vlad Trukhin
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel