tech-kern archive

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

RE: ugen vs interfaces



[apologies in advance, I'm using Outlook which really is annoying for plain
text/list responses. Let me know if I should have hard-wrapped the
line-endings, I forget the convention.]

> So the "intf 1 ep 0" endpoint is actually the same thing as the "intf 2 
> ep 1" endpoint, because they're both address 2, even though one is 
> UE_DIR_IN and the other is UE_DIR_OUT?  Or am I still confused?

The bEndpointAddress 0x82 is not the same as 0x02 -- at least to the
hardware on your device.  (The sign bit counts here. IN endpoint 0x02 has
the same bottom 4 bits of address as OUT endpoint 0x02, but because the
direction is different, they're different endpoints.

> What about the "intf 0 ep 0" endpoint, which is address 1, UE_DIR_IN,
> UE_INTERRUPT, and the "intf 1 ep 1" endpoint, which is UE_DIR_OUT and
> UE_BULK - but also address 1?

Same thing. Because the direction is different, the hardware is not
confused, and the collision is coincidental.

> Or are the bEndpointAddress values here not the addresses you're
> talking about?

Definitely what I'm talking about. 

> Perhaps it would also help to ask "what's an interface"?  They seem to
> be at the heart of my confusion here....

An interface is primarily an abstraction of interest to software on the
host.

An 'interface' represents:

1) a collection of endpoints that represent a logical function on a
multi-function device.

2) (in conjunction with alternate interface settings) a way of managing
bandwidth allocation for isochronous and interrupt data flows.

3) something that can be addressed with control transactions and SETUP
packets (independently of the device or of endpoints).

Sometimes a logical function needs to do #2 independently for multiple data
flows. For example, an audio device may have separate flows for the speaker
and the mic. In fact, an audio function often has three interface
descriptors: one for control, one for the speaker and one for the mic. The
control interface might not have any endpoints, but audio class uses #3 to
send messages to its function.

To make matters even more complicated, you often see an audio function (with
multiple interfaces) combined with a HID function (with one interface. 

Modern USB uses a special descriptor, the INTERFACE ASSOCIATION DECRIPTOR,
to indicate that several interfaces are part of the same logical function. 

More than you wanted to know, I'm sure.

Back to your problem: it seems likely that ugen binds to the entire device.
In this case, I would expect that you would use the endpoint *addresses* to
send traffic. You would mask off the direction bit, and for reads, it will
access address 0x80 | <your bits>; for writes, it will send to address <your
address bits>.

If ugen can't deal with the fact that endpoint addresses IN and OUT are not
logically related to each other, then it needs an update....

Best regards,
--Terry



Home | Main Index | Thread Index | Old Index