From: anton Date: Fri, 20 May 2022 05:02:47 +0000 (+0000) Subject: uhid_maxrepid() is currently not able to observe all report IDs as it X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cccc4d6c92b38703ce1bbaa3df7f3b643c1266e6;p=openbsd uhid_maxrepid() is currently not able to observe all report IDs as it passes hid_none as the wanted hid kind to hid_start_parse(). This becomes a problem for descriptors with multiple report IDs per collection. Therefore change the semantics of the hid_none kind to let it represents all possible kinds. Gets rid of "uhidev_intr: bad repid" console spam as reported by sthen@ on bugs@. Have been in snaps for a week. --- diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 1c4d5fa45e0..8611d9219a0 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hid.c,v 1.3 2020/06/04 23:03:43 deraadt Exp $ */ +/* $OpenBSD: hid.c,v 1.4 2022/05/20 05:02:47 anton Exp $ */ /* $NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */ @@ -229,7 +229,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) * Only copy HID item, increment position and return * if correct kind! */ - if (s->kind == c->kind) { + if (s->kind == hid_none || s->kind == c->kind) { *h = *c; DPRINTF("%u,%u,%u\n", h->loc.pos, h->loc.size, h->loc.count);