Blame view

Documentation/usb/error-codes.txt 6.41 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  Revised: 2004-Oct-21
  
  This is the documentation of (hopefully) all possible error codes (and
  their interpretation) that can be returned from usbcore.
  
  Some of them are returned by the Host Controller Drivers (HCDs), which
  device drivers only see through usbcore.  As a rule, all the HCDs should
  behave the same except for transfer speed dependent behaviors and the
  way certain faults are reported.
  
  
  **************************************************************************
  *                   Error codes returned by usb_submit_urb               *
  **************************************************************************
  
  Non-USB-specific:
  
  0		URB submission went fine
  
  -ENOMEM		no memory for allocation of internal structures	
  
  USB-specific:
  
  -ENODEV		specified USB-device or bus doesn't exist
  
  -ENOENT		specified interface or endpoint does not exist or
  		is not enabled
  
  -ENXIO		host controller driver does not support queuing of this type
  		of urb.  (treat as a host controller bug.)
  
  -EINVAL		a) Invalid transfer type specified (or not supported)
  		b) Invalid or unsupported periodic transfer interval
  		c) ISO: attempted to change transfer interval
  		d) ISO: number_of_packets is < 0
  		e) various other cases
  
  -EAGAIN		a) specified ISO start frame too early
  		b) (using ISO-ASAP) too much scheduled for the future
  		   wait some time and try again.
  
  -EFBIG		Host controller driver can't schedule that many ISO frames.
f661c6f8c   Alan Stern   USB: check the en...
43
44
  -EPIPE		The pipe type specified in the URB doesn't match the
  		endpoint's actual type.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45
46
47
  
  -EMSGSIZE	(a) endpoint maxpacket size is zero; it is not usable
  		    in the current interface altsetting.
620948a01   Alan Stern   [PATCH] USB: docu...
48
49
50
  		(b) ISO packet is larger than the endpoint maxpacket.
  		(c) requested data transfer length is invalid: negative
  		    or too large for the host controller.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
51
52
53
54
55
56
57
58
59
60
  
  -ENOSPC		This request would overcommit the usb bandwidth reserved
  		for periodic transfers (interrupt, isochronous).
  
  -ESHUTDOWN	The device or host controller has been disabled due to some
  		problem that could not be worked around.
  
  -EPERM		Submission failed because urb->reject was set.
  
  -EHOSTUNREACH	URB was rejected because the device is suspended.
f661c6f8c   Alan Stern   USB: check the en...
61
  -ENOEXEC	A control URB doesn't contain a Setup packet.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
62
63
64
65
66
67
68
69
70
71
72
73
74
  
  **************************************************************************
  *                   Error codes returned by in urb->status               *
  *                   or in iso_frame_desc[n].status (for ISO)             *
  **************************************************************************
  
  USB device drivers may only test urb status values in completion handlers.
  This is because otherwise there would be a race between HCDs updating
  these values on one CPU, and device drivers testing them on another CPU.
  
  A transfer's actual_length may be positive even when an error has been
  reported.  That's because transfers often involve several packets, so that
  one or more packets could finish before an error stops further endpoint I/O.
a9e758634   Sarah Sharp   USB: Fix up URB e...
75
76
77
78
79
80
  For isochronous URBs, the urb status value is non-zero only if the URB is
  unlinked, the device is removed, the host controller is disabled, or the total
  transferred length is less than the requested length and the URB_SHORT_NOT_OK
  flag is set.  Completion handlers for isochronous URBs should only see
  urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
  Individual frame descriptor status fields may report more status codes.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  
  0			Transfer completed successfully
  
  -ENOENT			URB was synchronously unlinked by usb_unlink_urb
  
  -EINPROGRESS		URB still pending, no results yet
  			(That is, if drivers see this it's a bug.)
  
  -EPROTO (*, **)		a) bitstuff error
  			b) no response packet received within the
  			   prescribed bus turn-around time
  			c) unknown USB error 
  
  -EILSEQ (*, **)		a) CRC mismatch
  			b) no response packet received within the
  			   prescribed bus turn-around time
  			c) unknown USB error 
  
  			Note that often the controller hardware does not
  			distinguish among cases a), b), and c), so a
  			driver cannot tell whether there was a protocol
  			error, a failure to respond (often caused by
  			device disconnect), or some other fault.
38e2bfc94   Pete Zaitcev   USB: Dealias -110...
104
  -ETIME (**)		No response packet received within the prescribed
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
105
106
  			bus turn-around time.  This error may instead be
  			reported as -EPROTO or -EILSEQ.
38e2bfc94   Pete Zaitcev   USB: Dealias -110...
107
108
109
  -ETIMEDOUT		Synchronous USB message functions use this code
  			to indicate timeout expired before the transfer
  			completed, and no other error was reported by HC.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
  
  -EPIPE (**)		Endpoint stalled.  For non-control endpoints,
  			reset this status with usb_clear_halt().
  
  -ECOMM			During an IN transfer, the host controller
  			received data from an endpoint faster than it
  			could be written to system memory
  
  -ENOSR			During an OUT transfer, the host controller
  			could not retrieve data from system memory fast
  			enough to keep up with the USB data rate
  
  -EOVERFLOW (*)		The amount of data returned by the endpoint was
  			greater than either the max packet size of the
  			endpoint or the remaining buffer size.  "Babble".
  
  -EREMOTEIO		The data read from the endpoint did not fill the
  			specified buffer, and URB_SHORT_NOT_OK was set in
  			urb->transfer_flags.
  
  -ENODEV			Device was removed.  Often preceded by a burst of
fff9289b2   Matt LaPlante   Fix typos in Docu...
131
  			other errors, since the hub driver doesn't detect
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
132
133
134
  			device removal events immediately.
  
  -EXDEV			ISO transfer only partially completed
a9e758634   Sarah Sharp   USB: Fix up URB e...
135
  			(only set in iso_frame_desc[n].status, not urb->status)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  
  -EINVAL			ISO madness, if this happens: Log off and go home
  
  -ECONNRESET		URB was asynchronously unlinked by usb_unlink_urb
  
  -ESHUTDOWN		The device or host controller has been disabled due
  			to some problem that could not be worked around,
  			such as a physical disconnect.
  
  
  (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
  hardware problems such as bad devices (including firmware) or cables.
  
  (**) This is also one of several codes that different kinds of host
670e9f34e   Paolo Ornati   Documentation: re...
150
  controller use to indicate a transfer has failed because of device
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
  disconnect.  In the interval before the hub driver starts disconnect
  processing, devices may receive such fault reports for every request.
  
  
  
  **************************************************************************
  *              Error codes returned by usbcore-functions                 *
  *           (expect also other submit and transfer status codes)         *
  **************************************************************************
  
  usb_register():
  -EINVAL			error during registering new driver
  
  usb_get_*/usb_set_*():
  usb_control_msg():
  usb_bulk_msg():
  -ETIMEDOUT		Timeout expired before the transfer completed.