Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/dev/ic pullup 1.159->1.161 -- requested by ross. ap...



details:   https://anonhg.NetBSD.org/src/rev/1001b7871f8b
branches:  netbsd-1-4
changeset: 468376:1001b7871f8b
user:      perry <perry%NetBSD.org@localhost>
date:      Mon Apr 19 20:37:57 1999 +0000

description:
pullup 1.159->1.161 -- requested by ross. apparently fixes critical bugs on
a number of ports.

diffstat:

 sys/dev/ic/com.c |  23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diffs (52 lines):

diff -r d2307c8765ac -r 1001b7871f8b sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Mon Apr 19 19:51:13 1999 +0000
+++ b/sys/dev/ic/com.c  Mon Apr 19 20:37:57 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com.c,v 1.159 1999/03/31 12:44:04 mrg Exp $    */
+/*     $NetBSD: com.c,v 1.159.2.1 1999/04/19 20:37:57 perry Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -223,6 +223,10 @@
 #define        COM_ISALIVE(sc) ((sc)->enabled != 0 && \
                         ISSET((sc)->sc_dev.dv_flags, DVF_ACTIVE))
 
+#define        BR      BUS_SPACE_BARRIER_READ
+#define        BW      BUS_SPACE_BARRIER_WRITE
+#define COM_BARRIER(t, h, f) bus_space_barrier((t), (h), 0, COM_NPORTS, (f))
+
 int
 comspeed(speed, frequency)
        long speed, frequency;
@@ -2170,24 +2174,21 @@
        int c;
 {
        int s = splserial();
-       u_char stat;
        int timo;
 
        /* wait for any pending transmission to finish */
-       timo = 50000;
-       while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY)
-           && --timo)
-               ;
+       timo = 150000;
+       while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo)
+               continue;
 
        bus_space_write_1(iot, ioh, com_data, c);
+       COM_BARRIER(iot, ioh, BR | BW);
+
        /* wait for this transmission to complete */
        timo = 1500000;
-       while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY)
-           && --timo)
-               ;
+       while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo)
+               continue;
 
-       /* clear any interrupts generated by this transmission */
-       stat = bus_space_read_1(iot, ioh, com_iir);
        splx(s);
 }
 



Home | Main Index | Thread Index | Old Index