From: Ping-Ke Shih <pkshih@xxxxxxxxxxx> Add a new debugging function. Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx> Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> --- .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 23 ++++++++++++++++++++++ drivers/net/wireless/realtek/rtlwifi/debug.h | 14 +++++++++++++ 2 files changed, 37 insertions(+) Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h =================================================================== --- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h +++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h @@ -27,6 +27,29 @@ #include "../wifi.h" +#ifdef CONFIG_RTLWIFI_DEBUG + +#define BTC_SPRINTF(ptr, ...) snprintf(ptr, ##__VA_ARGS__) +#define BTC_TRACE(fmt) \ +do { \ + struct rtl_priv *rtlpriv = gl_bt_coexist.adapter; \ + if (!rtlpriv) \ + break; \ + RT_TRACE_STRING(rtlpriv, COMP_COEX, DBG_LOUD, fmt); \ +} while (0) + +#else + +static inline void BTC_SPRINTF(char *ptr, ...) +{ +} + +static inline void BTC_TRACE(const char *ptr) +{ +} + +#endif + #define NORMAL_EXEC false #define FORCE_EXEC true Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/debug.h =================================================================== --- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/debug.h +++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/debug.h @@ -194,6 +194,15 @@ do { \ } \ } while (0) +#define RT_TRACE_STRING(__priv, comp, level, string) \ +do { \ + if (unlikely(((comp) & __priv->dbg.global_debugcomponents) && \ + ((level) <= __priv->dbg.global_debuglevel))) { \ + printk(KBUILD_MODNAME ":%s():<%lx> %s", \ + __func__, in_interrupt(), string); \ + } \ +} while (0) + #define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \ _hexdatalen) \ do { \ @@ -230,6 +239,11 @@ static inline void RTPRINT(struct rtl_pr { } +static inline void RT_TRACE_STRING(struct rtl_priv *rtlpriv, + u64 comp, int level, const char *string) +{ +} + static inline void RT_PRINT_DATA(struct rtl_priv *rtlpriv, u64 comp, int level, const char *titlestring,