mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
USB: allow match on bInterfaceNumber
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@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7e97243c20
commit
81df2d5943
6 changed files with 40 additions and 7 deletions
|
@ -776,6 +776,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
|
|||
.idProduct = (prod), \
|
||||
.bInterfaceProtocol = (pr)
|
||||
|
||||
/**
|
||||
* USB_DEVICE_INTERFACE_NUMBER - describe a usb device with a specific interface number
|
||||
* @vend: the 16 bit USB Vendor ID
|
||||
* @prod: the 16 bit USB Product ID
|
||||
* @num: bInterfaceNumber value
|
||||
*
|
||||
* This macro is used to create a struct usb_device_id that matches a
|
||||
* specific interface number of devices.
|
||||
*/
|
||||
#define USB_DEVICE_INTERFACE_NUMBER(vend, prod, num) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
|
||||
USB_DEVICE_ID_MATCH_INT_NUMBER, \
|
||||
.idVendor = (vend), \
|
||||
.idProduct = (prod), \
|
||||
.bInterfaceNumber = (num)
|
||||
|
||||
/**
|
||||
* USB_DEVICE_INFO - macro used to describe a class of usb devices
|
||||
* @cl: bDeviceClass value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue