summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-10-13 18:37:59 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-10-13 18:37:59 +0000
commitd82a1a6a577612572517638bed6f6c138bdb09e7 (patch)
treeee7508a92fced5ffc85f3720b18c958fd766c1f0 /sys
parent56443547fc26c29550460c4dc03c72dfa8b8d01c (diff)
be sure to always set fifolen to at least 1 and if the code probes a 0 byte
fifo (ie., a 16450 misdetected as 16550a) the HW_FIFO bit is disabled. reported and ok by miod@. work with him.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/com_subr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ic/com_subr.c b/sys/dev/ic/com_subr.c
index 40025dabfd8..8563585b99a 100644
--- a/sys/dev/ic/com_subr.c
+++ b/sys/dev/ic/com_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_subr.c,v 1.3 2005/10/13 14:58:56 fgsch Exp $ */
+/* $OpenBSD: com_subr.c,v 1.4 2005/10/13 18:37:58 fgsch Exp $ */
/*
* Copyright (c) 1997 - 1999, Jason Downs. All rights reserved.
@@ -312,13 +312,16 @@ com_attach_subr(sc)
default:
panic("comattach: bad fifo type");
}
- if (sc->sc_fifolen == 0)
- sc->sc_fifolen = 1; /* default */
#ifdef notyet
com_fifo_probe(sc);
#endif
+ if (sc->sc_fifolen == 0) {
+ CLR(sc->sc_hwflags, COM_HW_FIFO);
+ sc->sc_fifolen = 1;
+ }
+
/* clear and disable fifo */
bus_space_write_1(iot, ioh, com_fifo, FIFO_RCV_RST | FIFO_XMT_RST);
(void)bus_space_read_1(iot, ioh, com_data);