c458b04
From: Johan Hovold <johan@kernel.org>
c458b04
Date: Mon, 25 Aug 2014 17:51:26 +0200
c458b04
Subject: [PATCH] USB: core: add device-qualifier quirk
c458b04
MIME-Version: 1.0
c458b04
Content-Type: text/plain; charset=UTF-8
c458b04
Content-Transfer-Encoding: 8bit
c458b04
c458b04
Add new quirk for devices that cannot handle requests for the
c458b04
device_qualifier descriptor.
c458b04
c458b04
A USB-2.0 compliant device must respond to requests for the
c458b04
device_qualifier descriptor (even if it's with a request error), but at
c458b04
least one device is known to misbehave after such a request.
c458b04
c458b04
Suggested-by: Bjørn Mork <bjorn@mork.no>
c458b04
Signed-off-by: Johan Hovold <johan@kernel.org>
c458b04
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c458b04
---
c458b04
 drivers/usb/core/hub.c     | 3 +++
c458b04
 include/linux/usb/quirks.h | 3 +++
c458b04
 2 files changed, 6 insertions(+)
c458b04
c458b04
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
c458b04
index 6050143ce7ec..9a6d2d6d9fe2 100644
c458b04
--- a/drivers/usb/core/hub.c
c458b04
+++ b/drivers/usb/core/hub.c
c458b04
@@ -4538,6 +4538,9 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1)
c458b04
 	struct usb_qualifier_descriptor	*qual;
c458b04
 	int				status;
c458b04
 
c458b04
+	if (udev->quirks & USB_QUIRK_DEVICE_QUALIFIER)
c458b04
+		return;
c458b04
+
c458b04
 	qual = kmalloc (sizeof *qual, GFP_KERNEL);
c458b04
 	if (qual == NULL)
c458b04
 		return;
c458b04
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
c458b04
index 55a17b188daa..ffe565c94743 100644
c458b04
--- a/include/linux/usb/quirks.h
c458b04
+++ b/include/linux/usb/quirks.h
c458b04
@@ -41,4 +41,7 @@
c458b04
  */
c458b04
 #define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL	0x00000080
c458b04
 
c458b04
+/* device can't handle device_qualifier descriptor requests */
c458b04
+#define USB_QUIRK_DEVICE_QUALIFIER	0x00000100
c458b04
+
c458b04
 #endif /* __LINUX_USB_QUIRKS_H */
c458b04
-- 
c458b04
1.9.3
c458b04