aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-03-11 10:20:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-03-25 01:26:14 -0400
commit392e1d9817d0024c96aae237c3c4349e47c976fd (patch)
tree41fb12fe0d67f36773c1dd5c2e70f51e37c30594
parent12cd5b984f825c5448aa4c0df561f8252076fd52 (diff)
USB: new quirk flag to avoid Set-Interface
This patch (as1057) fixes a problem with the X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter; the device crashes when it receives a Set-Interface request. A new quirk (USB_QUIRK_NO_SET_INTF) is introduced and a quirks entry is created for this device. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/message.c5
-rw-r--r--drivers/usb/core/quirks.c3
-rw-r--r--include/linux/usb/quirks.h3
3 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index fefb92296e8f..c311f67b7f08 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1206,7 +1206,10 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1206 return -EINVAL; 1206 return -EINVAL;
1207 } 1207 }
1208 1208
1209 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 1209 if (dev->quirks & USB_QUIRK_NO_SET_INTF)
1210 ret = -EPIPE;
1211 else
1212 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1210 USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE, 1213 USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE,
1211 alternate, interface, NULL, 0, 5000); 1214 alternate, interface, NULL, 0, 5000);
1212 1215
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index d9d1eb19f2a1..dfc5418ea10c 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -50,6 +50,9 @@ static const struct usb_device_id usb_quirk_list[] = {
50 /* M-Systems Flash Disk Pioneers */ 50 /* M-Systems Flash Disk Pioneers */
51 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, 51 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
52 52
53 /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
54 { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
55
53 /* Action Semiconductor flash disk */ 56 /* Action Semiconductor flash disk */
54 { USB_DEVICE(0x10d6, 0x2200), .driver_info = 57 { USB_DEVICE(0x10d6, 0x2200), .driver_info =
55 USB_QUIRK_STRING_FETCH_255 }, 58 USB_QUIRK_STRING_FETCH_255 },
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 2692ec9389ca..1f999ec8d08c 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -9,3 +9,6 @@
9 9
10/* device can't resume correctly so reset it instead */ 10/* device can't resume correctly so reset it instead */
11#define USB_QUIRK_RESET_RESUME 0x00000002 11#define USB_QUIRK_RESET_RESUME 0x00000002
12
13/* device can't handle Set-Interface requests */
14#define USB_QUIRK_NO_SET_INTF 0x00000004