using USB to HotSync Palm IIIc

Benjamin Herrenschmidt mol-general@lists.maconlinux.org
Sat, 6 Apr 2002 20:03:38 +0100


>No, not at the moment. Real USB access would be nice. However,
>I'm not too familiar with the inner workings of USB so 
>I don't know how much work it would be. The main question
>is whether there is a simple way to add a MacOS driver for
>a USB controller. Last I checked I wasn't able to find
>an API for that.

This is the main problem, though I beleive it would make
sense to just emulate an OHCI controller. OHCI is an "intelligent"
chip, that is it works mostly out of data structures laid out in
memory by the driver and accessed directly by the chip, as far as
I know it, it makes a good candidate for beeing emulated. I could
eventually work on this though I really lack time for now.

What apple does on OS X is, I think, to emulate the higher level USB
API so that a device not claimed by a driver in OS X will be made
visible to classic. We could do differently by emulating the OHCI
controller and letting the user explicitely select what devices
to be made visible to MacOS. MOL would then register a driver for
that device (thus preventing conflicts with another linux side 
driver) and would forward packets.

I have to look in more detail at the userland API to linux USB as
I think we don't really need a kernel driver here. The OHCI side
shouldn't be that difficult to emulate. Basically, the driver sets
up lists of endpoint descriptor, and on each of them, a list of
transmit descriptors in which it queues packets. The chip
continusouly walks these lists, filling packets with incoming datas
for in enpoints, or sending outgoing datas for out endpoints. Once
the OHCI has handled a packet it dequeues it from the endpoint
descriptor chain, and enqueue it in a special list (the done list)
and emits an interrupt. The driver then collects packets in the done
list and completes client requests appropriately (or just requeue
new packets).

Ben.