ath9k: Add wiphy name to log messages.
Subsystems (3)
PATCH 1/1 ath9k: Add wiphy name to log messages.
From: Ben Greear <[email protected]>
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!
---
:100644 100644 efc0111... 54f255d... M drivers/net/wireless/ath/ath.h
:100644 100644 d9218fe... ea2c737... M drivers/net/wireless/ath/main.c
drivers/net/wireless/ath/ath.h | 7 ++++--- drivers/net/wireless/ath/main.c | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath.h +4 -3
@@ -174,12 +174,13 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);void ath_hw_cycle_counters_update (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, ...); +extern __printf(3, 4) void ath_printk(const char *level, + const struct ath_common *common, + const char *fmt, ...); #define _ath_printk(level, common, fmt, ...) \ do { \ - __always_unused struct ath_common *unused = common; \ - ath_printk(level, fmt, ##__VA_ARGS__); \ + ath_printk(level, common, fmt, ##__VA_ARGS__); \ } while (0)#define ath_emerg (common, fmt, ...) \
drivers/net/wireless/ath/main.c +7 -2
@@ -57,7 +57,8 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common, }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;va_list args;
@@ -67,7 +68,11 @@ void ath_printk(const char *level, const char *fmt, ...) vaf.fmt = fmt; 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); }
Signature · 1 line
1.7.3.4
Quoted 7 lines · greearb at candelatech.com
From: Ben Greear <[email protected]>
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!
Makes some sense.
drivers/net/wireless/ath/ath.h
Quoted 1 line
drivers/net/wireless/ath/ath.h +0
-0
[]
drivers/net/wireless/ath/ath.h bool ath_hw_keyreset(struct ath_common *common, u16 entry); · line 179
Quoted 8 lines
drivers/net/wireless/ath/ath.h +3
-1@@ -174,12 +174,13 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);void ath_hw_cycle_counters_update (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, ...); +extern __printf(3, 4) void ath_printk(const char *level, + const struct ath_common *common, + const char *fmt, ...);
Maybe
__printf(3, 4)
void ath_printk(etc...
drivers/net/wireless/ath/ath.h bool ath_hw_keyreset(struct ath_common *common, u16 entry); · line 186
Quoted 9 lines
drivers/net/wireless/ath/ath.h +1
-2#define _ath_printk (level, common, fmt, ...) \ do { \ - __always_unused struct ath_common *unused = common; \ - ath_printk(level, fmt, ##__VA_ARGS__); \ + ath_printk(level, common, fmt, ##__VA_ARGS__); \ } while (0)#define ath_emerg (common, fmt, ...) \
It's probably better to remove the _ath_printk indirection altogether and just use ath_printk directly in the ath_<level> macros.
drivers/net/wireless/ath/main.c
Quoted 1 line
drivers/net/wireless/ath/main.c +0
-0
[]
Quoted 12 lines
drivers/net/wireless/ath/main.c +2
-1@@ -57,7 +57,8 @@ struct sk_buff *ath_rxbuf_alloc(struct ath_common *common, }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;va_list args;@@ -67,7 +68,11 @@ void ath_printk(const char *level, const char *fmt, ...) vaf.fmt = fmt;
drivers/net/wireless/ath/main.c void ath_printk(const char *level, const char *fmt, ...) · line 77
Quoted 10 lines
drivers/net/wireless/ath/main.c +5
-1vaf.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);
Maybe it's better to print wiphyX: only when multiple ath nics exist?
PATCH 1/1 ath9k: Add wiphy name to log messages.
Quoted 2 lines · Joe Perches
Maybe it's better to print wiphyX: only when
multiple ath nics exist?
on the other hand, parsing is simpler if the same kind of error message always has the same structure, not depending on the number of nics in system.
Further, printing the wiphy id shows that this information was set when generating the error message, thus proving more information even if there is only one nic.
Regards,
M. Braun
PATCH 1/1 ath9k: Add wiphy name to log messages.
Quoted 10 lines · michael-dev
Quoted 2 lines · Joe Perches
Maybe it's better to print wiphyX: only when
multiple ath nics exist?on the other hand, parsing is simpler if the same kind of error message always has the same structure, not depending on the number of nics in system.
Further, printing the wiphy id shows that this information was set when generating the error message, thus proving more information even if there is only one nic.
I also want to leave that part as it is..but I'll make the other changes that were suggested by Joe.
Thanks,
Ben
Quoted 8 lines
Regards,
M. Braun_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com