staging: r8188eu: remove ODM_dbg_* macro definitions
[linux-2.6-microblaze.git] / drivers / staging / r8188eu / include / odm_debug.h
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */
3
4 #ifndef __ODM_DBG_H__
5 #define __ODM_DBG_H__
6
7 /*  */
8 /*      Define the debug levels */
9 /*  */
10 /*      1. DBG_TRACE and DBG_LOUD are used for normal cases. */
11 /*      They can help SW engineer to develop or trace states changed */
12 /*      and also help HW enginner to trace every operation to and from HW, */
13 /*      e.g IO, Tx, Rx. */
14 /*  */
15 /*      2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, */
16 /*      which help us to debug SW or HW. */
17
18 /*      Never used in a call to ODM_RT_TRACE()! */
19 #define ODM_DBG_OFF                             1
20
21 /*      Fatal bug. */
22 /*      For example, Tx/Rx/IO locked up, OS hangs, memory access violation, */
23 /*      resource allocation failed, unexpected HW behavior, HW BUG and so on. */
24 #define ODM_DBG_SERIOUS                         2
25
26 /*      Abnormal, rare, or unexpeted cases. */
27 /*      For example, IRP/Packet/OID canceled, device suprisely unremoved and so on. */
28 #define ODM_DBG_WARNING                         3
29
30 /*      Normal case with useful information about current SW or HW state. */
31 /*      For example, Tx/Rx descriptor to fill, Tx/Rx descr. completed status, */
32 /*      SW protocol state change, dynamic mechanism state change and so on. */
33 /*  */
34 #define ODM_DBG_LOUD                                    4
35
36 /*      Normal case with detail execution flow or information. */
37 #define ODM_DBG_TRACE                                   5
38
39 /*  Define the tracing components */
40 /* BB Functions */
41 #define ODM_COMP_DIG                                    BIT0
42 #define ODM_COMP_RA_MASK                                BIT1
43 #define ODM_COMP_DYNAMIC_TXPWR                          BIT2
44 #define ODM_COMP_FA_CNT                                 BIT3
45 #define ODM_COMP_RSSI_MONITOR                           BIT4
46 #define ODM_COMP_CCK_PD                                 BIT5
47 #define ODM_COMP_ANT_DIV                                BIT6
48 #define ODM_COMP_PWR_SAVE                               BIT7
49 #define ODM_COMP_PWR_TRA                                BIT8
50 #define ODM_COMP_RATE_ADAPTIVE                          BIT9
51 #define ODM_COMP_PATH_DIV                               BIT10
52 #define ODM_COMP_PSD                                    BIT11
53 #define ODM_COMP_DYNAMIC_PRICCA                         BIT12
54 #define ODM_COMP_RXHP                                   BIT13
55 /* MAC Functions */
56 #define ODM_COMP_EDCA_TURBO                             BIT16
57 #define ODM_COMP_EARLY_MODE                             BIT17
58 /* RF Functions */
59 #define ODM_COMP_TX_PWR_TRACK                           BIT24
60 #define ODM_COMP_RX_GAIN_TRACK                          BIT25
61 #define ODM_COMP_CALIBRATION                            BIT26
62 /* Common Functions */
63 #define ODM_COMP_COMMON                                 BIT30
64 #define ODM_COMP_INIT                                   BIT31
65
66 /*------------------------Export Marco Definition---------------------------*/
67 #define DbgPrint        pr_info
68 #define RT_PRINTK(fmt, args...)                         \
69         DbgPrint( "%s(): " fmt, __func__, ## args);
70
71 #ifndef ASSERT
72         #define ASSERT(expr)
73 #endif
74
75 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)                         \
76         if (((comp) & pDM_Odm->DebugComponents) &&                      \
77             (level <= pDM_Odm->DebugLevel)) {                           \
78                 if (pDM_Odm->SupportICType == ODM_RTL8192C)             \
79                         DbgPrint("[ODM-92C] ");                         \
80                 else if (pDM_Odm->SupportICType == ODM_RTL8192D)        \
81                         DbgPrint("[ODM-92D] ");                         \
82                 else if (pDM_Odm->SupportICType == ODM_RTL8723A)        \
83                         DbgPrint("[ODM-8723A] ");                       \
84                 else if (pDM_Odm->SupportICType == ODM_RTL8188E)        \
85                         DbgPrint("[ODM-8188E] ");                       \
86                 else if (pDM_Odm->SupportICType == ODM_RTL8812)         \
87                         DbgPrint("[ODM-8812] ");                        \
88                 else if (pDM_Odm->SupportICType == ODM_RTL8821)         \
89                         DbgPrint("[ODM-8821] ");                        \
90                 RT_PRINTK fmt;                                          \
91         }
92
93 #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)                       \
94         if (((comp) & pDM_Odm->DebugComponents) &&                      \
95             (level <= pDM_Odm->DebugLevel)) {                           \
96                 RT_PRINTK fmt;                                          \
97         }
98
99 #define ODM_RT_ASSERT(pDM_Odm, expr, fmt)                               \
100         if (!(expr)) {                                                  \
101                 DbgPrint( "Assertion failed! %s at ......\n", #expr);   \
102                 DbgPrint( "      ......%s,%s,line=%d\n", __FILE__,      \
103                         __func__, __LINE__);                            \
104                 RT_PRINTK fmt;                                          \
105                 ASSERT(false);                                          \
106         }
107
108 void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm);
109
110 #endif  /*  __ODM_DBG_H__ */