On Friday 18 August 2006 9:28 am, Alan Stern wrote:

> The one interesting aspect is that the dev_set_drvdata calls were
> moved from the usb_create_hcd and usb_put_hcd routines, where they
> clearly don't belong, into usb_add_hcd and usb_remove_hcd.  This
> shouldn't cause any problems.

Actually it'd be best to not do that.  When initializing an integrated
dual role controller -- basically a set of FIFOs programmable to act as
either host or peripheral mode, taking maybe 1/4 the silicon of separate
controllers and likely OTG-capable -- it turns out to be important to be
able to strongly decouple host side setup/create from activation/add.

That's because activating the host needs to be delayed until it's also
possible to activate the peripheral role (that is, the gadget driver
has been registered too) ... but it must also be possible to do things
like "rmmod" the combined host/peripheral driver before a gadget driver
is loaded, and that means that the driver needs to get at the information
currently stored by create() via set_drvdata().

If they "clearly don't belong", it would be because the driver itself,
rather than the glue layer, ought to control that driver data field.
For example, by pointing to the driver-private structure used to manage
both roles (host, peripheral), rather than a usbcore structure that's
irrelevant if usbcore isn't configured (e.g. a peripheral-only board).
But I don't see that as currently being practical.  So meanwhile,
please leave that part of the setup/create logic as-is.

- Dave



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to