ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / Documentation / usb / error-codes.txt
1 Revised: 2002-Feb-09.
2
3 This is the documentation of (hopefully) all possible error codes (and
4 their interpretation) that can be returned from usbcore.
5
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.
9
10
11 **************************************************************************
12 *                   Error codes returned by usb_submit_urb               *
13 **************************************************************************
14
15 Non-USB-specific:
16
17 0               URB submission went fine
18
19 -ENOMEM         no memory for allocation of internal structures 
20
21 USB-specific:
22
23 -ENODEV         specified USB-device or bus doesn't exist
24
25 -ENXIO          host controller driver does not support queuing of this type
26                 of urb.  (treat as a host controller bug.)
27
28 -EINVAL         a) Invalid transfer type specified (or not supported)
29                 b) Invalid interrupt interval (0<=n<256)
30                 c) more than one interrupt packet requested
31                 d) ISO: number_of_packets is < 0
32
33 -EAGAIN         a) specified ISO start frame too early
34                 b) (using ISO-ASAP) too much scheduled for the future
35                    wait some time and try again.
36
37 -EFBIG          too much ISO frames requested (currently uhci>900)
38
39 -EPIPE          Specified endpoint is stalled.  For non-control endpoints,
40                 reset this status with usb_clear_halt().
41
42 -EMSGSIZE       endpoint message size is zero, do interface/alternate setting
43
44 -ENOSPC         The host controller's bandwidth is already consumed and
45                 this request would push it past its allowed limit.
46
47 -ESHUTDOWN      The host controller has been disabled due to some
48                 problem that could not be worked around.
49
50
51 **************************************************************************
52 *                   Error codes returned by in urb->status               *
53 *                   or in iso_frame_desc[n].status (for ISO)             *
54 **************************************************************************
55
56 USB device drivers may only test urb status values in completion handlers.
57 This is because otherwise there would be a race between HCDs updating
58 these values on one CPU, and device drivers testing them on another CPU.
59
60 A transfer's actual_length may be positive even when an error has been
61 reported.  That's because transfers often involve several packets, so that
62 one or more packets could finish before an error stops further endpoint I/O.
63
64
65 0                       Transfer completed successfully
66
67 -ENOENT                 URB was synchronously unlinked by usb_unlink_urb
68
69 -EINPROGRESS            URB still pending, no results yet
70                         (That is, if drivers see this it's a bug.)
71
72 -EPROTO (*)             a) bitstuff error
73                         b) no response packet received within the
74                            prescribed bus turn-around time
75                         c) unknown USB error 
76
77 -EILSEQ (*)             CRC mismatch
78
79 -EPIPE                  Endpoint stalled.  For non-control endpoints,
80                         reset this status with usb_clear_halt().
81
82 -ECOMM                  During an IN transfer, the host controller
83                         received data from an endpoint faster than it
84                         could be written to system memory
85
86 -ENOSR                  During an OUT transfer, the host controller
87                         could not retrieve data from system memory fast
88                         enough to keep up with the USB data rate
89
90 -EOVERFLOW (*)          The amount of data returned by the endpoint was
91                         greater than either the max packet size of the
92                         endpoint or the remaining buffer size.  "Babble".
93
94 -EREMOTEIO              The data read from the endpoint did not fill the
95                         specified buffer, and URB_SHORT_NOT_OK was set in
96                         urb->transfer_flags.
97
98 -ETIMEDOUT              transfer timed out, NAK
99
100 -ENODEV                 Device was removed.  Often preceded by a burst of
101                         other errors, since the hub driver does't detect
102                         device removal events immediately.
103
104 -EXDEV                  ISO transfer only partially completed
105                         look at individual frame status for details
106
107 -EINVAL                 ISO madness, if this happens: Log off and go home
108
109 -ECONNRESET             URB was asynchronously unlinked by usb_unlink_urb
110
111 -ESHUTDOWN              The host controller has been disabled due to some
112                         problem that could not be worked around.
113
114
115 (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
116 hardware problems such as bad devices (including firmware) or cables.
117
118
119
120 **************************************************************************
121 *              Error codes returned by usbcore-functions                 *
122 *           (expect also other submit and transfer status codes)         *
123 **************************************************************************
124
125 usb_register():
126 -EINVAL                 error during registering new driver
127
128 usb_get_*/usb_set_*():
129 usb_control_msg():
130 usb_bulk_msg():
131                         All USB errors (submit/status) can occur