Module Name: src Committed By: jmcneill Date: Mon Dec 9 22:03:35 UTC 2024
Modified Files: src/sys/dev/hid: hid.c Log Message: Fix parsing keyboard HID descriptor on ThinkPad T14s Gen6. Undo a change made 18 years ago when the bluetooth stack was imported. The commit message didn't describe why the change was made, and it breaks detection of the keyboard device on this laptop. OpenBSD's hid parser looks like the original code here. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 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.6 src/sys/dev/hid/hid.c:1.7 --- src/sys/dev/hid/hid.c:1.6 Tue Oct 17 02:46:57 2023 +++ src/sys/dev/hid/hid.c Mon Dec 9 22:03:34 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: hid.c,v 1.6 2023/10/17 02:46:57 nat Exp $ */ +/* $NetBSD: hid.c,v 1.7 2024/12/09 22:03:34 jmcneill 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.6 2023/10/17 02:46:57 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.7 2024/12/09 22:03:34 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -524,10 +524,7 @@ hid_is_collection(const void *desc, int hi.collection == HCOLL_LOGICAL)) coll_usage = hi.usage; - if (hi.kind == hid_endcollection) - coll_usage = ~0; - - if (hi.kind == hid_collection && + if (hi.kind == hid_endcollection && coll_usage == usage && hi.report_ID == id) { DPRINTFN(2,("hid_is_collection: found\n"));