From owner-svn-src-all@FreeBSD.ORG Mon Apr 18 12:15:44 2011 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 5A559106566B; Mon, 18 Apr 2011 12:15:44 +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 45C2D8FC16; Mon, 18 Apr 2011 12:15:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3ICFikG071350; Mon, 18 Apr 2011 12:15:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3ICFiVr071342; Mon, 18 Apr 2011 12:15:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104181215.p3ICFiVr071342@svn.freebsd.org> From: Adrian Chadd Date: Mon, 18 Apr 2011 12:15:44 +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: r220772 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 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, 18 Apr 2011 12:15:44 -0000 Author: adrian Date: Mon Apr 18 12:15:43 2011 New Revision: 220772 URL: http://svn.freebsd.org/changeset/base/220772 Log: Add global TX timeout handling. The global TX timeout counter increments whenever a frame is ready to be transmitted and the medium is busy. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/ath_hal/ah.h Mon Apr 18 12:15:43 2011 (r220772) @@ -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; /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Apr 18 12:15:43 2011 (r220772) @@ -275,6 +275,8 @@ ar5416GetCapability(struct ath_hal *ah, 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: Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Apr 18 12:15:43 2011 (r220772) @@ -605,10 +605,8 @@ ar5416InitUserSettings(struct ath_hal *a 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 Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/if_ath.c Mon Apr 18 12:15:43 2011 (r220772) @@ -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); Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/if_ath_sysctl.c Mon Apr 18 12:15:43 2011 (r220772) @@ -705,6 +705,8 @@ ath_sysctl_stats_attach(struct ath_softc &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); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/if_athioctl.h Mon Apr 18 12:15:43 2011 (r220772) @@ -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) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Apr 18 11:25:13 2011 (r220771) +++ head/sys/dev/ath/if_athvar.h Mon Apr 18 12:15:43 2011 (r220772) @@ -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)))