tech-kern archive

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

RE: ugen vs interfaces



The following might or might not be helpful.

Endpoint *addresses* are a flat space in USB. Endpoint *indices* within
interface are almost never used. If your device doesn't have multiple
configuration or multiple alternate settings, the endpoint address is
enough.  Endpoint (index) 3 of interface 5 is only a config time concept;
I/O is always sent to endpoint *address* whatever.

If your device has multiple configs and/or alternate settings, then you have
to select the config and setting. In this context, the meaning of endpoint
address x changes (as determined by the governing active config or alternate
setting -- you look at the endpoint descriptor under the selected
config/alternate setting to find out the meaning). 

Best regards,
--Terry

-----Original Message-----
From: tech-kern-owner%NetBSD.org@localhost [mailto:tech-kern-owner%NetBSD.org@localhost] On
Behalf Of Mouse
Sent: Tuesday, November 15, 2016 15:19
To: tech-kern%netbsd.org@localhost
Subject: ugen vs interfaces

I'm trying to use ugen - on 5.2, but a look at cvsweb (ugen.4 and
ugen.c) makes me think current is identical in these regards.  I've
forced the device of interest to configure as ugen ("flags 1") and my
code can find it (bus 3 device 3, at the moment, for example).

The example code I'm working from was designed (of course :-þ) for
Linux, and seems to use interface 2.  But I can't see how to tell
NetBSD I want to use interface 2.  I can _find_ interface 2, by walking
interfaces and endpoints on the control endpoint.  But I can't figure
out how to tell the kernel I want to do bulk I/O on endpoint 3 of
interface 2.  The ugen device name specifies the bus and device (via
the ugen instance, in the high bits) and the endpoint number (in the
low four bits).  But I can't see anywhere I can set the interface
number.  I can't see any way to set anything on the control endpoint so
that opening the /dev/ugen* devices will come up using the interface I
want and I can't see anything I can do with the endpoint file
descriptor once opened that will cause it to switch to using the
interface I want.

Surely I'm just missing something...but what?

I can, of course, give more details if they'd help.  But I suspect
there's just something simple I'm not getting....

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B



Home | Main Index | Thread Index | Old Index