aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debug.h
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-08-07 18:41:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:46 -0400
commit3d816c77ecb05d3a3e974a205e53392e5353553e (patch)
treed86eb434ea830d5ec43ee0a6d6aa1251fbcd67a5 /drivers/net/wireless/iwlwifi/iwl-debug.h
parent34b921cf6fb4014e0e8d414492959a4725049000 (diff)
iwlwifi: re-introduce per device debugging
Commit "iwlwifi: make debug level more user friendly" cleaned up the debug level handling. In doing so it created a single global debug level for all devices. Some setups do consits of more that one iwlwifi device and in these setups there is a requirement that debug levels should be unique per device. We now re-introduce the per device debugging while maintaining the cleanup effort of the previous patch. The maintain the global debug level and now introduce a per-device debug level that will be used if it (the per-device debug level) is set. The per-device debug level can be controlled via the debug_level sysfs file while the global debug level is controlled by the debug module parameter. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debug.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index fbe177608bc7..09af046927ab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -46,7 +46,7 @@ do { \
46#ifdef CONFIG_IWLWIFI_DEBUG 46#ifdef CONFIG_IWLWIFI_DEBUG
47#define IWL_DEBUG(__priv, level, fmt, args...) \ 47#define IWL_DEBUG(__priv, level, fmt, args...) \
48do { \ 48do { \
49 if (iwl_debug_level & (level)) \ 49 if (iwl_get_debug_level(__priv) & (level)) \
50 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \ 50 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \
51 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 51 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
52 __func__ , ## args); \ 52 __func__ , ## args); \
@@ -54,15 +54,15 @@ do { \
54 54
55#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) \ 55#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) \
56do { \ 56do { \
57 if ((iwl_debug_level & (level)) && net_ratelimit()) \ 57 if ((iwl_get_debug_level(__priv) & (level)) && net_ratelimit()) \
58 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \ 58 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \
59 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 59 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
60 __func__ , ## args); \ 60 __func__ , ## args); \
61} while (0) 61} while (0)
62 62
63#define iwl_print_hex_dump(level, p, len) \ 63#define iwl_print_hex_dump(priv, level, p, len) \
64do { \ 64do { \
65 if (iwl_debug_level & level) \ 65 if (iwl_get_debug_level(priv) & level) \
66 print_hex_dump(KERN_DEBUG, "iwl data: ", \ 66 print_hex_dump(KERN_DEBUG, "iwl data: ", \
67 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 67 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
68} while (0) 68} while (0)
@@ -106,7 +106,8 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv);
106#else 106#else
107#define IWL_DEBUG(__priv, level, fmt, args...) 107#define IWL_DEBUG(__priv, level, fmt, args...)
108#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) 108#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
109static inline void iwl_print_hex_dump(int level, void *p, u32 len) 109static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
110 void *p, u32 len)
110{} 111{}
111#endif /* CONFIG_IWLWIFI_DEBUG */ 112#endif /* CONFIG_IWLWIFI_DEBUG */
112 113