USB: allow match on bInterfaceNumber
[firefly-linux-kernel-4.4.55.git] / include / linux / usb.h
index dea39dc551d44c3602f1b7c33800dfba57a0a5b3..f717fbdaee8e1726ef6e1ce08ce9175b4765b205 100644 (file)
@@ -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