Commit 1662e3a7 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: add quirk to avoid config and interface strings

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: default avatarMelchior FRANZ <melchior.franz@gmail.com>
Tested-by: default avatarMelchior FRANZ <melchior.franz@gmail.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>  [2.6.28 and 2.6.29, nothing earlier]
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8e0ee43b
...@@ -1719,7 +1719,8 @@ int usb_set_configuration(struct usb_device *dev, int configuration) ...@@ -1719,7 +1719,8 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
} }
kfree(new_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); cp->string = usb_cache_string(dev, cp->desc.iConfiguration);
/* Now that all the interfaces are set up, register them /* Now that all the interfaces are set up, register them
......
...@@ -54,6 +54,10 @@ static const struct usb_device_id usb_quirk_list[] = { ...@@ -54,6 +54,10 @@ static const struct usb_device_id usb_quirk_list[] = {
{ USB_DEVICE(0x0638, 0x0a13), .driver_info = { USB_DEVICE(0x0638, 0x0a13), .driver_info =
USB_QUIRK_STRING_FETCH_255 }, 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 */ /* M-Systems Flash Disk Pioneers */
{ USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/usb/quirks.h>
#include "usb.h" #include "usb.h"
/* Active configuration fields */ /* Active configuration fields */
...@@ -813,7 +814,8 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf) ...@@ -813,7 +814,8 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf)
if (intf->sysfs_files_created || intf->unregistering) if (intf->sysfs_files_created || intf->unregistering)
return 0; return 0;
if (alt->string == NULL) if (alt->string == NULL &&
!(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
alt->string = usb_cache_string(udev, alt->desc.iInterface); alt->string = usb_cache_string(udev, alt->desc.iInterface);
if (alt->string) if (alt->string)
retval = device_create_file(&intf->dev, &dev_attr_interface); retval = device_create_file(&intf->dev, &dev_attr_interface);
......
...@@ -16,4 +16,7 @@ ...@@ -16,4 +16,7 @@
/* device can't handle Set-Interface requests */ /* device can't handle Set-Interface requests */
#define USB_QUIRK_NO_SET_INTF 0x00000004 #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 */ #endif /* __LINUX_USB_QUIRKS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment