Module Name:    src
Committed By:   martin
Date:           Wed Feb 16 14:36:12 UTC 2022

Modified Files:
        src/sys/dev/usb [netbsd-9]: uhidev.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1428):

        sys/dev/usb/uhidev.c: revision 1.82

Do not explicitly set the HID Report Protocol upon attach, some devices
don't like it and should be in Report Protocol after enumeration/reset
anyway.

May address PR kern/55019.


To generate a diff of this commit:
cvs rdiff -u -r1.75.2.1 -r1.75.2.2 src/sys/dev/usb/uhidev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uhidev.c
diff -u src/sys/dev/usb/uhidev.c:1.75.2.1 src/sys/dev/usb/uhidev.c:1.75.2.2
--- src/sys/dev/usb/uhidev.c:1.75.2.1	Thu Feb  4 19:16:01 2021
+++ src/sys/dev/usb/uhidev.c	Wed Feb 16 14:36:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhidev.c,v 1.75.2.1 2021/02/04 19:16:01 martin Exp $	*/
+/*	$NetBSD: uhidev.c,v 1.75.2.2 2022/02/16 14:36:12 martin 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.75.2.1 2021/02/04 19:16:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.75.2.2 2022/02/16 14:36:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -169,8 +169,16 @@ uhidev_attach(device_t parent, device_t 
 	}
 	(void)usbd_set_idle(iface, 0, 0);
 
-	if ((usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_NO_SET_PROTO) == 0)
+#if 0
+	/*
+	 * HID 1.11 says we should do this, but the device firmware is
+	 * supposed to come up in Report Protocol after reset anyway, and
+	 * apparently explicitly requesting it confuses some devices.
+	 */
+	if ((usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_NO_SET_PROTO) == 0 &&
+	    id->bInterfaceSubClass == UISUBCLASS_BOOT)
 		(void)usbd_set_protocol(iface, 1);
+#endif
 
 	maxinpktsize = 0;
 	sc->sc_iep_addr = sc->sc_oep_addr = -1;

Reply via email to