Re: [PATCH] USB: match on bInterfaceNumber

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 18, 2012 at 09:27:43PM +0200, Bjørn Mork wrote:
> Some composite USB devices provide multiple interfaces
> with different functions, all using "vendor-specific"
> for class/subclass/protocol.  Another OS use interface
> numbers to match the driver and interface. It seems
> these devices are designed with that in mind - using
> static interface numbers for the different functions.
> 
> This adds support for matching against the
> bInterfaceNumber, allowing such devices to be supported
> without having to resort to testing against interface
> number whitelists and/or blacklists in the probe.
> 
> Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
> ---
> So, how about something like this?
> 
> Barely tested:
> 
> bjorn@nemi:~$ modinfo sierra|grep 68A2
> alias:          usb:v1199p68A2d*dc*dsc*dp*ic*isc*ip*in03*
> alias:          usb:v1199p68A2d*dc*dsc*dp*ic*isc*ip*in02*
> bjorn@nemi:~$ modinfo qmi_wwan|grep 68A2
> alias:          usb:v1199p68A2d*dc*dsc*dp*ic*isc*ip*in08*
> 
> May 18 21:09:30 nemi kernel: [  273.244184] usb 8-4: new high-speed USB device number 3 using ehci_hcd
> May 18 21:09:31 nemi kernel: [  273.379669] usb 8-4: config 1 has an invalid interface number: 8 but max is 3
> May 18 21:09:31 nemi kernel: [  273.379679] usb 8-4: config 1 has no interface number 1
> May 18 21:09:31 nemi kernel: [  273.383670] usb 8-4: New USB device found, idVendor=1199, idProduct=68a2
> May 18 21:09:31 nemi kernel: [  273.383680] usb 8-4: New USB device strings: Mfr=3, Product=2, SerialNumber=4
> May 18 21:09:31 nemi kernel: [  273.383686] usb 8-4: Product: MC7710
> May 18 21:09:31 nemi kernel: [  273.383691] usb 8-4: Manufacturer: Sierra Wireless, Incorporated
> May 18 21:09:31 nemi kernel: [  273.383697] usb 8-4: SerialNumber: 3581780400xxxxx
> May 18 21:09:31 nemi kernel: [  273.408874] usbcore: registered new interface driver usbserial
> May 18 21:09:31 nemi kernel: [  273.409161] usbcore: registered new interface driver usbserial_generic
> May 18 21:09:31 nemi kernel: [  273.409455] USB Serial support registered for generic
> May 18 21:09:31 nemi kernel: [  273.409585] usbserial: USB Serial Driver core
> May 18 21:09:31 nemi kernel: [  273.410975] usbcore: registered new interface driver sierra
> May 18 21:09:31 nemi kernel: [  273.411267] USB Serial support registered for Sierra USB modem
> May 18 21:09:31 nemi kernel: [  273.411376] sierra 8-4:1.2: Sierra USB modem converter detected
> May 18 21:09:36 nemi kernel: [  278.409188] usb 8-4: Sierra USB modem converter now attached to ttyUSB0
> May 18 21:09:36 nemi kernel: [  278.409255] sierra 8-4:1.3: Sierra USB modem converter detected
> May 18 21:09:36 nemi kernel: [  278.410157] usb 8-4: Sierra USB modem converter now attached to ttyUSB1
> May 18 21:09:36 nemi kernel: [  278.416162] qmi_wwan 8-4:1.8: cdc-wdm0: USB WDM device
> May 18 21:09:36 nemi kernel: [  278.416923] qmi_wwan 8-4:1.8: wwan0: register 'qmi_wwan' at usb-0000:00:1d.7-4, Sierra Wireless wwan/QMI device, e2:d9:a3:bb:da:ba
> May 18 21:09:36 nemi kernel: [  278.417008] usbcore: registered new interface driver qmi_wwan
> 
> 
> Looks like it might be working. This could lead to a
> single device requiring a large number of entries if
> there are many interfaces to match.  However, there is
> nothing preventing a driver from ignoring this, and use
> the same probing strategy as today so I don't that is a
> real problem.
> 
> So?  Anything I missed here?  I tried grepping for the
> alias string, but looking at the split matches I found
> I guess I could have missed something...

At first glance, it looks good to me.  But do you mind if I hold off
applying this until 3.6?  I'd like it to get a lot of testing in
linux-next before going to Linus, and 3.5-rc1 is about to be opened.
That way we can also have the time to convert some drivers to use this,
to ensure it is working properly :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux