On Wed, 14 Jun 2006, David Brownell wrote: > On Wednesday 14 June 2006 12:25 pm, Alan Stern wrote: > > On Tue, 13 Jun 2006, David Brownell wrote: > > > > > > 4. Make usb_generic into a genuine device driver. This involves > > > > adding a mechanism to tell apart USB interface drivers from USB > > > > device drivers -- of which usb_generic is currently the only > > > > one. > > > > > > Arguably this is how "hub.c" should work. (Plus as you mentioned local > > > proxies for remote or virtualzed usb gadgets.) > > > > I don't understand what you mean about hub.c. > > That it's a good example of something that arguably "should" work as > a device-level driver. It's already special, being the "interior" > node of each USB tree. Making that behave (with suspend/resume!) > would go a long way towards sorting things out. Later maybe the > current "generic" could become "per-interface".
Yes, that could simplify a few things. Like the fact that downstream devices are children of the hub device, not of the hub interface, even though it's the hub interface driver that creates and removes them. > > > Maybe a "usb_device_driver" could be a better virtualization hook too; > > > its responsibilities will certainly be very different from those of the > > > current usb_(interface_)_driver structure. > > > > Agreed, it should have been done that way. Can't think why I didn't do it > > originally, but it's easy enough to fix up. However I'm not so sure about > > going through and changing all the existing occurrences of "usb_driver" to > > "usb_interface_driver"! > > #define usb_driver usb_interface_driver would do it. I don't see a need > to change that any time soon, though. I'd prefer simply to leave it as it is; there's no advantage to using that #define. Using automatic tools it wouldn't be hard to create a big renaming patch. But it would be quite lengthy to no very good point, so I'm inclined not to. > > It turns out there is a small disadvantage to doing this. > > > > usb_generic doesn't bind to a device until the device is registered. > > Can't you just set driver model dev.driver "early" though, like > as soon as the device is created? Always used to be able to do > that sort of thing. Today you could do it by a simple "is it a > hub or not" kind of switch... I considered this approach. It has the disadvantage that it won't work for messages generated after usb_generic is unbound from a device. So does my proposal. Greg's notion of printing the bus name if the driver isn't set sounds best. Alan Stern _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel