David Brownell wrote:
Stuart Lynne wrote:
...
> I think you need a middle layer. It needs to implement at a minimum:
>
> ...
> If you don't have a middle layer you'll end up re-implementing all of
> that in each and every function driver. This is a needless replication
> of code and leads to inconsistant behaviour across function drivers.
Hmm, the urb queueing and registration issues would be hardware driver
issues, not function driver issues, as I had described things. ...
One more point that keeps coming back to me though: although I don't
think a "downward directed" middle layer is desirable on the device side
of things (which was what you focussed on), I do think that eventually
an "upward directed" set of library (optional!) code might evolve to
handle some tasks for function drivers that act complex through USB.
For example, consider again the pxa250 and its fifteen (plus control)
endpoints. There are a number of useful function drivers that only
need one interface, with a couple endpoints, to work. Those will be
the first ones to be deployed -- examples include versions of the
sa1100 'usb-eth' (usbnet) and 'usb-char' (usb-serial) drivers, which
currently have pxa250-specific versions in standard ARM kernels.
(Or "net_fd" and "serial_fd" in the Lineo code.)
But once a bunch of those function drivers become portable, it might
be reasonable to want some library code to let them run together in
various ways. Packaging "interface drivers" would allow N drivers
to work at the same time; doing it as "configuration drivers" would
mean only one would work at a time. Hey, maybe all fifteen endpoints
would end up in active use at the same time!
My model is that those policies don't belong in the API core, since
many gadgets won't need or want them ... putting them there would
just cause code bloat. That draft API allows those policies, but
they'd be the responsibility of higher level gadget driver code as
part of its setup() callback.
- Dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel