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


> > But this seems somewhat incomplete, and it bothers me that the driver
> > for a usb device is using usb_interface entities in its usbcore chitchat.
> > 
> > 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.


On Wednesday 14 June 2006 1:51 pm, you wrote:
> 
> 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...


> This means that all the early dev_info and dev_dbg log messages in
> usb_new_device, hub_port_init, and so on, don't have a device driver name.
> 
> Maybe I should replace those macros with something like "usb_info" and 
> "usb_dbg" that would always print "usb" for the driver name.

I'd as soon see the info() and dbg() macros vanish.  There are a few
places a device isn't available, but usually dev_dbg() etc is better.
Or were you meaning "wrap dev_dbg"?

- Dave


_______________________________________________
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