You are not logged in.

#1 2012-09-28 06:15:22

framas
Member
Registered: 2009-07-24
Posts: 50

[SOLVED] USB error numbers and codes

Hi there,

I struggle around with some erros on usb devices.

dmesg does only output error numbers like e.g.

device not accepting address 69, error -71

On http://stackoverflow.com/questions/9544 … 4-error-71 I found a description what this error means (error -71 is a EPROTO error).

in /usr/src/linux/Documentation/usb/error-codes.txt all this codes are described but there is no association to the number.

So how can I convert a error number to the error code described in the text file if the next time any other error appears.

Cheers Framas

Last edited by framas (2012-09-28 12:44:18)

Offline

#2 2012-09-28 06:43:43

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] USB error numbers and codes

https://bbs.archlinux.org/viewtopic.php?id=149384

Don't forget to mark it as solved.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-09-28 06:56:53

framas
Member
Registered: 2009-07-24
Posts: 50

Re: [SOLVED] USB error numbers and codes

This thread doesn't answer my question

DSpider wrote:

https://bbs.archlinux.org/viewtopic.php?id=149384

Don't forget to mark it as solved.

Offline

#4 2012-09-28 07:04:16

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] USB error numbers and codes

Are you sure? Because this one sounds awfully similar:

...
Sep 22 11:20:54 arch64 kernel: [   75.716691] usb 2-4: device not accepting address 6, error -110

Different numbers because it fails at different read blocks. This depends on the capacity (in gigabytes) of the flash media and the hardware reading it.


Is this a laptop? If it's not, it may be related to the PSU (power supply unit).


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#5 2012-09-28 11:25:03

framas
Member
Registered: 2009-07-24
Posts: 50

Re: [SOLVED] USB error numbers and codes

error code numbers are standing for the read block number? That's  new for me. And yes I'm sure.
It looks like you did not really read my quesion  accurate.

Anyways I got the solution for my own. 

In /usr/src/linux/drivers/usb/host/ohci.h I found I mapping from usb ohci status codes to errno (Just take care of the "-")

/* map OHCI TD status codes (CC) to errno values */
static const int cc_to_error [16] = {
        /* No  Error  */               0,
        /* CRC Error  */               -EILSEQ,
        /* Bit Stuff  */               -EPROTO,
        /* Data Togg  */               -EILSEQ,
        /* Stall      */               -EPIPE,
        /* DevNotResp */               -ETIME,
        /* PIDCheck   */               -EPROTO,
        /* UnExpPID   */               -EPROTO,
        /* DataOver   */               -EOVERFLOW,
        /* DataUnder  */               -EREMOTEIO,
        /* (for hw)   */               -EIO,
        /* (for hw)   */               -EIO,
        /* BufferOver */               -ECOMM,
        /* BuffUnder  */               -ENOSR,
        /* (for HCD)  */               -EALREADY,
        /* (for HCD)  */               -EALREADY
};

These constants are defined in /usr/src/linux/drivers/include/asm-generic/errno.h
e.g:

#define EPROTO          71      /* Protocol error */

With these Information you can lookup in

/usr/src/linux/Documentation/usb/error-codes.txt  for a description


DSpider wrote:

Are you sure? Because this one sounds awfully similar:

...
Sep 22 11:20:54 arch64 kernel: [   75.716691] usb 2-4: device not accepting address 6, error -110

Different numbers because it fails at different read blocks. This depends on the capacity (in gigabytes) of the flash media and the hardware reading it.


Is this a laptop? If it's not, it may be related to the PSU (power supply unit).

Offline

Board footer

Powered by FluxBB