On Thu, 24 Aug 2006, Perez-Gonzalez, Inaky wrote:
> >This won't be easy. For one thing, hcd_root_hub_lock is private to
> hcd.c
> >and hdev_to_hub is private to hub.c.
>
> Nothing that exporting something like a safe_hdev_to_hub() to the
> host API cannot do.
That's not so easy either. The fact is, hdev_to_hub() _isn't_ safe unless
you possess some extra prior knowledge.
> >Are you sure you need to store this information in the hub structure?
>
> Yes, the point is I need to access it from hub_port_wait_reset()
> to establish that the device speed is USB_SPEED_VARIABLE.
I'm still confused. Which devices need to be variable speed? Is it only
top-level devices on a wireless bus (i.e., those attached directly to the
root hub)? Or is it everything below a wireless port on any hub? Or
something else?
As you can guess, I don't understand how wireless USB works.
> >Wouldn't it make more sense to store it in the hcd structure instead?
> >After all, it is a property of the entire bus and not just one
> >particular hub, right?
>
> I could dig hub->hdev and then play something to guess if that
> is a root hub and dig out a back pointer to hcd->self.root_hub.
> But that'd be even more painful.
No, it's easy. To test for a root hub, all you need to do is see whether
hub->hdev->parent is NULL (root hubs don't have parent hubs). To go from
a hub to its hcd is a little harder because it involves a routine that has
been submitted but not yet accepted. :-) For now, you can do:
container_of(hub->hdev->bus, struct usb_hcd, self)
With the new routine (in Greg's queue) you'll be able to write:
bus_to_hcd(hub->hdev->bus)
> For now, as far as I can tell, the rest of the bus could care less;
> maybe in the future it is needed? I don't know. The thing is the
> decoupling between the bus and the root hub for this case is too
> decoupled :)
There's a reason for it to be that way. If this is causing you problems,
it's probably because you're trying to work against the design of Linux's
USB stack.
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
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel