On 7/3/06, mgr@xxxxxxxxxxx <mgr@xxxxxxxxxxx> wrote:
Hi, I am writing a USB device driver for a specific device. My code is built on the usb_skeleton.c found in the kernel source code (2.6.16.16) under /drivers/usb. I changed the vendor and product ID to fit my device and "insmod" it into the kernel and tested it in user space with the system calls open, read, write and close. The driver works and it is possible to read and write to the device. Now I want to change the endpoint transfer type from bulk to interrupt. I changed all the "bulk" in the code to "int". Now, I get an error in the probe function. It does not find any int-in and int-out endpoints. How can I change this? Do I have to create a new interface setting? Or how does it work? Does a particular device only use one type of transfer or is it always possible to use the type of endpoint that I want? For instance, when I use a driver for a mouse, the interrupt endpoint is found. It seems like there is always a default setting for a device and this happens to be bulk-in and bulk-out endpoints for my device. How do I add int-in and int-out endpoints? Tell me if you need to have a look at the code fragment in the probe function where the error occurs.
first of all, linux-usb-devel mailling list was a better choice for such questions as they would be more authoritive in the solutions they give. as far as i know, endpoints are pre-defined for any device. ie, your device needs to have (Int.) endpoints for what you're trying to do. try doing cat /proc/bus/usb/devices to get the list of usb devices in your system. in that you'll find a line like: E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms first do the above and find the list of endpoints, its direction and then go for writing code. if you're still not sure, just send me the output of the above mentioned 'cat' command. Thanks, Jinesh. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/