From owner-svn-src-user@FreeBSD.ORG Thu Sep 29 05:20:43 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6927D106566B; Thu, 29 Sep 2011 05:20:43 +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 4EEFA8FC12; Thu, 29 Sep 2011 05:20:43 +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 p8T5KhXT005971; Thu, 29 Sep 2011 05:20:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T5Khpt005967; Thu, 29 Sep 2011 05:20:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109290520.p8T5Khpt005967@svn.freebsd.org> From: Adrian Chadd Date: Thu, 29 Sep 2011 05:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225863 - in user/adrian/if_ath_tx/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 05:20:43 -0000 Author: adrian Date: Thu Sep 29 05:20:42 2011 New Revision: 225863 URL: http://svn.freebsd.org/changeset/base/225863 Log: Add in a local patch (not likely a merge candidate to -HEAD in this state) which enables KTR logging for the interrupt status registers. * Add a new field to the public HAL * add in code to ar5416GetPendingInterrupts() which populates it based on the contents of the AR_ISR{_S[0..5]} registers * log it via KTR in ath_intr() Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h Thu Sep 29 05:16:53 2011 (r225862) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h Thu Sep 29 05:20:42 2011 (r225863) @@ -809,6 +809,8 @@ struct ath_hal { uint16_t *ah_eepromdata; /* eeprom buffer, if needed */ + uint32_t ah_intrstate[8]; /* last int state */ + HAL_OPS_CONFIG ah_config; const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, u_int mode); Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Sep 29 05:16:53 2011 (r225862) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Sep 29 05:20:42 2011 (r225863) @@ -70,6 +70,8 @@ ar5416GetPendingInterrupts(struct ath_ha uint32_t isr, isr0, isr1, sync_cause = 0; HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + bzero(&ah->ah_intrstate, sizeof(ah->ah_intrstate)); + /* * Verify there's a mac interrupt and the RTC is on. */ @@ -90,6 +92,14 @@ ar5416GetPendingInterrupts(struct ath_ha return AH_FALSE; } + ah->ah_intrstate[0] = isr; + ah->ah_intrstate[1] = OS_REG_READ(ah, AR_ISR_S0); + ah->ah_intrstate[2] = OS_REG_READ(ah, AR_ISR_S1); + ah->ah_intrstate[3] = OS_REG_READ(ah, AR_ISR_S2); + ah->ah_intrstate[4] = OS_REG_READ(ah, AR_ISR_S3); + ah->ah_intrstate[5] = OS_REG_READ(ah, AR_ISR_S4); + ah->ah_intrstate[6] = OS_REG_READ(ah, AR_ISR_S5); + if (isr != 0) { struct ath_hal_5212 *ahp = AH5212(ah); uint32_t mask2; Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Thu Sep 29 05:16:53 2011 (r225862) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Thu Sep 29 05:20:42 2011 (r225863) @@ -1372,6 +1372,13 @@ ath_intr(void *arg) ath_hal_getisr(ah, &status); /* NB: clears ISR too */ DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status); CTR1(ATH_KTR_INTR, "ath_intr: mask=0x%.8x", status); + CTR5(ATH_KTR_INTR, + "ath_intr: ISR=0x%.8x, ISR_S0=0x%.8x, ISR_S1=0x%.8x, ISR_S2=0x%.8x, ISR_S5=0x%.8x", + ah->ah_intrstate[0], + ah->ah_intrstate[1], + ah->ah_intrstate[2], + ah->ah_intrstate[3], + ah->ah_intrstate[6]); status &= sc->sc_imask; /* discard unasked for bits */ /* Short-circuit un-handled interrupts */