aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2011-04-18 12:15:43 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2011-04-18 12:15:43 +0000
commit6ad02dbafe6826656b54e59661e5f1054a9a2a24 (patch)
tree347dccdd55cc3f722f7e0dcd971cdbdf806bad9f /sys/dev/ath
parent66f3a31ff930ce74cf6f15f9228b3b8f1403ba43 (diff)
downloadsrc-6ad02dbafe6826656b54e59661e5f1054a9a2a24.tar.gz
src-6ad02dbafe6826656b54e59661e5f1054a9a2a24.zip
Add global TX timeout handling.
The global TX timeout counter increments whenever a frame is ready to be transmitted and the medium is busy.
Notes
Notes: svn path=/head/; revision=220772
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/ath_hal/ah.h1
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_misc.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_reset.c6
-rw-r--r--sys/dev/ath/if_ath.c6
-rw-r--r--sys/dev/ath/if_ath_sysctl.c2
-rw-r--r--sys/dev/ath/if_athioctl.h3
-rw-r--r--sys/dev/ath/if_athvar.h2
7 files changed, 17 insertions, 5 deletions
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h
index e8ef39908c7d..e234efa1ae35 100644
--- a/sys/dev/ath/ath_hal/ah.h
+++ b/sys/dev/ath/ath_hal/ah.h
@@ -123,6 +123,7 @@ typedef enum {
HAL_CAP_SPLIT_4KB_TRANS = 40, /* hardware supports descriptors straddling a 4k page boundary */
HAL_CAP_HAS_PSPOLL = 41, /* hardware has ps-poll support */
HAL_CAP_RXDESC_SELFLINK = 42, /* support a self-linked tail RX descriptor */
+ HAL_CAP_GTXTO = 43, /* hardware supports global tx timeout */
} HAL_CAPABILITY_TYPE;
/*
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c b/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
index 359d71d64412..b16394a557fa 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
@@ -275,6 +275,8 @@ ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
uint32_t capability, uint32_t *result)
{
switch (type) {
+ case HAL_CAP_GTXTO:
+ return HAL_OK; /* All AR5416+ supports Global TX Timeout */
case HAL_CAP_BB_HANG:
switch (capability) {
case HAL_BB_HANG_RIFS:
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
index 3908fee8f935..011ee3d6c07d 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
@@ -605,10 +605,8 @@ ar5416InitUserSettings(struct ath_hal *ah)
ar5212SetCTSTimeout(ah, ahp->ah_ctstimeout);
if (AH_PRIVATE(ah)->ah_diagreg != 0)
OS_REG_WRITE(ah, AR_DIAG_SW, AH_PRIVATE(ah)->ah_diagreg);
-#if 0 /* XXX Todo */
- if (ahp->ah_globaltxtimeout != (u_int) -1)
- ar5416SetGlobalTxTimeout(ah, ahp->ah_globaltxtimeout);
-#endif
+ if (AH5416(ah)->ah_globaltxtimeout != (u_int) -1)
+ ar5416SetGlobalTxTimeout(ah, AH5416(ah)->ah_globaltxtimeout);
}
static void
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index c2357143fbe0..10161fdf6b0d 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1355,6 +1355,8 @@ ath_intr(void *arg)
sc->sc_stats.ast_bmiss++;
taskqueue_enqueue(sc->sc_tq, &sc->sc_bmisstask);
}
+ if (status & HAL_INT_GTT)
+ sc->sc_stats.ast_tx_timeout++;
if (status & HAL_INT_MIB) {
sc->sc_stats.ast_mib++;
/*
@@ -1559,6 +1561,10 @@ ath_init(void *arg)
if (sc->sc_needmib && ic->ic_opmode == IEEE80211_M_STA)
sc->sc_imask |= HAL_INT_MIB;
+ /* Enable global TX timeout statistics if available */
+ if (ath_hal_gtxto_supported(ah))
+ sc->sc_imask |= (HAL_INT_GTT & HAL_INT_BMISC);
+
ifp->if_drv_flags |= IFF_DRV_RUNNING;
callout_reset(&sc->sc_wd_ch, hz, ath_watchdog, sc);
ath_hal_intrset(ah, sc->sc_imask);
diff --git a/sys/dev/ath/if_ath_sysctl.c b/sys/dev/ath/if_ath_sysctl.c
index 9339d186599d..45a9b5d738d7 100644
--- a/sys/dev/ath/if_ath_sysctl.c
+++ b/sys/dev/ath/if_ath_sysctl.c
@@ -705,6 +705,8 @@ ath_sysctl_stats_attach(struct ath_softc *sc)
&sc->sc_stats.ast_tx_htprotect, 0, "HT tx frames with protection");
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_hitqueueend", CTLFLAG_RD,
&sc->sc_stats.ast_rx_hitqueueend, 0, "RX hit queue end");
+ SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_timeout", CTLFLAG_RD,
+ &sc->sc_stats.ast_tx_timeout, 0, "TX Global Timeout");
/* Attach the RX phy error array */
ath_sysctl_stats_attach_rxphyerr(sc, child);
diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h
index 6d99372f0c0e..644d3184fb40 100644
--- a/sys/dev/ath/if_athioctl.h
+++ b/sys/dev/ath/if_athioctl.h
@@ -129,7 +129,8 @@ struct ath_stats {
u_int32_t ast_rx_hi_rx_chain;
u_int32_t ast_tx_htprotect; /* HT tx frames with protection */
u_int32_t ast_rx_hitqueueend;
- u_int32_t ast_pad[2];
+ u_int32_t ast_tx_timeout; /* Global TX timeout */
+ u_int32_t ast_pad[1];
};
#define SIOCGATHSTATS _IOWR('i', 137, struct ifreq)
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index dcb57ef5cdc0..26a50bc5d65a 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -649,6 +649,8 @@ void ath_intr(void *);
(ath_hal_getcapability(_ah, HAP_CAP_SPLIT_4KB_TRANS, 0, NULL) == HAL_OK)
#define ath_hal_self_linked_final_rxdesc(_ah) \
(ath_hal_getcapability(_ah, HAL_CAP_RXDESC_SELFLINK, 0, NULL) == HAL_OK)
+#define ath_hal_gtxto_supported(_ah) \
+ (ath_hal_getcapability(_ah, HAL_CAP_GTXTO, 0, NULL) == HAL_OK)
#define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \
((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq)))