Module Name:    src
Committed By:   nat
Date:           Tue Oct 17 02:46:57 UTC 2023

Modified Files:
        src/sys/dev/hid: hid.c

Log Message:
Improve hid matching.

It now matches all kinds (application/physical/logical) in the hid
collection.

Patch from PR applied.

Addresses PR/46868.

Ok skrll@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hid/hid.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/hid/hid.c
diff -u src/sys/dev/hid/hid.c:1.5 src/sys/dev/hid/hid.c:1.6
--- src/sys/dev/hid/hid.c:1.5	Sun Mar 13 11:35:47 2022
+++ src/sys/dev/hid/hid.c	Tue Oct 17 02:46:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.c,v 1.5 2022/03/13 11:35:47 riastradh Exp $	*/
+/*	$NetBSD: hid.c,v 1.6 2023/10/17 02:46:57 nat Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.5 2022/03/13 11:35:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.6 2023/10/17 02:46:57 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -519,13 +519,15 @@ hid_is_collection(const void *desc, int 
 			    hi.kind, hi.report_ID, hi.usage, coll_usage));
 
 		if (hi.kind == hid_collection &&
-		    hi.collection == HCOLL_APPLICATION)
+		    (hi.collection == HCOLL_APPLICATION ||
+		    hi.collection == HCOLL_PHYSICAL ||
+		    hi.collection == HCOLL_LOGICAL))
 			coll_usage = hi.usage;
 
 		if (hi.kind == hid_endcollection)
 			coll_usage = ~0;
 
-		if (hi.kind == hid_input &&
+		if (hi.kind == hid_collection &&
 		    coll_usage == usage &&
 		    hi.report_ID == id) {
 			DPRINTFN(2,("hid_is_collection: found\n"));

Reply via email to