svn commit: r225863 - in user/adrian/if_ath_tx/sys/dev/ath: . ath_hal ath_hal/ar5416

Adrian Chadd adrian at FreeBSD.org
Thu Sep 29 05:20:43 UTC 2011


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 */


More information about the svn-src-user mailing list