Home | History | Annotate | Line # | Download | only in dev
kbd.c revision 1.22
      1  1.22       is /*	$NetBSD: kbd.c,v 1.22 1996/05/16 20:18:01 is Exp $	*/
      2  1.11      cgd 
      3   1.1       mw /*
      4   1.1       mw  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
      5   1.1       mw  * All rights reserved.
      6   1.1       mw  *
      7   1.1       mw  * Redistribution and use in source and binary forms, with or without
      8   1.1       mw  * modification, are permitted provided that the following conditions
      9   1.1       mw  * are met:
     10   1.1       mw  * 1. Redistributions of source code must retain the above copyright
     11   1.1       mw  *    notice, this list of conditions and the following disclaimer.
     12   1.1       mw  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.1       mw  *    notice, this list of conditions and the following disclaimer in the
     14   1.1       mw  *    documentation and/or other materials provided with the distribution.
     15   1.1       mw  * 3. All advertising materials mentioning features or use of this software
     16   1.1       mw  *    must display the following acknowledgement:
     17   1.1       mw  *	This product includes software developed by the University of
     18   1.1       mw  *	California, Berkeley and its contributors.
     19   1.1       mw  * 4. Neither the name of the University nor the names of its contributors
     20   1.1       mw  *    may be used to endorse or promote products derived from this software
     21   1.1       mw  *    without specific prior written permission.
     22   1.1       mw  *
     23   1.1       mw  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24   1.1       mw  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25   1.1       mw  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26   1.1       mw  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27   1.1       mw  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28   1.1       mw  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29   1.1       mw  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30   1.1       mw  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31   1.1       mw  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32   1.1       mw  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33   1.1       mw  * SUCH DAMAGE.
     34   1.1       mw  *
     35   1.4       mw  *	kbd.c
     36   1.1       mw  */
     37   1.7   chopps #include <sys/param.h>
     38   1.7   chopps #include <sys/systm.h>
     39   1.9   chopps #include <sys/device.h>
     40   1.7   chopps #include <sys/ioctl.h>
     41   1.7   chopps #include <sys/tty.h>
     42   1.7   chopps #include <sys/proc.h>
     43   1.7   chopps #include <sys/file.h>
     44   1.7   chopps #include <sys/kernel.h>
     45   1.7   chopps #include <sys/syslog.h>
     46  1.18    veego #include <sys/signalvar.h>
     47   1.8   chopps #include <dev/cons.h>
     48   1.7   chopps #include <machine/cpu.h>
     49   1.9   chopps #include <amiga/amiga/device.h>
     50   1.7   chopps #include <amiga/amiga/custom.h>
     51  1.19       is #ifdef DRACO
     52  1.19       is #include <amiga/amiga/drcustom.h>
     53  1.19       is #endif
     54   1.7   chopps #include <amiga/amiga/cia.h>
     55   1.9   chopps #include <amiga/dev/itevar.h>
     56   1.9   chopps #include <amiga/dev/kbdreg.h>
     57  1.18    veego #include <amiga/dev/kbdmap.h>
     58   1.7   chopps #include <amiga/dev/event_var.h>
     59   1.7   chopps #include <amiga/dev/vuid_event.h>
     60   1.9   chopps #include "kbd.h"
     61   1.5       mw 
     62  1.18    veego #include <sys/conf.h>
     63  1.18    veego #include <machine/conf.h>
     64  1.18    veego 
     65   1.5       mw struct kbd_softc {
     66   1.9   chopps 	int k_event_mode;	/* if true, collect events, else pass to ite */
     67   1.9   chopps 	struct evvar k_events;	/* event queue state */
     68  1.19       is #ifdef DRACO
     69  1.19       is 	u_char k_rlprfx;	/* MF-II rel. prefix has been seen */
     70  1.19       is #endif
     71   1.9   chopps };
     72   1.9   chopps struct kbd_softc kbd_softc;
     73   1.9   chopps 
     74  1.17   mhitch int kbdmatch __P((struct device *, void *, void *));
     75  1.17   mhitch void kbdattach __P((struct device *, struct device *, void *));
     76  1.18    veego void kbdintr __P((int));
     77  1.19       is void kbdstuffchar __P((u_char));
     78   1.9   chopps 
     79  1.16  thorpej struct cfattach kbd_ca = {
     80  1.16  thorpej 	sizeof(struct device), kbdmatch, kbdattach
     81  1.16  thorpej };
     82  1.16  thorpej 
     83  1.16  thorpej struct cfdriver kbd_cd = {
     84  1.16  thorpej 	NULL, "kbd", DV_DULL, NULL, 0
     85  1.16  thorpej };
     86   1.9   chopps 
     87   1.9   chopps /*ARGSUSED*/
     88   1.9   chopps int
     89  1.16  thorpej kbdmatch(pdp, match, auxp)
     90   1.9   chopps 	struct device *pdp;
     91  1.16  thorpej 	void *match, *auxp;
     92   1.9   chopps {
     93  1.16  thorpej 
     94   1.9   chopps 	if (matchname((char *)auxp, "kbd"))
     95   1.9   chopps 		return(1);
     96   1.9   chopps 	return(0);
     97   1.9   chopps }
     98   1.9   chopps 
     99   1.9   chopps /*ARGSUSED*/
    100   1.9   chopps void
    101   1.9   chopps kbdattach(pdp, dp, auxp)
    102   1.9   chopps 	struct device *pdp, *dp;
    103   1.9   chopps 	void *auxp;
    104   1.9   chopps {
    105  1.19       is #ifdef DRACO
    106  1.19       is 	/*
    107  1.19       is 	 * XXX Must be kept in sync with kbdenable() switch.
    108  1.19       is 	 * XXX This should be probed, but this way we dont need to initialize
    109  1.19       is 	 * the keyboards.
    110  1.19       is 	 */
    111  1.19       is 	switch (is_draco()) {
    112  1.19       is 		case 0:
    113  1.19       is 		case 1:
    114  1.19       is 		case 2:
    115  1.19       is 			printf(": CIA A type Amiga\n");
    116  1.19       is 			break;
    117  1.19       is 		case 3:
    118  1.19       is 		case 4:
    119  1.19       is 		default:
    120  1.19       is 			printf(": QuickLogic type MF-II\n");
    121  1.19       is 			break;
    122  1.19       is 	}
    123  1.19       is #else
    124  1.19       is 	printf(": CIA A type Amiga\n");
    125  1.19       is #endif
    126  1.19       is 
    127   1.9   chopps }
    128   1.5       mw 
    129   1.5       mw /* definitions for amiga keyboard encoding. */
    130   1.5       mw #define KEY_CODE(c)  ((c) & 0x7f)
    131   1.5       mw #define KEY_UP(c)    ((c) & 0x80)
    132   1.5       mw 
    133   1.1       mw void
    134  1.18    veego kbdenable()
    135   1.1       mw {
    136   1.9   chopps 	int s;
    137  1.22       is 
    138  1.21       is #ifdef DRACO
    139  1.21       is 	u_char c;
    140  1.21       is #endif
    141   1.9   chopps 	/*
    142   1.9   chopps 	 * collides with external ints from SCSI, watch out for this when
    143   1.9   chopps 	 * enabling/disabling interrupts there !!
    144   1.9   chopps 	 */
    145   1.9   chopps 	s = spltty();
    146  1.19       is #ifdef DRACO
    147  1.19       is 	switch (is_draco()) {
    148  1.19       is 		case 0:
    149  1.19       is 			custom.intena = INTF_SETCLR | INTF_PORTS;
    150  1.19       is 
    151  1.19       is 			ciaa.icr = CIA_ICR_IR_SC | CIA_ICR_SP;
    152  1.19       is 						/* SP interrupt enable */
    153  1.19       is 			ciaa.cra &= ~(1<<6);	/* serial line == input */
    154  1.19       is 			printf("ok.\n");
    155  1.19       is 			break;
    156  1.19       is 		case 1:
    157  1.19       is 		case 2:
    158  1.19       is 			/* XXX: tobedone: conditionally enable that one */
    159  1.19       is 			/* XXX: for now, just enable DraCo ports and CIA */
    160  1.19       is 			*draco_intena |= DRIRQ_INT2;
    161  1.19       is 			ciaa.icr = CIA_ICR_IR_SC | CIA_ICR_SP;
    162  1.19       is 						/* SP interrupt enable */
    163  1.19       is 			ciaa.cra &= ~(1<<6);	/* serial line == input */
    164  1.19       is 			break;
    165  1.19       is 
    166  1.19       is 		case 3:
    167  1.19       is 			ciaa.icr = CIA_ICR_SP;  /* CIA SP interrupt disable */
    168  1.19       is 			ciaa.cra &= ~(1<<6);	/* serial line == input */
    169  1.19       is 			/* FALLTHROUGH */
    170  1.19       is 		case 4:
    171  1.19       is 		default:
    172  1.19       is 			/* XXX: for now: always enable own keyboard */
    173  1.19       is 
    174  1.19       is 			while (draco_ioct->io_status & DRSTAT_KBDRECV) {
    175  1.19       is 				c = draco_ioct->io_kbddata;
    176  1.19       is 				draco_ioct->io_kbdrst = 0;
    177  1.19       is 				printf(".");
    178  1.19       is 				DELAY(2000);
    179  1.19       is 			}
    180  1.19       is 
    181  1.19       is 			draco_ioct->io_control &= ~DRCNTRL_KBDINTENA;
    182  1.19       is 			break;
    183  1.19       is 	}
    184  1.19       is #else
    185   1.9   chopps 	custom.intena = INTF_SETCLR | INTF_PORTS;
    186   1.9   chopps 	ciaa.icr = CIA_ICR_IR_SC | CIA_ICR_SP;  /* SP interrupt enable */
    187   1.9   chopps 	ciaa.cra &= ~(1<<6);		/* serial line == input */
    188  1.19       is #endif
    189   1.9   chopps 	kbd_softc.k_event_mode = 0;
    190   1.9   chopps 	kbd_softc.k_events.ev_io = 0;
    191   1.9   chopps 	splx(s);
    192   1.1       mw }
    193   1.1       mw 
    194   1.1       mw 
    195   1.1       mw int
    196  1.18    veego kbdopen(dev, flags, mode, p)
    197  1.18    veego 	dev_t dev;
    198  1.18    veego 	int flags, mode;
    199  1.18    veego 	struct proc *p;
    200   1.5       mw {
    201   1.5       mw 
    202  1.18    veego 	if (kbd_softc.k_events.ev_io)
    203  1.18    veego 		return EBUSY;
    204   1.5       mw 
    205  1.18    veego 	kbd_softc.k_events.ev_io = p;
    206  1.18    veego 	ev_init(&kbd_softc.k_events);
    207  1.18    veego 	return (0);
    208   1.5       mw }
    209   1.5       mw 
    210   1.5       mw int
    211  1.18    veego kbdclose(dev, flags, mode, p)
    212  1.18    veego 	dev_t dev;
    213  1.18    veego 	int flags, mode;
    214  1.18    veego 	struct proc *p;
    215   1.5       mw {
    216  1.18    veego 
    217  1.18    veego 	/* Turn off event mode, dump the queue */
    218  1.18    veego 	kbd_softc.k_event_mode = 0;
    219  1.18    veego 	ev_fini(&kbd_softc.k_events);
    220  1.18    veego 	kbd_softc.k_events.ev_io = NULL;
    221  1.18    veego 	return (0);
    222   1.5       mw }
    223   1.5       mw 
    224   1.5       mw int
    225  1.18    veego kbdread(dev, uio, flags)
    226  1.18    veego 	dev_t dev;
    227  1.18    veego 	struct uio *uio;
    228  1.18    veego 	int flags;
    229   1.5       mw {
    230  1.18    veego 	return ev_read (&kbd_softc.k_events, uio, flags);
    231   1.5       mw }
    232   1.5       mw 
    233   1.5       mw int
    234  1.18    veego kbdioctl(dev, cmd, data, flag, p)
    235  1.18    veego 	dev_t dev;
    236  1.18    veego 	u_long cmd;
    237  1.18    veego 	register caddr_t data;
    238  1.18    veego 	int flag;
    239  1.18    veego 	struct proc *p;
    240   1.5       mw {
    241  1.18    veego 	register struct kbd_softc *k = &kbd_softc;
    242  1.18    veego 
    243  1.18    veego 	switch (cmd) {
    244  1.18    veego 		case KIOCTRANS:
    245  1.18    veego 			if (*(int *)data == TR_UNTRANS_EVENT)
    246  1.18    veego 				return 0;
    247  1.18    veego 			break;
    248  1.18    veego 
    249  1.18    veego 		case KIOCGTRANS:
    250  1.18    veego 			/* Get translation mode */
    251  1.18    veego 			*(int *)data = TR_UNTRANS_EVENT;
    252  1.18    veego 			return 0;
    253  1.18    veego 
    254  1.18    veego 		case KIOCSDIRECT:
    255  1.18    veego 			k->k_event_mode = *(int *)data;
    256  1.18    veego 			return 0;
    257  1.18    veego 
    258  1.18    veego 		case FIONBIO:	/* we will remove this someday (soon???) */
    259  1.18    veego 			return 0;
    260  1.18    veego 
    261  1.18    veego 		case FIOASYNC:
    262  1.18    veego 			k->k_events.ev_async = *(int *)data != 0;
    263  1.18    veego 			return 0;
    264  1.18    veego 
    265  1.18    veego 		case TIOCSPGRP:
    266  1.18    veego 			if (*(int *)data != k->k_events.ev_io->p_pgid)
    267  1.18    veego 				return EPERM;
    268  1.18    veego 			return 0;
    269  1.18    veego 
    270  1.18    veego 		default:
    271  1.18    veego 			return ENOTTY;
    272  1.18    veego 	}
    273   1.5       mw 
    274  1.18    veego 	/* We identified the ioctl, but we do not handle it. */
    275  1.18    veego 	return EOPNOTSUPP;	/* misuse, but what the heck */
    276   1.5       mw }
    277   1.5       mw 
    278   1.5       mw int
    279  1.18    veego kbdselect(dev, rw, p)
    280  1.18    veego 	dev_t dev;
    281  1.18    veego 	int rw;
    282  1.18    veego 	struct proc *p;
    283   1.5       mw {
    284  1.18    veego 	return ev_select (&kbd_softc.k_events, rw, p);
    285   1.5       mw }
    286   1.5       mw 
    287   1.5       mw 
    288  1.18    veego void
    289  1.18    veego kbdintr(mask)
    290  1.18    veego 	int mask;
    291   1.1       mw {
    292  1.18    veego 	u_char c;
    293  1.13   chopps #ifdef KBDRESET
    294  1.18    veego 	static int reset_warn;
    295  1.13   chopps #endif
    296   1.1       mw 
    297  1.19       is 	/*
    298  1.19       is 	 * now only invoked from generic CIA interrupt handler if there *is*
    299  1.18    veego 	 * a keyboard interrupt pending
    300  1.18    veego 	 */
    301   1.1       mw 
    302  1.18    veego 	c = ~ciaa.sdr;	/* keyboard data is inverted */
    303  1.18    veego 	/* ack */
    304  1.18    veego 	ciaa.cra |= (1 << 6);	/* serial line output */
    305  1.13   chopps #ifdef KBDRESET
    306  1.18    veego 	if (reset_warn && c == 0xf0) {
    307  1.13   chopps #ifdef DEBUG
    308  1.18    veego 		printf ("kbdintr: !!!! Reset Warning !!!!\n");
    309  1.13   chopps #endif
    310  1.18    veego 		bootsync();
    311  1.18    veego 		reset_warn = 0;
    312  1.18    veego 		DELAY(30000000);
    313  1.18    veego 	}
    314  1.13   chopps #endif
    315  1.18    veego 	/* wait 200 microseconds (for bloody Cherry keyboards..) */
    316  1.18    veego 	DELAY(2000);			/* fudge delay a bit for some keyboards */
    317  1.18    veego 	ciaa.cra &= ~(1 << 6);
    318  1.18    veego 
    319  1.18    veego 	/* process the character */
    320  1.18    veego 	c = (c >> 1) | (c << 7);	/* rotate right once */
    321   1.1       mw 
    322  1.13   chopps #ifdef KBDRESET
    323  1.18    veego 	if (c == 0x78) {
    324  1.13   chopps #ifdef DEBUG
    325  1.18    veego 		printf ("kbdintr: Reset Warning started\n");
    326  1.13   chopps #endif
    327  1.18    veego 		++reset_warn;
    328  1.18    veego 		return;
    329  1.18    veego 	}
    330  1.13   chopps #endif
    331  1.19       is 	kbdstuffchar(c);
    332  1.19       is }
    333  1.19       is 
    334  1.19       is #ifdef DRACO
    335  1.19       is /* maps MF-II keycodes to Amiga keycodes */
    336  1.19       is 
    337  1.19       is u_char drkbdtab[] = {
    338  1.19       is 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50,
    339  1.19       is 	0x45, 0xff, 0xff, 0xff, 0xff, 0x42, 0x00, 0x51,
    340  1.19       is 
    341  1.19       is 	0xff, 0x64, 0x60, 0x30, 0x63, 0x10, 0x01, 0x52,
    342  1.19       is 	0xff, 0x66, 0x31, 0x21, 0x20, 0x11, 0x02, 0x53,
    343  1.19       is 
    344  1.19       is 	0xff, 0x33, 0x32, 0x22, 0x12, 0x04, 0x03, 0x54,
    345  1.19       is 	0xff, 0x40, 0x34, 0x23, 0x14, 0x13, 0x05, 0x55,
    346  1.19       is 
    347  1.19       is 	0xff, 0x36, 0x35, 0x25, 0x24, 0x15, 0x06, 0x56,
    348  1.19       is 	0xff, 0x67, 0x37, 0x26, 0x16, 0x07, 0x08, 0x57,
    349  1.19       is 	/* --- */
    350  1.19       is 	0xff, 0x38, 0x27, 0x17, 0x18, 0x0a, 0x09, 0x58,
    351  1.19       is 	0xff, 0x39, 0x3a, 0x28, 0x29, 0x19, 0x0b, 0x59,
    352  1.19       is 
    353  1.19       is 	0xff, 0xff, 0x2a, 0x2b, 0x1a, 0x0c, 0x4b, 0xff,
    354  1.19       is 	0x65, 0x61, 0x44, 0x1b, 0xff, 0xff, 0x6f, 0xff,
    355  1.19       is 
    356  1.19       is 	0x4d, 0x4f, 0xff, 0x4c, 0x0d, 0xff, 0x41, 0x46,
    357  1.19       is 	0xff, 0x1d, 0x4e, 0x2d, 0x3d, 0x4a, 0x5f, 0x62,
    358  1.19       is 
    359  1.19       is 	0x0f, 0x3c, 0x1e, 0x2e, 0x2f, 0x3e, 0x5a, 0x5b,
    360  1.19       is 	0xff, 0x43, 0x1f, 0xff, 0x5e, 0x3f, 0x5c, 0xff,
    361  1.19       is 	/* --- */
    362  1.19       is 	0xff, 0xff, 0xff, 0xff, 0x5d
    363  1.19       is };
    364  1.19       is #endif
    365  1.19       is 
    366  1.19       is 
    367  1.19       is int
    368  1.19       is kbdgetcn ()
    369  1.19       is {
    370  1.19       is 	int s;
    371  1.19       is 	u_char ints, mask, c, in;
    372  1.19       is 
    373  1.19       is #ifdef DRACO
    374  1.19       is 	/*
    375  1.19       is 	 * XXX todo: if CIA DraCo, get from cia if cia kbd
    376  1.19       is 	 * installed.
    377  1.19       is 	 */
    378  1.19       is 	if (is_draco()) {
    379  1.19       is 		c = 0;
    380  1.19       is 		s = spltty ();
    381  1.19       is 		while ((draco_ioct->io_status & DRSTAT_KBDRECV) == 0);
    382  1.19       is 		in = draco_ioct->io_kbddata;
    383  1.19       is 		draco_ioct->io_kbdrst = 0;
    384  1.19       is 		if (in == 0xF0) { /* release prefix */
    385  1.19       is 			c = 0x80;
    386  1.19       is 			while ((draco_ioct->io_status & DRSTAT_KBDRECV) == 0);
    387  1.19       is 			in = draco_ioct->io_kbddata;
    388  1.19       is 			draco_ioct->io_kbdrst = 0;
    389  1.19       is 		}
    390  1.19       is 		splx(s);
    391  1.19       is #ifdef DRACORAWKEYDEBUG
    392  1.19       is 		printf("<%02x>", in);
    393  1.19       is #endif
    394  1.19       is 		return (in>=sizeof(drkbdtab) ? 0xff : drkbdtab[in]|c);
    395  1.19       is 	}
    396  1.19       is #endif
    397  1.19       is 	s = spltty();
    398  1.19       is 	for (ints = 0; ! ((mask = ciaa.icr) & CIA_ICR_SP);
    399  1.19       is 	    ints |= mask) ;
    400  1.19       is 
    401  1.19       is 	in = ciaa.sdr;
    402  1.19       is 	c = ~in;
    403  1.19       is 
    404  1.19       is 	/* ack */
    405  1.19       is 	ciaa.cra |= (1 << 6);	/* serial line output */
    406  1.19       is 	ciaa.sdr = 0xff;	/* ack */
    407  1.19       is 	/* wait 200 microseconds */
    408  1.19       is 	DELAY(2000);	/* XXXX only works as long as DELAY doesn't
    409  1.19       is 			 * use a timer and waits.. */
    410  1.19       is 	ciaa.cra &= ~(1 << 6);
    411  1.19       is 	ciaa.sdr = in;
    412  1.19       is 
    413  1.19       is 	splx (s);
    414  1.19       is 	c = (c >> 1) | (c << 7);
    415  1.19       is 
    416  1.19       is 	/* take care that no CIA-interrupts are lost */
    417  1.19       is 	if (ints)
    418  1.19       is 		dispatch_cia_ints (0, ints);
    419  1.19       is 
    420  1.19       is 	return c;
    421  1.19       is }
    422  1.19       is 
    423  1.19       is void
    424  1.19       is kbdstuffchar(c)
    425  1.19       is 	u_char c;
    426  1.19       is {
    427  1.19       is 	struct firm_event *fe;
    428  1.19       is 	struct kbd_softc *k = &kbd_softc;
    429  1.19       is 	int put;
    430  1.19       is 
    431  1.19       is 	/*
    432  1.19       is 	 * If not in event mode, deliver straight to ite to process
    433  1.19       is 	 * key stroke
    434  1.19       is 	 */
    435  1.19       is 
    436  1.18    veego 	if (! k->k_event_mode) {
    437  1.18    veego 		ite_filter (c, ITEFILT_TTY);
    438  1.18    veego 		return;
    439  1.18    veego 	}
    440  1.18    veego 
    441  1.19       is 	/*
    442  1.19       is 	 * Keyboard is generating events. Turn this keystroke into an
    443  1.19       is 	 * event and put it in the queue. If the queue is full, the
    444  1.18    veego 	 * keystroke is lost (sorry!).
    445  1.18    veego 	 */
    446  1.19       is 
    447  1.18    veego 	put = k->k_events.ev_put;
    448  1.18    veego 	fe = &k->k_events.ev_q[put];
    449  1.18    veego 	put = (put + 1) % EV_QSIZE;
    450  1.18    veego 	if (put == k->k_events.ev_get) {
    451  1.19       is 		log(LOG_WARNING, "keyboard event queue overflow\n");
    452  1.19       is 			/* ??? */
    453  1.18    veego 		return;
    454  1.18    veego 	}
    455  1.18    veego 	fe->id = KEY_CODE(c);
    456  1.18    veego 	fe->value = KEY_UP(c) ? VKEY_UP : VKEY_DOWN;
    457  1.18    veego 	fe->time = time;
    458  1.18    veego 	k->k_events.ev_put = put;
    459  1.18    veego 	EV_WAKEUP(&k->k_events);
    460   1.1       mw }
    461   1.1       mw 
    462   1.1       mw 
    463  1.19       is #ifdef DRACO
    464  1.19       is void
    465  1.19       is drkbdintr()
    466   1.1       mw {
    467  1.19       is 	u_char in;
    468  1.19       is 	struct kbd_softc *k = &kbd_softc;
    469  1.18    veego 
    470  1.19       is 	in = draco_ioct->io_kbddata;
    471  1.19       is 	draco_ioct->io_kbdrst = 0;
    472   1.1       mw 
    473  1.19       is 	if (in == 0xF0)
    474  1.19       is 		k->k_rlprfx = 0x80;
    475  1.19       is 	else {
    476  1.19       is 		kbdstuffchar(in>=sizeof(drkbdtab) ? 0xff :
    477  1.19       is 		    drkbdtab[in] | k->k_rlprfx);
    478  1.19       is 		k->k_rlprfx = 0;
    479  1.19       is 	}
    480  1.19       is }
    481   1.1       mw 
    482  1.19       is #endif
    483