diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-10-11 22:08:58 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-10-11 22:08:58 +0000 |
commit | 57d2abb4c707e3cc3473d7afe7e191295d3dd748 (patch) | |
tree | 1e0922211e48024416c6954ba7d1fc429ac16e81 /sys/arch/mvme88k/dev/dart.c | |
parent | f98251456fb2389246c3c5003d861df01903ab0b (diff) |
Nuke trailing whitespace.
Diffstat (limited to 'sys/arch/mvme88k/dev/dart.c')
-rw-r--r-- | sys/arch/mvme88k/dev/dart.c | 95 |
1 files changed, 47 insertions, 48 deletions
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c index 0d355417c49..b357f8742d4 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.24 2003/10/03 16:44:50 miod Exp $ */ +/* $OpenBSD: dart.c,v 1.25 2003/10/11 22:08:57 miod Exp $ */ /* * Mach Operating System @@ -86,9 +86,9 @@ struct dartsoftc { int dartmatch(struct device *parent, void *self, void *aux); void dartattach(struct device *parent, struct device *self, void *aux); -struct cfattach dart_ca = { +struct cfattach dart_ca = { sizeof(struct dartsoftc), dartmatch, dartattach -}; +}; struct cfdriver dart_cd = { NULL, "dart", DV_TTY, 0 @@ -154,14 +154,14 @@ dart_speed(speed) { struct dart_s *ds = dart_speeds; while (ds->kspeed != 0xFFFF) { - if (ds->kspeed == speed) + if (ds->kspeed == speed) return ds->dspeed; ds++; } return NOBAUD; } -struct tty* +struct tty* darttty(dev) dev_t dev; { @@ -188,7 +188,7 @@ dartmatch(parent, vcf, args) if (brdtyp != BRD_188) return (0); ca->ca_vaddr = ca->ca_paddr; /* 1:1 */ addr = (union dartreg *)ca->ca_vaddr; - + if (badvaddr((vaddr_t)addr, 2)) { printf("==> dart: failed address check.\n"); return (0); @@ -218,7 +218,7 @@ dartattach(parent, self, aux) sc->sc_dart[A_PORT].tty = NULL; sc->sc_dart[B_PORT].tty = NULL; ca->ca_vec = SYSCV_SCC; /* hard coded vector */ - sc->sc_vec = ca->ca_vec; + sc->sc_vec = ca->ca_vec; addr = sc->dart_reg; @@ -238,7 +238,7 @@ dartattach(parent, self, aux) /* Start out with Tx and RX interrupts disabled */ /* Enable input port change interrupt */ dart_sv_reg.sv_imr = IIPCHG; - + if (dart_cons >= 0) { printf(" console (tty%s) ", dart_cons == 0 ? "a" : "b"); } @@ -323,19 +323,19 @@ dartstart(tp) port = DART_PORT(dev); if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return; - + sc = (struct dartsoftc *) dart_cd.cd_devs[0]; addr = sc->dart_reg; ptaddr = sc->port_reg[port]; if ((tp->t_state & TS_ISOPEN) == 0) return; - + s = spltty(); - + if (tp->t_state & (TS_TIMEOUT |TS_BUSY | TS_TTSTOP)) goto bail; - + if (tp->t_outq.c_cc <= tp->t_lowat) { if (tp->t_state & TS_ASLEEP) { tp->t_state &= ~TS_ASLEEP; @@ -369,7 +369,7 @@ dartstart(tp) dprintf(("dartstart: writing char \"%c\" (0x%02x) to port %d\n", c & 0xff, c & 0xff, port)); ptaddr->write.wr_tb = c & 0xff; - + if (port != dart_cons) dprintf(("dartstart: enabling Tx int\n")); if (port == A_PORT) @@ -443,12 +443,12 @@ dartmctl (dev, flags, how) int newflags = 0; struct dart_info *dart; struct dartsoftc *sc; - int s; + int s; port = DART_PORT(dev); if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); - + sc = (struct dartsoftc *) dart_cd.cd_devs[0]; dart = &sc->sc_dart[port]; addr = sc->dart_reg; @@ -463,9 +463,9 @@ dartmctl (dev, flags, how) dartbreak(port, 0); flags &= ~TIOCCBRK; } -#endif +#endif s = spltty(); - + HANDLE_FLAG(TIOCM_DTR, port, OPDTRA, OPDTRB); HANDLE_FLAG(TIOCM_RTS, port, OPRTSA, OPRTSB); @@ -476,7 +476,7 @@ dartmctl (dev, flags, how) HOW2STR(how), flags, FLAGSTRING); panic("dartmctl"); } -#endif +#endif dprintf(("dartmctl: action=%s flags=0x%x\n", HOW2STR(how), newflags)); @@ -527,7 +527,7 @@ dartbreak(dev, state) addr = sc->dart_reg; ptaddr = sc->port_reg[port]; - + if (state == 1) { /* the duart must be enabled with a dummy byte, to prevent the transmitter empty interrupt */ @@ -540,7 +540,7 @@ dartbreak(dev, state) return; } -int +int dartioctl(dev, cmd, data, flag, p) dev_t dev; u_long cmd; @@ -557,7 +557,7 @@ dartioctl(dev, cmd, data, flag, p) port = DART_PORT(dev); if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); - + sc = (struct dartsoftc *) dart_cd.cd_devs[0]; dart = &sc->sc_dart[port]; tp = dart->tty; @@ -610,9 +610,9 @@ dartioctl(dev, cmd, data, flag, p) *(int *)data = dart->dart_swflags; break; case TIOCSFLAGS: - error = suser(p, 0); + error = suser(p, 0); if (error != 0) - return(EPERM); + return(EPERM); dart->dart_swflags = *(int *)data; if (dart_cons == port) @@ -630,7 +630,7 @@ dartioctl(dev, cmd, data, flag, p) /* * To be called at spltty - tty already locked. */ -int +int dartparam(tp, t) struct tty *tp; struct termios *t; @@ -655,7 +655,7 @@ dartparam(tp, t) dart = &sc->sc_dart[port]; addr = sc->dart_reg; ptaddr = sc->port_reg[port]; - + tp->t_ispeed = t->c_ispeed; tp->t_ospeed = t->c_ospeed; tp->t_cflag = t->c_cflag; @@ -809,7 +809,7 @@ dartmodemtrans(sc, ip, ipcr) (void) ttymodem(tp, dcdstate); } -int +int dartopen (dev, flag, mode, p) dev_t dev; int flag; @@ -872,7 +872,7 @@ dartopen (dev, flag, mode, p) return ((*linesw[tp->t_line].l_open)(dev, tp)); } -int +int dartclose (dev, flag, mode, p) dev_t dev; int flag; @@ -887,17 +887,17 @@ dartclose (dev, flag, mode, p) port = DART_PORT(dev); if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); - + sc = (struct dartsoftc *) dart_cd.cd_devs[0]; dart = &sc->sc_dart[port]; tp = dart->tty; (*linesw[tp->t_line].l_close)(tp, flag); ttyclose(tp); - + return 0; } -int +int dartread (dev, uio, flag) dev_t dev; struct uio *uio; @@ -911,7 +911,7 @@ dartread (dev, uio, flag) port = DART_PORT(dev); if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); - + sc = (struct dartsoftc *) dart_cd.cd_devs[0]; dart = &sc->sc_dart[port]; tp = dart->tty; @@ -921,7 +921,7 @@ dartread (dev, uio, flag) return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); } -int +int dartwrite(dev, uio, flag) dev_t dev; struct uio *uio; @@ -935,7 +935,7 @@ dartwrite(dev, uio, flag) port = DART_PORT(dev); if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS) return (ENODEV); - + sc = (struct dartsoftc *)dart_cd.cd_devs[0]; dart = &sc->sc_dart[port]; @@ -1022,7 +1022,7 @@ dartrint(sc, port) data &= 0177; /* CS7 */ ttyinput(data, tp); } -#endif +#endif } } } @@ -1092,9 +1092,8 @@ dartintr(arg) addr = sc->dart_reg; isr = addr->read.rd_isr; - isr &= dart_sv_reg.sv_imr; - + if (isr) { /* interrupt from this duart */ if (isr & IIPCHG) { unsigned int ip = addr->read.rd_ip; @@ -1191,13 +1190,13 @@ dartcnputc(dev, c) ptaddr = (union dart_pt_io *) addr + (port * 0x20); #else ptaddr = (union dart_pt_io *) addr + ((dev & 1) ? 1 : 0); -#endif +#endif #if 1 s = spltty(); -#else +#else psr = disable_interrupts_return_psr(); -#endif +#endif /* Assume first port initialized if we get here. */ /* Assume the bug initializes the port */ @@ -1223,9 +1222,9 @@ dartcnputc(dev, c) #if 1 splx(s); -#else +#else set_psr(psr); -#endif +#endif } int @@ -1255,7 +1254,7 @@ dartcngetc(dev) ptaddr = (union dart_pt_io *) addr + (port * 0x20); #else ptaddr = (union dart_pt_io *) addr + ((dev & 1) ? 1 : 0); -#endif +#endif /* enable receiver */ ptaddr->write.wr_cr = RXEN; @@ -1276,9 +1275,9 @@ dartcngetc(dev) ptaddr->write.wr_cr = ERRRESET; #if 1 splx(s); -#else +#else set_psr(psr); -#endif +#endif return c; } @@ -1291,17 +1290,17 @@ dartcngetc(dev) buf[5] = (char) c; #if 1 splx(s); -#else +#else set_psr(psr); -#endif +#endif return (c & 0x7f); } } } while (-1); #if 1 splx(s); -#else +#else set_psr(psr); -#endif +#endif return -1; } |