diff options
author | adrian <adrian@FreeBSD.org> | 2011-03-05 21:20:18 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-03-05 21:20:18 +0000 |
commit | 3b8e8b2e3136f809f5a78af99a2dee2f5687e84a (patch) | |
tree | 9ab5175c3a13e8a187e341ea36e22efc6eb35447 /sys/dev/ath/ah_osdep.c | |
parent | de259f37cb31240cbd58da707d68faf712d77bb3 (diff) | |
download | FreeBSD-src-3b8e8b2e3136f809f5a78af99a2dee2f5687e84a.zip FreeBSD-src-3b8e8b2e3136f809f5a78af99a2dee2f5687e84a.tar.gz |
Change HALDEBUG() to be a macro that conditionally calls the debug output routine.
The earlier way of doing debugging would evaluate the function parameters
before calling the HALDEBUG. In the case of detailed register debugging
would mean a -lot- of unneeded register IO and other stuff was going on.
This method evaluates the ath_hal_debug variable before the function
parameters are evaluated, drastically reducing the amount of overhead
enabling HAL debugging during compilation.
Diffstat (limited to 'sys/dev/ath/ah_osdep.c')
-rw-r--r-- | sys/dev/ath/ah_osdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ath/ah_osdep.c b/sys/dev/ath/ah_osdep.c index 6b11b21..2cd6c97 100644 --- a/sys/dev/ath/ah_osdep.c +++ b/sys/dev/ath/ah_osdep.c @@ -71,7 +71,7 @@ extern void ath_hal_assert_failed(const char* filename, int lineno, const char* msg); #endif #ifdef AH_DEBUG -extern void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...); +extern void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...); #endif /* AH_DEBUG */ /* NB: put this here instead of the driver to avoid circular references */ @@ -79,7 +79,7 @@ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); #ifdef AH_DEBUG -static int ath_hal_debug = 0; +int ath_hal_debug = 0; SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, 0, "Atheros HAL debugging printfs"); TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); @@ -136,7 +136,7 @@ ath_hal_ether_sprintf(const u_int8_t *mac) #ifdef AH_DEBUG void -HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) +DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { if (ath_hal_debug & mask) { __va_list ap; |