Fix compilation with HAL_DEBUG=1

Provide forward declaration of struct ath_hal in ah_osdep.h.  Implement
OS_GETUPTIME (the implementation is quite primitive, as it's only used
once for some obscure condition in 5212 chips).  Implement HALDEBUG()
and ath_hal_ether_sprintf().


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4019 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2009-05-07 20:40:54 +00:00
parent 0e32b2c2a3
commit 200f8b8a6a
2 changed files with 25 additions and 0 deletions

View File

@ -264,6 +264,27 @@ ath_hal_printf(struct ath_hal *ah, HAL_BOOL prefer_alq, const char *fmt, ...)
} }
EXPORT_SYMBOL(ath_hal_printf); 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 /* 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 * for). Names were taken from openhal ar5212regs.h. Return AH_TRUE if the
* name is a known ar5212 register, and AH_FALSE otherwise. */ * name is a known ar5212 register, and AH_FALSE otherwise. */

View File

@ -214,6 +214,7 @@ struct ath_hal_rf *const *ah_rfs_ptrs[] = { \
#if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ) #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_WRITE(_ah, _reg, _val) ath_hal_reg_write(_ah, _reg, _val)
#define OS_REG_READ(_ah, _reg) ath_hal_reg_read(_ah, _reg) #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, extern void __ahdecl ath_hal_reg_write(struct ath_hal *ah, u_int reg,
u_int32_t val); u_int32_t val);
extern u_int32_t __ahdecl ath_hal_reg_read(struct ath_hal *ah, u_int reg); extern u_int32_t __ahdecl ath_hal_reg_read(struct ath_hal *ah, u_int reg);
@ -226,6 +227,9 @@ extern u_int32_t __ahdecl ath_hal_reg_read(struct ath_hal *ah, u_int reg);
extern void __ahdecl ath_hal_delay(int); extern void __ahdecl ath_hal_delay(int);
#define OS_DELAY(_n) ath_hal_delay(_n) #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_INLINE __inline
#define OS_MEMZERO(_a, _n) ath_hal_memzero((_a), (_n)) #define OS_MEMZERO(_a, _n) ath_hal_memzero((_a), (_n))
extern void __ahdecl ath_hal_memzero(void *, size_t); extern void __ahdecl ath_hal_memzero(void *, size_t);