summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-06-17 16:27:59 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-06-17 16:27:59 +0000
commita2aeb9f207e15e74bc8f59dfc7c1ac40dcaafb56 (patch)
tree57bf5feb15feb4abe50ef9017110c9dc5ba576b8 /sys/dev
parentd182f8bedd433d1d257136760201058f477d599e (diff)
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.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ugen.c18
-rw-r--r--sys/dev/usb/uhidev.c15
2 files changed, 29 insertions, 4 deletions
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 <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usbdevs.h>
#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);
}