Commit 0f28b55d authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] usbhid: automatically set HID_QUIRK_NOGET for keyboards and mice

It seems to be relatively common for USB keyboards and mice to dislike
being polled for reports.  Since there's no need to poll a keyboard or
a mouse, this patch (as685) automatically sets the HID_QUIRK_NOGET flag
for devices that advertise themselves as either sort of device with boot
protocol support.

This won't cure all the problems since some devices don't support the
boot protocol, but it's simple and easy and it should fix quite a few
problems.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a82e49b8
...@@ -1797,6 +1797,14 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) ...@@ -1797,6 +1797,14 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
(hid_blacklist[n].idProduct == le16_to_cpu(dev->descriptor.idProduct))) (hid_blacklist[n].idProduct == le16_to_cpu(dev->descriptor.idProduct)))
quirks = hid_blacklist[n].quirks; quirks = hid_blacklist[n].quirks;
/* Many keyboards and mice don't like to be polled for reports,
* so we will always set the HID_QUIRK_NOGET flag for them. */
if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT) {
if (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_KEYBOARD ||
interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE)
quirks |= HID_QUIRK_NOGET;
}
if (quirks & HID_QUIRK_IGNORE) if (quirks & HID_QUIRK_IGNORE)
return NULL; return NULL;
......
...@@ -40,6 +40,14 @@ ...@@ -40,6 +40,14 @@
#define USB_INTERFACE_CLASS_HID 3 #define USB_INTERFACE_CLASS_HID 3
/*
* USB HID interface subclass and protocol codes
*/
#define USB_INTERFACE_SUBCLASS_BOOT 1
#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
#define USB_INTERFACE_PROTOCOL_MOUSE 2
/* /*
* HID class requests * HID class requests
*/ */
......
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