LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Usb driver programming, ioctl returns -1 (https://www.linuxquestions.org/questions/programming-9/usb-driver-programming-ioctl-returns-1-a-821473/)

wybourn 07-22-2010 06:56 AM

Usb driver programming, ioctl returns -1
 
I'm creating a usb device driver that needs to be able to read from two different endpoints. I couldn't see any way of having two read functions in the driver, so I got round this by reading from one of the endpoints with read, and the other with ioctl.

However this hasn't worked, the ioctl call from c returns -1. I added a printk command in the driver in the ioctl function, however looking at kern.log I can see that this function is never being called.

Just to mention, debugging is enabled, the other drivers work fine and the ioctl function has been added to the file_operations structure.

greplinux 07-23-2010 06:07 AM

Hi,

What endpoints you are trying to read? Can you post your code ?

Thanks,

jf.argentino 07-23-2010 06:54 AM

Quote:

I'm creating a usb device driver that needs to be able to read from two different endpoints.
Sorry to not answer to your question but I think doing it that way is not a good solution... Are you sure there's any way to put all your glue inside a user-land library which open two USB link and fusion datas?
I say that for at least 2 reasons:
-the tools / policies idea (kernel provides tools, policies, that use these tools, must be done elsewhere)
-this kind of scheme goes against what I know of USB drivers, thus you're using tricks and tricks are the last solutions, when nothing else could work.


All times are GMT -5. The time now is 02:58 PM.