Once again thanks a lot for your reactivity and great support ! ( I am used to deal with support - mostly commercial - and they are often not so effective) I will look at serial drivers and the way they create and register several character devices. I just have a "candid" question when you said : >It would be easier for you if the different pairs of endpoints belonged >to different interfaces. Can you change the device's firmware to >accomplish this? You mean USB interfaces ? If so, yes I could create two different interfaces but then I will have to select one or the other, won't I ? I guess I have to study deeper this way of seeing things. ( I wonder if it is possible to access two different interfaces in the same time ) Anyway thanks a lot. Sylvain PORTES. 2009/7/7 Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>: > On Mon, 6 Jul 2009, Sylvain PORTES wrote: > >> Dear Alan, >> >> Thanks a lot for your answer. >> >> It seems I still have some code reverse engineering to do to find the >> good example for my application. > > You haven't stated your problem correctly. The fact that you're > dealing with more than one pair of endpoints isn't important. > > Your real problem is that you want to create and register more than one > character device. The USB core doesn't provide any support for this, > so you would have to write all the support routines yourself. > >> What is according to you the best example of managing "independent" >> access to two endpoints (in fact 4 : 2 (IN/OUT) pairs. > > See, you're confused. The number of endpoints doesn't matter. What > matters is the number of character devices. > > The usb-serial driver can register several char devices. You can find > out about creating char devices and see some code examples in the Linux > Device Drivers book. > >> My final application is a USB/I2C converter. My device is a >> 湣ontroller which has two I2C ports. The idea is to have a endpoint >> pair for each I2C ports. >> Indeed the max I2C throughput is 400 kbits/sec = 50 kBytes/sec. With a >> full speed interrupt endpoint the theoretical throughput is 64 >> kBytes/sec. >> >> Then in fact I would have two devs (something like "usb_i2c1" and >> "usb_i2c2") which could manage the same traditional fops for these >> ports. >> >> These dev files shall manage multiple threaded access ( asynch io I guess) > > It would be easier for you if the different pairs of endpoints belonged > to different interfaces. Can you change the device's firmware to > accomplish this? > >> I am really interesting in having your expert point of view on the >> best approach for doing such a driver. >> >> I went on my research, I guess I have to look at USB serial converter >> access. I had a look also at endpoint.c in the drivers/usb/core. I saw >> that some endpoint devices are created in /dev/ but I don't know if I >> can use it directly. > > You can't. > > Alan Stern > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html