]> git.hungrycats.org Git - linux/commitdiff
USB: add quirk to avoid config and interface strings
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 26 Mar 2009 18:25:19 +0000 (18:25 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:56:35 +0000 (10:56 -0700)
upstream commit: 1662e3a7f076e51e3073faf9ce77157b529c475b

Apparently the Configuration and Interface strings aren't used as
often as the Vendor, Product, and Serial strings.  In at least one
device (a Saitek Cyborg Gold 3D joystick), attempts to read the
Configuration string cause the device to stop responding to Control
requests.

This patch (as1226) adds a quirks flag, telling the kernel not to
read a device's Configuration or Interface strings, together with a
new quirk for the offending joystick.

Reported-by: Melchior FRANZ <melchior.franz@gmail.com>
Tested-by: Melchior FRANZ <melchior.franz@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/usb/core/message.c
drivers/usb/core/quirks.c
drivers/usb/core/sysfs.c
include/linux/usb/quirks.h

index e00127c4e8ecc65342f78f1d304e317a1076a309..aaf6ea50fa30f5d0aa3b3f18455a36a6619692b4 100644 (file)
@@ -1637,7 +1637,8 @@ free_interfaces:
        }
        kfree(new_interfaces);
 
-       if (cp->string == NULL)
+       if (cp->string == NULL &&
+                       !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
                cp->string = usb_cache_string(dev, cp->desc.iConfiguration);
 
        /* Now that all the interfaces are set up, register them
index c070b34b669de70da98c450eaf7ac4d48e85ec93..ab93918d92076dedec3575b49e5eaacfb2c32e71 100644 (file)
@@ -54,6 +54,10 @@ static const struct usb_device_id usb_quirk_list[] = {
        { USB_DEVICE(0x0638, 0x0a13), .driver_info =
          USB_QUIRK_STRING_FETCH_255 },
 
+       /* Saitek Cyborg Gold Joystick */
+       { USB_DEVICE(0x06a3, 0x0006), .driver_info =
+                       USB_QUIRK_CONFIG_INTF_STRINGS },
+
        /* M-Systems Flash Disk Pioneers */
        { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
 
index 4fb65fdc9dc36bb51eb25059789886fbd1dfe857..813b337fc832a4fbd3b9b3419d8a060bd90111a9 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/usb.h>
+#include <linux/usb/quirks.h>
 #include "usb.h"
 
 /* Active configuration fields */
@@ -847,7 +848,8 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf)
         * and missing in others.  Hence its attribute cannot be created
         * before the uevent is broadcast.
         */
-       if (alt->string == NULL)
+       if (alt->string == NULL &&
+                       !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
                alt->string = usb_cache_string(udev, alt->desc.iInterface);
        if (alt->string)
                retval = device_create_file(&intf->dev, &dev_attr_interface);
index 7f6c603db654d077f4cd8ee8351c97e8f9957815..2526f3bbd273e522e1ff77b2ba404c87d9a5a56a 100644 (file)
@@ -16,4 +16,7 @@
 /* device can't handle Set-Interface requests */
 #define USB_QUIRK_NO_SET_INTF          0x00000004
 
+/* device can't handle its Configuration or Interface strings */
+#define USB_QUIRK_CONFIG_INTF_STRINGS  0x00000008
+
 #endif /* __LINUX_USB_QUIRKS_H */