From 86f21a33c1a05a801e37f2981ac94e171c3a3906 Mon Sep 17 00:00:00 2001 From: macallan Date: Thu, 30 Aug 2012 01:27:44 +0000 Subject: [PATCH] add options ADBKBD_EMUL_USB to turn USB emulation on by default --- sys/dev/adb/adb_kbd.c | 9 +++++++-- sys/dev/adb/files.adb | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/adb/adb_kbd.c b/sys/dev/adb/adb_kbd.c index 6e2cf48df6ed..9dbdc0ecbc44 100644 --- a/sys/dev/adb/adb_kbd.c +++ b/sys/dev/adb/adb_kbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: adb_kbd.c,v 1.18 2012/08/29 02:44:07 macallan Exp $ */ +/* $NetBSD: adb_kbd.c,v 1.19 2012/08/30 01:27:44 macallan Exp $ */ /* * Copyright (C) 1998 Colin Wood @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.18 2012/08/29 02:44:07 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.19 2012/08/30 01:27:44 macallan Exp $"); #include #include @@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: adb_kbd.c,v 1.18 2012/08/29 02:44:07 macallan Exp $" #include #include "opt_wsdisplay_compat.h" +#include "opt_adbkbd.h" #include "adbdebug.h" #include "wsmouse.h" @@ -336,6 +337,10 @@ adbkbd_attach(device_t parent, device_t self, void *aux) a.accesscookie = sc; sc->sc_wskbddev = config_found_ia(self, "wskbddev", &a, wskbddevprint); +#ifdef ADBKBD_EMUL_USB + sc->sc_emul_usb = TRUE; + wskbd_set_evtrans(sc->sc_wskbddev, adb_to_usb, 128); +#endif /* ADBKBD_EMUL_USB */ #if NWSMOUSE > 0 /* attach the mouse device */ diff --git a/sys/dev/adb/files.adb b/sys/dev/adb/files.adb index d31bd395683c..fad4c381549d 100644 --- a/sys/dev/adb/files.adb +++ b/sys/dev/adb/files.adb @@ -1,5 +1,5 @@ # -# $NetBSD: files.adb,v 1.6 2012/08/29 02:44:07 macallan Exp $ +# $NetBSD: files.adb,v 1.7 2012/08/30 01:27:44 macallan Exp $ # # Apple Desktop Bus protocol and drivers @@ -19,6 +19,7 @@ device adbkbd : wskbddev, wsmousedev, sysmon_power, sysmon_taskq attach adbkbd at nadb file dev/adb/adb_kbd.c adbkbd needs-flag file dev/adb/adb_usb_map.c adbkbd +defflag opt_adbkbd.h ADBKBD_EMUL_USB device adbbt : wskbddev attach adbbt at nadb