On Wednesday 23 August 2006 19:23, Alan Stern wrote:
> On Wed, 23 Aug 2006, Iñaky Pérez-González wrote:
> > Ok, I am officially dumb: hdev_to_hub(). Dah!
> >
> > I'll change the code tomorrow to set a flag variable in struct usb_hub
> > and leave port-status unmodified.
> >
> > Thanks for the nudge, Alan
>
> Just remember my warning.  You'll get an oops if you try to use that
> function at a time when there is no hub structure associated with the
> root-hub device.

I was thinking about something like the following in my hc_probe():

...
usb_add_hcd(hcd);
if (wait_event_timeout(&wq, hcd->rh_registered != 0, TIMEOUT) == 0) {
        result = -ETIMEDOUT;
        goto error...;
}
spin_lock_irqsave (&hcd_root_hub_lock, flags);
if (hcd->rh_registered) {
        struct usb_hub *usb;
        hub = hdev_to_hub(hcd->self.root_hub);
        hub->wireless = 1;
}
else {
        result = -ENODEV;
        spin_unlock_irqrestore (&hcd_root_hub_lock, flags);
        goto error_..
}
spin_unlock_irqrestore (&hcd_root_hub_lock, flags);

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