Re: Newbie interested in using usbfs2.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
> µController 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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux