1
2
3
4
5
6
7
8#ifndef __ODM_DBG_H__
9#define __ODM_DBG_H__
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#define ODM_DBG_OFF 1
28
29
30
31
32
33
34#define ODM_DBG_SERIOUS 2
35
36
37
38
39
40
41
42#define ODM_DBG_WARNING 3
43
44
45
46
47
48
49#define ODM_DBG_LOUD 4
50
51
52
53
54#define ODM_DBG_TRACE 5
55
56
57
58
59
60
61#define ODM_COMP_DIG BIT0
62#define ODM_COMP_RA_MASK BIT1
63#define ODM_COMP_DYNAMIC_TXPWR BIT2
64#define ODM_COMP_FA_CNT BIT3
65#define ODM_COMP_RSSI_MONITOR BIT4
66#define ODM_COMP_CCK_PD BIT5
67#define ODM_COMP_ANT_DIV BIT6
68#define ODM_COMP_PWR_SAVE BIT7
69#define ODM_COMP_PWR_TRAIN BIT8
70#define ODM_COMP_RATE_ADAPTIVE BIT9
71#define ODM_COMP_PATH_DIV BIT10
72#define ODM_COMP_PSD BIT11
73#define ODM_COMP_DYNAMIC_PRICCA BIT12
74#define ODM_COMP_RXHP BIT13
75#define ODM_COMP_MP BIT14
76#define ODM_COMP_CFO_TRACKING BIT15
77
78#define ODM_COMP_EDCA_TURBO BIT16
79#define ODM_COMP_EARLY_MODE BIT17
80
81#define ODM_COMP_TX_PWR_TRACK BIT24
82#define ODM_COMP_RX_GAIN_TRACK BIT25
83#define ODM_COMP_CALIBRATION BIT26
84
85#define ODM_COMP_COMMON BIT30
86#define ODM_COMP_INIT BIT31
87
88
89 #define DbgPrint printk
90 #define RT_PRINTK(fmt, args...)\
91 DbgPrint("%s(): " fmt, __func__, ## args)
92 #define RT_DISP(dbgtype, dbgflag, printstr)
93
94#ifndef ASSERT
95 #define ASSERT(expr)
96#endif
97
98#if DBG
99#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\
100 do {\
101 if (\
102 (comp & pDM_Odm->DebugComponents) &&\
103 (level <= pDM_Odm->DebugLevel ||\
104 level == ODM_DBG_SERIOUS)\
105 ) {\
106 RT_PRINTK fmt;\
107 } \
108 } while (0)
109
110#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\
111 do {\
112 if (\
113 (comp & pDM_Odm->DebugComponents) &&\
114 (level <= pDM_Odm->DebugLevel)\
115 ) {\
116 RT_PRINTK fmt;\
117 } \
118 } while (0)
119
120#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\
121 do {\
122 if (!expr) {\
123 DbgPrint("Assertion failed! %s at ......\n", #expr);\
124 DbgPrint(\
125 " ......%s,%s, line =%d\n",\
126 __FILE__,\
127 __func__,\
128 __LINE__\
129 );\
130 RT_PRINTK fmt;\
131 ASSERT(false);\
132 } \
133 } while (0)
134#define ODM_dbg_enter() { DbgPrint("==> %s\n", __func__); }
135#define ODM_dbg_exit() { DbgPrint("<== %s\n", __func__); }
136#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); }
137
138#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\
139 do {\
140 if (\
141 (comp & pDM_Odm->DebugComponents) &&\
142 (level <= pDM_Odm->DebugLevel)\
143 ) {\
144 int __i;\
145 u8 *__ptr = (u8 *)ptr;\
146 DbgPrint("[ODM] ");\
147 DbgPrint(title_str);\
148 DbgPrint(" ");\
149 for (__i = 0; __i < 6; __i++)\
150 DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\
151 DbgPrint("\n");\
152 } \
153 } while (0)
154#else
155#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) no_printk fmt
156#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) no_printk fmt
157#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) no_printk fmt
158#define ODM_dbg_enter() do {} while (0)
159#define ODM_dbg_exit() do {} while (0)
160#define ODM_dbg_trace(str) no_printk("%s", str)
161#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \
162 no_printk("%s %p", title_str, ptr)
163#endif
164
165void ODM_InitDebugSetting(PDM_ODM_T pDM_Odm);
166
167#endif
168