}
EXPORT_SYMBOL(ath_hal_printf);
+#ifdef AH_DEBUG
+extern const char *ath_hal_ether_sprintf(const uint8_t *mac)
+{
+ static char buf[18];
+ sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2],
+ mac[3], mac[4], mac[5]);
+ return buf;
+}
+
+void
+HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
+{
+ if (ath_hal_debug & mask) {
+ __va_list ap;
+ va_start(ap, fmt);
+ _hal_vprintf(ah, AH_FALSE, fmt, ap);
+ va_end(ap);
+ }
+}
+#endif /* AH_DEBUG */
+
/* Lookup a friendly name for a register address (for any we have nicknames
* for). Names were taken from openhal ar5212regs.h. Return AH_TRUE if the
* name is a known ar5212 register, and AH_FALSE otherwise. */
#if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ)
#define OS_REG_WRITE(_ah, _reg, _val) ath_hal_reg_write(_ah, _reg, _val)
#define OS_REG_READ(_ah, _reg) ath_hal_reg_read(_ah, _reg)
+struct ath_hal;
extern void __ahdecl ath_hal_reg_write(struct ath_hal *ah, u_int reg,
u_int32_t val);
extern u_int32_t __ahdecl ath_hal_reg_read(struct ath_hal *ah, u_int reg);
extern void __ahdecl ath_hal_delay(int);
#define OS_DELAY(_n) ath_hal_delay(_n)
+/* Uptime in milliseconds, used by debugging code only */
+#define OS_GETUPTIME(_ah) ((int)(1000 * jiffies / HZ))
+
#define OS_INLINE __inline
#define OS_MEMZERO(_a, _n) ath_hal_memzero((_a), (_n))
extern void __ahdecl ath_hal_memzero(void *, size_t);