On Wed, 10 May 2006, Vojtech Pavlik wrote:

> On Wed, May 10, 2006 at 10:50:47AM -0400, Alan Stern wrote:
> > Dmitry and Vojtech:
> > 
> > So many USB keyboards require the HID_QUIRK_NOGET blacklist flag, does it 
> > make sense to set the flag automatically for every keyboard device?
> > 
> > Or would that cause problems with some highly advanced keyboards?
>  
> No, it wouldn't be a big deal to enable it for keyboard and mice. We
> need it for joysticks for autocalibration, though.

Does this patch look right?  Would it be okay to omit testing for a
keyboard or mouse protocol, and simply rely on the Boot interface 
subclass?

Alan Stern


Index: usb-2.6/drivers/usb/input/hid.h
===================================================================
--- usb-2.6.orig/drivers/usb/input/hid.h
+++ usb-2.6/drivers/usb/input/hid.h
@@ -41,6 +41,14 @@
 #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
  */
 
Index: usb-2.6/drivers/usb/input/hid-core.c
===================================================================
--- usb-2.6.orig/drivers/usb/input/hid-core.c
+++ usb-2.6/drivers/usb/input/hid-core.c
@@ -1790,6 +1790,14 @@ static struct hid_device *usb_hid_config
                        (hid_blacklist[n].idProduct == 
le16_to_cpu(dev->descriptor.idProduct)))
                                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)
                return NULL;
 



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to