From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 02:49:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5EDE1065676; Mon, 23 Jul 2012 02:49:25 +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 B0B378FC12; Mon, 23 Jul 2012 02:49:25 +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 q6N2nPR6056224; Mon, 23 Jul 2012 02:49:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N2nPwK056220; Mon, 23 Jul 2012 02:49:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207230249.q6N2nPwK056220@svn.freebsd.org> From: Adrian Chadd Date: Mon, 23 Jul 2012 02:49:25 +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: r238709 - 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: Mon, 23 Jul 2012 02:49:26 -0000 Author: adrian Date: Mon Jul 23 02:49:25 2012 New Revision: 238709 URL: http://svn.freebsd.org/changeset/base/238709 Log: Flesh out a new DMA map for the EDMA TX completion status, as well as a lock to go with that whole code path. Modified: head/sys/dev/ath/if_ath_ahb.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Mon Jul 23 02:26:33 2012 (r238708) +++ head/sys/dev/ath/if_ath_ahb.c Mon Jul 23 02:49:25 2012 (r238709) @@ -194,11 +194,13 @@ ath_ahb_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); + ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(AR9130_DEVID, sc); if (error == 0) /* success */ return 0; + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); @@ -240,6 +242,7 @@ ath_ahb_detach(device_t dev) if (sc->sc_eepromdata) free(sc->sc_eepromdata, M_TEMP); + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Mon Jul 23 02:26:33 2012 (r238708) +++ head/sys/dev/ath/if_ath_pci.c Mon Jul 23 02:49:25 2012 (r238709) @@ -250,11 +250,13 @@ ath_pci_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); + ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(pci_get_device(dev), sc); if (error == 0) /* success */ return 0; + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); @@ -295,6 +297,7 @@ ath_pci_detach(device_t dev) if (sc->sc_eepromdata) free(sc->sc_eepromdata, M_TEMP); + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 23 02:26:33 2012 (r238708) +++ head/sys/dev/ath/if_athvar.h Mon Jul 23 02:49:25 2012 (r238709) @@ -558,6 +558,11 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ + + struct ath_descdma sc_txcompdma; /* TX EDMA completion */ + struct mtx sc_txcomplock; /* TX EDMA completion lock */ + char sc_txcompname[12]; /* eg ath0_txcomp */ + int sc_wd_timer; /* count down for wd timer */ struct callout sc_wd_ch; /* tx watchdog timer */ struct ath_tx_radiotap_header sc_tx_th; @@ -735,6 +740,19 @@ struct ath_softc { #define ATH_TXBUF_LOCK_ASSERT(_sc) \ mtx_assert(&(_sc)->sc_txbuflock, MA_OWNED) +#define ATH_TXSTATUS_LOCK_INIT(_sc) do { \ + snprintf((_sc)->sc_txcompname, sizeof((_sc)->sc_txcompname), \ + "%s_buf", \ + device_get_nameunit((_sc)->sc_dev)); \ + mtx_init(&(_sc)->sc_txcomplock, (_sc)->sc_txcompname, NULL, \ + MTX_DEF); \ +} while (0) +#define ATH_TXSTATUS_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_txcomplock) +#define ATH_TXSTATUS_LOCK(_sc) mtx_lock(&(_sc)->sc_txcomplock) +#define ATH_TXSTATUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_txcomplock) +#define ATH_TXSTATUS_LOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->sc_txcomplock, MA_OWNED) + int ath_attach(u_int16_t, struct ath_softc *); int ath_detach(struct ath_softc *); void ath_resume(struct ath_softc *);