summaryrefslogtreecommitdiff
path: root/include/linux/mod_devicetable.h
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2012-05-18 23:27:43 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-14 02:40:09 +0400
commit81df2d594340dcb6d1a02191976be88a1ca8120c (patch)
treef5a20ebf416c03b41611518d54706019d0c0ffa2 /include/linux/mod_devicetable.h
parent7e97243c2080ecae7129e83635227fdebd4feef6 (diff)
downloadlinux-81df2d594340dcb6d1a02191976be88a1ca8120c.tar.xz
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>
Diffstat (limited to 'include/linux/mod_devicetable.h')
-rw-r--r--include/linux/mod_devicetable.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5db93821f9c7..7771d453e5f3 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -78,6 +78,9 @@ struct ieee1394_device_id {
* of a given interface; other interfaces may support other classes.
* @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass.
* @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass.
+ * @bInterfaceNumber: Number of interface; composite devices may use
+ * fixed interface numbers to differentiate between vendor-specific
+ * interfaces.
* @driver_info: Holds information used by the driver. Usually it holds
* a pointer to a descriptor understood by the driver, or perhaps
* device flags.
@@ -115,6 +118,9 @@ struct usb_device_id {
__u8 bInterfaceSubClass;
__u8 bInterfaceProtocol;
+ /* Used for vendor-specific interface matches */
+ __u8 bInterfaceNumber;
+
/* not matched against */
kernel_ulong_t driver_info;
};
@@ -130,6 +136,7 @@ struct usb_device_id {
#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
+#define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400
#define HID_ANY_ID (~0)
#define HID_BUS_ANY 0xffff