Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8538f96ae5aada1c04d69a993b20ad160b191d47
Commit:     8538f96ae5aada1c04d69a993b20ad160b191d47
Parent:     7f9985c2e4e5555b750d6f891b4923e63cc834c1
Author:     Daniel Drake <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 00:32:24 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:29:48 2007 -0700

    USB: add USB_DEVICE_AND_INTERFACE_INFO for device matching
    
    Recently, the USB device matching code stopped matching generic interface
    matches against devices with vendor-specific device class values.
    
    Some drivers now need to explicitly match USB device ID's (in addition to
    generic interface info) to retain the same behaviour as before. This new 
macro,
    suggested by Alan Stern, makes the explicit device/interface matching a 
little
    simpler for those users.
    
    Signed-off-by: Daniel Drake <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 include/linux/usb.h |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb.h b/include/linux/usb.h
index 3d63e0c..98e0338 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -771,6 +771,28 @@ static inline int usb_endpoint_is_isoc_out(const struct 
usb_endpoint_descriptor
        .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \
        .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
 
+/**
+ * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device
+ *             with a class of usb interfaces
+ * @vend: the 16 bit USB Vendor ID
+ * @prod: the 16 bit USB Product ID
+ * @cl: bInterfaceClass value
+ * @sc: bInterfaceSubClass value
+ * @pr: bInterfaceProtocol value
+ *
+ * This macro is used to create a struct usb_device_id that matches a
+ * specific device with a specific class of interfaces.
+ *
+ * This is especially useful when explicitly matching devices that have
+ * vendor specific bDeviceClass values, but standards-compliant interfaces.
+ */
+#define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \
+       .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+               | USB_DEVICE_ID_MATCH_DEVICE, \
+       .idVendor = (vend), .idProduct = (prod), \
+       .bInterfaceClass = (cl), \
+       .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
+
 /* ----------------------------------------------------------------------- */
 
 /* Stuff for dynamic usb ids */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to