LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   usb serial driver failing when calling "usb_submit_urb" - why? (https://www.linuxquestions.org/questions/programming-9/usb-serial-driver-failing-when-calling-usb_submit_urb-why-720467/)

DEF. 04-20-2009 01:31 PM

usb serial driver failing when calling "usb_submit_urb" - why?
 
I have a Sierra Wireless Compass 888 USB modem running on Linux: host is a Ubuntu 8.04 and Target is an embedded target (ARM variant). Both the host and target are running kernel 2.6.24.23.

Now, at this time I am not in a position to get a) vendor support for the embedded target and b_ support for the vendor support for the modem. So I am hoping someone can help point me in the right direction on how to debug this problem.

So... the modem works fine on the host. I cross-compile the same driver code for the target and all compiles well (using the target supplied environment/tool-chain). At this stage the only noted differences are that my target as default has it's usb-serial driver 'built-in' and is thus not a kernel module (other than the host is x86 and the target is ARM (+any other platform difference) ). So after compiling I have a sierra.ko (this is the modem driver - it is dependent on the usbserial and the usbcore modules.

On bootup I can see the correct modem driver version is loaded.

When plugging in the modem I see all the expected USB/serial port and identified.

So I decide to send the modem a command (signal strength) as follows:

echo 'AT+CSQ' > dev/ttyUSB3

and the following error is displayed at the terminal

"write error: Cannot allocate memory"

and the system is hung until I unplug the modem.

The debug output is as follows:

"sierra ttyUSB2: sierra_open: submit urb 1 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 2 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 3 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 4 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 5 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 6 failed (-12) 4096
sierra ttyUSB2: sierra_open: submit urb 7 failed (-12) 4096
sierra ttyUSB2: sierra_write - usb_submit_urb(write bulk) failed with status = -12"



Any one any ideas how I can begin to debug this? I know the usb_submit_urb() function in the sierra driver is failing. I know it because it can't allocate memory, but I don't know why?

Is it maybe a cross compile problem? I don't know if this driver has been built for ARM yet?

Any help appreciated.....................

greplinux 04-22-2009 04:17 AM

Quote:

So I decide to send the modem a command (signal strength) as follows:

echo 'AT+CSQ' > dev/ttyUSB3
Quote:



sierra ttyUSB2: sierra_open: submit urb 7 failed (-12) 4096
I see that you are issuing AT command to "/dev/ttyUSB3" and getting error for "ttyUSB2". That seems odd to me. Could you please recheck the connection procedures.

URB- stands for USB request Blocks which is the basic data structure used for communication in USB protocol. So for any USB communication this is needed, without this USB transaction is impossible.

usb_submit_urb - This function actually submits the URB to the kernel for using it in USB communication. Since it is failing, it is not possible for communicate using USB protocol.

Hope this helps

Thanks,

DEF. 04-28-2009 07:38 AM

Oh I am really sorry for taking so long to reply and also the original email contains a mistake as the port used is /dev/ttyUSB3 and the message should read as follows:

"sierra ttyUSB3: sierra_open: submit urb 1 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 2 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 3 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 4 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 5 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 6 failed (-12) 4096
sierra ttyUSB3: sierra_open: submit urb 7 failed (-12) 4096
sierra ttyUSB3: sierra_write - usb_submit_urb(write bulk) failed with status = -12"

Now error (-12) is 'out of memory' but the device has plenty of free memory. Does it require the memory to be configured in a specific way?

DEF. 05-28-2009 10:25 AM

Hmm, it looks like a problem with my USB host driver ox... and bulk transfers.


All times are GMT -5. The time now is 06:33 PM.