Am Mittwoch, 11. Juli 2007 schrieb jidong xiao:
> I see there are two routines, usb_unlink_urb and usb_kill_urb,the
> latter one should be used for sync unlinking,this means it can go to
> sleep,it won't return until the completion handler have finished.And
> the former one could not go to sleep.But what's difference between
> sync and async,I mean,why do we need such two kinds of mechanism to
> cancel a transfer request?

Under some conditions, eg. network drivers' and the storage driver's
timeout handling, drivers cannot sleep. They have to stop transfers
asynchronously.

> I can find there are such comments in the source code,
>  * When the URB_ASYNC_UNLINK transfer flag for the URB is set, this
>  * request is asynchronous.  Success is indicated by returning -EINPROGRESS,
>  * at which time the URB will normally have been unlinked but not yet
>  * given back to the device driver.  When it is called, the completion
>  * function will see urb->status == -ECONNRESET.
> 
> my question is, what would happen if urb->status==-ECONNRESET?

The driver then knows that an URB was stopped prematurely and the transfer
must be unconsidered incomplete. What exactly must be done depends on why
the driver called usb_unlink_urb()

I am sorry for this somewhat generic answer. Your question is not specific
enough.

        Regards
                Oliver

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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