1 /******************************************************************************
\r
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
\r
5 * This program is free software; you can redistribute it and/or modify it
\r
6 * under the terms of version 2 of the GNU General Public License as
\r
7 * published by the Free Software Foundation.
\r
9 * This program is distributed in the hope that it will be useful, but WITHOUT
\r
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
14 * You should have received a copy of the GNU General Public License along with
\r
15 * this program; if not, write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
\r
19 ******************************************************************************/
\r
22 #ifndef __ODM_DBG_H__
\r
23 #define __ODM_DBG_H__
\r
26 //-----------------------------------------------------------------------------
\r
27 // Define the debug levels
\r
29 // 1. DBG_TRACE and DBG_LOUD are used for normal cases.
\r
30 // So that, they can help SW engineer to develope or trace states changed
\r
31 // and also help HW enginner to trace every operation to and from HW,
\r
34 // 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases,
\r
35 // which help us to debug SW or HW.
\r
37 //-----------------------------------------------------------------------------
\r
39 // Never used in a call to ODM_RT_TRACE()!
\r
41 #define ODM_DBG_OFF 1
\r
45 // For example, Tx/Rx/IO locked up, OS hangs, memory access violation,
\r
46 // resource allocation failed, unexpected HW behavior, HW BUG and so on.
\r
48 #define ODM_DBG_SERIOUS 2
\r
51 // Abnormal, rare, or unexpeted cases.
\r
52 // For example, IRP/Packet/OID canceled, device suprisely unremoved and so on.
\r
54 #define ODM_DBG_WARNING 3
\r
57 // Normal case with useful information about current SW or HW state.
\r
58 // For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status,
\r
59 // SW protocol state change, dynamic mechanism state change and so on.
\r
61 #define ODM_DBG_LOUD 4
\r
64 // Normal case with detail execution flow or information.
\r
66 #define ODM_DBG_TRACE 5
\r
68 //-----------------------------------------------------------------------------
\r
69 // Define the tracing components
\r
71 //-----------------------------------------------------------------------------
\r
73 #define ODM_COMP_DIG BIT0
\r
74 #define ODM_COMP_RA_MASK BIT1
\r
75 #define ODM_COMP_DYNAMIC_TXPWR BIT2
\r
76 #define ODM_COMP_FA_CNT BIT3
\r
77 #define ODM_COMP_RSSI_MONITOR BIT4
\r
78 #define ODM_COMP_CCK_PD BIT5
\r
79 #define ODM_COMP_ANT_DIV BIT6
\r
80 #define ODM_COMP_PWR_SAVE BIT7
\r
81 #define ODM_COMP_PWR_TRAIN BIT8
\r
82 #define ODM_COMP_RATE_ADAPTIVE BIT9
\r
83 #define ODM_COMP_PATH_DIV BIT10
\r
84 #define ODM_COMP_PSD BIT11
\r
85 #define ODM_COMP_DYNAMIC_PRICCA BIT12
\r
86 #define ODM_COMP_RXHP BIT13
\r
87 #define ODM_COMP_MP BIT14
\r
88 #define ODM_COMP_CFO_TRACKING BIT15
\r
89 #define ODM_COMP_ACS BIT16
\r
90 #define PHYDM_COMP_ADAPTIVITY BIT17
\r
92 #define ODM_COMP_EDCA_TURBO BIT20
\r
93 #define ODM_COMP_EARLY_MODE BIT21
\r
95 #define ODM_COMP_TX_PWR_TRACK BIT24
\r
96 #define ODM_COMP_RX_GAIN_TRACK BIT25
\r
97 #define ODM_COMP_CALIBRATION BIT26
\r
99 #define ODM_COMP_COMMON BIT30
\r
100 #define ODM_COMP_INIT BIT31
\r
102 /*------------------------Export Marco Definition---------------------------*/
\r
103 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
\r
104 #define RT_PRINTK DbgPrint
\r
105 #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
\r
106 #define DbgPrint printk
\r
107 #define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args);
\r
108 #define RT_DISP(dbgtype, dbgflag, printstr)
\r
110 #define DbgPrint panic_printk
\r
111 #define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args);
\r
115 #define ASSERT(expr)
\r
119 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
\r
120 if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)) \
\r
122 if(pDM_Odm->SupportICType == ODM_RTL8192C) \
\r
123 DbgPrint("[ODM-92C] "); \
\r
124 else if(pDM_Odm->SupportICType == ODM_RTL8192D) \
\r
125 DbgPrint("[ODM-92D] "); \
\r
126 else if(pDM_Odm->SupportICType == ODM_RTL8723A) \
\r
127 DbgPrint("[ODM-8723A] "); \
\r
128 else if(pDM_Odm->SupportICType == ODM_RTL8188E) \
\r
129 DbgPrint("[ODM-8188E] "); \
\r
130 else if(pDM_Odm->SupportICType == ODM_RTL8192E) \
\r
131 DbgPrint("[ODM-8192E] "); \
\r
132 else if(pDM_Odm->SupportICType == ODM_RTL8812) \
\r
133 DbgPrint("[ODM-8812] "); \
\r
134 else if(pDM_Odm->SupportICType == ODM_RTL8821) \
\r
135 DbgPrint("[ODM-8821] "); \
\r
136 else if(pDM_Odm->SupportICType == ODM_RTL8814A) \
\r
137 DbgPrint("[ODM-8814] "); \
\r
141 #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \
\r
142 if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
\r
147 #define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \
\r
149 DbgPrint( "Assertion failed! %s at ......\n", #expr); \
\r
150 DbgPrint( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
\r
154 #define ODM_dbg_enter() { DbgPrint("==> %s\n", __FUNCTION__); }
\r
155 #define ODM_dbg_exit() { DbgPrint("<== %s\n", __FUNCTION__); }
\r
156 #define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __FUNCTION__, str); }
\r
158 #define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \
\r
159 if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
\r
162 pu1Byte __ptr = (pu1Byte)ptr; \
\r
163 DbgPrint("[ODM] "); \
\r
164 DbgPrint(title_str); \
\r
166 for( __i=0; __i<6; __i++ ) \
\r
167 DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-"); \
\r
171 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)
\r
172 #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)
\r
173 #define ODM_RT_ASSERT(pDM_Odm, expr, fmt)
\r
174 #define ODM_dbg_enter()
\r
175 #define ODM_dbg_exit()
\r
176 #define ODM_dbg_trace(str)
\r
177 #define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)
\r
182 PHYDM_InitDebugSetting(IN PDM_ODM_T pDM_Odm);
\r
184 #define BB_TMP_BUF_SIZE 100
\r
185 VOID phydm_BB_Debug_Info(IN PDM_ODM_T pDM_Odm);
\r
186 VOID phydm_BasicProfile(IN PVOID pDM_VOID);
\r
187 VOID phydm_BasicDbgMessage( IN PVOID pDM_VOID);
\r
189 #if (DM_ODM_SUPPORT_TYPE == ODM_CE)
\r
192 IN PDM_ODM_T pDM_Odm,
\r
201 #endif // __ODM_DBG_H__
\r