From owner-p4-projects@FreeBSD.ORG Wed Jan 19 19:59:27 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7B9DE16A4D0; Wed, 19 Jan 2005 19:59:27 +0000 (GMT) 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 3E47216A4CE for ; Wed, 19 Jan 2005 19:59:27 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07C9743D39 for ; Wed, 19 Jan 2005 19:59:27 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j0JJxQLN076716 for ; Wed, 19 Jan 2005 19:59:26 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j0JJxQGx076713 for perforce@freebsd.org; Wed, 19 Jan 2005 19:59:26 GMT (envelope-from sam@freebsd.org) Date: Wed, 19 Jan 2005 19:59:26 GMT Message-Id: <200501191959.j0JJxQGx076713@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 69316 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: Wed, 19 Jan 2005 19:59:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=69316 Change 69316 by sam@sam_ebb on 2005/01/19 19:58:26 use bus_dmamap_load_mbuf_sg Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#70 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#70 (text+ko) ==== @@ -1987,18 +1987,6 @@ __func__, rfilt, mfilt[0], mfilt[1]); } -static void -ath_mbuf_load_cb(void *arg, bus_dma_segment_t *seg, int nseg, bus_size_t mapsize, int error) -{ - struct ath_buf *bf = arg; - - KASSERT(nseg <= ATH_MAX_SCATTER, ("too many DMA segments %u", nseg)); - KASSERT(error == 0, ("error %u on bus_dma callback", error)); - bf->bf_mapsize = mapsize; - bf->bf_nseg = nseg; - bcopy(seg, bf->bf_segs, nseg * sizeof (seg[0])); -} - /* * Set the slot time based on the current setting. */ @@ -2081,8 +2069,8 @@ sc->sc_stats.ast_be_nombuf++; return ENOMEM; } - error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_dmamap, m, - ath_mbuf_load_cb, bf, + error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, + bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); if (error == 0) { bf->bf_m = m; @@ -2227,12 +2215,12 @@ if (ieee80211_beacon_update(ic, bf->bf_node, &sc->sc_boff, m, ncabq)) { /* XXX too conservative? */ bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_dmamap, m, - ath_mbuf_load_cb, bf, + error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, + bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); if (error != 0) { if_printf(ic->ic_ifp, - "%s: bus_dmamap_load_mbuf failed, error %u\n", + "%s: bus_dmamap_load_mbuf_sg failed, error %u\n", __func__, error); return; } @@ -2732,14 +2720,14 @@ bf->bf_m = m; m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; - error = bus_dmamap_load_mbuf(sc->sc_dmat, + error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, - ath_mbuf_load_cb, bf, + bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); if (error != 0) { DPRINTF(sc, ATH_DEBUG_ANY, - "%s: bus_dmamap_load_mbuf failed; error %d\n", - __func__, error); + "%s: bus_dmamap_load_mbuf_sg failed; error %d\n", + __func__, error); sc->sc_stats.ast_rx_busdma++; return error; } @@ -3383,8 +3371,8 @@ * Load the DMA map so any coalescing is done. This * also calculates the number of descriptors we need. */ - error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_dmamap, m0, - ath_mbuf_load_cb, bf, + error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m0, + bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); if (error == EFBIG) { /* XXX packet requires too many descriptors */ @@ -3407,8 +3395,8 @@ m_freem(m0); return ENOMEM; } - error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_dmamap, m0, - ath_mbuf_load_cb, bf, + error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m0, + bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); if (error != 0) { sc->sc_stats.ast_tx_busdma++;