X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/5c6adb3e3b3a2ef6e6cb679bbad1d61ed669bfc0..5c65daa3e99ab89fcb5e58130096de1299d9c890:/usr/src/sys/vax/uba/dz.c diff --git a/usr/src/sys/vax/uba/dz.c b/usr/src/sys/vax/uba/dz.c index 1c9489541c..c0ae610574 100644 --- a/usr/src/sys/vax/uba/dz.c +++ b/usr/src/sys/vax/uba/dz.c @@ -1,4 +1,4 @@ -/* dz.c 3.4 %H% */ +/* dz.c 3.10 %G% */ /* * DZ-11 Driver @@ -14,6 +14,18 @@ #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 @@ -192,7 +204,11 @@ dzrint(dev) 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) @@ -200,12 +216,10 @@ dzrint(dev) if (((tp->t_flags & (EVENP|ODDP)) == EVENP) || ((tp->t_flags & (EVENP|ODDP)) == ODDP)) continue; -#ifdef BERKNET if (tp->t_line == NETLDISC) { c &= 0177; - NETINPUT(c, tp); + BKINPUT(c, tp); } else -#endif (*linesw[tp->t_line].l_rint)(c, tp); } } @@ -226,8 +240,22 @@ dev_t dev; 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) @@ -260,6 +288,8 @@ dzxint(tp) register struct tty *tp; { register struct pdma *dp; + register s; + s = spl6(); /* block the clock */ dp = &dzpdma[tp-dz_tty]; tp->t_state &= ~BUSY; @@ -273,6 +303,7 @@ register struct tty *tp; 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) @@ -372,11 +403,15 @@ dzscan() } 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);