Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290270
b: refs/heads/master
c: 3b1b7d0
h: refs/heads/master
v: v3
  • Loading branch information
Kalle Valo committed Jan 18, 2012
1 parent c71a522 commit e255a39
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5afa5aa79680ee107fef1195c80f5f67c54b6691
refs/heads/master: 3b1b7d0985fdb26403678e49938a668ef7f772ea
30 changes: 30 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,36 @@ int ath6kl_printk(const char *level, const char *fmt, ...)

#ifdef CONFIG_ATH6KL_DEBUG

void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
{
struct va_format vaf;
va_list args;

if (!(debug_mask & mask))
return;

va_start(args, fmt);

vaf.fmt = fmt;
vaf.va = &args;

ath6kl_printk(KERN_DEBUG, "%pV", &vaf);

va_end(args);
}

void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
const char *msg, const char *prefix,
const void *buf, size_t len)
{
if (debug_mask & mask) {
if (msg)
ath6kl_dbg(mask, "%s\n", msg);

print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
}
}

#define REG_OUTPUT_LEN_PER_LINE 25
#define REGTYPE_STR_LEN 100

Expand Down
25 changes: 4 additions & 21 deletions trunk/drivers/net/wireless/ath/ath6kl/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,11 @@ enum ath6kl_war {
};

#ifdef CONFIG_ATH6KL_DEBUG
#define ath6kl_dbg(mask, fmt, ...) \
({ \
int rtn; \
if (debug_mask & mask) \
rtn = ath6kl_printk(KERN_DEBUG, fmt, ##__VA_ARGS__); \
else \
rtn = 0; \
\
rtn; \
})

static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
const char *msg, const char *prefix,
const void *buf, size_t len)
{
if (debug_mask & mask) {
if (msg)
ath6kl_dbg(mask, "%s\n", msg);

print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
}
}
void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...);
void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
const char *msg, const char *prefix,
const void *buf, size_t len);

void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_proc_registers *irq_proc_reg,
Expand Down

0 comments on commit e255a39

Please sign in to comment.