On Wed, 23 Aug 2006, Iñaky Pérez-González wrote:

> I am not happy at all with that approach, I know it could be a future
> maintenance mess. And I would have much more preferred to set a bit in 
> struct usb_hub. 
> 
> But as I said above, going from struct usb_hcd to it's root hub 
> 'struct usb_hub' is not trivial (or I am missing something too
> simple). Any pointers in that?

It isn't trivial, but it's also not impossible.  There are a couple of 
places where the kernel does it.  For example, look at 
usb_hcd_resume_root_hub() in hcd.c, which calls usb_resume_root_hub() in 
hub.c.  Or look at usb_hc_died() in hcd.c, which calls usb_kick_khubd() in 
hub.c.

The general strategy has been to break the job up into two pieces:  The
HCD framework goes from the hcd struct to the usb_device struct for the
root hub, and the hub driver then goes from that to the usb_hub struct.

Of course, you do have to watch out for the possibility that there _is_ no 
hub structure associated with the root hub.  This can happen if someone 
unbinds the hub driver or if you try to manipulate the data structure 
before it is fully registered.

Alan Stern


-------------------------------------------------------------------------
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