blob: 8d1e2a9ebbba25a2736690877c524927eb96b0b1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001Revised: 2004-Oct-21
2
3This is the documentation of (hopefully) all possible error codes (and
4their interpretation) that can be returned from usbcore.
5
6Some of them are returned by the Host Controller Drivers (HCDs), which
7device drivers only see through usbcore. As a rule, all the HCDs should
8behave the same except for transfer speed dependent behaviors and the
9way certain faults are reported.
10
11
12**************************************************************************
13* Error codes returned by usb_submit_urb *
14**************************************************************************
15
16Non-USB-specific:
17
180 URB submission went fine
19
20-ENOMEM no memory for allocation of internal structures
21
22USB-specific:
23
24-ENODEV specified USB-device or bus doesn't exist
25
26-ENOENT specified interface or endpoint does not exist or
27 is not enabled
28
29-ENXIO host controller driver does not support queuing of this type
30 of urb. (treat as a host controller bug.)
31
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
37
Alan Sterna03bede2012-10-01 10:31:53 -040038-EXDEV ISO: URB_ISO_ASAP wasn't specified and all the frames
39 the URB would be scheduled in have already expired.
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41-EFBIG Host controller driver can't schedule that many ISO frames.
42
Alan Sternf661c6f2009-12-11 16:20:20 -050043-EPIPE The pipe type specified in the URB doesn't match the
44 endpoint's actual type.
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46-EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable
47 in the current interface altsetting.
Alan Stern620948a2005-11-28 15:22:55 -050048 (b) ISO packet is larger than the endpoint maxpacket.
49 (c) requested data transfer length is invalid: negative
50 or too large for the host controller.
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
52-ENOSPC This request would overcommit the usb bandwidth reserved
53 for periodic transfers (interrupt, isochronous).
54
55-ESHUTDOWN The device or host controller has been disabled due to some
56 problem that could not be worked around.
57
58-EPERM Submission failed because urb->reject was set.
59
60-EHOSTUNREACH URB was rejected because the device is suspended.
61
Alan Sternf661c6f2009-12-11 16:20:20 -050062-ENOEXEC A control URB doesn't contain a Setup packet.
63
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
65**************************************************************************
66* Error codes returned by in urb->status *
67* or in iso_frame_desc[n].status (for ISO) *
68**************************************************************************
69
70USB device drivers may only test urb status values in completion handlers.
71This is because otherwise there would be a race between HCDs updating
72these values on one CPU, and device drivers testing them on another CPU.
73
74A transfer's actual_length may be positive even when an error has been
75reported. That's because transfers often involve several packets, so that
76one or more packets could finish before an error stops further endpoint I/O.
77
Sarah Sharpa9e75862011-06-16 13:06:04 -070078For isochronous URBs, the urb status value is non-zero only if the URB is
79unlinked, the device is removed, the host controller is disabled, or the total
80transferred length is less than the requested length and the URB_SHORT_NOT_OK
81flag is set. Completion handlers for isochronous URBs should only see
82urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
83Individual frame descriptor status fields may report more status codes.
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
860 Transfer completed successfully
87
88-ENOENT URB was synchronously unlinked by usb_unlink_urb
89
90-EINPROGRESS URB still pending, no results yet
91 (That is, if drivers see this it's a bug.)
92
93-EPROTO (*, **) a) bitstuff error
94 b) no response packet received within the
95 prescribed bus turn-around time
96 c) unknown USB error
97
98-EILSEQ (*, **) a) CRC mismatch
99 b) no response packet received within the
100 prescribed bus turn-around time
101 c) unknown USB error
102
103 Note that often the controller hardware does not
104 distinguish among cases a), b), and c), so a
105 driver cannot tell whether there was a protocol
106 error, a failure to respond (often caused by
107 device disconnect), or some other fault.
108
Pete Zaitcev38e2bfc2006-09-18 22:49:02 -0700109-ETIME (**) No response packet received within the prescribed
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 bus turn-around time. This error may instead be
111 reported as -EPROTO or -EILSEQ.
112
Pete Zaitcev38e2bfc2006-09-18 22:49:02 -0700113-ETIMEDOUT Synchronous USB message functions use this code
114 to indicate timeout expired before the transfer
115 completed, and no other error was reported by HC.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
117-EPIPE (**) Endpoint stalled. For non-control endpoints,
118 reset this status with usb_clear_halt().
119
120-ECOMM During an IN transfer, the host controller
121 received data from an endpoint faster than it
122 could be written to system memory
123
124-ENOSR During an OUT transfer, the host controller
125 could not retrieve data from system memory fast
126 enough to keep up with the USB data rate
127
128-EOVERFLOW (*) The amount of data returned by the endpoint was
129 greater than either the max packet size of the
130 endpoint or the remaining buffer size. "Babble".
131
132-EREMOTEIO The data read from the endpoint did not fill the
133 specified buffer, and URB_SHORT_NOT_OK was set in
134 urb->transfer_flags.
135
136-ENODEV Device was removed. Often preceded by a burst of
Matt LaPlantefff92892006-10-03 22:47:42 +0200137 other errors, since the hub driver doesn't detect
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 device removal events immediately.
139
140-EXDEV ISO transfer only partially completed
Sarah Sharpa9e75862011-06-16 13:06:04 -0700141 (only set in iso_frame_desc[n].status, not urb->status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
143-EINVAL ISO madness, if this happens: Log off and go home
144
145-ECONNRESET URB was asynchronously unlinked by usb_unlink_urb
146
147-ESHUTDOWN The device or host controller has been disabled due
148 to some problem that could not be worked around,
149 such as a physical disconnect.
150
151
152(*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
153hardware problems such as bad devices (including firmware) or cables.
154
155(**) This is also one of several codes that different kinds of host
Paolo Ornati670e9f32006-10-03 22:57:56 +0200156controller use to indicate a transfer has failed because of device
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157disconnect. In the interval before the hub driver starts disconnect
158processing, devices may receive such fault reports for every request.
159
160
161
162**************************************************************************
163* Error codes returned by usbcore-functions *
164* (expect also other submit and transfer status codes) *
165**************************************************************************
166
167usb_register():
168-EINVAL error during registering new driver
169
170usb_get_*/usb_set_*():
171usb_control_msg():
172usb_bulk_msg():
173-ETIMEDOUT Timeout expired before the transfer completed.