error-codes.txt 5.9 KB

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