On Mon, 8 Aug 2005, Vlado Handziski wrote: > I still have one remaining question. In my previous mail I said that it is > very logical that the parent hub is reset and powered-up when a child hub is > not reachable (because the partent's port to which the second hub is > connected has been turned-off). This default behavior is causing much > problems for us. I.e. some of the devices that we want to power control are > attached to the hubs using active cables (i.e. hubs intemself). And this > results in repowering of the whole hub when we turn off the power to the > feeding port. Is there a way to cleanly modify the hub.c to disable this > feature?. Any pointers about the best place such modification can be made? I > believe that the code in hub.c should by default check if the inability to > communicate with the child (detected by hub_irq) is a result of a explicit > action by the user. Can this info be passed to the hub driver in some way, > when one is using ioctl to directly communicate with the devices?
Right now the kernel has very minimal support for hub port power changes. IIRC, the code for automatically turning port power back on was added in order to cope with peculiarities of various host controllers or with the USB OTG requirements. It probably would be safe to change it so that it only applies to root hub ports -- but that won't help you very much. In principle, we could add an interface to the hub driver allowing userspace to ask that certain ports be left powered off (and also that ports be powered back on). This could be done using sysfs or ioctl; it doesn't fit all that well into the usbfs framework. ioctl would probably be simpler. I don't have time to work on such a change now, but you certainly may. You would need to add to struct usb_hub a bit-vector of ports that are supposed to be powered off. Also, the hub_port_logical_disconnect routine has long needed an extra argument specifying whether port power should be turned off -- this would be an ideal time to add it. One important matter to watch out for is hubs that either have ganged power switches or no power switching at all. This is quite common among root hubs. Alan Stern ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel