Add a flags variable to dc softc, and when attaching a dc determine

(via systype) whether or not it is possible for a keyboard and mouse
to be attached.  The console on a 5100 now works!
This commit is contained in:
simonb 1999-12-03 13:07:35 +00:00
parent 54c58da2e5
commit 04f70ed884
2 changed files with 44 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dc.c,v 1.52 1999/11/29 15:02:38 ad Exp $ */
/* $NetBSD: dc.c,v 1.53 1999/12/03 13:07:35 simonb Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.52 1999/11/29 15:02:38 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.53 1999/12/03 13:07:35 simonb Exp $");
/*
* devDC7085.c --
@ -302,7 +302,19 @@ dcattach(sc, addr, dtr_mask, rtscts_mask, speed,
sc->dc_19200 = speed;
sc->dc_modem = dtr_mask;
sc->dc_rtscts = rtscts_mask;
sc->dc_flags = 0;
switch (systype) {
case DS_PMAX:
case DS_3MAX:
sc->dc_flags |= DC_KBDMOUSE;
break;
case DS_MIPSMATE:
break;
default:
/* XXX error?? */
break;
}
/*
* Special handling for consoles.
@ -771,35 +783,37 @@ dcrint(sc)
(c >> 8) & 03);
overrun = 1;
}
/* the keyboard requires special translation */
if (tp == dc_tty[DCKBD_PORT]) {
if (cc == LK_DO) {
if (sc->dc_flags & DC_KBDMOUSE) {
/* the keyboard requires special translation */
if (tp == dc_tty[DCKBD_PORT]) {
if (cc == LK_DO) {
#ifdef DDB
spl0();
Debugger();
return;
spl0();
Debugger();
return;
#endif
}
}
#ifdef DEBUG
debugChar = cc;
debugChar = cc;
#endif
if (dcDivertXInput) {
(*dcDivertXInput)(cc);
return;
}
#if NRASTERCONSOLE > 0
if ((cp = kbdMapChar(cc, &cl)) == NULL)
return;
while (cl--)
rcons_input(0, *cp++);
#endif
return;
} else if (tp == dc_tty[DCMOUSE_PORT] && dcMouseButtons) {
#if NRASTERCONSOLE > 0
mouseInput(cc);
#endif
if (dcDivertXInput) {
(*dcDivertXInput)(cc);
return;
}
#if NRASTERCONSOLE > 0
if ((cp = kbdMapChar(cc, &cl)) == NULL)
return;
while (cl--)
rcons_input(0, *cp++);
#endif
return;
} else if (tp == dc_tty[DCMOUSE_PORT] && dcMouseButtons) {
#if NRASTERCONSOLE > 0
mouseInput(cc);
#endif
return;
}
if (!(tp->t_state & TS_ISOPEN)) {
wakeup((caddr_t)&tp->t_rawq);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dcvar.h,v 1.4 1997/05/28 14:21:39 jonathan Exp $ */
/* $NetBSD: dcvar.h,v 1.5 1999/12/03 13:07:35 simonb Exp $ */
/*
* External declarations from DECstation dc serial driver.
@ -19,12 +19,17 @@ struct dc_softc {
*/
int dc_brk;
int dc_flags;
char dc_19200; /* this unit supports 19200 */
char dcsoftCAR; /* mask, lines with carrier on (DSR) */
char dc_rtscts; /* mask, lines with hw flow control */
char dc_modem; /* mask, lines with DTR wired */
};
/* flags */
#define DC_KBDMOUSE 0x01 /* keyboard and mouse attached */
int dcattach __P((struct dc_softc *sc, void *addr,
int dtrmask, int rts_ctsmask,
int speed, int consline));