These files have never been used; remove them.

This commit is contained in:
ragge 1998-06-20 18:44:16 +00:00
parent ec35b60cdb
commit 3b6ba87592
3 changed files with 0 additions and 1590 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,170 +0,0 @@
/* $NetBSD: dc7085cons.h,v 1.1 1996/07/20 18:55:10 ragge Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell and Rick Macklem.
*
* 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 the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
*
* @(#)dc7085cons.h 8.1 (Berkeley) 6/10/93
*
* dc7085.h --
*
* Definitions for the dc7085 chip.
*
* Copyright (C) 1989 Digital Equipment Corporation.
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appears in all copies.
* Digital Equipment Corporation makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* from: Header: /sprite/src/kernel/dev/ds3100.md/RCS/dc7085.h,
*
* v 1.4 89/08/15 19:52:46 rab Exp SPRITE (DECWRL)
*/
#ifndef _DC7085
#define _DC7085
typedef volatile struct dc7085regs {
u_short dc_csr; /* control and status (R/W) */
u_short pad0;
short dc_rbuf_lpr; /* receiver data (R), line params (W) */
u_short pad1;
u_short dc_tcr; /* transmitter control (R/W) */
u_short pad2;
u_short dc_msr_tdr; /* modem status (R), transmit data (W) */
} dcregs;
#define dc_rbuf dc_rbuf_lpr
#define dc_lpr dc_rbuf_lpr
#define dc_msr dc_msr_tdr
#define dc_tdr dc_msr_tdr
/*
* Control status register bits.
*/
#define CSR_TRDY 0x8000
#define CSR_TIE 0x4000 /* not avail on VS2000 */
#define CSR_TX_LINE_NUM 0x0300
#define CSR_RDONE 0x0080
#define CSR_RIE 0x0040 /* not avail on VS2000 */
#define CSR_MSE 0x0020
#define CSR_CLR 0x0010
#define CSR_MAINT 0x0008
/*
* Receiver buffer register bits.
*/
#define RBUF_DVAL 0x8000
#define RBUF_OERR 0x4000
#define RBUF_FERR 0x2000
#define RBUF_PERR 0x1000
#define RBUF_LINE_NUM 0x0300
#define RBUF_LINE_NUM_SHIFT 8
#define RBUF_CHAR 0x00FF
/*
* Transmit control register values.
*/
#define TCR_DTR2 0x0400
#define TCR_EN3 0x0008
#define TCR_EN2 0x0004
#define TCR_EN1 0x0002
#define TCR_EN0 0x0001
#define TCR_RTS2 0x0800 /* VS2000: LLBK_2 */
#define TCR_RTS3 0x0200 /* VS2000: DSRS_2 */
#define TCR_DTR3 0x0100 /* VS2000: RTS_2 */
/*
* Line parameter register bits.
*/
#define LPR_RXENAB 0x1000
#define LPR_B50 0x0000
#define LPR_B75 0x0100
#define LPR_B110 0x0200
#define LPR_B134 0x0300
#define LPR_B150 0x0400
#define LPR_B300 0x0500
#define LPR_B600 0x0600
#define LPR_B1200 0x0700
#define LPR_B1800 0x0800
#define LPR_B2000 0x0900
#define LPR_B2400 0x0A00
#define LPR_B3600 0x0B00
#define LPR_B4800 0x0C00
#define LPR_B7200 0x0D00
#define LPR_B9600 0x0E00
#define LPR_B19200 0x0F00
#define LPR_B38400 0x0F00
#define LPR_OPAR 0x0080
#define LPR_PARENB 0x0040
#define LPR_2_STOP 0x0020
#define LPR_8_BIT_CHAR 0x0018
#define LPR_7_BIT_CHAR 0x0010
#define LPR_6_BIT_CHAR 0x0008
#define LPR_5_BIT_CHAR 0x0000
/*
* Modem status register bits.
*/
#define MSR_DSR2 0x0200
#define MSR_RI2 0x0800 /* VS2000: 0x0004 */
#define MSR_CD2 0x0400
#define MSR_CTS2 0x0100
#define MSR_RI3 0x0008 /* VS2000: not used/available */
#define MSR_CD3 0x0004 /* VS2000: RI2 */
#define MSR_DSR3 0x0002 /* VS2000: MBZ */
#define MSR_CTS3 0x0001 /* VS2000: TMI_2 */
/*
* The four serial ports.
*/
#define DCKBD_PORT 0
#define DCMOUSE_PORT 1
#define DCCOMM_PORT 2
#define DCPRINTER_PORT 3
/* bits in dm lsr, copied from dmreg.h */
#define DML_DSR 0000400 /* data set ready, not a real DM bit */
#define DML_RNG 0000200 /* ring */
#define DML_CAR 0000100 /* carrier detect */
#define DML_CTS 0000040 /* clear to send */
#define DML_SR 0000020 /* secondary receive */
#define DML_ST 0000010 /* secondary transmit */
#define DML_RTS 0000004 /* request to send */
#define DML_DTR 0000002 /* data terminal ready */
#define DML_LE 0000001 /* line enable */
#endif /* _DC7085 */

View File

@ -1,397 +0,0 @@
/* $NetBSD: lk201.c,v 1.5 1998/03/22 09:37:47 jonathan Exp $ */
/*
* The LK201 keycode mapping routine is here, along with initialization
* functions for the keyboard and mouse.
*/
#include <sys/param.h>
#include <sys/syslog.h>
#include <sys/select.h>
#include <dev/cons.h>
#include <dev/dec/lk201.h>
#include <pmax/include/pmioctl.h>
/* Exported functions */
extern int kbdMapChar __P((int keycode));
extern void KBDReset __P(( dev_t dev, void (*putc) (dev_t, int) ));
/*
* Keyboard to Ascii, unshifted.
*/
static unsigned char unshiftedAscii[] = {
/* 0 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 4 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 8 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 10 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 14 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 18 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 1c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 20 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 24 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 28 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 2c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 30 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 34 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 38 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 3c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 40 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 44 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 48 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 4c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 50 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 54 */ KBD_NOKEY, KBD_NOKEY, KBD_F1, KBD_F2,
/* 58 */ KBD_F3, KBD_F4, KBD_F5, KBD_NOKEY,
/* 5c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 60 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 64 */ KBD_F6, KBD_F7, KBD_F8, KBD_F9,
/* 68 */ KBD_F10, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 6c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 70 */ KBD_NOKEY, '\033', KBD_F12, KBD_F13,
/* 74 */ KBD_F14, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 78 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 7c */ KBD_HELP, KBD_DO, KBD_NOKEY, KBD_NOKEY,
/* 80 */ KBD_F17, KBD_F18, KBD_F19, KBD_F20,
/* 84 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 88 */ KBD_NOKEY, KBD_NOKEY, KBD_FIND, KBD_INSERT,
/* 8c */ KBD_REMOVE, KBD_SELECT, KBD_PREVIOUS, KBD_NEXT,
/* 90 */ KBD_NOKEY, KBD_NOKEY, '0', KBD_NOKEY,
/* 94 */ '.', KBD_KP_ENTER, '1', '2',
/* 98 */ '3', '4', '5', '6',
/* 9c */ ',', '7', '8', '9',
/* a0 */ '-', KBD_KP_F1, KBD_KP_F2, KBD_KP_F3,
/* a4 */ KBD_KP_F4, KBD_NOKEY, KBD_NOKEY, KBD_LEFT,
/* a8 */ KBD_RIGHT, KBD_DOWN, KBD_UP, KBD_NOKEY,
/* ac */ KBD_NOKEY, KBD_NOKEY, KBD_SHIFT, KBD_CONTROL,
/* b0 */ KBD_CAPSLOCK, KBD_ALTERNATE, KBD_NOKEY, KBD_NOKEY,
/* b4 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* b8 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* bc */ KBD_DEL, KBD_RET, KBD_TAB, '`',
/* c0 */ '1', 'q', 'a', 'z',
/* c4 */ KBD_NOKEY, '2', 'w', 's',
/* c8 */ 'x', '<', KBD_NOKEY, '3',
/* cc */ 'e', 'd', 'c', KBD_NOKEY,
/* d0 */ '4', 'r', 'f', 'v',
/* d4 */ ' ', KBD_NOKEY, '5', 't',
/* d8 */ 'g', 'b', KBD_NOKEY, '6',
/* dc */ 'y', 'h', 'n', KBD_NOKEY,
/* e0 */ '7', 'u', 'j', 'm',
/* e4 */ KBD_NOKEY, '8', 'i', 'k',
/* e8 */ ',', KBD_NOKEY, '9', 'o',
/* ec */ 'l', '.', KBD_NOKEY, '0',
/* f0 */ 'p', KBD_NOKEY, ';', '/',
/* f4 */ KBD_NOKEY, '=', ']', '\\',
/* f8 */ KBD_NOKEY, '-', '[', '\'',
/* fc */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
};
/*
* Keyboard to Ascii, shifted.
*/
static unsigned char shiftedAscii[] = {
/* 0 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 4 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 8 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 10 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 14 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 18 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 1c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 20 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 24 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 28 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 2c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 30 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 34 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 38 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 3c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 40 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 44 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 48 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 4c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 50 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 54 */ KBD_NOKEY, KBD_NOKEY, KBD_F1, KBD_F2,
/* 58 */ KBD_F3, KBD_F4, KBD_F5, KBD_NOKEY,
/* 5c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 60 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 64 */ KBD_F6, KBD_F7, KBD_F8, KBD_F9,
/* 68 */ KBD_F10, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 6c */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 70 */ KBD_NOKEY, KBD_F11, KBD_F12, KBD_F13,
/* 74 */ KBD_F14, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 78 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 7c */ KBD_HELP, KBD_DO, KBD_NOKEY, KBD_NOKEY,
/* 80 */ KBD_F17, KBD_F18, KBD_F19, KBD_F20,
/* 84 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* 88 */ KBD_NOKEY, KBD_NOKEY, KBD_FIND, KBD_INSERT,
/* 8c */ KBD_REMOVE, KBD_SELECT, KBD_PREVIOUS, KBD_NEXT,
/* 90 */ KBD_NOKEY, KBD_NOKEY, '0', KBD_NOKEY,
/* 94 */ '.', KBD_KP_ENTER, '1', '2',
/* 98 */ '3', '4', '5', '6',
/* 9c */ ',', '7', '8', '9',
/* a0 */ '-', KBD_KP_F1, KBD_KP_F2, KBD_KP_F3,
/* a4 */ KBD_KP_F4, KBD_NOKEY, KBD_NOKEY, KBD_LEFT,
/* a8 */ KBD_RIGHT, KBD_DOWN, KBD_UP, KBD_NOKEY,
/* ac */ KBD_NOKEY, KBD_NOKEY, KBD_SHIFT, KBD_CONTROL,
/* b0 */ KBD_CAPSLOCK, KBD_ALTERNATE, KBD_NOKEY, KBD_NOKEY,
/* b4 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* b8 */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
/* bc */ KBD_DEL, KBD_RET, KBD_TAB, '~',
/* c0 */ '!', 'q', 'a', 'z',
/* c4 */ KBD_NOKEY, '@', 'w', 's',
/* c8 */ 'x', '>', KBD_NOKEY, '#',
/* cc */ 'e', 'd', 'c', KBD_NOKEY,
/* d0 */ '$', 'r', 'f', 'v',
/* d4 */ ' ', KBD_NOKEY, '%', 't',
/* d8 */ 'g', 'b', KBD_NOKEY, '^',
/* dc */ 'y', 'h', 'n', KBD_NOKEY,
/* e0 */ '&', 'u', 'j', 'm',
/* e4 */ KBD_NOKEY, '*', 'i', 'k',
/* e8 */ '<', KBD_NOKEY, '(', 'o',
/* ec */ 'l', '>', KBD_NOKEY, ')',
/* f0 */ 'p', KBD_NOKEY, ':', '?',
/* f4 */ KBD_NOKEY, '+', '}', '|',
/* f8 */ KBD_NOKEY, '_', '{', '"',
/* fc */ KBD_NOKEY, KBD_NOKEY, KBD_NOKEY, KBD_NOKEY,
};
/*
* Keyboard initialization string.
*/
static u_char kbdInitString[] = {
LK_LED_ENABLE, LED_ALL, /* show we are resetting keyboard */
LK_DEFAULTS,
LK_CMD_MODE(LK_AUTODOWN, 1),
LK_CMD_MODE(LK_AUTODOWN, 2),
LK_CMD_MODE(LK_AUTODOWN, 3),
LK_CMD_MODE(LK_DOWN, 4), /* could also be LK_AUTODOWN */
LK_CMD_MODE(LK_UPDOWN, 5),
LK_CMD_MODE(LK_UPDOWN, 6),
LK_CMD_MODE(LK_AUTODOWN, 7),
LK_CMD_MODE(LK_AUTODOWN, 8),
LK_CMD_MODE(LK_AUTODOWN, 9),
LK_CMD_MODE(LK_AUTODOWN, 10),
LK_CMD_MODE(LK_AUTODOWN, 11),
LK_CMD_MODE(LK_AUTODOWN, 12),
LK_CMD_MODE(LK_DOWN, 13),
LK_CMD_MODE(LK_AUTODOWN, 14),
LK_AR_ENABLE, /* we want autorepeat by default */
LK_CL_ENABLE, 0x83, /* keyclick, volume */
LK_KBD_ENABLE, /* the keyboard itself */
LK_BELL_ENABLE, 0x83, /* keyboard bell, volume */
LK_LED_DISABLE, LED_ALL, /* clear keyboard leds */
};
/*
* Initialize the Keyboard.
*/
void
KBDReset(kbddev, putc)
dev_t kbddev;
void (*putc) __P((dev_t, int));
{
register int i;
static int inKBDReset;
if (inKBDReset)
return;
inKBDReset = 1;
for (i = 0; i < sizeof(kbdInitString); i++)
(*putc)(kbddev, (int)kbdInitString[i]);
inKBDReset = 0;
}
/*
* ----------------------------------------------------------------------------
*
* kbdMapChar --
*
* Map characters from the keyboard to ASCII. Return -1 if there is
* no valid mapping.
*
* Results:
* None.
*
* Side effects:
* Remember state of shift and control keys.
*
* ----------------------------------------------------------------------------
*/
int
kbdMapChar(cc)
int cc;
{
static u_char shiftDown;
static u_char ctrlDown;
static u_char lastChar;
switch (cc) {
case KEY_REPEAT:
cc = lastChar;
goto done;
case KEY_UP:
shiftDown = 0;
ctrlDown = 0;
return (-1);
case KEY_SHIFT:
case KEY_R_SHIFT:
if (ctrlDown || shiftDown)
shiftDown = 0;
else
shiftDown = 1;
return (-1);
case KEY_CONTROL:
if (shiftDown || ctrlDown)
ctrlDown = 0;
else
ctrlDown = 1;
return (-1);
case LK_POWER_ERROR:
case LK_KDOWN_ERROR:
case LK_INPUT_ERROR:
case LK_OUTPUT_ERROR:
log(LOG_WARNING,
"lk201: keyboard error, code=%x\n", cc);
return (-1);
}
if (shiftDown)
cc = shiftedAscii[cc];
else
cc = unshiftedAscii[cc];
if (cc >= KBD_NOKEY) {
/*
* A function key was typed - ignore it.
*/
return (-1);
}
if (cc >= 'a' && cc <= 'z') {
if (ctrlDown)
cc = cc - 'a' + '\1'; /* ^A */
else if (shiftDown)
cc = cc - 'a' + 'A';
} else if (ctrlDown) {
if (cc >= '[' && cc <= '_')
cc = cc - '@';
else if (cc == ' ' || cc == '@')
cc = '\0';
}
lastChar = cc;
done:
return (cc);
}
static int (*raw_kbd_getc) __P((dev_t dev)) = NULL;
static dev_t lk_in_dev = NODEV;
/*
* Divert input from a serial port to the lk-201 keyboard handler.
*/
void
lk_divert(getfn, in_dev)
int (*getfn) __P ((dev_t dev)) ;
dev_t in_dev;
{
raw_kbd_getc = getfn;
lk_in_dev = in_dev;
}
/*
* Get an ASCII character off of the keyboard.
* Simply pass the getc request onto the underlying
* serial driver, and map the resulting LK-201 keycode to ASCII.
* FIXME: this design can't handle cursor or keypad keys,
* and should be thrown away and replaced with a stackable
* "Bstreams"-style driver.
*/
int
LKgetc(dev)
dev_t dev; /* ignored */
{
register int c;
extern sccGetc();
#if 0
/*XXX*/ printf("LK-201 getc 0x%x( [%d %d]) in_dev [%d %d]\n",
raw_kbd_getc,
major(dev), minor(dev),
major(lk_in_dev), minor(lk_in_dev));
#endif
if (raw_kbd_getc == NULL) {
panic("Reading from LK-201 before keyboard driver diverted\n");
return (-1);
}
for (;;) {
/* c = (*cn_tab.cn_kbdgetc)(cn_tab.cn_dev); */
c = (*raw_kbd_getc) (lk_in_dev);
#if 0
/*XXX*/ printf(" 0x%x [%c]", c, c);
#endif
if (c == 0)
return (-1);
if ((c = kbdMapChar(c & 0xff)) >= 0)
break;
}
return (c);
}
/*
* Initialize the mouse. (Doesn't really belong here.)
*/
void
MouseInit(mdev, putc, getc)
dev_t mdev;
void (*putc) __P((dev_t, int));
int (*getc) __P((dev_t));
{
int id_byte1, id_byte2, id_byte3, id_byte4;
/*
* Initialize the mouse.
*/
(*putc)(mdev, MOUSE_SELF_TEST);
id_byte1 = (*getc)(mdev);
if (id_byte1 < 0) {
printf("MouseInit: Timeout on 1st byte of self-test report\n");
return;
}
id_byte2 = (*getc)(mdev);
if (id_byte2 < 0) {
printf("MouseInit: Timeout on 2nd byte of self-test report\n");
return;
}
id_byte3 = (*getc)(mdev);
if (id_byte3 < 0) {
printf("MouseInit: Timeout on 3rd byte of self-test report\n");
return;
}
id_byte4 = (*getc)(mdev);
if (id_byte4 < 0) {
printf("MouseInit: Timeout on 4th byte of self-test report\n");
return;
}
if ((id_byte2 & 0x0f) != 0x2)
printf("MouseInit: We don't have a mouse!!!\n");
/*
* For some reason, the mouse doesn't see this command if it comes
* too soon after a self test.
*/
DELAY(150);
(*putc)(mdev, MOUSE_INCREMENTAL);
}