From 4c134f3e801548185ff51f18d024aa180495b4ed Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 12 Mar 2008 20:20:36 +0000 Subject: [PATCH] Partially revert 1.95. It changed the probe for a mouse device to only accept a mouse using the boot subclass. Instead, restore the original hid_is_collection() test and fallback to testing the interface class, subclass, and protocol if that fails. MFC after: 1 week PR: usb/118670 --- sys/dev/usb/ums.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index 875539b6c68..73bb120b22d 100644 --- a/sys/dev/usb/ums.c +++ b/sys/dev/usb/ums.c @@ -198,7 +198,10 @@ ums_match(device_t self) if (err) return (UMATCH_NONE); - if (id->bInterfaceClass == UICLASS_HID && + if (hid_is_collection(desc, size, + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) + ret = UMATCH_IFACECLASS; + else if (id->bInterfaceClass == UICLASS_HID && id->bInterfaceSubClass == UISUBCLASS_BOOT && id->bInterfaceProtocol == UIPROTO_MOUSE) ret = UMATCH_IFACECLASS;