Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Correctly sync the MPT request buffers, and remov...



details:   https://anonhg.NetBSD.org/src/rev/9debc477cc2e
branches:  trunk
changeset: 545838:9debc477cc2e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Apr 16 23:02:14 2003 +0000

description:
Correctly sync the MPT request buffers, and remove BUS_DMA_COHERENT
from the mapping of those buffers.

diffstat:

 sys/dev/ic/mpt.c        |  7 ++-----
 sys/dev/ic/mpt_netbsd.c |  6 +++---
 sys/dev/ic/mpt_netbsd.h |  7 ++++++-
 3 files changed, 11 insertions(+), 9 deletions(-)

diffs (69 lines):

diff -r 049e119bd1c7 -r 9debc477cc2e sys/dev/ic/mpt.c
--- a/sys/dev/ic/mpt.c  Wed Apr 16 22:36:14 2003 +0000
+++ b/sys/dev/ic/mpt.c  Wed Apr 16 23:02:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpt.c,v 1.1 2003/04/16 22:02:59 thorpej Exp $  */
+/*     $NetBSD: mpt.c,v 1.2 2003/04/16 23:02:14 thorpej Exp $  */
 
 /*
  * Copyright (c) 2000, 2001 by Greg Ansley
@@ -277,10 +277,7 @@
                mpt_prt(mpt, "%08x %08x %08x %08x",
                    pReq[12], pReq[13], pReq[14], pReq[15]);
        }
-#if 0 /* XXXJRT */
-       bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap,
-           BUS_DMASYNC_PREWRITE);
-#endif
+       MPT_SYNC_REQ(mpt, req, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
        req->debug = REQ_ON_CHIP;
        mpt_write(mpt, MPT_OFFSET_REQUEST_Q, (u_int32_t) req->req_pbuf);
 }
diff -r 049e119bd1c7 -r 9debc477cc2e sys/dev/ic/mpt_netbsd.c
--- a/sys/dev/ic/mpt_netbsd.c   Wed Apr 16 22:36:14 2003 +0000
+++ b/sys/dev/ic/mpt_netbsd.c   Wed Apr 16 23:02:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpt_netbsd.c,v 1.1 2003/04/16 22:03:00 thorpej Exp $   */
+/*     $NetBSD: mpt_netbsd.c,v 1.2 2003/04/16 23:02:14 thorpej Exp $   */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -204,8 +204,7 @@
        }
 
        error = bus_dmamem_map(mpt->sc_dmat, &request_seg, request_rseg,
-           MPT_REQ_MEM_SIZE(mpt), (caddr_t *) &mpt->request,
-           BUS_DMA_COHERENT/*XXX*/);
+           MPT_REQ_MEM_SIZE(mpt), (caddr_t *) &mpt->request, 0);
        if (error) {
                aprint_error("%s: unable to map request area, error = %d\n",
                    mpt->sc_dev.dv_xname, error);
@@ -451,6 +450,7 @@
                return;
        }
 
+       MPT_SYNC_REQ(mpt, req, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
        mpt_req = req->req_vbuf;
 
        /* Short cut for task management replies; nothing more for us to do. */
diff -r 049e119bd1c7 -r 9debc477cc2e sys/dev/ic/mpt_netbsd.h
--- a/sys/dev/ic/mpt_netbsd.h   Wed Apr 16 22:36:14 2003 +0000
+++ b/sys/dev/ic/mpt_netbsd.h   Wed Apr 16 23:02:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpt_netbsd.h,v 1.1 2003/04/16 22:03:00 thorpej Exp $   */
+/*     $NetBSD: mpt_netbsd.h,v 1.2 2003/04/16 23:02:14 thorpej Exp $   */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -242,6 +242,11 @@
        void                    (*sc_set_config_regs)(struct mpt_softc *);
 } mpt_softc_t;
 
+#define        MPT_SYNC_REQ(mpt, req, ops)                             \
+       bus_dmamap_sync((mpt)->sc_dmat, (mpt)->request_dmap,    \
+           (req)->req_pbuf - (mpt)->request_phys,              \
+           MPT_REQUEST_AREA, (ops))
+
 #define        mpt_read(mpt, reg)                                      \
        bus_space_read_4((mpt)->sc_st, (mpt)->sc_sh, (reg))
 #define        mpt_write(mpt, reg, val)                                \



Home | Main Index | Thread Index | Old Index