Attach USB HID devices from the Generic Destop page, usage pointer to
authormatthieu <matthieu@openbsd.org>
Sun, 28 Dec 2014 15:24:08 +0000 (15:24 +0000)
committermatthieu <matthieu@openbsd.org>
Sun, 28 Dec 2014 15:24:08 +0000 (15:24 +0000)
ums. This is how the USB Tablet from Qemu in libvirt/kvm shows up and
it works with ums(4). ok mpi@

sys/dev/usb/ums.c

index 8fe5004..2576f41 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ums.c,v 1.39 2014/08/21 14:52:56 mpi Exp $ */
+/*     $OpenBSD: ums.c,v 1.40 2014/12/28 15:24:08 matthieu Exp $ */
 /*     $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $        */
 
 /*
@@ -94,6 +94,10 @@ ums_match(struct device *parent, void *match, void *aux)
 
        uhidev_get_report_desc(uha->parent, &desc, &size);
 
+       if (hid_is_collection(desc, size, uha->reportid,
+           HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_POINTER)))
+               return (UMATCH_IFACECLASS);
+
        if (hid_is_collection(desc, size, uha->reportid,
            HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
                return (UMATCH_IFACECLASS);