error-codes.txt 6.4 KB

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