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 the previous differently:



details:   https://anonhg.NetBSD.org/src/rev/963e056e83f7
branches:  trunk
changeset: 500412:963e056e83f7
user:      ws <ws%NetBSD.org@localhost>
date:      Mon Dec 11 17:07:38 2000 +0000

description:
Fix the previous differently:
The intent was to protect the full range of ports on the board by the
barriers.  But the start address was wrong.  Fix it.

While here, change two other barriers to also protect the full range
(not only the nic ports), and add yet another similar barrier.

diffstat:

 sys/dev/ic/ne2000.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (64 lines):

diff -r 12d2e25f4f06 -r 963e056e83f7 sys/dev/ic/ne2000.c
--- a/sys/dev/ic/ne2000.c       Mon Dec 11 16:49:15 2000 +0000
+++ b/sys/dev/ic/ne2000.c       Mon Dec 11 17:07:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ne2000.c,v 1.30 2000/12/03 23:15:23 jlam Exp $ */
+/*     $NetBSD: ne2000.c,v 1.31 2000/12/11 17:07:38 ws Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -314,12 +314,12 @@
        /* Reset the board. */
 #ifdef GWETHER
        bus_space_write_1(asict, asich, NE2000_ASIC_RESET, 0);
-       bus_space_barrier(asict, asich, 0, NE2000_ASIC_NPORTS,
+       bus_space_barrier(nict, nich, 0, NE2000_NPORTS,
                          BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
        delay(200);
 #endif /* GWETHER */
        tmp = bus_space_read_1(asict, asich, NE2000_ASIC_RESET);
-       bus_space_barrier(asict, asich, 0, NE2000_ASIC_NPORTS,
+       bus_space_barrier(nict, nich, 0, NE2000_NPORTS,
                          BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
        delay(10000);
 
@@ -332,7 +332,7 @@
         * the invasive thing for now.  Yuck.]
         */
        bus_space_write_1(asict, asich, NE2000_ASIC_RESET, tmp);
-       bus_space_barrier(asict, asich, 0, NE2000_ASIC_NPORTS,
+       bus_space_barrier(nict, nich, 0, NE2000_NPORTS,
                          BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
        delay(5000);
 
@@ -722,8 +722,9 @@
        NIC_BARRIER(nict, nich);
        bus_space_write_1(nict, nich, ED_P0_CR,
            ED_CR_RD0 | ED_CR_PAGE_0 | ED_CR_STA);
-       NIC_BARRIER(nict, nich);
 
+       bus_space_barrier(nict, nich, 0, NE2000_NPORTS,
+                         BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
        if (useword)
                bus_space_read_multi_stream_2(asict, asich, NE2000_ASIC_DATA,
                    (u_int16_t *)dst, amount >> 1);
@@ -772,8 +773,9 @@
        NIC_BARRIER(nict, nich);
        bus_space_write_1(nict, nich, ED_P0_CR,
            ED_CR_RD1 | ED_CR_PAGE_0 | ED_CR_STA);
-       NIC_BARRIER(nict, nich);
 
+       bus_space_barrier(nict, nich, 0, NE2000_NPORTS,
+                         BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
        if (useword)
                bus_space_write_multi_stream_2(asict, asich, NE2000_ASIC_DATA,
                    (u_int16_t *)src, len >> 1);
@@ -788,6 +790,8 @@
         * waiting causes really bad things to happen - like the NIC wedging
         * the bus.
         */
+       bus_space_barrier(nict, nich, 0, NE2000_NPORTS,
+                         BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
        while (((bus_space_read_1(nict, nich, ED_P0_ISR) & ED_ISR_RDC) !=
            ED_ISR_RDC) && --maxwait)
                DELAY(1);



Home | Main Index | Thread Index | Old Index