summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/ath_hal/ah_internal.h
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-06-23 06:55:29 +0000
committeradrian <adrian@FreeBSD.org>2011-06-23 06:55:29 +0000
commitd00135573a2cb956464d92b084d1337dd4be1910 (patch)
tree8f16c5f681f3d6e963637221a8a0b3cd133cfad8 /sys/dev/ath/ath_hal/ah_internal.h
parent65bbe8b4728cec874007cf3b252103f6641d694b (diff)
downloadFreeBSD-src-d00135573a2cb956464d92b084d1337dd4be1910.zip
FreeBSD-src-d00135573a2cb956464d92b084d1337dd4be1910.tar.gz
Re-introduce a global ath_hal_debug again for now, whilst I figure out what
to do about the few cases where the HAL state isn't available (regdomain) or isn't yet setup (probe/attach.) The global ath_hal_debug now affects all instances of the HAL. This also restores the ability for probe/attach debugging to work; as the sysctl tree may not be attached at that point. Users can just set the global "hw.ath.hal.debug" to a suitable value to enable probe/attach related debugging.
Diffstat (limited to 'sys/dev/ath/ath_hal/ah_internal.h')
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index 91edc34..0959218 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -498,10 +498,29 @@ extern void ath_hal_free(void *);
/* common debugging interfaces */
#ifdef AH_DEBUG
#include "ah_debug.h"
+extern int ath_hal_debug; /* Global debug flags */
+
+/*
+ * This is used for global debugging, when ahp doesn't yet have the
+ * related debugging state. For example, during probe/attach.
+ */
+#define HALDEBUG_G(_ah, __m, ...) \
+ do { \
+ if ((__m) == HAL_DEBUG_UNMASKABLE || \
+ ath_hal_debug & (__m)) { \
+ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \
+ } \
+ } while (0);
+
+/*
+ * This is used for local debugging, when ahp isn't NULL and
+ * thus may have debug flags set.
+ */
#define HALDEBUG(_ah, __m, ...) \
do { \
if ((__m) == HAL_DEBUG_UNMASKABLE || \
- ((_ah != AH_NULL) && (((struct ath_hal*)_ah)->ah_config.ah_debug & (__m)))) { \
+ ath_hal_debug & (__m) || \
+ (_ah)->ah_config.ah_debug & (__m)) { \
DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \
} \
} while(0);
OpenPOWER on IntegriCloud