diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/macppc/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/macppc/conf/RAMDISK | 3 | ||||
-rw-r--r-- | sys/arch/macppc/conf/files.macppc | 6 | ||||
-rw-r--r-- | sys/arch/macppc/dev/adb.c | 17 | ||||
-rw-r--r-- | sys/arch/macppc/dev/aed.c | 555 | ||||
-rw-r--r-- | sys/arch/macppc/dev/aedvar.h | 76 | ||||
-rw-r--r-- | sys/arch/macppc/dev/akbd.c | 11 | ||||
-rw-r--r-- | sys/arch/macppc/dev/ams.c | 8 | ||||
-rw-r--r-- | sys/arch/macppc/include/conf.h | 3 |
9 files changed, 7 insertions, 675 deletions
diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC index 3c3add7b498..81f27ea57b5 100644 --- a/sys/arch/macppc/conf/GENERIC +++ b/sys/arch/macppc/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.115 2005/12/20 01:36:10 brad Exp $g +# $OpenBSD: GENERIC,v 1.116 2005/12/21 18:50:51 miod Exp $g # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -133,7 +133,6 @@ pi2c0 at adb? # PMU I2C wi* at macobio? # airport macgpio* at macobio? # GPIO, PMU interrupt router. macgpio* at macgpio? # GPIO, PMU interrupt router. -aed* at adb? # ADB Event Device akbd* at adb? # ADB keyboard wskbd* at akbd? mux 1 diff --git a/sys/arch/macppc/conf/RAMDISK b/sys/arch/macppc/conf/RAMDISK index 5100fd4bfe6..e032ffa6fc1 100644 --- a/sys/arch/macppc/conf/RAMDISK +++ b/sys/arch/macppc/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.58 2005/11/17 15:03:52 drahn Exp $ +# $OpenBSD: RAMDISK,v 1.59 2005/12/21 18:50:51 miod Exp $ # # PPC GENERIC config file # @@ -117,7 +117,6 @@ adb* at macobio? # Apple Desktop Bus wi* at macobio? # Apple Airport 802.11DS macgpio* at macobio? # GPIO, PMU interrupt router. macgpio* at macgpio? # GPIO, PMU interrupt router. -aed* at adb? # ADB Event Device akbd* at adb? # ADB keyboard wskbd* at akbd? mux 1 #ams* at adb? # ADB mouse diff --git a/sys/arch/macppc/conf/files.macppc b/sys/arch/macppc/conf/files.macppc index d6c91c67f3e..b4d7fda95d1 100644 --- a/sys/arch/macppc/conf/files.macppc +++ b/sys/arch/macppc/conf/files.macppc @@ -1,4 +1,4 @@ -# $OpenBSD: files.macppc,v 1.42 2005/12/20 01:36:10 brad Exp $ +# $OpenBSD: files.macppc,v 1.43 2005/12/21 18:50:51 miod Exp $ # # macppc-specific configuration info @@ -163,10 +163,6 @@ device apm attach apm at adb file arch/macppc/dev/apm.c apm needs-count -device aed -attach aed at adb -file arch/macppc/dev/aed.c aed needs-flag - device akbd: wskbddev attach akbd at adb file arch/macppc/dev/akbd.c akbd needs-flag diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c index 58b6e247d5c..87f1f0633c7 100644 --- a/sys/arch/macppc/dev/adb.c +++ b/sys/arch/macppc/dev/adb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adb.c,v 1.15 2005/11/21 18:16:37 millert Exp $ */ +/* $OpenBSD: adb.c,v 1.16 2005/12/21 18:50:52 miod Exp $ */ /* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */ /*- @@ -47,7 +47,6 @@ #include <macppc/dev/akbdvar.h> #include <macppc/dev/viareg.h> -#include "aed.h" #include "apm.h" /* @@ -148,14 +147,6 @@ adbattach(struct device *parent, struct device *self, void *aux) printf(", %d targets\n", totaladbs); -#if NAED > 0 - /* ADB event device for compatibility */ - aa_args.origaddr = 0; - aa_args.adbaddr = 0; - aa_args.handler_id = 0; - (void)config_found(self, &aa_args, adbprint); -#endif - /* for each ADB device */ for (adbindex = 1; adbindex <= totaladbs; adbindex++) { /* Get the ADB information */ @@ -206,12 +197,6 @@ adbprint(void *args, const char *name) printf("%s addr %d: ", name, aa_args->adbaddr); switch(aa_args->origaddr) { #ifdef DIAGNOSTIC -#if NAED > 0 - case 0: - printf("ADB event device"); - rv = UNCONF; - break; -#endif case ADBADDR_SECURE: printf("security dongle (%d)", aa_args->handler_id); break; diff --git a/sys/arch/macppc/dev/aed.c b/sys/arch/macppc/dev/aed.c deleted file mode 100644 index a48d481c710..00000000000 --- a/sys/arch/macppc/dev/aed.c +++ /dev/null @@ -1,555 +0,0 @@ -/* $OpenBSD: aed.c,v 1.9 2005/11/21 18:16:37 millert Exp $ */ -/* $NetBSD: aed.c,v 1.5 2000/03/23 06:40:33 thorpej Exp $ */ - -/* - * Copyright (C) 1994 Bradley A. Grantham - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bradley A. Grantham. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/fcntl.h> -#include <sys/poll.h> -#include <sys/selinfo.h> -#include <sys/proc.h> -#include <sys/signalvar.h> -#include <sys/systm.h> - -#include <machine/autoconf.h> -#include <machine/conf.h> -#include <machine/cpu.h> - -#include <macppc/dev/keyboard.h> -#include <macppc/dev/adbvar.h> -#include <macppc/dev/aedvar.h> -#include <macppc/dev/akbdvar.h> - -#define spladb splhigh - -/* - * Function declarations. - */ -int aedmatch(struct device *, void *, void *); -void aedattach(struct device *, struct device *, void *); -void aed_emulate_mouse(adb_event_t *event); -void aed_kbdrpt(void *kstate); -void aed_dokeyupdown(adb_event_t *event); -void aed_handoff(adb_event_t *event); -void aed_enqevent(adb_event_t *event); - -/* - * Local variables. - */ -struct aed_softc *aed_sc = NULL; -int aed_options = 0; /* | AED_MSEMUL; */ - -/* Driver definition */ -struct cfdriver aed_cd = { - NULL, "aed", DV_DULL -}; -/* Driver definition */ -struct cfattach aed_ca = { - sizeof(struct aed_softc), aedmatch, aedattach -}; - -int -aedmatch(struct device *parent, void *cf, void *aux) -{ - struct adb_attach_args *aa_args = (struct adb_attach_args *)aux; - static int aed_matched = 0; - - /* Allow only one instance. */ - if ((aa_args->origaddr == 0) && (!aed_matched)) { - aed_matched = 1; - return (1); - } else - return (0); -} - -void -aedattach(struct device *parent, struct device *self, void *aux) -{ - struct adb_attach_args *aa_args = (struct adb_attach_args *)aux; - struct aed_softc *sc = (struct aed_softc *)self; - - aed_sc = sc; - - timeout_set(&sc->sc_repeat_ch, aed_kbdrpt, aed_sc); - - sc->origaddr = aa_args->origaddr; - sc->adbaddr = aa_args->adbaddr; - sc->handler_id = aa_args->handler_id; - - sc->sc_evq_tail = 0; - sc->sc_evq_len = 0; - - sc->sc_rptdelay = 20; - sc->sc_rptinterval = 6; - sc->sc_repeating = -1; /* not repeating */ - - /* Pull in the options flags. */ - sc->sc_options = (sc->sc_dev.dv_cfdata->cf_flags | aed_options); - - sc->sc_ioproc = NULL; - - sc->sc_buttons = 0; - - sc->sc_open = 0; - - printf("ADB Event device\n"); -} - -/* - * Given a keyboard ADB event, record the keycode and call the key - * repeat handler, optionally passing the event through the mouse - * button emulation handler first. Pass mouse events directly to - * the handoff function. - */ -void -aed_input(adb_event_t *event) -{ - adb_event_t new_event = *event; - - switch (event->def_addr) { - case ADBADDR_KBD: - if (aed_sc->sc_options & AED_MSEMUL) - aed_emulate_mouse(&new_event); - else - aed_dokeyupdown(&new_event); - break; - case ADBADDR_MS: - new_event.u.m.buttons |= aed_sc->sc_buttons; - aed_handoff(&new_event); - break; - default: /* God only knows. */ -#ifdef DIAGNOSTIC - panic("aed: received event from unsupported device!"); -#endif - break; - } - -} - -/* - * Handles mouse button emulation via the keyboard. If the emulation - * modifier key is down, left and right arrows will generate 2nd and - * 3rd mouse button events while the 1, 2, and 3 keys will generate - * the corresponding mouse button event. - */ -void -aed_emulate_mouse(adb_event_t *event) -{ - static int emulmodkey_down = 0; - adb_event_t new_event; - - if (event->u.k.key == ADBK_KEYDOWN(ADBK_OPTION)) { - emulmodkey_down = 1; - } else if (event->u.k.key == ADBK_KEYUP(ADBK_OPTION)) { - /* key up */ - emulmodkey_down = 0; - if (aed_sc->sc_buttons & 0xfe) { - aed_sc->sc_buttons &= 1; - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - } - } else if (emulmodkey_down) { - switch(event->u.k.key) { -#ifdef ALTXBUTTONS - case ADBK_KEYDOWN(ADBK_1): - aed_sc->sc_buttons |= 1; /* left down */ - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - break; - case ADBK_KEYUP(ADBK_1): - aed_sc->sc_buttons &= ~1; /* left up */ - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - break; -#endif - case ADBK_KEYDOWN(ADBK_LEFT): -#ifdef ALTXBUTTONS - case ADBK_KEYDOWN(ADBK_2): -#endif - aed_sc->sc_buttons |= 2; /* middle down */ - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - break; - case ADBK_KEYUP(ADBK_LEFT): -#ifdef ALTXBUTTONS - case ADBK_KEYUP(ADBK_2): -#endif - aed_sc->sc_buttons &= ~2; /* middle up */ - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - break; - case ADBK_KEYDOWN(ADBK_RIGHT): -#ifdef ALTXBUTTONS - case ADBK_KEYDOWN(ADBK_3): -#endif - aed_sc->sc_buttons |= 4; /* right down */ - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - break; - case ADBK_KEYUP(ADBK_RIGHT): -#ifdef ALTXBUTTONS - case ADBK_KEYUP(ADBK_3): -#endif - aed_sc->sc_buttons &= ~4; /* right up */ - new_event.def_addr = ADBADDR_MS; - new_event.u.m.buttons = aed_sc->sc_buttons; - new_event.u.m.dx = new_event.u.m.dy = 0; - microtime(&new_event.timestamp); - aed_handoff(&new_event); - break; - case ADBK_KEYUP(ADBK_SHIFT): - case ADBK_KEYDOWN(ADBK_SHIFT): - case ADBK_KEYUP(ADBK_CONTROL): - case ADBK_KEYDOWN(ADBK_CONTROL): - case ADBK_KEYUP(ADBK_FLOWER): - case ADBK_KEYDOWN(ADBK_FLOWER): - /* ctrl, shift, cmd */ - aed_dokeyupdown(event); - break; - default: - if (event->u.k.key & 0x80) - /* ignore keyup */ - break; - - /* key down */ - new_event = *event; - - /* send option-down */ - new_event.u.k.key = ADBK_KEYDOWN(ADBK_OPTION); - new_event.bytes[0] = new_event.u.k.key; - microtime(&new_event.timestamp); - aed_dokeyupdown(&new_event); - - /* send key-down */ - new_event.u.k.key = event->bytes[0]; - new_event.bytes[0] = new_event.u.k.key; - microtime(&new_event.timestamp); - aed_dokeyupdown(&new_event); - - /* send key-up */ - new_event.u.k.key = - ADBK_KEYUP(ADBK_KEYVAL(event->bytes[0])); - microtime(&new_event.timestamp); - new_event.bytes[0] = new_event.u.k.key; - aed_dokeyupdown(&new_event); - - /* send option-up */ - new_event.u.k.key = ADBK_KEYUP(ADBK_OPTION); - new_event.bytes[0] = new_event.u.k.key; - microtime(&new_event.timestamp); - aed_dokeyupdown(&new_event); - break; - } - } else { - aed_dokeyupdown(event); - } -} - -/* - * Keyboard autorepeat timeout function. Sends key up/down events - * for the repeating key and schedules the next call at sc_rptinterval - * ticks in the future. - */ -void -aed_kbdrpt(void *kstate) -{ - struct aed_softc *aed_sc = (struct aed_softc *)kstate; - - aed_sc->sc_rptevent.bytes[0] |= 0x80; - microtime(&aed_sc->sc_rptevent.timestamp); - aed_handoff(&aed_sc->sc_rptevent); /* do key up */ - - aed_sc->sc_rptevent.bytes[0] &= 0x7f; - microtime(&aed_sc->sc_rptevent.timestamp); - aed_handoff(&aed_sc->sc_rptevent); /* do key down */ - - if (aed_sc->sc_repeating == aed_sc->sc_rptevent.u.k.key) { - timeout_add(&aed_sc->sc_repeat_ch, aed_sc->sc_rptinterval); - } -} - - -/* - * Cancels the currently repeating key event if there is one, schedules - * a new repeating key event if needed, and hands the event off to the - * appropriate subsystem. - */ -void -aed_dokeyupdown(adb_event_t *event) -{ - int kbd_key; - - kbd_key = ADBK_KEYVAL(event->u.k.key); - if (ADBK_PRESS(event->u.k.key) && keyboard[kbd_key][0] != 0) { - /* ignore shift & control */ - if (aed_sc->sc_repeating != -1) - timeout_del(&aed_sc->sc_repeat_ch); - - aed_sc->sc_rptevent = *event; - aed_sc->sc_repeating = kbd_key; - timeout_add(&aed_sc->sc_repeat_ch, aed_sc->sc_rptdelay); - } else { - if (aed_sc->sc_repeating != -1) { - aed_sc->sc_repeating = -1; - timeout_del(&aed_sc->sc_repeat_ch); - } - aed_sc->sc_rptevent = *event; - } - aed_handoff(event); -} - -/* - * Place the event in the event queue if a requesting device is open - * and we are not polling. - */ -void -aed_handoff(adb_event_t *event) -{ - if (aed_sc->sc_open && !adb_polling) - aed_enqevent(event); -} - -/* - * Place the event in the event queue and wakeup any waiting processes. - */ -void -aed_enqevent(adb_event_t *event) -{ - int s; - - s = spladb(); - -#ifdef DIAGNOSTIC - if (aed_sc->sc_evq_tail < 0 || aed_sc->sc_evq_tail >= AED_MAX_EVENTS) - panic("adb: event queue tail is out of bounds"); - - if (aed_sc->sc_evq_len < 0 || aed_sc->sc_evq_len > AED_MAX_EVENTS) - panic("adb: event queue len is out of bounds"); -#endif - - if (aed_sc->sc_evq_len == AED_MAX_EVENTS) { - splx(s); - return; /* Oh, well... */ - } - aed_sc->sc_evq[(aed_sc->sc_evq_len + aed_sc->sc_evq_tail) % - AED_MAX_EVENTS] = *event; - aed_sc->sc_evq_len++; - - selwakeup(&aed_sc->sc_selinfo); - if (aed_sc->sc_ioproc) - psignal(aed_sc->sc_ioproc, SIGIO); - - splx(s); -} - -int -aedopen(dev_t dev, int flag, int mode, struct proc *p) -{ - int unit; - int error = 0; - int s; - - unit = minor(dev); - - if (unit != 0) - return (ENXIO); - - s = spladb(); - if (aed_sc->sc_open) { - splx(s); - return (EBUSY); - } - aed_sc->sc_evq_tail = 0; - aed_sc->sc_evq_len = 0; - aed_sc->sc_open = 1; - aed_sc->sc_ioproc = p; - splx(s); - - return (error); -} - - -int -aedclose(dev_t dev, int flag, int mode, struct proc *p) -{ - int s = spladb(); - - aed_sc->sc_open = 0; - aed_sc->sc_ioproc = NULL; - splx(s); - - return (0); -} - - -int -aedread(dev_t dev, struct uio *uio, int flag) -{ - int s, error; - int willfit; - int total; - int firstmove; - int moremove; - - if (uio->uio_resid < sizeof(adb_event_t)) - return (EMSGSIZE); /* close enough. */ - - s = spladb(); - if (aed_sc->sc_evq_len == 0) { - splx(s); - return (0); - } - willfit = howmany(uio->uio_resid, sizeof(adb_event_t)); - total = (aed_sc->sc_evq_len < willfit) ? aed_sc->sc_evq_len : willfit; - - firstmove = (aed_sc->sc_evq_tail + total > AED_MAX_EVENTS) - ? (AED_MAX_EVENTS - aed_sc->sc_evq_tail) : total; - - error = uiomove((caddr_t) & aed_sc->sc_evq[aed_sc->sc_evq_tail], - firstmove * sizeof(adb_event_t), uio); - if (error) { - splx(s); - return (error); - } - moremove = total - firstmove; - - if (moremove > 0) { - error = uiomove((caddr_t) & aed_sc->sc_evq[0], - moremove * sizeof(adb_event_t), uio); - if (error) { - splx(s); - return (error); - } - } - aed_sc->sc_evq_tail = (aed_sc->sc_evq_tail + total) % AED_MAX_EVENTS; - aed_sc->sc_evq_len -= total; - splx(s); - return (0); -} - - -int -aedwrite(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; -{ - return 0; -} - - -int -aedioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) -{ - switch (cmd) { - case ADBIOCDEVSINFO: - { - adb_devinfo_t *di; - ADBDataBlock adbdata; - int totaldevs; - int adbaddr; - int i; - - di = (void *)data; - - /* Initialize to no devices */ - for (i = 0; i < 16; i++) - di->dev[i].addr = -1; - - totaldevs = CountADBs(); - for (i = 1; i <= totaldevs; i++) { - adbaddr = GetIndADB(&adbdata, i); - di->dev[adbaddr].addr = adbaddr; - di->dev[adbaddr].default_addr = (int)(adbdata.origADBAddr); - di->dev[adbaddr].handler_id = (int)(adbdata.devType); - } - - /* Must call ADB Manager to get devices now */ - } - break; - - case ADBIOCGETREPEAT: - { - adb_rptinfo_t *ri; - - ri = (void *)data; - ri->delay_ticks = aed_sc->sc_rptdelay; - ri->interval_ticks = aed_sc->sc_rptinterval; - } - break; - - case ADBIOCSETREPEAT: - { - adb_rptinfo_t *ri; - - ri = (void *) data; - aed_sc->sc_rptdelay = ri->delay_ticks; - aed_sc->sc_rptinterval = ri->interval_ticks; - } - break; - - case ADBIOCRESET: - /* Do nothing for now */ - break; - - case ADBIOCLISTENCMD: - { - adb_listencmd_t *lc; - - lc = (void *)data; - } - /* FALLTHROUGH */ - - default: - return (EINVAL); - } - - return (0); -} diff --git a/sys/arch/macppc/dev/aedvar.h b/sys/arch/macppc/dev/aedvar.h deleted file mode 100644 index 31ec5ffb048..00000000000 --- a/sys/arch/macppc/dev/aedvar.h +++ /dev/null @@ -1,76 +0,0 @@ -/* $OpenBSD: aedvar.h,v 1.4 2003/10/16 03:54:48 deraadt Exp $ */ -/* $NetBSD: aedvar.h,v 1.2 2000/03/23 06:40:33 thorpej Exp $ */ - -/* - * Copyright (C) 1994 Bradley A. Grantham - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bradley A. Grantham. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/timeout.h> -#include <machine/adbsys.h> - -/* Event queue definitions */ -#ifndef AED_MAX_EVENTS -#define AED_MAX_EVENTS 200 /* Maximum events to be kept in queue */ - /* maybe should be higher for slower macs? */ -#endif /* AED_MAX_EVENTS */ - -struct aed_softc { - struct device sc_dev; - - struct timeout sc_repeat_ch; - - /* ADB info */ - u_char origaddr; /* ADB device type (ADBADDR_AED) */ - u_char adbaddr; /* current ADB address */ - u_char handler_id; /* type of device */ - - /* ADB event queue */ - adb_event_t sc_evq[AED_MAX_EVENTS]; /* the queue */ - int sc_evq_tail; /* event queue tail pointer */ - int sc_evq_len; /* event queue length */ - - /* Keyboard repeat state */ - int sc_rptdelay; /* ticks before auto-repeat */ - int sc_rptinterval; /* ticks between auto-repeat */ - int sc_repeating; /* key that is auto-repeating */ - adb_event_t sc_rptevent; /* event to auto-repeat */ - - int sc_buttons; /* mouse button state */ - - struct selinfo sc_selinfo; /* select() info */ - struct proc * sc_ioproc; /* process to wakeup */ - - int sc_open; /* Are we queuing events? */ - int sc_options; /* config options */ -}; - -/* Options */ -#define AED_MSEMUL 0x1 /* emulate mouse buttons */ - -void aed_input(adb_event_t *event); diff --git a/sys/arch/macppc/dev/akbd.c b/sys/arch/macppc/dev/akbd.c index 2d91faf27c8..7288c9e9c6c 100644 --- a/sys/arch/macppc/dev/akbd.c +++ b/sys/arch/macppc/dev/akbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: akbd.c,v 1.18 2005/11/21 18:16:37 millert Exp $ */ +/* $OpenBSD: akbd.c,v 1.19 2005/12/21 18:50:52 miod Exp $ */ /* $NetBSD: akbd.c,v 1.13 2001/01/25 14:08:55 tsubai Exp $ */ /* @@ -52,13 +52,10 @@ #include <macppc/dev/keyboard.h> #include <macppc/dev/adbvar.h> -#include <macppc/dev/aedvar.h> #include <macppc/dev/akbdmap.h> #include <macppc/dev/akbdvar.h> #include <macppc/dev/amsvar.h> -#include "aed.h" - /* * Function declarations. */ @@ -311,17 +308,11 @@ kbd_processevent(adb_event_t *event, struct akbd_softc *ksc) new_event.u.k.key = event->bytes[0]; new_event.bytes[1] = 0xff; akbd_intr(&new_event); -#if NAED > 0 - aed_input(&new_event); -#endif if (event->bytes[1] != 0xff) { new_event.u.k.key = event->bytes[1]; new_event.bytes[0] = event->bytes[1]; new_event.bytes[1] = 0xff; akbd_intr(&new_event); -#if NAED > 0 - aed_input(&new_event); -#endif } } diff --git a/sys/arch/macppc/dev/ams.c b/sys/arch/macppc/dev/ams.c index 8f70ac9f9f0..e95498d74f3 100644 --- a/sys/arch/macppc/dev/ams.c +++ b/sys/arch/macppc/dev/ams.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ams.c,v 1.11 2005/11/21 18:16:37 millert Exp $ */ +/* $OpenBSD: ams.c,v 1.12 2005/12/21 18:50:52 miod Exp $ */ /* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */ /* @@ -46,11 +46,8 @@ #include <dev/wscons/wsmousevar.h> #include <macppc/dev/adbvar.h> -#include <macppc/dev/aedvar.h> #include <macppc/dev/amsvar.h> -#include "aed.h" - /* * Function declarations. */ @@ -513,9 +510,6 @@ ms_processevent(adb_event_t *event, struct ams_softc *sc) wsmouse_input(sc->sc_wsmousedev, new_event.u.m.buttons, new_event.u.m.dx, -new_event.u.m.dy, 0, WSMOUSE_INPUT_DELTA); -#if NAED > 0 - aed_input(&new_event); -#endif } int diff --git a/sys/arch/macppc/include/conf.h b/sys/arch/macppc/include/conf.h index 0a339454816..c0ff0a84715 100644 --- a/sys/arch/macppc/include/conf.h +++ b/sys/arch/macppc/include/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.9 2003/09/23 16:51:11 millert Exp $ */ +/* $OpenBSD: conf.h,v 1.10 2005/12/21 18:50:52 miod Exp $ */ /* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */ /* @@ -43,6 +43,5 @@ cdev_decl(mm); (dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \ (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) } -cdev_decl(aed); cdev_decl(apm); cdev_decl(zs); |