}
EXPORT_SYMBOL(ath_hal_print_register);
-static inline void
-_trace_regop(struct ath_hal *ah, int regop, u_int address, u_int32_t value)
-{
-#ifdef AH_DEBUG
- switch (ath_hal_debug) {
- case HAL_DEBUG_OFF:
- break;
- case HAL_DEBUG_REGOPS:
- /* XXX: Identify wifiX */
- _print_undecoded_register(ah, ath_hal_device, AH_TRUE /* prefer alq */,
- regop, address,
- value);
- break;
- default:
- /* XXX: Identify wifiX */
- _print_decoded_register(ah, ath_hal_device, AH_TRUE /* prefer alq */,
- regop, address,
- ((regop == REGOP_WRITE && ath_hal_debug >= HAL_DEBUG_REGOPS_DELTAS) ?
- _OS_REG_READ(ah, address) :
- value),
- value,
- (ath_hal_debug >= HAL_DEBUG_REGOPS_BITFIELDS));
- break;
- }
-
-#endif /* AH_DEBUG */
-}
-
#if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ)
/*
* Memory-mapped device register read/write. These are here
void __ahdecl
ath_hal_reg_write(struct ath_hal *ah, u_int address, u_int32_t value)
{
- _trace_regop(ah, REGOP_WRITE, address, value);
_OS_REG_WRITE(ah, address, value);
}
EXPORT_SYMBOL(ath_hal_reg_write);
ath_hal_reg_read(struct ath_hal *ah, u_int address)
{
u_int32_t val = _OS_REG_READ(ah, address);
- _trace_regop(ah, REGOP_READ, address, val);
return val;
}
EXPORT_SYMBOL(ath_hal_reg_read);
EXPORT_SYMBOL(ath_hal_mhz2ieee);
EXPORT_SYMBOL(ath_hal_process_noisefloor);
-#ifdef MMIOTRACE
-extern void (*kmmio_logmsg)(struct ath_hal *ah, u8 write, u_int address, u_int32_t val);
-
-void _trace_regop(struct ath_hal *ah, int regop, u_int address, u_int32_t newval);
-static void _kmmio_logmsg(struct ath_hal *ah, u8 write, u_int address, u_int32_t val) {
- _trace_regop(ah, write ? REGOP_WRITE : REGOP_READ, address, val);
-}
-#endif /* MMIOTRACE */
-
-
static int __init
init_ath_hal(void)
{
-#ifdef MMIOTRACE
- kmmio_logmsg = _kmmio_logmsg;
-#endif
-
ath_hal_sysctl_register();
return (0);
}
static void __exit
exit_ath_hal(void)
{
-#ifdef MMIOTRACE
- kmmio_logmsg = NULL;
-#endif
ath_hal_sysctl_unregister();
}
module_exit(exit_ath_hal);
#define labs(_a) __builtin_labs(_a)
#endif
-#define HAL_DEBUG_OFF 0
-/* Show register accesses */
-#define HAL_DEBUG_REGOPS 1
-/* Show decoded register dump (include name, etc) */
-#define HAL_DEBUG_REGOPS_DECODED 2
-/* Show bit-fields where we put decode logic in */
-#define HAL_DEBUG_REGOPS_BITFIELDS 3
-/* Add a read before a write to show 'changes', may have side-effects */
-#define HAL_DEBUG_REGOPS_DELTAS 4
-
/* XXX: This should be stored per-device for proper multi-radio support */
extern const char *ath_hal_func;
extern const char *ath_hal_device;