diff options
Diffstat (limited to 'sys/dev/ic/com.c')
-rw-r--r-- | sys/dev/ic/com.c | 70 |
1 files changed, 39 insertions, 31 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 5570f7ef424..112b40fad55 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,5 +1,5 @@ -/* $OpenBSD: com.c,v 1.12 1996/04/29 14:16:15 hvozda Exp $ */ -/* $NetBSD: com.c,v 1.79 1996/04/15 18:54:31 cgd Exp $ */ +/* $OpenBSD: com.c,v 1.13 1996/05/07 07:36:25 deraadt Exp $ */ +/* $NetBSD: com.c,v 1.80 1996/04/29 20:03:00 christos Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996 @@ -75,6 +75,7 @@ #include "com.h" + #define COM_IBUFSIZE (2 * 512) #define COM_IHIGHWATER ((3 * COM_IBUFSIZE) / 4) @@ -121,15 +122,25 @@ struct com_softc { #ifdef COM_HAYESP int comprobeHAYESP __P((bus_io_handle_t hayespioh, struct com_softc *sc)); #endif -int comopen __P((dev_t, int, int, struct proc *)); -int comclose __P((dev_t, int, int, struct proc *)); -void comdiag __P((void *)); -int comintr __P((void *)); -void compoll __P((void *)); -int comparam __P((struct tty *, struct termios *)); -void comstart __P((struct tty *)); -void com_absent_notify __P((struct com_softc *sc)); -void comstart_pending __P((void *arg)); +void comdiag __P((void *)); +int comspeed __P((long)); +int comparam __P((struct tty *, struct termios *)); +void comstart __P((struct tty *)); +int comintr __P((void *)); +void compoll __P((void *)); + +/* XXX: These belong elsewhere */ +cdev_decl(com); +bdev_decl(com); + +struct consdev; +void comcnprobe __P((struct consdev *)); +void comcninit __P((struct consdev *)); +int comcngetc __P((dev_t)); +void comcnputc __P((dev_t, int)); +void comcnpollc __P((dev_t, int)); + +static u_char tiocm_xxx2mcr __P((int)); /* * XXX the following two cfattach structs should be different, and possibly @@ -155,7 +166,7 @@ struct cfdriver com_cd = { NULL, "com", DV_TTY }; -int cominit __P((bus_chipset_tag_t, bus_io_handle_t, int)); +void cominit __P((bus_chipset_tag_t, bus_io_handle_t, int)); #ifndef CONSPEED #define CONSPEED B9600 @@ -194,20 +205,18 @@ extern int kgdb_debug_init; #if NCOM_PCMCIA #include <dev/pcmcia/pcmciavar.h> -int com_pcmcia_match __P((struct device *, void *, void *)); -void com_pcmcia_attach __P((struct device *, struct device *, void *)); -int com_pcmcia_detach __P((struct device *)); +int com_pcmcia_match __P((struct device *, void *, void *)); +void com_pcmcia_attach __P((struct device *, struct device *, void *)); +int com_pcmcia_detach __P((struct device *)); struct cfattach com_pcmcia_ca = { sizeof(struct com_softc), com_pcmcia_match, comattach, com_pcmcia_detach }; -int -com_pcmcia_mod __P((struct pcmcia_link *pc_link, - struct device *self, - struct pcmcia_conf *pc_cf, - struct cfdata *cf)); +int com_pcmcia_mod __P((struct pcmcia_link *pc_link, struct device *self, + struct pcmcia_conf *pc_cf, struct cfdata *cf)); +void com_absent_notify __P((struct com_softc *sc)); /* additional setup needed for pcmcia devices */ /* modify config entry */ @@ -507,7 +516,6 @@ comprobe(parent, match, aux) struct device *parent; void *match, *aux; { - struct cfdata *cf = match; bus_chipset_tag_t bc; bus_io_handle_t ioh; int iobase, needioh; @@ -537,6 +545,7 @@ comprobe(parent, match, aux) #endif #if NCOM_COMMULTI if (1) { + struct cfdata *cf = match; struct commulti_attach_args *ca = aux; if (cf->cf_loc[0] != -1 && cf->cf_loc[0] != ca->ca_slave) @@ -580,11 +589,9 @@ comattach(parent, self, aux) void *aux; { struct com_softc *sc = (void *)self; - struct cfdata *cf = sc->sc_dev.dv_cfdata; int iobase, irq; bus_chipset_tag_t bc; bus_io_handle_t ioh; - struct tty *tp; #ifdef COM_HAYESP int hayesp_ports[] = { 0x140, 0x180, 0x280, 0x300, 0 }; int *hayespp; @@ -715,7 +722,7 @@ comattach(parent, self, aux) if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) kgdb_dev = -1; /* can't debug over console port */ else { - (void) cominit(bc, ioh, kgdb_rate); + cominit(bc, ioh, kgdb_rate); if (kgdb_debug_init) { /* * Print prefix of device name, @@ -1342,9 +1349,10 @@ stopped: /* * Stop output on a line. */ -void +int comstop(tp, flag) struct tty *tp; + int flag; { int s; @@ -1353,6 +1361,7 @@ comstop(tp, flag) if (!ISSET(tp->t_state, TS_TTSTOP)) SET(tp->t_state, TS_FLUSH); splx(s); + return 0; } void @@ -1607,14 +1616,11 @@ void comcnprobe(cp) struct consdev *cp; { - bus_chipset_tag_t bc; + /* XXX NEEDS TO BE FIXED XXX */ + bus_chipset_tag_t bc = 0; bus_io_handle_t ioh; int found; -#if 0 - XXX NEEDS TO BE FIXED XXX - bc = ???; -#endif if (bus_io_map(bc, CONADDR, COM_NPORTS, &ioh)) { cp->cn_pri = CN_DEAD; return; @@ -1657,6 +1663,7 @@ comcninit(cp) comconsinit = 0; } +void cominit(bc, ioh, rate) bus_chipset_tag_t bc; bus_io_handle_t ioh; @@ -1676,6 +1683,7 @@ cominit(bc, ioh, rate) splx(s); } +int comcngetc(dev) dev_t dev; { @@ -1710,7 +1718,7 @@ comcnputc(dev, c) if (dev != kgdb_dev) #endif if (comconsinit == 0) { - (void) cominit(bc, ioh, comdefaultrate); + cominit(bc, ioh, comdefaultrate); comconsinit = 1; } /* wait for any pending transmission to finish */ |