Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Always try to set USB HID devices into Report Pr...



details:   https://anonhg.NetBSD.org/src/rev/d1a33a10eb12
branches:  trunk
changeset: 826078:d1a33a10eb12
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Aug 13 22:29:42 2017 +0000

description:
Always try to set USB HID devices into Report Protocol.  (Unless the
device is known to be quirky.)

Some of the most-widely-compatible methods of implementing USB Keyboard
NKRO depend on this Request to function as designed.

Issuing this Request is recommended by the HID 1.11 spec (7.2.6):

... "the host should not make any assumptions about the device's state
and should set the desired protocol whenever initializing a device."

diffstat:

 sys/dev/usb/uhidev.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r cc2d6f77bde2 -r d1a33a10eb12 sys/dev/usb/uhidev.c
--- a/sys/dev/usb/uhidev.c      Sun Aug 13 22:23:16 2017 +0000
+++ b/sys/dev/usb/uhidev.c      Sun Aug 13 22:29:42 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhidev.c,v 1.70 2017/06/01 02:45:12 chs Exp $  */
+/*     $NetBSD: uhidev.c,v 1.71 2017/08/13 22:29:42 jakllsch Exp $     */
 
 /*
  * Copyright (c) 2001, 2012 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.70 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.71 2017/08/13 22:29:42 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -153,12 +153,9 @@
                aprint_error_dev(self, "couldn't establish power handler\n");
 
        (void)usbd_set_idle(iface, 0, 0);
-#if 0
 
-       if ((usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_NO_SET_PROTO) == 0 &&
-           id->bInterfaceSubClass != UISUBCLASS_BOOT)
+       if ((usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_NO_SET_PROTO) == 0)
                (void)usbd_set_protocol(iface, 1);
-#endif
 
        maxinpktsize = 0;
        sc->sc_iep_addr = sc->sc_oep_addr = -1;



Home | Main Index | Thread Index | Old Index