From 34e5f64b49460dacb16310f33e806846568d0375 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 2 Jul 2011 20:58:33 +0000 Subject: [PATCH] Fix for "nomatch" event for ums and ukbd drivers when uhid is loaded. MFC after: 3 days --- sys/dev/usb/input/uhid.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index 1da12039d7c4..1b810e321a0c 100644 --- a/sys/dev/usb/input/uhid.c +++ b/sys/dev/usb/input/uhid.c @@ -634,6 +634,18 @@ uhid_probe(device_t dev) if (usb_test_quirk(uaa, UQ_HID_IGNORE)) return (ENXIO); + /* + * Don't attach to mouse and keyboard devices, hence then no + * "nomatch" event is generated and then ums and ukbd won't + * attach properly when loaded. + */ + if ((uaa->info.bInterfaceClass == UICLASS_HID) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && + ((uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD) || + (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))) { + return (ENXIO); + } + return (BUS_PROBE_GENERIC); }