[haiku-development] Re: usb_asix

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 07 Jan 2010 14:27:20 +0100

> On Wed, 6 Jan 2010 21:31:55 +0000, Oliver Ruiz Dorantes
> <oliver.ruiz.dorantes@xxxxxxxxx> wrote:
> 
> > Before filling a ticket, Is this expected? Couldn't we avoid this
> overhead
> > by being more specific? or am i missing something?
> 
> In case this specialization will decrease mentioned calls of 
> init_driver
> function - it have the sence to do it. In oposite case I see no 
> difference
> between devices look up on bus module's side or on driver's side. ;-)

When you let the USB stack do the work by providing support descriptors 
it will cause the driver not to be loaded (when it wasn't loaded 
yet/unloaded again) and the add device hook not to be called. I've seen 
that there are quite a few different vendor/product ids involed though 
and to build the device you have to go through them again anyway, so it 
makes only limited sense to do this work twice. If these devices all 
have a common class/subclass or the like (even if they are 0xff vendor 
specific) it would make the most sense to add a support descriptor that 
limits loading to these. See usb_ecm for example, where only ECM type 
devices are matched. You can add multiple such descriptors to match 
different types. Using 0 in a field of the descriptor is a wildcard.

Regards
Michael

Other related posts: