Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - Swap the bytes OR'd into init_ladrf[], for big...



details:   https://anonhg.NetBSD.org/src/rev/00c075794a6a
branches:  trunk
changeset: 514309:00c075794a6a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Aug 28 15:22:30 2001 +0000

description:
- Swap the bytes OR'd into init_ladrf[], for big-endian machines.
- Make sure to sync the init block.

Pointed out by Izumi Tsutsui.

diffstat:

 sys/dev/pci/if_pcn.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r e26360ba4bc6 -r 00c075794a6a sys/dev/pci/if_pcn.c
--- a/sys/dev/pci/if_pcn.c      Tue Aug 28 15:17:47 2001 +0000
+++ b/sys/dev/pci/if_pcn.c      Tue Aug 28 15:22:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_pcn.c,v 1.2 2001/08/28 14:15:18 thorpej Exp $       */
+/*     $NetBSD: if_pcn.c,v 1.3 2001/08/28 15:22:30 thorpej Exp $       */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -1723,6 +1723,7 @@
         * Send the init block to the chip, and wait for it
         * to be processed.
         */
+       PCN_CDINITSYNC(sc, BUS_DMASYNC_PREWRITE);
        pcn_csr_write(sc, LE_CSR1, PCN_CDINITADDR(sc) & 0xffff);
        pcn_csr_write(sc, LE_CSR2, (PCN_CDINITADDR(sc) >> 16) & 0xffff);
        pcn_csr_write(sc, LE_CSR0, LE_C0_INIT);
@@ -1732,6 +1733,7 @@
                        break;
                delay(10);
        }
+       PCN_CDINITSYNC(sc, BUS_DMASYNC_POSTWRITE);
        if (i == 10000) {
                printf("%s: timeout processing init block\n",
                    sc->sc_dev.dv_xname);
@@ -1916,7 +1918,8 @@
                crc >>= 26;
 
                /* Set the corresponding bit in the filter. */
-               sc->sc_initblock.init_ladrf[crc >> 4] |= 1 << (crc & 0xf);
+               sc->sc_initblock.init_ladrf[crc >> 4] |=
+                   htole16(1 << (crc & 0xf));
 
                ETHER_NEXT_MULTI(step, enm);
        }



Home | Main Index | Thread Index | Old Index