diff options
| author | ragge <ragge@NetBSD.org> | 2000-12-30 22:11:46 +0000 |
|---|---|---|
| committer | ragge <ragge@NetBSD.org> | 2000-12-30 22:11:46 +0000 |
| commit | 9bbf84e4cab40b9b004cefcd78d3a03f4abfe432 (patch) | |
| tree | 911761e416de6e6bbd135d0c225180bdf09173a5 /sys/dev | |
| parent | 8679c3517416ca55a2a03b6e1c04c26e1688f682 (diff) | |
Changes for dzkbd/dzms. This is not yet finished, but at least the
kernel is useable.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/qbus/dz.c | 26 | ||||
| -rw-r--r-- | sys/dev/qbus/dzvar.h | 9 | ||||
| -rw-r--r-- | sys/dev/qbus/files.uba | 4 |
3 files changed, 17 insertions, 22 deletions
diff --git a/sys/dev/qbus/dz.c b/sys/dev/qbus/dz.c index c41817381d9..076f06fd794 100644 --- a/sys/dev/qbus/dz.c +++ b/sys/dev/qbus/dz.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz.c,v 1.25 2000/11/02 00:01:45 eeh Exp $ */ +/* $NetBSD: dz.c,v 1.26 2000/12/30 22:11:46 ragge Exp $ */ /* * Copyright (c) 1996 Ken C. Wellsch. All rights reserved. * Copyright (c) 1992, 1993 @@ -53,10 +53,6 @@ #include <sys/syslog.h> #include <sys/device.h> -#ifdef DDB -#include <dev/cons.h> -#endif - #include <machine/bus.h> #include <dev/qbus/dzreg.h> @@ -178,7 +174,8 @@ dzrint(void *arg) tp = sc->sc_dz[line].dz_tty; /* Must be caught early */ - if (sc->sc_catch && (*sc->sc_catch)(line, cc)) + if (sc->sc_dz[line].dz_catch && + (*sc->sc_dz[line].dz_catch)(sc->sc_dz[line].dz_private, cc)) continue; if (!(tp->t_state & TS_ISOPEN)) { @@ -198,17 +195,6 @@ dzrint(void *arg) if (c & DZ_RBUF_PARITY_ERR) cc |= TTY_PE; -#if defined(DDB) && (defined(VAX410) || defined(VAX43) || defined(VAX46)) - if (tp->t_dev == cn_tab->cn_dev) { - int j = kdbrint(cc); - - if (j == 1) /* Escape received, just return */ - continue; - - if (j == 2) /* Second char wasn't 'D' */ - (*tp->t_linesw->l_rint)(27, tp); - } -#endif (*tp->t_linesw->l_rint)(cc, tp); } } @@ -264,6 +250,8 @@ dzxint(void *arg) tcr &= 255; tcr &= ~(1 << line); DZ_WRITE_BYTE(dr_tcr, tcr); + if (sc->sc_dz[line].dz_catch) + continue; if (tp->t_state & TS_FLUSH) tp->t_state &= ~TS_FLUSH; @@ -295,6 +283,10 @@ dzopen(dev_t dev, int flag, int mode, struct proc *p) if (line >= sc->sc_type) return ENXIO; + /* if some other device is using the line, it's busy */ + if (sc->sc_dz[line].dz_catch) + return EBUSY; + tp = sc->sc_dz[line].dz_tty; if (tp == NULL) return (ENODEV); diff --git a/sys/dev/qbus/dzvar.h b/sys/dev/qbus/dzvar.h index 8255a9c86fc..8de5f01e45b 100644 --- a/sys/dev/qbus/dzvar.h +++ b/sys/dev/qbus/dzvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: dzvar.h,v 1.9 2000/06/05 00:09:18 matt Exp $ */ +/* $NetBSD: dzvar.h,v 1.10 2000/12/30 22:11:46 ragge Exp $ */ /* * Copyright (c) 1996 Ken C. Wellsch. All rights reserved. * Copyright (c) 1992, 1993 @@ -59,8 +59,11 @@ struct dz_softc { int sc_rxint; /* Receive interrupt count XXX */ u_char sc_brk; /* Break asserted on some lines */ u_char sc_dsr; /* DSR set bits if no mdm ctrl */ - int (*sc_catch)(int, int); /* Fast catch recv */ - struct { + struct dz_linestate { + struct dz_softc *dz_sc; /* backpointer to softc */ + int dz_line; /* sub-driver unit number */ + void *dz_private; /* sub-driver data pointer */ + int (*dz_catch) __P((void *, int)); /* Fast catch recv */ struct tty * dz_tty; /* what we work on */ #ifdef notyet caddr_t dz_mem; /* pointers to clist output */ diff --git a/sys/dev/qbus/files.uba b/sys/dev/qbus/files.uba index 94c0e4b73b3..3306fb7900c 100644 --- a/sys/dev/qbus/files.uba +++ b/sys/dev/qbus/files.uba @@ -1,4 +1,4 @@ -# $NetBSD: files.uba,v 1.7 2000/04/22 16:46:45 ragge Exp $ +# $NetBSD: files.uba,v 1.8 2000/12/30 22:11:46 ragge Exp $ # # Config file and device description for machine-independent # code for devices Digital Equipment Corp. Unibus and Q22 bus. @@ -10,7 +10,7 @@ define qfont file dev/qbus/uba.c uba # DZ-11 (-compatible) tty device driver. -device dz { }: tty +device dz { line = -1 }: tty attach dz at uba with dz_uba file dev/qbus/dz.c dz needs-flag file dev/qbus/dz_uba.c dz_uba |
