Note: My comments all refer to Linux 2.6.15 and other recent kernels. Not to 2.4.
On Tue, 10 Jan 2006, Konrad Eriksson wrote: > Hi. > > I'm currently working on a HC for the CRIS architecture and I'm You know, there already is a USB host controller driver for CRIS in the kernel (but it's broken). Is that the one you're working on? > wondering if there is a summary of the possible codes for the URB status? USB status codes are described in Documentation/usb/error-codes.txt. > When does the USB Core set it and when is the HC supposed to change it? The core sets status to -EINPROGRESS when an URB is submitted and changes it if the URB is unlinked or killed. The HCD (not the HC!) is supposed to change it when the URB completes, but only if the core hasn't already changed it from -EINPROGRESS. > I've seen that some drivers don't resubmit the URB if it finishes with > the -ENOENT. > > How can the HC see de difference between a usb_unlink_urb() and > usb_kill_urb() when they both issues the same function call > urb_dequeue() down to the HC? The HCD doesn't need to see the difference; it just dequeues the URB. However if you really want to, you can tell them apart because usb_unlink_urb sets urb->status to -ECONNRESET and usb_kill_urb sets it to -ENOENT. > I've seen that the USB Core presets the URB status to -ENOENT before > calling urb_dequeue() in the HC for some cases but also -ESHUTDOWN. > Difference? -ESHUTDOWN is used when the URB's endpoint has been disabled because the device configuration or altsetting was changed or because the device was unplugged. > How does most device-drivers handle this? Each one handles this in its own way. If you're working on an HCD then you shouldn't care how device drivers handle it. > When running test 11 & 12 from usbtest.c both unlink and kill uses > urb_dequeue() and can have the URB_ASYNC_UNLINK flag sat. Can a > usb_kill_urb() really be asynchronous? The URB_ASYNC_UNLINK flag no longer exists and usb_kill_urb is _always_ asynchronous. Read the kerneldoc in drivers/usb/core/urb.c. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
