diff options
author | Bjørn Mork <bjorn@mork.no> | 2012-10-31 06:08:39 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 10:51:19 -0700 |
commit | 3943a08b97f2e36e01172d1f321e43c8067c9094 (patch) | |
tree | 4e0cb6dd2d9e58eac52d13b72256bcc81e4c745c | |
parent | 939a3a4989f3210a20f5e68734896c43d9b6ae6c (diff) |
USB: add USB_DEVICE_INTERFACE_CLASS macro
commit 17b72feb2be14e6d37023267dc0e199e8e0e3fdc upstream.
Matching on device and interface class with with unspecified
subclass and protocol is sometimes useful. This is slightly
different from USB_DEVICE_AND_INTERFACE_INFO which requires
the full interface class/subclass/protocol triplet.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/linux/usb.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 4e8e6685f513..473907ac9104 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -715,6 +715,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) .bcdDevice_hi = (hi) /** + * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class + * @vend: the 16 bit USB Vendor ID + * @prod: the 16 bit USB Product ID + * @cl: bInterfaceClass value + * + * This macro is used to create a struct usb_device_id that matches a + * specific interface class of devices. + */ +#define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \ + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ + USB_DEVICE_ID_MATCH_INT_CLASS, \ + .idVendor = (vend), \ + .idProduct = (prod), \ + .bInterfaceClass = (cl) + +/** * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol * @vend: the 16 bit USB Vendor ID * @prod: the 16 bit USB Product ID |