Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Call bus_dmamap_sync() properly before/after read...



details:   https://anonhg.NetBSD.org/src/rev/07483b8004d5
branches:  trunk
changeset: 486604:07483b8004d5
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri May 26 19:11:24 2000 +0000

description:
Call bus_dmamap_sync() properly before/after reading fcd_stats
in fxp_control_data.

diffstat:

 sys/dev/ic/i82557.c    |  6 +++++-
 sys/dev/ic/i82557var.h |  6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r 9394b935710f -r 07483b8004d5 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Fri May 26 19:01:51 2000 +0000
+++ b/sys/dev/ic/i82557.c       Fri May 26 19:11:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557.c,v 1.31 2000/05/24 13:20:32 soren Exp $        */
+/*     $NetBSD: i82557.c,v 1.32 2000/05/26 19:11:24 tsutsui Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -1086,6 +1086,8 @@
 
        s = splnet();
 
+       FXP_CDSTATSSYNC(sc, BUS_DMASYNC_POSTREAD);
+
        ifp->if_opackets += le32toh(sp->tx_good);
        ifp->if_collisions += le32toh(sp->tx_total_collisions);
        if (sp->rx_good) {
@@ -1133,6 +1135,7 @@
                /*
                 * Start another stats dump.
                 */
+               FXP_CDSTATSSYNC(sc, BUS_DMASYNC_PREREAD);
                CSR_WRITE_1(sc, FXP_CSR_SCB_COMMAND,
                    FXP_SCB_COMMAND_CU_DUMPRESET);
        } else {
@@ -1317,6 +1320,7 @@
        fxp_scb_wait(sc);
        CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL,
            sc->sc_cddma + FXP_CDSTATSOFF);
+       FXP_CDSTATSSYNC(sc, BUS_DMASYNC_PREREAD);
        CSR_WRITE_1(sc, FXP_CSR_SCB_COMMAND, FXP_SCB_COMMAND_CU_DUMP_ADR);
 
        cbp = &sc->sc_control_data->fcd_configcb;
diff -r 9394b935710f -r 07483b8004d5 sys/dev/ic/i82557var.h
--- a/sys/dev/ic/i82557var.h    Fri May 26 19:01:51 2000 +0000
+++ b/sys/dev/ic/i82557var.h    Fri May 26 19:11:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557var.h,v 1.14 2000/05/12 18:46:33 jhawk Exp $     */
+/*     $NetBSD: i82557var.h,v 1.15 2000/05/26 19:11:25 tsutsui Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -248,6 +248,10 @@
        bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap,                 \
            FXP_CDMCSOFF, sizeof(struct fxp_cb_mcs), (ops))
 
+#define        FXP_CDSTATSSYNC(sc, ops)                                        \
+       bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap,                 \
+           FXP_CDSTATSOFF, sizeof(struct fxp_stats), (ops))
+
 #define        FXP_RXBUFSIZE(m)        ((m)->m_ext.ext_size -                  \
                                 (sizeof(struct fxp_rfa) +              \
                                  RFA_ALIGNMENT_FUDGE))



Home | Main Index | Thread Index | Old Index