From 36b6d2a9e7f15c4c9b4217831d6d8e74d10ecb37 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 22 Nov 2021 11:29:17 +0000 Subject: [PATCH] Add missing claim multiple report ids conditionals to uhidev drivers. --- sys/dev/usb/ukbd.c | 5 ++++- sys/dev/usb/ums.c | 5 ++++- sys/dev/usb/umstc.c | 5 ++++- sys/dev/usb/utpms.c | 5 ++++- sys/dev/usb/uwacom.c | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 5854373250b..528bbecdde7 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukbd.c,v 1.84 2021/09/12 06:58:08 anton Exp $ */ +/* $OpenBSD: ukbd.c,v 1.85 2021/11/22 11:29:17 anton Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -201,6 +201,9 @@ ukbd_match(struct device *parent, void *match, void *aux) int size; void *desc; + if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha)) + return (UMATCH_NONE); + uhidev_get_report_desc(uha->parent, &desc, &size); if (!hid_is_collection(desc, size, uha->reportid, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index 12f47bba124..c217e9bcbfd 100644 --- a/sys/dev/usb/ums.c +++ b/sys/dev/usb/ums.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ums.c,v 1.50 2021/09/12 06:58:08 anton Exp $ */ +/* $OpenBSD: ums.c,v 1.51 2021/11/22 11:29:17 anton Exp $ */ /* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -93,6 +93,9 @@ ums_match(struct device *parent, void *match, void *aux) int size; void *desc; + if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha)) + return (UMATCH_NONE); + uhidev_get_report_desc(uha->parent, &desc, &size); if (hid_is_collection(desc, size, uha->reportid, diff --git a/sys/dev/usb/umstc.c b/sys/dev/usb/umstc.c index 47c084828af..4bebeb41811 100644 --- a/sys/dev/usb/umstc.c +++ b/sys/dev/usb/umstc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umstc.c,v 1.6 2021/09/12 06:58:08 anton Exp $ */ +/* $OpenBSD: umstc.c,v 1.7 2021/11/22 11:29:18 anton Exp $ */ /* * Copyright (c) 2020 joshua stein @@ -80,6 +80,9 @@ umstc_match(struct device *parent, void *match, void *aux) int size; void *desc; + if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha)) + return (UMATCH_NONE); + if (!usb_lookup(umstc_devs, uha->uaa->vendor, uha->uaa->product)) return UMATCH_NONE; diff --git a/sys/dev/usb/utpms.c b/sys/dev/usb/utpms.c index 77f5abb1b76..944431eb141 100644 --- a/sys/dev/usb/utpms.c +++ b/sys/dev/usb/utpms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utpms.c,v 1.11 2020/10/23 21:23:58 tobhe Exp $ */ +/* $OpenBSD: utpms.c,v 1.12 2021/11/22 11:29:18 anton Exp $ */ /* * Copyright (c) 2005, Johan Wallén @@ -269,6 +269,9 @@ utpms_match(struct device *parent, void *match, void *aux) usb_interface_descriptor_t *id; int i; + if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha)) + return (UMATCH_NONE); + id = usbd_get_interface_descriptor(uha->uaa->iface); if (id == NULL || id->bInterfaceSubClass != UISUBCLASS_BOOT || diff --git a/sys/dev/usb/uwacom.c b/sys/dev/usb/uwacom.c index ff67e395977..e039a96e344 100644 --- a/sys/dev/usb/uwacom.c +++ b/sys/dev/usb/uwacom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uwacom.c,v 1.4 2021/09/12 06:58:08 anton Exp $ */ +/* $OpenBSD: uwacom.c,v 1.5 2021/11/22 11:29:18 anton Exp $ */ /* * Copyright (c) 2016 Frank Groeneveld @@ -75,6 +75,9 @@ uwacom_match(struct device *parent, void *match, void *aux) int size; void *desc; + if (UHIDEV_CLAIM_MULTIPLE_REPORTID(uha)) + return (UMATCH_NONE); + if (usb_lookup(uwacom_devs, uha->uaa->vendor, uha->uaa->product) == NULL) return (UMATCH_NONE); -- 2.20.1