Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Fix bogons in previous change:



details:   https://anonhg.NetBSD.org/src/rev/fedcff724b64
branches:  trunk
changeset: 467802:fedcff724b64
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Mon Mar 29 13:21:15 1999 +0000

description:
Fix bogons in previous change:
* The fact that IIR_NOPEND was not set on entry does *not* mean that no
  transmission was in progress.  Besides, we don't want to throw away receive
  interrupts either.
* In the !clearirq case, we didn't splx().

diffstat:

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

diffs (45 lines):

diff -r d6983d69937c -r fedcff724b64 sys/dev/ic/com.c
--- a/sys/dev/ic/com.c  Mon Mar 29 12:45:22 1999 +0000
+++ b/sys/dev/ic/com.c  Mon Mar 29 13:21:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com.c,v 1.156 1999/03/29 10:01:39 ross Exp $   */
+/*     $NetBSD: com.c,v 1.157 1999/03/29 13:21:15 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -2174,32 +2174,25 @@
        int c;
 {
        int s = splserial();
-       int clearirq;
        u_char stat;
        int timo;
 
        /* wait for any pending transmission to finish */
-       timo = 500;
+       timo = 1500;
        while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY)
            && --timo)
                delay(100);
 
-       clearirq = ISSET(bus_space_read_1(iot, ioh, com_iir), IIR_NOPEND);
-       COM_BARRIER(iot, ioh, BR | BW);
        bus_space_write_1(iot, ioh, com_data, c);
        COM_BARRIER(iot, ioh, BR | BW);
+
        /* wait for this transmission to complete */
        timo = 15000;
        while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY)
            && --timo)
                delay(100);
 
-       if(clearirq != 0) {
-               /* clear any interrupts generated by this transmission */
-               (void)bus_space_read_1(iot, ioh, com_iir);
-               COM_BARRIER(iot, ioh, BR | BW);
-               splx(s);
-       }
+       splx(s);
 }
 
 /*



Home | Main Index | Thread Index | Old Index