From owner-p4-projects@FreeBSD.ORG Tue Apr 8 12:03:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4B38637B401; Tue, 8 Apr 2003 12:03:39 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D988937B405 for ; Tue, 8 Apr 2003 12:03:38 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0F5943F75 for ; Tue, 8 Apr 2003 12:03:37 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h38J3b0U074566 for ; Tue, 8 Apr 2003 12:03:37 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h38J3btB074563 for perforce@freebsd.org; Tue, 8 Apr 2003 12:03:37 -0700 (PDT) Date: Tue, 8 Apr 2003 12:03:37 -0700 (PDT) Message-Id: <200304081903.h38J3btB074563@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 28544 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 19:03:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=28544 Change 28544 by jhb@jhb_laptop on 2003/04/08 12:03:00 IFC @28542. Affected files ... .. //depot/projects/smpng/sys/dev/fxp/if_fxp.c#28 integrate Differences ... ==== //depot/projects/smpng/sys/dev/fxp/if_fxp.c#28 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.165 2003/04/08 18:35:51 mux Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.166 2003/04/08 18:56:45 mux Exp $"); #include #include @@ -223,8 +223,9 @@ static int sysctl_hw_fxp_int_delay(SYSCTL_HANDLER_ARGS); static __inline void fxp_scb_wait(struct fxp_softc *sc); static __inline void fxp_scb_cmd(struct fxp_softc *sc, int cmd); -static __inline void fxp_dma_wait(volatile u_int16_t *status, - struct fxp_softc *sc); +static __inline void fxp_dma_wait(struct fxp_softc *sc, + volatile u_int16_t *status, bus_dma_tag_t dmat, + bus_dmamap_t map); static device_method_t fxp_methods[] = { /* Device interface */ @@ -288,12 +289,16 @@ } static __inline void -fxp_dma_wait(volatile u_int16_t *status, struct fxp_softc *sc) +fxp_dma_wait(struct fxp_softc *sc, volatile u_int16_t *status, + bus_dma_tag_t dmat, bus_dmamap_t map) { int i = 10000; - while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) + bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD); + while (!(le16toh(*status) & FXP_CB_STATUS_C) && --i) { DELAY(2); + bus_dmamap_sync(dmat, map, BUS_DMASYNC_POSTREAD); + } if (i == 0) device_printf(sc->dev, "DMA timeout\n"); } @@ -1904,7 +1909,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->mcs_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&mcsp->cb_status, sc); + fxp_dma_wait(sc, &mcsp->cb_status, sc->mcs_tag, sc->mcs_map); bus_dmamap_sync(sc->mcs_tag, sc->mcs_map, BUS_DMASYNC_POSTWRITE); } @@ -2016,7 +2021,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cbp->cb_status, sc); + fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); /* @@ -2037,7 +2042,7 @@ bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_PREWRITE); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cb_ias->cb_status, sc); + fxp_dma_wait(sc, &cb_ias->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); /* @@ -2555,7 +2560,7 @@ CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->fxp_desc.cbl_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START); /* ...and wait for it to complete. */ - fxp_dma_wait(&cbp->cb_status, sc); + fxp_dma_wait(sc, &cbp->cb_status, sc->cbl_tag, sc->cbl_map); bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, BUS_DMASYNC_POSTWRITE); device_printf(sc->dev, "Microcode loaded, int_delay: %d usec bundle_max: %d\n",