Hi!
I'm currently writing a USB driver and wonder if I just hit a limitation of
the USB framework of Linux.
I'm using usb_register_dev() to create USB character devices under /dev. As
far as I can see it however one can only create one device for the same USB
interface, correct?
Here's what I'd like to do:
USB Device
+--- USB Interface 1
+--- Endpoint 1 (in/out) -> /dev/foo_a (character device)
+--- Endpoint 2 (in/out) -> /dev/foo_b (character device)
And I tried it this way:
In the probe function implementation I use usb_set_intfdata() to store the
data structures I need and call usb_register_dev() to create the character
devices.
In the open function imlementation of the character devices I then use:
interface = usb_find_interface(&foo_driver, iminor(inode));
foo_device_data = usb_get_intfdata(interface);
to get that mandatory custom data for work in the read(), write() function
implementations.
Now this works fine for just one character device, but not for more than one
character device for same USB interface, since struct usb_interface only
stores a scalar minor number instead of a list of minors. So is this indeed a
limitation or am I just missing something?
Is there a simple workaround or would I need to implement a complete driver
class and then use device_create() ?
Thanks for any comments!
CU
Christian
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html