aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/debug.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-04-07 12:28:00 +0200
committerTakashi Iwai <tiwai@suse.de>2012-04-07 12:28:00 +0200
commitc38f62b08d800104fa9b0e9d6e9141459986c06d (patch)
tree1d04d768c8aa0c1a544d1f068317c7beb0101be2 /drivers/net/wireless/rtlwifi/debug.h
parentALSA: hda - clean up CX20549 test mixer setup (diff)
parentASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS (diff)
downloadlinux-dev-c38f62b08d800104fa9b0e9d6e9141459986c06d.tar.xz
linux-dev-c38f62b08d800104fa9b0e9d6e9141459986c06d.zip
Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: fixes for 3.4 A bunch of driver-specific fixes and one generic fix for the new support for platform DAPM contexts - we were picking the wrong default for the idle_bias_off setting which was meaning we weren't actually achieving any useful runtime PM on platform devices.
Diffstat (limited to 'drivers/net/wireless/rtlwifi/debug.h')
-rw-r--r--drivers/net/wireless/rtlwifi/debug.h121
1 files changed, 73 insertions, 48 deletions
diff --git a/drivers/net/wireless/rtlwifi/debug.h b/drivers/net/wireless/rtlwifi/debug.h
index 160dd0685213..07493d2957f2 100644
--- a/drivers/net/wireless/rtlwifi/debug.h
+++ b/drivers/net/wireless/rtlwifi/debug.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Copyright(c) 2009-2010 Realtek Corporation.
+ * Copyright(c) 2009-2012 Realtek Corporation.
*
* Tmis program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
@@ -156,53 +156,78 @@ enum dbgp_flag_e {
DBGP_TYPE_MAX
};
-#define RT_ASSERT(_exp, fmt) \
- do { \
- if (!(_exp)) { \
- printk(KERN_DEBUG "%s:%s(): ", KBUILD_MODNAME, \
- __func__); \
- printk fmt; \
- } \
- } while (0);
-
-#define RT_TRACE(rtlpriv, comp, level, fmt)\
- do { \
- if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \
- ((level) <= rtlpriv->dbg.global_debuglevel))) {\
- printk(KERN_DEBUG "%s:%s():<%lx-%x> ", KBUILD_MODNAME, \
- __func__, in_interrupt(), in_atomic()); \
- printk fmt; \
- } \
- } while (0);
-
-#define RTPRINT(rtlpriv, dbgtype, dbgflag, printstr) \
- do { \
- if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \
- printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
- printk printstr; \
- } \
- } while (0);
-
-#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
- _hexdatalen) \
- do {\
- if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) &&\
- (_level <= rtlpriv->dbg.global_debuglevel))) { \
- int __i; \
- u8* ptr = (u8 *)_hexdata; \
- printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
- printk("In process \"%s\" (pid %i):", current->comm,\
- current->pid); \
- printk(_titlestring); \
- for (__i = 0; __i < (int)_hexdatalen; __i++) { \
- printk("%02X%s", ptr[__i], (((__i + 1) % 4)\
- == 0) ? " " : " ");\
- if (((__i + 1) % 16) == 0) \
- printk("\n"); \
- } \
- printk(KERN_DEBUG "\n"); \
- } \
- } while (0);
+#ifdef CONFIG_RTLWIFI_DEBUG
+
+#define RT_ASSERT(_exp, fmt, ...) \
+do { \
+ if (!(_exp)) { \
+ printk(KERN_DEBUG KBUILD_MODNAME ":%s(): " fmt, \
+ __func__, ##__VA_ARGS__); \
+ } \
+} while (0)
+
+#define RT_TRACE(rtlpriv, comp, level, fmt, ...) \
+do { \
+ if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \
+ ((level) <= rtlpriv->dbg.global_debuglevel))) { \
+ printk(KERN_DEBUG KBUILD_MODNAME ":%s():<%lx-%x> " fmt, \
+ __func__, in_interrupt(), in_atomic(), \
+ ##__VA_ARGS__); \
+ } \
+} while (0)
+
+#define RTPRINT(rtlpriv, dbgtype, dbgflag, fmt, ...) \
+do { \
+ if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \
+ printk(KERN_DEBUG KBUILD_MODNAME ": " fmt, \
+ ##__VA_ARGS__); \
+ } \
+} while (0)
+
+#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
+ _hexdatalen) \
+do { \
+ if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) && \
+ (_level <= rtlpriv->dbg.global_debuglevel))) { \
+ printk(KERN_DEBUG "%s: In process \"%s\" (pid %i): %s\n", \
+ KBUILD_MODNAME, current->comm, current->pid, \
+ _titlestring); \
+ print_hex_dump_bytes("", DUMP_PREFIX_NONE, \
+ _hexdata, _hexdatalen); \
+ } \
+} while (0)
+
+#else
+
+struct rtl_priv;
+
+__printf(2, 3)
+static inline void RT_ASSERT(int exp, const char *fmt, ...)
+{
+}
+
+__printf(4, 5)
+static inline void RT_TRACE(struct rtl_priv *rtlpriv,
+ int comp, int level,
+ const char *fmt, ...)
+{
+}
+
+__printf(4, 5)
+static inline void RTPRINT(struct rtl_priv *rtlpriv,
+ int dbgtype, int dbgflag,
+ const char *fmt, ...)
+{
+}
+
+static inline void RT_PRINT_DATA(struct rtl_priv *rtlpriv,
+ int comp, int level,
+ const char *titlestring,
+ const void *hexdata, size_t hexdatalen)
+{
+}
+
+#endif
void rtl_dbgp_flag_init(struct ieee80211_hw *hw);
#endif