aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sio
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1996-11-30 15:29:31 +0000
committerBruce Evans <bde@FreeBSD.org>1996-11-30 15:29:31 +0000
commiteea9b0845f157ab8527771f67a1693057df23dd8 (patch)
tree18a3f0dbdaa0a91740c929d5e2d6eb4ffa5b7da5 /sys/dev/sio
parent4670f800ec1ebc23aff98bc14dd42961fdafaff5 (diff)
downloadsrc-eea9b0845f157ab8527771f67a1693057df23dd8.tar.gz
src-eea9b0845f157ab8527771f67a1693057df23dd8.zip
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
Notes
Notes: svn path=/head/; revision=20048
Diffstat (limited to 'sys/dev/sio')
-rw-r--r--sys/dev/sio/sio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index d4125c31352a..0b70455f3c75 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 *