aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2012-03-08 13:20:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-12 14:19:36 -0400
commit98b36a029550def4b3e76cc44d4345bf20a729bd (patch)
tree587283350b0b82234768d059645748610c7bc064 /drivers
parent4e13f092f755df5ed8169c8d8bfb952dc057e1aa (diff)
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: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath.h26
-rw-r--r--drivers/net/wireless/ath/main.c9
2 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index efc01110dc34..c54b7d37bff1 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -174,28 +174,24 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);
174void ath_hw_cycle_counters_update(struct ath_common *common); 174void ath_hw_cycle_counters_update(struct ath_common *common);
175int32_t ath_hw_get_listen_time(struct ath_common *common); 175int32_t ath_hw_get_listen_time(struct ath_common *common);
176 176
177extern __printf(2, 3) void ath_printk(const char *level, const char *fmt, ...); 177__printf(3, 4)
178 178void ath_printk(const char *level, const struct ath_common *common,
179#define _ath_printk(level, common, fmt, ...) \ 179 const char *fmt, ...);
180do { \
181 __always_unused struct ath_common *unused = common; \
182 ath_printk(level, fmt, ##__VA_ARGS__); \
183} while (0)
184 180
185#define ath_emerg(common, fmt, ...) \ 181#define ath_emerg(common, fmt, ...) \
186 _ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__) 182 ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__)
187#define ath_alert(common, fmt, ...) \ 183#define ath_alert(common, fmt, ...) \
188 _ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__) 184 ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__)
189#define ath_crit(common, fmt, ...) \ 185#define ath_crit(common, fmt, ...) \
190 _ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__) 186 ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__)
191#define ath_err(common, fmt, ...) \ 187#define ath_err(common, fmt, ...) \
192 _ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__) 188 ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__)
193#define ath_warn(common, fmt, ...) \ 189#define ath_warn(common, fmt, ...) \
194 _ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__) 190 ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__)
195#define ath_notice(common, fmt, ...) \ 191#define ath_notice(common, fmt, ...) \
196 _ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__) 192 ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__)
197#define ath_info(common, fmt, ...) \ 193#define ath_info(common, fmt, ...) \
198 _ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__) 194 ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__)
199 195
200/** 196/**
201 * enum ath_debug_level - atheros wireless debug level 197 * enum ath_debug_level - atheros wireless debug level
@@ -256,7 +252,7 @@ enum ATH_DEBUG {
256#define ath_dbg(common, dbg_mask, fmt, ...) \ 252#define ath_dbg(common, dbg_mask, fmt, ...) \
257do { \ 253do { \
258 if ((common)->debug_mask & ATH_DBG_##dbg_mask) \ 254 if ((common)->debug_mask & ATH_DBG_##dbg_mask) \
259 _ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \ 255 ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \
260} while (0) 256} while (0)
261 257
262#define ATH_DBG_WARN(foo, arg...) WARN(foo, arg) 258#define ATH_DBG_WARN(foo, arg...) WARN(foo, arg)
diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c
index d9218fe02036..ea2c737138d3 100644
--- a/drivers/net/wireless/ath/main.c
+++ b/drivers/net/wireless/ath/main.c
@@ -57,7 +57,8 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
57} 57}
58EXPORT_SYMBOL(ath_rxbuf_alloc); 58EXPORT_SYMBOL(ath_rxbuf_alloc);
59 59
60void ath_printk(const char *level, const char *fmt, ...) 60void ath_printk(const char *level, const struct ath_common* common,
61 const char *fmt, ...)
61{ 62{
62 struct va_format vaf; 63 struct va_format vaf;
63 va_list args; 64 va_list args;
@@ -67,7 +68,11 @@ void ath_printk(const char *level, const char *fmt, ...)
67 vaf.fmt = fmt; 68 vaf.fmt = fmt;
68 vaf.va = &args; 69 vaf.va = &args;
69 70
70 printk("%sath: %pV", level, &vaf); 71 if (common && common->hw && common->hw->wiphy)
72 printk("%sath: %s: %pV",
73 level, wiphy_name(common->hw->wiphy), &vaf);
74 else
75 printk("%sath: %pV", level, &vaf);
71 76
72 va_end(args); 77 va_end(args);
73} 78}