On Mon, 23 May 2016 17:47:28 +0200 Martin Pieuchot <m...@openbsd.org> wrote: > On 23/05/16(Mon) 16:51, Gerhard Roth wrote: > > On Mon, 23 May 2016 16:18:29 +0200 Martin Pieuchot <m...@openbsd.org> wrote: > > > On 23/05/16(Mon) 15:38, Gerhard Roth wrote: > > > > This is part 2 of the MBIM patch. It adds the mbim driver to i386 > > > > +/* > > > > + * Some devices are picky about too frequent control messages. > > > > + * Query device state not more often than every 0.5 secs. > > > > + */ > > > > +struct timeval mbim_update_rate = { 0, 500000 }; > > > > +int mbim_delay = 4000; > > > > + > > > > +/* > > > > + * Normally, MBIM devices are detected by their interface class and > > > > subclass. > > > > + * But for some models that have multiple configurations, it is better > > > > to > > > > + * match by vendor and product id so that we can select the desired > > > > + * configuration ourselves. > > > > + * > > > > + * OTOH, some devices identifiy themself als an MBIM device but fail > > > > to speak > > > > + * the MBIM protocol. > > > > + */ > > > > > > Why is it better? This is just working around usb_probe_and_attach() > > > and require developer to add an entry for every device we need to > > > support. > > > > I just thought that some modules that are already in use say with a > > umsm config would otherwise change to mbim and break the setup. The idea > > was to keep existing modules first as they are now and start adding > > new one to the list. > > Well the rule is first match win. Since umsm(4) uses a vendor/product > table as long as you don't add your device to this table it should be > ok. >
Now I remember why I needed to match on VID/PID, too. I have one MBIM module (Sierra Wireless MC8305) that shows some strange behaviour: If you read the configuration descriptor #1 and then set configuration #2, the device resets itself and shortly disapears from the USB bus. When matching VID/PID, I can prevent usbd_probe_and_attach() from reading configuration #1. Without matching VID/PID, usbd_probe_and_attach() will read configuration #1 to try matching all the interfaces provided by the device. But then I not able to switch to configuration #2 anymore. I'm quite sure this is a firmware bug and the only workaround I have is the match by VID/PID. That still allows to match other MBIM devices not listed in the table to be matched by Class/SubClass. Any suggestions? Gerhard