Hi,
Here are the last drivers missing a claim multiple report ids
conditional. None of them currently claims more than one report id.
With this is place, the old problematic approach of signalling
that multiple report ids should be claimed to the match routines using
__UHIDEV_CLAIM_MULTIPLE_REPORTID can be removed.

Comments? OK?

Index: sys/dev/usb/ukbd.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ukbd.c,v
retrieving revision 1.84
diff -u -p -r1.84 ukbd.c
--- sys/dev/usb/ukbd.c  12 Sep 2021 06:58:08 -0000      1.84
+++ sys/dev/usb/ukbd.c  17 Nov 2021 06:23:28 -0000
@@ -201,6 +201,9 @@ ukbd_match(struct device *parent, void *
        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)))
Index: sys/dev/usb/ums.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ums.c,v
retrieving revision 1.50
diff -u -p -r1.50 ums.c
--- sys/dev/usb/ums.c   12 Sep 2021 06:58:08 -0000      1.50
+++ sys/dev/usb/ums.c   17 Nov 2021 06:23:28 -0000
@@ -93,6 +93,9 @@ ums_match(struct device *parent, void *m
        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,
Index: sys/dev/usb/umstc.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umstc.c,v
retrieving revision 1.6
diff -u -p -r1.6 umstc.c
--- sys/dev/usb/umstc.c 12 Sep 2021 06:58:08 -0000      1.6
+++ sys/dev/usb/umstc.c 17 Nov 2021 06:23:28 -0000
@@ -80,6 +80,9 @@ umstc_match(struct device *parent, void 
        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;
 
Index: sys/dev/usb/utpms.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/utpms.c,v
retrieving revision 1.11
diff -u -p -r1.11 utpms.c
--- sys/dev/usb/utpms.c 23 Oct 2020 21:23:58 -0000      1.11
+++ sys/dev/usb/utpms.c 17 Nov 2021 06:23:28 -0000
@@ -269,6 +269,9 @@ utpms_match(struct device *parent, void 
        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 ||
Index: sys/dev/usb/uwacom.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uwacom.c,v
retrieving revision 1.4
diff -u -p -r1.4 uwacom.c
--- sys/dev/usb/uwacom.c        12 Sep 2021 06:58:08 -0000      1.4
+++ sys/dev/usb/uwacom.c        17 Nov 2021 06:23:28 -0000
@@ -75,6 +75,9 @@ uwacom_match(struct device *parent, void
        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);

Reply via email to