From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51572106564A; Fri, 27 Jul 2012 10:41:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22EF08FC12; Fri, 27 Jul 2012 10:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6RAfsFh095774; Fri, 27 Jul 2012 10:41:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAfs81095771; Fri, 27 Jul 2012 10:41:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271041.q6RAfs81095771@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 10:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238836 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:41:55 -0000 Author: adrian Date: Fri Jul 27 10:41:54 2012 New Revision: 238836 URL: http://svn.freebsd.org/changeset/base/238836 Log: Allocate a descriptor ring for EDMA TX completion status. Configure the hardware with said ring physical address and size. Modified: head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Fri Jul 27 10:41:53 2012 (r238835) +++ head/sys/dev/ath/if_ath_tx_edma.c Fri Jul 27 10:41:54 2012 (r238836) @@ -119,17 +119,33 @@ __FBSDID("$FreeBSD$"); /* * some general macros - */ + */ #define INCR(_l, _sz) (_l) ++; (_l) &= ((_sz) - 1) #define DECR(_l, _sz) (_l) --; (_l) &= ((_sz) - 1) +/* + * XXX doesn't belong here, and should be tunable + */ +#define ATH_TXSTATUS_RING_SIZE 512 + MALLOC_DECLARE(M_ATHDEV); static int ath_edma_dma_txsetup(struct ath_softc *sc) { + int error; + + error = ath_descdma_alloc_desc(sc, &sc->sc_txsdma, + NULL, "txcomp", sc->sc_tx_statuslen, ATH_TXSTATUS_RING_SIZE); + if (error != 0) + return (error); + + ath_hal_setuptxstatusring(sc->sc_ah, + (void *) sc->sc_txsdma.dd_desc, + sc->sc_txsdma.dd_desc_paddr, + ATH_TXSTATUS_RING_SIZE); + - /* XXX placeholder */ return (0); } @@ -137,7 +153,7 @@ static int ath_edma_dma_txteardown(struct ath_softc *sc) { - /* XXX placeholder */ + ath_descdma_cleanup(sc, &sc->sc_txsdma, NULL); return (0); } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Jul 27 10:41:53 2012 (r238835) +++ head/sys/dev/ath/if_athvar.h Fri Jul 27 10:41:54 2012 (r238836) @@ -557,6 +557,7 @@ struct ath_softc { int sc_txbuf_cnt; /* how many buffers avail */ struct ath_descdma sc_txdma_mgmt; /* mgmt TX descriptors */ ath_bufhead sc_txbuf_mgmt; /* mgmt transmit buffer */ + struct ath_descdma sc_txsdma; /* EDMA TX status desc's */ struct mtx sc_txbuflock; /* txbuf lock */ char sc_txname[12]; /* e.g. "ath0_buf" */ u_int sc_txqsetup; /* h/w queues setup */