3 This is the documentation of (hopefully) all possible error codes (and
4 their interpretation) that can be returned from usbcore.
6 Some of them are returned by the Host Controller Drivers (HCDs), which
7 device drivers only see through usbcore. As a rule, all the HCDs should
8 behave the same except for transfer speed dependent behaviors and the
9 way certain faults are reported.
12 **************************************************************************
13 * Error codes returned by usb_submit_urb *
14 **************************************************************************
18 0 URB submission went fine
20 -ENOMEM no memory for allocation of internal structures
24 -ENODEV specified USB-device or bus doesn't exist
26 -ENOENT specified interface or endpoint does not exist or
29 -ENXIO host controller driver does not support queuing of this type
30 of urb. (treat as a host controller bug.)
32 -EINVAL a) Invalid transfer type specified (or not supported)
33 b) Invalid or unsupported periodic transfer interval
34 c) ISO: attempted to change transfer interval
35 d) ISO: number_of_packets is < 0
36 e) various other cases
38 -EAGAIN a) specified ISO start frame too early
39 b) (using ISO-ASAP) too much scheduled for the future
40 wait some time and try again.
42 -EFBIG Host controller driver can't schedule that many ISO frames.
44 -EPIPE Specified endpoint is stalled. For non-control endpoints,
45 reset this status with usb_clear_halt().
47 -EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable
48 in the current interface altsetting.
49 (b) ISO packet is biger than endpoint maxpacket
50 (c) requested data transfer size is invalid (negative)
52 -ENOSPC This request would overcommit the usb bandwidth reserved
53 for periodic transfers (interrupt, isochronous).
55 -ESHUTDOWN The device or host controller has been disabled due to some
56 problem that could not be worked around.
58 -EPERM Submission failed because urb->reject was set.
60 -EHOSTUNREACH URB was rejected because the device is suspended.
63 **************************************************************************
64 * Error codes returned by in urb->status *
65 * or in iso_frame_desc[n].status (for ISO) *
66 **************************************************************************
68 USB device drivers may only test urb status values in completion handlers.
69 This is because otherwise there would be a race between HCDs updating
70 these values on one CPU, and device drivers testing them on another CPU.
72 A transfer's actual_length may be positive even when an error has been
73 reported. That's because transfers often involve several packets, so that
74 one or more packets could finish before an error stops further endpoint I/O.
77 0 Transfer completed successfully
79 -ENOENT URB was synchronously unlinked by usb_unlink_urb
81 -EINPROGRESS URB still pending, no results yet
82 (That is, if drivers see this it's a bug.)
84 -EPROTO (*, **) a) bitstuff error
85 b) no response packet received within the
86 prescribed bus turn-around time
89 -EILSEQ (*, **) a) CRC mismatch
90 b) no response packet received within the
91 prescribed bus turn-around time
94 Note that often the controller hardware does not
95 distinguish among cases a), b), and c), so a
96 driver cannot tell whether there was a protocol
97 error, a failure to respond (often caused by
98 device disconnect), or some other fault.
100 -ETIMEDOUT (**) No response packet received within the prescribed
101 bus turn-around time. This error may instead be
102 reported as -EPROTO or -EILSEQ.
104 Note that the synchronous USB message functions
105 also use this code to indicate timeout expired
106 before the transfer completed.
108 -EPIPE (**) Endpoint stalled. For non-control endpoints,
109 reset this status with usb_clear_halt().
111 -ECOMM During an IN transfer, the host controller
112 received data from an endpoint faster than it
113 could be written to system memory
115 -ENOSR During an OUT transfer, the host controller
116 could not retrieve data from system memory fast
117 enough to keep up with the USB data rate
119 -EOVERFLOW (*) The amount of data returned by the endpoint was
120 greater than either the max packet size of the
121 endpoint or the remaining buffer size. "Babble".
123 -EREMOTEIO The data read from the endpoint did not fill the
124 specified buffer, and URB_SHORT_NOT_OK was set in
127 -ENODEV Device was removed. Often preceded by a burst of
128 other errors, since the hub driver does't detect
129 device removal events immediately.
131 -EXDEV ISO transfer only partially completed
132 look at individual frame status for details
134 -EINVAL ISO madness, if this happens: Log off and go home
136 -ECONNRESET URB was asynchronously unlinked by usb_unlink_urb
138 -ESHUTDOWN The device or host controller has been disabled due
139 to some problem that could not be worked around,
140 such as a physical disconnect.
143 (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
144 hardware problems such as bad devices (including firmware) or cables.
146 (**) This is also one of several codes that different kinds of host
147 controller use to to indicate a transfer has failed because of device
148 disconnect. In the interval before the hub driver starts disconnect
149 processing, devices may receive such fault reports for every request.
153 **************************************************************************
154 * Error codes returned by usbcore-functions *
155 * (expect also other submit and transfer status codes) *
156 **************************************************************************
159 -EINVAL error during registering new driver
161 usb_get_*/usb_set_*():
164 -ETIMEDOUT Timeout expired before the transfer completed.
165 In the future this code may change to -ETIME,
166 whose definition is a closer match to this sort