error-codes.txt 6.0 KB

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