Where can I find a list of USB error codes?

The first one is EINVAL (a standard POSIX C error) inverted. If you are curious it's from line 4218 in [src]/drivers/usb/core/hub.c (v. 3.19):

4217     if (udev->state != USB_STATE_DEFAULT)
4218         return -EINVAL;

The other one is from the hub_port_init() function in the same file.

These kinds of error messages aren't really intended to provide more information to end users than what's there ("hub failed to enable device"), however. They're used in debugging, possibly including if you were to file a bug report.

If you were hoping for documentation that will explain the problem in detail I think you are out of luck. Part of the reason for this is perhaps that there may not be any more accurate, detailed explanation that can be provided. Some things can fail the same way with a range of indeterminate potential causes.


The origin of the error code can be found in the source code for the hub in question.

e.g. grep -A 1 -m 1 22 /usr/src/linux-source-4.3/drivers/usb/host/xhci.h

#define PORT_PLC        (1 << 22)
/* port configure error change - port failed to configure its link partner */

You'll find the meaning of some error codes in /usr/src/linux-source-$yourKernel/Documentation/usb/error-codes.txt

e.g.

-EINVAL         a) Invalid transfer type specified (or not supported)
                b) Invalid or unsupported periodic transfer interval
                c) ISO: attempted to change transfer interval
                d) ISO: number_of_packets is < 0
                e) various other cases

And also ISO madness, if this happens: Log off and go home


For the 61 error: /usr/src/linux-headers-4.3.0-0.bpo.1-common/include/uapi/asm-generic/errno.h

#define ENODATA         61      /* No data available */

The errno program (part of the moreutils package) translates error numbers to the corresponding name:

    $ errno 61
    ENODATA 61 No data available