On Mon, 21 Aug 2006, Peter.Chen wrote:

> > >  I have a question,the error received
> > > error CBW causes -104 error,or -104 error causes it receives error CBW?
> > 
> > There is no direct connection.  g_file_storage cancels the request when it 
> > gets some sort of reset from the host.  Those -104 errors generally 
> > indicate that the host has reset the device.
> I know the reason is the host has reset the device.
> Now,i want to find why the host wants to reset the device?
> So,i save the last CBW,and CSW,wants to see what causes the reset?

In general you can't find out the reason for the reset by looking on the
device.  You have to look on the host.  After all, the host is responsible
for issuing the reset.

However there are some obvious reasons why a reset may occur.  If the 
device receives an invalid CBW then it won't respond to the host, so the 
host will time out and will reset the device.  If the device sends a CSW 
with bCSWStatus = 2, the host will reset the device.

> Now,i use "stall=n" option when i load g_file_storage.
> If load "stall=y",there are some errors.

Are there errors if you use "stall=n"?

> If i leave only DEBUG, VERBOSE, and DUMP_MSGS,there are too many debug
> message during the data transfer.And my error only happens each several
> hours.I try open above DEBUG options,if the host resets device,just
> repeat below debug message:
> g_file_storage gadget: bulk_out_complete --> -104, 0/31
> g_file_storage gadget: reset config
> g_file_storage gadget: reset interface
> g_file_storage gadget: set interface 0
> g_file_storage gadget: full speed config #1

The messages above refer to the reset.

> g_file_storage gadget: sending command-failure status

This message replies to the command that follows the reset.

> And there is an error at check_command function per above message.
> It is unit_attention_data=SS_RESET_OCCURRED;And the check_command
> returns -EINVAL;

Correct.  The device sends the error status to tell the host that it has 
been reset.

> > > I wouder what causes -104 error?
> > 
> > That error means the request was cancelled.
> If the request was cancelled,the copy is aborted or not?
> If the software is pretty ok,it can go on copying after
> we receive bulk_out_complete --> -104.

It depends on the host.  The host can abort the copy or can let the copy 
continue.  Remember, the host is always in charge.

> My debugging log sequence is:
> Receive a error CBW:
>    0:  00 1e 45 ff 00 00 02 00  08 00 00 00 80 00 0a 25
>     10:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00

Are you certain this is the CBW you received?  Maybe you received a valid
CBW and it was overwritten before you printed it out.  Or maybe the host
sent a valid CBW and there is a bug in your UDC driver.

> Then the host send reset 8 times(WindowsXP),every reset,my log is:
> g_file_storage gadget: reset config
> g_file_storage gadget: reset interface
> g_file_storage gadget: set interface 0
> g_file_storage gadget: full speed config #1
> At the last reset:bulk_out_complete --> -104, 0/31 will appear first.
> then go on above log.

If the host sends multiple resets, it must be because the device isn't 
responding properly.  This could mean there's a bug in the UDC driver.

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