aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debug.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 225ae720c7d2..7c9e9af4a09d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -29,49 +29,50 @@
29#ifndef __iwl_debug_h__ 29#ifndef __iwl_debug_h__
30#define __iwl_debug_h__ 30#define __iwl_debug_h__
31 31
32#include "iwl-shared.h"
33
32struct iwl_priv; 34struct iwl_priv;
33 35
34#define IWL_ERR(p, f, a...) dev_err(p->bus->dev, f, ## a) 36/*No matter what is m (priv, bus, trans), this will work */
35#define IWL_WARN(p, f, a...) dev_warn(p->bus->dev, f, ## a) 37#define IWL_ERR(m, f, a...) dev_err(bus(m)->dev, f, ## a)
36#define IWL_INFO(p, f, a...) dev_info(p->bus->dev, f, ## a) 38#define IWL_WARN(m, f, a...) dev_warn(bus(m)->dev, f, ## a)
37#define IWL_CRIT(p, f, a...) dev_crit(p->bus->dev, f, ## a) 39#define IWL_INFO(m, f, a...) dev_info(bus(m)->dev, f, ## a)
40#define IWL_CRIT(m, f, a...) dev_crit(bus(m)->dev, f, ## a)
38 41
39#define iwl_print_hex_error(priv, p, len) \ 42#define iwl_print_hex_error(m, p, len) \
40do { \ 43do { \
41 print_hex_dump(KERN_ERR, "iwl data: ", \ 44 print_hex_dump(KERN_ERR, "iwl data: ", \
42 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 45 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
43} while (0) 46} while (0)
44 47
45#ifdef CONFIG_IWLWIFI_DEBUG 48#ifdef CONFIG_IWLWIFI_DEBUG
46#define IWL_DEBUG(__priv, level, fmt, args...) \ 49#define IWL_DEBUG(m, level, fmt, args...) \
47do { \ 50do { \
48 if (iwl_get_debug_level(__priv->shrd) & (level)) \ 51 if (iwl_get_debug_level((m)->shrd) & (level)) \
49 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \ 52 dev_printk(KERN_ERR, bus(m)->dev, \
50 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 53 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
51 __func__ , ## args); \ 54 __func__ , ## args); \
52} while (0) 55} while (0)
53 56
54#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) \ 57#define IWL_DEBUG_LIMIT(m, level, fmt, args...) \
55do { \ 58do { \
56 if ((iwl_get_debug_level(__priv->shrd) & (level)) && net_ratelimit())\ 59 if (iwl_get_debug_level((m)->shrd) & (level) && net_ratelimit())\
57 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \ 60 dev_printk(KERN_ERR, bus(m)->dev, \
58 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 61 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
59 __func__ , ## args); \ 62 __func__ , ## args); \
60} while (0) 63} while (0)
61 64
62#define iwl_print_hex_dump(priv, level, p, len) \ 65#define iwl_print_hex_dump(m, level, p, len) \
63do { \ 66do { \
64 if (iwl_get_debug_level(priv->shrd) & level) \ 67 if (iwl_get_debug_level((m)->shrd) & level) \
65 print_hex_dump(KERN_DEBUG, "iwl data: ", \ 68 print_hex_dump(KERN_DEBUG, "iwl data: ", \
66 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 69 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
67} while (0) 70} while (0)
68 71
69#else 72#else
70#define IWL_DEBUG(__priv, level, fmt, args...) 73#define IWL_DEBUG(m, level, fmt, args...)
71#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) 74#define IWL_DEBUG_LIMIT(m, level, fmt, args...)
72static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level, 75#define iwl_print_hex_dump(m, level, p, len)
73 const void *p, u32 len)
74{}
75#endif /* CONFIG_IWLWIFI_DEBUG */ 76#endif /* CONFIG_IWLWIFI_DEBUG */
76 77
77#ifdef CONFIG_IWLWIFI_DEBUGFS 78#ifdef CONFIG_IWLWIFI_DEBUGFS