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 The pipe type specified in the URB doesn't match the
  30. endpoint's actual type.
  31. -EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable
  32. in the current interface altsetting.
  33. (b) ISO packet is larger than the endpoint maxpacket.
  34. (c) requested data transfer length is invalid: negative
  35. or too large for the host controller.
  36. -ENOSPC This request would overcommit the usb bandwidth reserved
  37. for periodic transfers (interrupt, isochronous).
  38. -ESHUTDOWN The device or host controller has been disabled due to some
  39. problem that could not be worked around.
  40. -EPERM Submission failed because urb->reject was set.
  41. -EHOSTUNREACH URB was rejected because the device is suspended.
  42. -ENOEXEC A control URB doesn't contain a Setup packet.
  43. **************************************************************************
  44. * Error codes returned by in urb->status *
  45. * or in iso_frame_desc[n].status (for ISO) *
  46. **************************************************************************
  47. USB device drivers may only test urb status values in completion handlers.
  48. This is because otherwise there would be a race between HCDs updating
  49. these values on one CPU, and device drivers testing them on another CPU.
  50. A transfer's actual_length may be positive even when an error has been
  51. reported. That's because transfers often involve several packets, so that
  52. one or more packets could finish before an error stops further endpoint I/O.
  53. 0 Transfer completed successfully
  54. -ENOENT URB was synchronously unlinked by usb_unlink_urb
  55. -EINPROGRESS URB still pending, no results yet
  56. (That is, if drivers see this it's a bug.)
  57. -EPROTO (*, **) a) bitstuff error
  58. b) no response packet received within the
  59. prescribed bus turn-around time
  60. c) unknown USB error
  61. -EILSEQ (*, **) a) CRC mismatch
  62. b) no response packet received within the
  63. prescribed bus turn-around time
  64. c) unknown USB error
  65. Note that often the controller hardware does not
  66. distinguish among cases a), b), and c), so a
  67. driver cannot tell whether there was a protocol
  68. error, a failure to respond (often caused by
  69. device disconnect), or some other fault.
  70. -ETIME (**) No response packet received within the prescribed
  71. bus turn-around time. This error may instead be
  72. reported as -EPROTO or -EILSEQ.
  73. -ETIMEDOUT Synchronous USB message functions use this code
  74. to indicate timeout expired before the transfer
  75. completed, and no other error was reported by HC.
  76. -EPIPE (**) Endpoint stalled. For non-control endpoints,
  77. reset this status with usb_clear_halt().
  78. -ECOMM During an IN transfer, the host controller
  79. received data from an endpoint faster than it
  80. could be written to system memory
  81. -ENOSR During an OUT transfer, the host controller
  82. could not retrieve data from system memory fast
  83. enough to keep up with the USB data rate
  84. -EOVERFLOW (*) The amount of data returned by the endpoint was
  85. greater than either the max packet size of the
  86. endpoint or the remaining buffer size. "Babble".
  87. -EREMOTEIO The data read from the endpoint did not fill the
  88. specified buffer, and URB_SHORT_NOT_OK was set in
  89. urb->transfer_flags.
  90. -ENODEV Device was removed. Often preceded by a burst of
  91. other errors, since the hub driver doesn't detect
  92. device removal events immediately.
  93. -EXDEV ISO transfer only partially completed
  94. look at individual frame status for details
  95. -EINVAL ISO madness, if this happens: Log off and go home
  96. -ECONNRESET URB was asynchronously unlinked by usb_unlink_urb
  97. -ESHUTDOWN The device or host controller has been disabled due
  98. to some problem that could not be worked around,
  99. such as a physical disconnect.
  100. (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
  101. hardware problems such as bad devices (including firmware) or cables.
  102. (**) This is also one of several codes that different kinds of host
  103. controller use to indicate a transfer has failed because of device
  104. disconnect. In the interval before the hub driver starts disconnect
  105. processing, devices may receive such fault reports for every request.
  106. **************************************************************************
  107. * Error codes returned by usbcore-functions *
  108. * (expect also other submit and transfer status codes) *
  109. **************************************************************************
  110. usb_register():
  111. -EINVAL error during registering new driver
  112. usb_get_*/usb_set_*():
  113. usb_control_msg():
  114. usb_bulk_msg():
  115. -ETIMEDOUT Timeout expired before the transfer completed.