error-codes.txt 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. -EBUSY The URB is already active.
  16. -ENODEV specified USB-device or bus doesn't exist
  17. -ENOENT specified interface or endpoint does not exist or
  18. is not enabled
  19. -ENXIO host controller driver does not support queuing of this type
  20. of urb. (treat as a host controller bug.)
  21. -EINVAL a) Invalid transfer type specified (or not supported)
  22. b) Invalid or unsupported periodic transfer interval
  23. c) ISO: attempted to change transfer interval
  24. d) ISO: number_of_packets is < 0
  25. e) various other cases
  26. -EXDEV ISO: URB_ISO_ASAP wasn't specified and all the frames
  27. the URB would be scheduled in have already expired.
  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. For isochronous URBs, the urb status value is non-zero only if the URB is
  54. unlinked, the device is removed, the host controller is disabled, or the total
  55. transferred length is less than the requested length and the URB_SHORT_NOT_OK
  56. flag is set. Completion handlers for isochronous URBs should only see
  57. urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
  58. Individual frame descriptor status fields may report more status codes.
  59. 0 Transfer completed successfully
  60. -ENOENT URB was synchronously unlinked by usb_unlink_urb
  61. -EINPROGRESS URB still pending, no results yet
  62. (That is, if drivers see this it's a bug.)
  63. -EPROTO (*, **) a) bitstuff error
  64. b) no response packet received within the
  65. prescribed bus turn-around time
  66. c) unknown USB error
  67. -EILSEQ (*, **) a) CRC mismatch
  68. b) no response packet received within the
  69. prescribed bus turn-around time
  70. c) unknown USB error
  71. Note that often the controller hardware does not
  72. distinguish among cases a), b), and c), so a
  73. driver cannot tell whether there was a protocol
  74. error, a failure to respond (often caused by
  75. device disconnect), or some other fault.
  76. -ETIME (**) No response packet received within the prescribed
  77. bus turn-around time. This error may instead be
  78. reported as -EPROTO or -EILSEQ.
  79. -ETIMEDOUT Synchronous USB message functions use this code
  80. to indicate timeout expired before the transfer
  81. completed, and no other error was reported by HC.
  82. -EPIPE (**) Endpoint stalled. For non-control endpoints,
  83. reset this status with usb_clear_halt().
  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. -ENOSR During an OUT transfer, the host controller
  88. could not retrieve data from system memory fast
  89. enough to keep up with the USB data rate
  90. -EOVERFLOW (*) The amount of data returned by the endpoint was
  91. greater than either the max packet size of the
  92. endpoint or the remaining buffer size. "Babble".
  93. -EREMOTEIO The data read from the endpoint did not fill the
  94. specified buffer, and URB_SHORT_NOT_OK was set in
  95. urb->transfer_flags.
  96. -ENODEV Device was removed. Often preceded by a burst of
  97. other errors, since the hub driver doesn't detect
  98. device removal events immediately.
  99. -EXDEV ISO transfer only partially completed
  100. (only set in iso_frame_desc[n].status, not urb->status)
  101. -EINVAL ISO madness, if this happens: Log off and go home
  102. -ECONNRESET URB was asynchronously unlinked by usb_unlink_urb
  103. -ESHUTDOWN The device or host controller has been disabled due
  104. to some problem that could not be worked around,
  105. such as a physical disconnect.
  106. (*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
  107. hardware problems such as bad devices (including firmware) or cables.
  108. (**) This is also one of several codes that different kinds of host
  109. controller use to indicate a transfer has failed because of device
  110. disconnect. In the interval before the hub driver starts disconnect
  111. processing, devices may receive such fault reports for every request.
  112. **************************************************************************
  113. * Error codes returned by usbcore-functions *
  114. * (expect also other submit and transfer status codes) *
  115. **************************************************************************
  116. usb_register():
  117. -EINVAL error during registering new driver
  118. usb_get_*/usb_set_*():
  119. usb_control_msg():
  120. usb_bulk_msg():
  121. -ETIMEDOUT Timeout expired before the transfer completed.