On Wed, 9 Feb 2005, Flavio Pereira wrote:

> Hi all
> 
> I'm new to the USB subsystem in Linux, and can't seem to figure out how
> to implement more than a single read and write bulk endpoint. For
> example, my USB device has four interfaces with a total of 5 endpoints.
> 1 being an INTR endpoint and the others are all BULK. So I have set up
> the URB's using the appropriate macros (FILL_BULK_URB etc..), but when
> it comes to the write routines (using the dev interface), how does one
> distinguish which endpoint the file operation write is meant for? I see
> two possibilities:
> 
> 1. Implement an ioctl call that will select the appropriate interface
> for the write, or implement the URB write within the ioctl itself (a
> different case statement for each endpoint).
> 2. Register 5 different device nodes, use each node to identify a
> related endpoint.
> 
> Is there a better way of doing this other than 1 above, or am I missing
> something here?

Another possiblity is to have the first byte of the data buffer contain an 
indicator for which endpoint to use.

But maybe the real problem is that your implementation is using the wrong 
user interface.  Presenting a single-device read/write API usually isn't
appropriate for a device that can control multiple I/O streams.

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to