-/* dz.c 3.3 %H% */
+/* dz.c 3.10 %G% */
/*
* DZ-11 Driver
#include "../h/conf.h"
#include "../h/pdma.h"
#include "../h/bk.h"
+
+/*
+ * When running dz's using only SAE (silo alarm) on input
+ * it is necessary to call dzrint() at clock interrupt time.
+ * This is unsafe unless spl5()s in tty code are changed to
+ * spl6()s to block clock interrupts. Note that the dh driver
+ * currently in use works the same way as the dz, even though
+ * we could try to more intelligently manage its silo.
+ * Thus don't take this out if you have no dz's unless you
+ * change clock.c and dhtimer().
+ */
+#define spl5 spl6
#define DZADDR (UBA0_DEV + 0160100)
#ifdef ERNIE
register int c;
register struct device *dzaddr;
register struct tty *tp0;
+ int s;
+ s = spl6(); /* see comment in clock.c */
/* as long as we are here, service them all */
for (dev = 0; dev < NDZ; dev += 8) {
if ((dzact & (1<<(dev>>3))) == 0)
if (tp->t_flags & RAW)
c = 0; /* null for getty */
else
- c = 0177; /* DEL = interrupt */
+#ifdef IIASA
+ continue;
+#else
+ c = tun.t_intrc;
+#endif
if (c&OVERRUN)
printf("o");
if (c&PERROR)
if (((tp->t_flags & (EVENP|ODDP)) == EVENP)
|| ((tp->t_flags & (EVENP|ODDP)) == ODDP))
continue;
-#ifdef BERKNET
- if (tp->t_line == BNETLDIS) {
+ if (tp->t_line == NETLDISC) {
c &= 0177;
- NETINPUT(c, tp);
+ BKINPUT(c, tp);
} else
-#endif
(*linesw[tp->t_line].l_rint)(c, tp);
}
}
+ splx(s);
}
/*ARGSUSED*/
if (ttioccomm(cmd, tp, addr, dev)) {
if (cmd==TIOCSETP || cmd==TIOCSETN)
dzparam(minor(dev));
- } else
+ } else switch(cmd) {
+ case TIOCSBRK:
+ ((struct device *)(tp->t_addr))->dzbrk |= 1 << (dev&07);
+ break;
+ case TIOCCBRK:
+ ((struct device *)(tp->t_addr))->dzbrk &= ~(1 << (dev&07));
+ break;
+ case TIOCSDTR:
+ dzmodem(minor(dev), ON);
+ break;
+ case TIOCCDTR:
+ dzmodem(minor(dev), OFF);
+ break;
+ default:
u.u_error = ENOTTY;
+ }
}
dzparam(dev)
register struct tty *tp;
{
register struct pdma *dp;
+ register s;
+ s = spl6(); /* block the clock */
dp = &dzpdma[tp-dz_tty];
tp->t_state &= ~BUSY;
dzstart(tp);
if (tp->t_outq.c_cc == 0 || (tp->t_state&BUSY)==0)
dp->p_addr->dztcr &= ~(1 << ((tp-dz_tty) % 8));
+ splx(s);
}
dzstart(tp)
} else {
if ((tp->t_state & CARR_ON)) {
/* carrier lost */
- signal(tp->t_pgrp, SIGHUP);
- dzaddr->dzdtr &= ~bit;
- flushtty(tp);
+ if (tp->t_state&ISOPEN &&
+ (tp->t_local&LNOHANG) == 0) {
+ gsignal(tp->t_pgrp, SIGHUP);
+ gsignal(tp->t_pgrp, SIGCONT);
+ dzaddr->dzdtr &= ~bit;
+ flushtty(tp);
+ }
+ tp->t_state &= ~CARR_ON;
}
- tp->t_state &= ~CARR_ON;
}
}
timeout(dzscan, (caddr_t)0, 2*HZ);