Commit 98b36a02 authored by Ben Greear's avatar Ben Greear Committed by John W. Linville

ath9k: Add wiphy name to log messages.

On systems with multiple NICs, it's nice to know which
one is producing warnings.  Here is an example of the
new ouput:

ath: wiphy0: Failed to stop TX DMA, queues=0x005!
Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4e13f092
...@@ -174,28 +174,24 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry); ...@@ -174,28 +174,24 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);
void ath_hw_cycle_counters_update(struct ath_common *common); void ath_hw_cycle_counters_update(struct ath_common *common);
int32_t ath_hw_get_listen_time(struct ath_common *common); int32_t ath_hw_get_listen_time(struct ath_common *common);
extern __printf(2, 3) void ath_printk(const char *level, const char *fmt, ...); __printf(3, 4)
void ath_printk(const char *level, const struct ath_common *common,
#define _ath_printk(level, common, fmt, ...) \ const char *fmt, ...);
do { \
__always_unused struct ath_common *unused = common; \
ath_printk(level, fmt, ##__VA_ARGS__); \
} while (0)
#define ath_emerg(common, fmt, ...) \ #define ath_emerg(common, fmt, ...) \
_ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__) ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__)
#define ath_alert(common, fmt, ...) \ #define ath_alert(common, fmt, ...) \
_ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__) ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__)
#define ath_crit(common, fmt, ...) \ #define ath_crit(common, fmt, ...) \
_ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__) ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__)
#define ath_err(common, fmt, ...) \ #define ath_err(common, fmt, ...) \
_ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__) ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__)
#define ath_warn(common, fmt, ...) \ #define ath_warn(common, fmt, ...) \
_ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__) ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__)
#define ath_notice(common, fmt, ...) \ #define ath_notice(common, fmt, ...) \
_ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__) ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__)
#define ath_info(common, fmt, ...) \ #define ath_info(common, fmt, ...) \
_ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__) ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__)
/** /**
* enum ath_debug_level - atheros wireless debug level * enum ath_debug_level - atheros wireless debug level
...@@ -256,7 +252,7 @@ enum ATH_DEBUG { ...@@ -256,7 +252,7 @@ enum ATH_DEBUG {
#define ath_dbg(common, dbg_mask, fmt, ...) \ #define ath_dbg(common, dbg_mask, fmt, ...) \
do { \ do { \
if ((common)->debug_mask & ATH_DBG_##dbg_mask) \ if ((common)->debug_mask & ATH_DBG_##dbg_mask) \
_ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \ ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \
} while (0) } while (0)
#define ATH_DBG_WARN(foo, arg...) WARN(foo, arg) #define ATH_DBG_WARN(foo, arg...) WARN(foo, arg)
......
...@@ -57,7 +57,8 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common, ...@@ -57,7 +57,8 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
} }
EXPORT_SYMBOL(ath_rxbuf_alloc); EXPORT_SYMBOL(ath_rxbuf_alloc);
void ath_printk(const char *level, const char *fmt, ...) void ath_printk(const char *level, const struct ath_common* common,
const char *fmt, ...)
{ {
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
...@@ -67,7 +68,11 @@ void ath_printk(const char *level, const char *fmt, ...) ...@@ -67,7 +68,11 @@ void ath_printk(const char *level, const char *fmt, ...)
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; vaf.va = &args;
printk("%sath: %pV", level, &vaf); if (common && common->hw && common->hw->wiphy)
printk("%sath: %s: %pV",
level, wiphy_name(common->hw->wiphy), &vaf);
else
printk("%sath: %pV", level, &vaf);
va_end(args); va_end(args);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment