diff options
author | ache <ache@FreeBSD.org> | 1993-12-09 17:24:19 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1993-12-09 17:24:19 +0000 |
commit | bc518291b7e9abd2c2515cf0ea9c9d9d6db506fd (patch) | |
tree | 0c7724e6dfddb085097a8a0de6fdb7c5b7034a37 /sys | |
parent | 7903f013339182101e72f2e3d34255a5da016e9d (diff) | |
download | FreeBSD-src-bc518291b7e9abd2c2515cf0ea9c9d9d6db506fd.zip FreeBSD-src-bc518291b7e9abd2c2515cf0ea9c9d9d6db506fd.tar.gz |
1) Fix error with port recognition, speed initialization code
added to probe.
2) Force CLOCAL=on for outgoing ports and CLOCAL=off for
incoming ports into open in bidirectional case.
3) Add DELAY after writing to com_ier for fifo drain into probe.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sio/sio.c | 15 | ||||
-rw-r--r-- | sys/i386/isa/sio.c | 15 | ||||
-rw-r--r-- | sys/isa/sio.c | 15 |
3 files changed, 39 insertions, 6 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 39f2e59..819d362 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $ + * $Id: sio.c,v 1.16 1993/11/25 01:31:48 wollman Exp $ */ #include "sio.h" @@ -305,7 +305,7 @@ static int sioprobe(dev) struct isa_device *dev; { - static bool_t already_init; + static bool_t already_init=FALSE; Port_t *com_ptr; Port_t iobase; int result; @@ -342,10 +342,14 @@ sioprobe(dev) * o an output interrupt is generated and its vector is correct. * o the interrupt goes away when the IIR in the UART is read. */ + outb(iobase + com_cfcr, CFCR_DLAB); /* DLAB = 1 */ + outb(iobase + com_dlbl, COMBRD(9600) & 0xff); /* 9600bps */ + outb(iobase + com_dlbh, ((u_int) COMBRD(9600) >> 8) & 0xff); outb(iobase + com_cfcr, CFCR_8BITS); /* ensure IER is addressed */ outb(iobase + com_mcr, MCR_IENABLE); /* open gate early */ outb(iobase + com_ier, 0); /* ensure edge on next intr */ outb(iobase + com_ier, IER_ETXRDY); /* generate interrupt */ + DELAY(17000); /* wait for fifo drain on 9600 */ if ( inb(iobase + com_cfcr) != CFCR_8BITS || inb(iobase + com_ier) != IER_ETXRDY || inb(iobase + com_mcr) != MCR_IENABLE @@ -663,6 +667,13 @@ bidir_open_top: tp->t_lflag = 0; tp->t_ispeed = tp->t_ospeed = comdefaultrate; } +#ifdef COM_BIDIR + if (com->bidir) + if (callout) + tp->t_cflag |= CLOCAL; + else + tp->t_cflag &= ~CLOCAL; +#endif (void) commctl(com, MCR_DTR | MCR_RTS, DMSET); error = comparam(tp, &tp->t_termios); if (error != 0) diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index 39f2e59..819d362 100644 --- a/sys/i386/isa/sio.c +++ b/sys/i386/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $ + * $Id: sio.c,v 1.16 1993/11/25 01:31:48 wollman Exp $ */ #include "sio.h" @@ -305,7 +305,7 @@ static int sioprobe(dev) struct isa_device *dev; { - static bool_t already_init; + static bool_t already_init=FALSE; Port_t *com_ptr; Port_t iobase; int result; @@ -342,10 +342,14 @@ sioprobe(dev) * o an output interrupt is generated and its vector is correct. * o the interrupt goes away when the IIR in the UART is read. */ + outb(iobase + com_cfcr, CFCR_DLAB); /* DLAB = 1 */ + outb(iobase + com_dlbl, COMBRD(9600) & 0xff); /* 9600bps */ + outb(iobase + com_dlbh, ((u_int) COMBRD(9600) >> 8) & 0xff); outb(iobase + com_cfcr, CFCR_8BITS); /* ensure IER is addressed */ outb(iobase + com_mcr, MCR_IENABLE); /* open gate early */ outb(iobase + com_ier, 0); /* ensure edge on next intr */ outb(iobase + com_ier, IER_ETXRDY); /* generate interrupt */ + DELAY(17000); /* wait for fifo drain on 9600 */ if ( inb(iobase + com_cfcr) != CFCR_8BITS || inb(iobase + com_ier) != IER_ETXRDY || inb(iobase + com_mcr) != MCR_IENABLE @@ -663,6 +667,13 @@ bidir_open_top: tp->t_lflag = 0; tp->t_ispeed = tp->t_ospeed = comdefaultrate; } +#ifdef COM_BIDIR + if (com->bidir) + if (callout) + tp->t_cflag |= CLOCAL; + else + tp->t_cflag &= ~CLOCAL; +#endif (void) commctl(com, MCR_DTR | MCR_RTS, DMSET); error = comparam(tp, &tp->t_termios); if (error != 0) diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 39f2e59..819d362 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $ + * $Id: sio.c,v 1.16 1993/11/25 01:31:48 wollman Exp $ */ #include "sio.h" @@ -305,7 +305,7 @@ static int sioprobe(dev) struct isa_device *dev; { - static bool_t already_init; + static bool_t already_init=FALSE; Port_t *com_ptr; Port_t iobase; int result; @@ -342,10 +342,14 @@ sioprobe(dev) * o an output interrupt is generated and its vector is correct. * o the interrupt goes away when the IIR in the UART is read. */ + outb(iobase + com_cfcr, CFCR_DLAB); /* DLAB = 1 */ + outb(iobase + com_dlbl, COMBRD(9600) & 0xff); /* 9600bps */ + outb(iobase + com_dlbh, ((u_int) COMBRD(9600) >> 8) & 0xff); outb(iobase + com_cfcr, CFCR_8BITS); /* ensure IER is addressed */ outb(iobase + com_mcr, MCR_IENABLE); /* open gate early */ outb(iobase + com_ier, 0); /* ensure edge on next intr */ outb(iobase + com_ier, IER_ETXRDY); /* generate interrupt */ + DELAY(17000); /* wait for fifo drain on 9600 */ if ( inb(iobase + com_cfcr) != CFCR_8BITS || inb(iobase + com_ier) != IER_ETXRDY || inb(iobase + com_mcr) != MCR_IENABLE @@ -663,6 +667,13 @@ bidir_open_top: tp->t_lflag = 0; tp->t_ispeed = tp->t_ospeed = comdefaultrate; } +#ifdef COM_BIDIR + if (com->bidir) + if (callout) + tp->t_cflag |= CLOCAL; + else + tp->t_cflag &= ~CLOCAL; +#endif (void) commctl(com, MCR_DTR | MCR_RTS, DMSET); error = comparam(tp, &tp->t_termios); if (error != 0) |