From a2aeb9f207e15e74bc8f59dfc7c1ac40dcaafb56 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 17 Jun 2006 16:27:59 +0000 Subject: Recent Powerbook systems have their on-board keyboard and mouse devices also showing up as usb devices, but both devices are tied. To make things less confusing, do not attach the usb phantoms at all. --- sys/dev/usb/ugen.c | 18 +++++++++++++++--- sys/dev/usb/uhidev.c | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 4 deletions(-) (limited to 'sys/dev/usb') diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 9bcc875d770..d0a0df2db9a 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.33 2005/11/21 18:16:43 millert Exp $ */ +/* $OpenBSD: ugen.c,v 1.34 2006/06/17 16:27:58 miod Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -66,6 +66,7 @@ #include #include #include +#include #ifdef UGEN_DEBUG #define DPRINTF(x) do { if (ugendebug) logprintf x; } while (0) @@ -189,9 +190,20 @@ USB_MATCH(ugen) if (uaa->matchlvl) return (uaa->matchlvl); #endif - if (uaa->usegeneric) + if (uaa->usegeneric) { +#ifdef __macppc__ + /* + * Some Apple laptops have USB phantom devices which match + * the ADB devices. We want to ignore them to avoid + * confusing users, as the real hardware underneath is adb + * and has already attached. + */ + if (uaa->vendor == USB_VENDOR_APPLE && + uaa->product == USB_PRODUCT_APPLE_ADB) + return (UMATCH_NONE); +#endif return (UMATCH_GENERIC); - else + } else return (UMATCH_NONE); } diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index ef45c247404..d6ff3465b56 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.14 2006/05/14 12:00:04 matthieu Exp $ */ +/* $OpenBSD: uhidev.c,v 1.15 2006/06/17 16:27:58 miod Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -100,6 +100,19 @@ USB_MATCH(uhidev) return (UMATCH_NONE); if (uaa->matchlvl) return (uaa->matchlvl); + +#ifdef __macppc__ + /* + * Some Apple laptops have USB phantom devices which match + * the ADB devices. We want to ignore them to avoid + * confusing users, as the real hardware underneath is adb + * and has already attached. + */ + if (uaa->vendor == USB_VENDOR_APPLE && + uaa->product == USB_PRODUCT_APPLE_ADB) + return (UMATCH_NONE); +#endif + return (UMATCH_IFACECLASS_GENERIC); } -- cgit v1.2.3