aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-08-26 02:10:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-29 15:25:31 -0400
commit44856c6596bf4b96eb17ee5e785b5fe5b8a12531 (patch)
tree2daeee7563e1fe7168f988cbeef7eb52dc567146 /drivers/net
parent6ac2f839b0b21225a65f41802c5f0df5eff4f16c (diff)
iwlagn: modify the debug macro to be usable by all the layers
Since all the layers need to print debug message, the debug macro cannot suppose that they will be given iwl_priv as a parameter and then dereference it. Use iwl_shared instead. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h37
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c3
2 files changed, 21 insertions, 19 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
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 37bc017b80ac..a5e4ddad2e04 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -122,7 +122,8 @@ static void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
122 struct iwl_rx_mem_buffer *rxb) 122 struct iwl_rx_mem_buffer *rxb)
123{ 123{
124 struct iwl_rx_packet *pkt = rxb_addr(rxb); 124 struct iwl_rx_packet *pkt = rxb_addr(rxb);
125 u32 len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK; 125 u32 __maybe_unused len =
126 le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
126 IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled " 127 IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
127 "notification for %s:\n", len, 128 "notification for %s:\n", len,
128 get_cmd_string(pkt->hdr.cmd)); 129 get_cmd_string(pkt->hdr.cmd));