From 87d2c32cebe5c2ed26d29f4d8c4e7972205b0ee5 Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 30 Nov 1996 15:29:31 +0000 Subject: Reset h/w fifos (if any) in siostop(). Now ttyflush() works fairly well with sio devices (not perfectly, since there is no way to flush the tx holding register on 8250-16450's. I'm not sure if resetting the fifos flushes the tx shift register). Reminded by: NIST-PCTS --- sys/dev/sio/sio.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sys/dev/sio/sio.c') diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index d4125c3..0b70455 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.151 1996/11/30 15:03:05 bde Exp $ + * $Id: sio.c,v 1.152 1996/11/30 15:19:19 bde Exp $ */ #include "opt_comconsole.h" @@ -2123,6 +2123,10 @@ siostop(tp, rw) return; disable_intr(); if (rw & FWRITE) { + if (com->hasfifo) + /* XXX does this flush everything? */ + outb(com->iobase + com_fifo, + FIFO_XMT_RST | com->fifo_image); com->obufs[0].l_queued = FALSE; com->obufs[1].l_queued = FALSE; if (com->state & CS_ODONE) @@ -2131,13 +2135,15 @@ siostop(tp, rw) com->tp->t_state &= ~TS_BUSY; } if (rw & FREAD) { + if (com->hasfifo) + /* XXX does this flush everything? */ + outb(com->iobase + com_fifo, + FIFO_RCV_RST | com->fifo_image); com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } enable_intr(); comstart(tp); - - /* XXX should clear h/w fifos too. */ } static struct tty * -- cgit v1.1