summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-02-18 04:10:38 +0000
committeradrian <adrian@FreeBSD.org>2013-02-18 04:10:38 +0000
commitbad82cfd1480327256eaaf9a89a7c75fa2f64a92 (patch)
treec8e8d6f62285430f0e75af0eed18d7f19b6471c5
parent6b4006784bf5a2b3ecc431d5887df4f4edec4ac7 (diff)
downloadFreeBSD-src-bad82cfd1480327256eaaf9a89a7c75fa2f64a92.zip
FreeBSD-src-bad82cfd1480327256eaaf9a89a7c75fa2f64a92.tar.gz
Add a new ATH KTR debug method to log the interrupt status.
-rw-r--r--sys/dev/ath/if_ath_alq.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath_alq.h b/sys/dev/ath/if_ath_alq.h
index 3748d50..52a022d 100644
--- a/sys/dev/ath/if_ath_alq.h
+++ b/sys/dev/ath/if_ath_alq.h
@@ -92,6 +92,13 @@ struct if_ath_alq_tdma_timer_set {
uint32_t sc_tdmaswbaprep;
};
+#define ATH_ALQ_INTR_STATUS 10
+struct if_ath_alq_interrupt {
+ uint32_t intr_status;
+ uint32_t intr_state[8];
+ uint32_t intr_syncstate;
+};
+
/*
* These will always be logged, regardless.
*/
@@ -144,6 +151,27 @@ extern int if_ath_alq_start(struct if_ath_alq *alq);
extern int if_ath_alq_stop(struct if_ath_alq *alq);
extern void if_ath_alq_post(struct if_ath_alq *alq, uint16_t op,
uint16_t len, const char *buf);
+
+/* XXX maybe doesn't belong here? */
+static inline void
+if_ath_alq_post_intr(struct if_ath_alq *alq, uint32_t status,
+ uint32_t *state, uint32_t sync_state)
+{
+ int i;
+ struct if_ath_alq_interrupt intr;
+
+ if (! if_ath_alq_checkdebug(alq, ATH_ALQ_INTR_STATUS))
+ return;
+
+ intr.intr_status = htobe32(status);
+ for (i = 0; i < 8; i++)
+ intr.intr_state[i] = htobe32(state[i]);
+ intr.intr_syncstate = htobe32(sync_state);
+
+ if_ath_alq_post(alq, ATH_ALQ_INTR_STATUS, sizeof(&intr),
+ (const char *) &intr);
+}
+
#endif /* _KERNEL */
#endif
OpenPOWER on IntegriCloud