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 *);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to