LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   usb_bulk_msg return value -8 (https://www.linuxquestions.org/questions/linux-software-2/usb_bulk_msg-return-value-8-a-767150/)

random0 11-05-2009 04:09 PM

usb_bulk_msg return value -8
 
I'm writing a USB kernel driver and for some of the bulk transfers, I'm using the following function.

Code:

#include <linux/usb.h>
int usb_bulk_msg (struct usb_device * usb_dev, unsigned int pipe, void * data, int len, int * actual_length, int timeout);

When I call it, it returns -8. The man page states:

Quote:

If successful, it returns 0, otherwise a negative error number. The number of actual bytes transferred will be placed in the actual_timeout parameter.
If by "negative error number" it is referring to a value defined in errno.h, then that return value means "Exec format error". usb_bulk_msg is in the kernel, it shouldn't be calling exec. And if it was, wth?

Any ideas on what this value actually means?

ammorais 11-05-2009 04:34 PM

I believe you will actually look in to the source code. BTW, why do you think that is returning a value defined in "errno.h"? It just returns an int It can be anything.

Looking in to the source code you have:

Code:

return usb_start_wait_urb(urb,timeout,actual_length);
Fallowing usb_start_wait_urb I discovered:
Code:

ret = usb_internal_control_msg(dev, pipe, dr, data, size, timeout);

I don't think it has anything to do with errno.h


All times are GMT -5. The time now is 09:26 AM.