rtl8188eu: Set load parameter debug for dynamic debugging

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-05-17 16:52:06 -05:00
parent f8e677c4b4
commit 3ad757d04a
6 changed files with 103 additions and 765 deletions

View file

@ -25,16 +25,15 @@
#include <drv_types.h>
#define _drv_always_ 1
#define _drv_always_ 1
#define _drv_emerg_ 2
#define _drv_alert_ 3
#define _drv_crit_ 4
#define _drv_err_ 5
#define _drv_warning_ 6
#define _drv_notice_ 7
#define _drv_warning_ 6
#define _drv_notice_ 7
#define _drv_info_ 8
#define _drv_dump_ 9
#define _drv_debug_ 10
#define _drv_debug_ 9
#define _module_rtl871x_xmit_c_ BIT(0)
@ -43,30 +42,29 @@
#define _module_recv_osdep_c_ BIT(3)
#define _module_rtl871x_mlme_c_ BIT(4)
#define _module_mlme_osdep_c_ BIT(5)
#define _module_rtl871x_sta_mgt_c_ BIT(6)
#define _module_rtl871x_cmd_c_ BIT(7)
#define _module_rtl871x_sta_mgt_c_ BIT(6)
#define _module_rtl871x_cmd_c_ BIT(7)
#define _module_cmd_osdep_c_ BIT(8)
#define _module_rtl871x_io_c_ BIT(9)
#define _module_rtl871x_io_c_ BIT(9)
#define _module_io_osdep_c_ BIT(10)
#define _module_os_intfs_c_ BIT(11)
#define _module_rtl871x_security_c_ BIT(12)
#define _module_rtl871x_eeprom_c_ BIT(13)
#define _module_os_intfs_c_ BIT(11)
#define _module_rtl871x_security_c_ BIT(12)
#define _module_rtl871x_eeprom_c_ BIT(13)
#define _module_hal_init_c_ BIT(14)
#define _module_hci_hal_init_c_ BIT(15)
#define _module_rtl871x_ioctl_c_ BIT(16)
#define _module_rtl871x_ioctl_set_c_ BIT(17)
#define _module_rtl871x_ioctl_c_ BIT(16)
#define _module_rtl871x_ioctl_set_c_ BIT(17)
#define _module_rtl871x_ioctl_query_c_ BIT(18)
#define _module_rtl871x_pwrctrl_c_ BIT(19)
#define _module_hci_intfs_c_ BIT(20)
#define _module_hci_ops_c_ BIT(21)
#define _module_osdep_service_c_ BIT(22)
#define _module_rtl871x_pwrctrl_c_ BIT(19)
#define _module_hci_intfs_c_ BIT(20)
#define _module_hci_ops_c_ BIT(21)
#define _module_osdep_service_c_ BIT(22)
#define _module_mp_ BIT(23)
#define _module_hci_ops_os_c_ BIT(24)
#define _module_rtl871x_ioctl_os_c BIT(25)
#define _module_hci_ops_os_c_ BIT(24)
#define _module_rtl871x_ioctl_os_c BIT(25)
#define _module_rtl8712_cmd_c_ BIT(26)
//#define _module_efuse_ BIT(27)
#define _module_rtl8192c_xmit_c_ BIT(28)
#define _module_hal_xmit_c_ BIT(28)
#define _module_rtl8192c_xmit_c_ BIT(27)
#define _module_hal_xmit_c_ BIT(28)
#define _module_efuse_ BIT(29)
#define _module_rtl8712_recv_c_ BIT(30)
#define _module_rtl8712_led_c_ BIT(31)
@ -151,134 +149,78 @@
#define _MODULE_DEFINE_ _module_efuse_
#endif
#ifdef PLATFORM_OS_CE
extern void rtl871x_cedbg(const char *fmt, ...);
#endif
#define RT_TRACE(_Comp, _Level, Fmt) do{}while (0)
#define _func_enter_ do{}while (0)
#define _func_exit_ do{}while (0)
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) do{}while (0)
#ifdef PLATFORM_WINDOWS
#define DBG_871X do {} while (0)
#define MSG_8192C do {} while (0)
#define DBG_8192C do {} while (0)
#define DBG_871X_LEVEL do {} while (0)
#ifdef pr_info
#define _dbgdump pr_info
#else
#define DBG_871X(x, ...) do {} while (0)
#define MSG_8192C(x, ...) do {} while (0)
#define DBG_8192C(x,...) do {} while (0)
#define DBG_871X_LEVEL(x,...) do {} while (0)
#define _dbgdump printk
#endif
#undef _dbgdump
#ifdef PLATFORM_WINDOWS
#define DRIVER_PREFIX "RTL8188: "
#ifdef PLATFORM_OS_XP
#define _dbgdump DbgPrint
#elif defined PLATFORM_OS_CE
#define _dbgdump rtl871x_cedbg
#endif
#define DBG_871X_LEVEL(_Level, fmt, arg...) \
do { \
if (_Level <= GlobalDebugLevel) \
_dbgdump(DRIVER_PREFIX"ERROR " fmt, ##arg); \
} while (0)
#elif defined PLATFORM_LINUX
#define _dbgdump printk
#elif defined PLATFORM_FREEBSD
#define _dbgdump printf
#endif
#define DBG_871X(...) \
do { \
_dbgdump(DRIVER_PREFIX __VA_ARGS__); \
} while (0)
#define DRIVER_PREFIX "RTL871X: "
#define DEBUG_LEVEL (_drv_err_)
#if defined (_dbgdump)
#undef DBG_871X_LEVEL
#define DBG_871X_LEVEL(level, fmt, arg...) \
do {\
if (level <= DEBUG_LEVEL) {\
if (level <= _drv_err_ && level > _drv_always_) \
_dbgdump(DRIVER_PREFIX"ERROR " fmt, ##arg);\
else \
_dbgdump(DRIVER_PREFIX fmt, ##arg);\
}\
}while (0)
#endif
#define MSG_8192C(...) \
do { \
_dbgdump(DRIVER_PREFIX __VA_ARGS__); \
} while (0)
#ifdef CONFIG_DEBUG
#if defined (_dbgdump)
#undef DBG_871X
#define DBG_871X(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while (0)
#define DBG_8192C(...) \
do { \
_dbgdump(DRIVER_PREFIX __VA_ARGS__); \
} while (0)
#undef MSG_8192C
#define MSG_8192C(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while (0)
#undef DBG_8192C
#define DBG_8192C(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while (0)
#endif
#endif /* CONFIG_DEBUG */
#ifdef CONFIG_DEBUG_RTL871X
#ifndef _RTL871X_DEBUG_C_
extern u32 GlobalDebugLevel;
extern u64 GlobalDebugComponents;
#endif
#if defined (_dbgdump) && defined (_MODULE_DEFINE_)
#undef RT_TRACE
#define RT_TRACE(_Comp, _Level, Fmt)\
do {\
if ((_Comp & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) {\
_dbgdump("%s [0x%08x,%d]", DRIVER_PREFIX, (unsigned int)_Comp, _Level);\
_dbgdump Fmt;\
}\
}while (0)
#endif
extern u32 GlobalDebugLevel;
#if defined (_dbgdump)
#define RT_TRACE(_Comp, _Level, Fmt) \
do { \
if (_Level <= GlobalDebugLevel) { \
_dbgdump("%s [0x%08x,%d]", DRIVER_PREFIX, \
(unsigned int)_Comp, _Level); \
_dbgdump Fmt; \
} \
} while (0)
#undef _func_enter_
#define _func_enter_ \
do { \
if (GlobalDebugLevel >= _drv_debug_) \
{ \
_dbgdump("\n %s : %s enters at %d\n", DRIVER_PREFIX, __func__, __LINE__);\
} \
} while (0)
#define _func_enter_ \
do { \
if (GlobalDebugLevel >= _drv_debug_) \
_dbgdump("%s : %s enters at %d\n", \
DRIVER_PREFIX, __func__, __LINE__); \
} while (0)
#undef _func_exit_
#define _func_exit_ \
do { \
if (GlobalDebugLevel >= _drv_debug_) \
{ \
_dbgdump("\n %s : %s exits at %d\n", DRIVER_PREFIX, __func__, __LINE__); \
} \
} while (0)
#undef RT_PRINT_DATA
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
{ \
int __i; \
u8 *ptr = (u8 *)_HexData; \
_dbgdump("%s", DRIVER_PREFIX); \
_dbgdump(_TitleString); \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \
{ \
_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
if (((__i + 1) % 16) == 0) _dbgdump("\n"); \
} \
_dbgdump("\n"); \
}
#endif
#endif /* CONFIG_DEBUG_RTL871X */
#define _func_exit_ \
do { \
if (GlobalDebugLevel >= _drv_debug_) \
_dbgdump("%s : %s exits at %d\n", \
DRIVER_PREFIX, __func__, __LINE__); \
} while (0)
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)\
do { \
if (_Level <= GlobalDebugLevel) { \
int __i; \
u8 *ptr = (u8 *)_HexData; \
_dbgdump("%s", DRIVER_PREFIX); \
_dbgdump(_TitleString); \
for (__i = 0; __i < (int)_HexDataLen; __i++ ) { \
_dbgdump("%02X%s", ptr[__i], \
(((__i + 1) % 4) == 0) ? \
" " : " "); \
if (((__i + 1) % 16) == 0) \
printk("\n"); \
} \
printk("\n"); \
} \
} while (0)
#ifdef CONFIG_PROC_DEBUG