# BRCM_VERSION=3
[bcm963xx.git] / kernel / linux / 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 -EPERM          Submission failed because urb->reject was set.
51
52
53 **************************************************************************
54 *                   Error codes returned by in urb->status               *
55 *                   or in iso_frame_desc[n].status (for ISO)             *
56 **************************************************************************
57
58 USB device drivers may only test urb status values in completion handlers.
59 This is because otherwise there would be a race between HCDs updating
60 these values on one CPU, and device drivers testing them on another CPU.
61
62 A transfer's actual_length may be positive even when an error has been
63 reported.  That's because transfers often involve several packets, so that
64 one or more packets could finish before an error stops further endpoint I/O.
65
66
67 0                       Transfer completed successfully
68
69 -ENOENT                 URB was synchronously unlinked by usb_unlink_urb
70
71 -EINPROGRESS            URB still pending, no results yet
72                         (That is, if drivers see this it's a bug.)
73
74 -EPROTO (*)             a) bitstuff error
75                         b) no response packet received within the
76                            prescribed bus turn-around time
77                         c) unknown USB error 
78
79 -EILSEQ (*)             CRC mismatch
80
81 -EPIPE                  Endpoint stalled.  For non-control endpoints,
82                         reset this status with usb_clear_halt().
83
84 -ECOMM                  During an IN transfer, the host controller
85                         received data from an endpoint faster than it
86                         could be written to system memory
87
88 -ENOSR                  During an OUT transfer, the host controller
89                         could not retrieve data from system memory fast
90                         enough to keep up with the USB data rate
91
92 -EOVERFLOW (*)          The amount of data returned by the endpoint was
93                         greater than either the max packet size of the
94                         endpoint or the remaining buffer size.  "Babble".
95
96 -EREMOTEIO              The data read from the endpoint did not fill the
97                         specified buffer, and URB_SHORT_NOT_OK was set in
98                         urb->transfer_flags.
99
100 -ETIMEDOUT              transfer timed out, NAK
101
102 -ENODEV                 Device was removed.  Often preceded by a burst of
103                         other errors, since the hub driver does't detect
104                         device removal events immediately.
105
106 -EXDEV                  ISO transfer only partially completed
107                         look at individual frame status for details
108
109 -EINVAL                 ISO madness, if this happens: Log off and go home
110
111 -ECONNRESET             URB was asynchronously unlinked by usb_unlink_urb
112
113 -ESHUTDOWN              The host controller has been disabled due to some
114                         problem that could not be worked around.
115
116
117 (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
118 hardware problems such as bad devices (including firmware) or cables.
119
120
121
122 **************************************************************************
123 *              Error codes returned by usbcore-functions                 *
124 *           (expect also other submit and transfer status codes)         *
125 **************************************************************************
126
127 usb_register():
128 -EINVAL                 error during registering new driver
129
130 usb_get_*/usb_set_*():
131 usb_control_msg():
132 usb_bulk_msg():
133                         All USB errors (submit/status) can occur