summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-06-17 13:09:43 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2013-07-12 00:03:17 +0200
commit4d233287abee07ccfc1084a20c4a31af3afbfd17 (patch)
treeaac6245b055a1230e27438e071d956ca2cae602f
parentb253920862f3a3ac0c5966d527e109d107eaae14 (diff)
backports: add USB_DEVICE_INTERFACE_NUMBER
Upstream commit 98be7feed42539492bc768ec287b204b186790c4 The original version also checked for bInterfaceNumber, which is only available in more recent kernel versions. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/usb.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
index 8ea9d750..a217d160 100644
--- a/backport/backport-include/linux/usb.h
+++ b/backport/backport-include/linux/usb.h
@@ -38,6 +38,22 @@
.bInterfaceProtocol = (pr)
#endif
+#ifndef USB_DEVICE_INTERFACE_NUMBER
+/**
+ * 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, \
+ .idVendor = (vend), \
+ .idProduct = (prod)
+#endif /* USB_DEVICE_INTERFACE_NUMBER */
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
#ifdef CPTCFG_BACKPORT_OPTION_USB_URB_THREAD_FIX
#define usb_scuttle_anchored_urbs LINUX_BACKPORT(usb_scuttle_anchored_urbs)