1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
22 /* Define the debug levels */
24 /* 1. DBG_TRACE and DBG_LOUD are used for normal cases. */
25 /* So that, they can help SW engineer to develope or trace states changed */
26 /* and also help HW enginner to trace every operation to and from HW, */
29 /* 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, */
30 /* which help us to debug SW or HW. */
34 /* Never used in a call to ODM_RT_TRACE()! */
40 /* For example, Tx/Rx/IO locked up, OS hangs, memory access violation, */
41 /* resource allocation failed, unexpected HW behavior, HW BUG and so on. */
43 #define ODM_DBG_SERIOUS 2
46 /* Abnormal, rare, or unexpeted cases. */
47 /* For example, IRP/Packet/OID canceled, device suprisely unremoved and so on. */
49 #define ODM_DBG_WARNING 3
52 /* Normal case with useful information about current SW or HW state. */
53 /* For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status, */
54 /* SW protocol state change, dynamic mechanism state change and so on. */
56 #define ODM_DBG_LOUD 4
59 /* Normal case with detail execution flow or information. */
61 #define ODM_DBG_TRACE 5
64 /* Define the tracing components */
68 #define ODM_COMP_DIG BIT(0)
69 #define ODM_COMP_RA_MASK BIT(1)
70 #define ODM_COMP_DYNAMIC_TXPWR BIT(2)
71 #define ODM_COMP_FA_CNT BIT(3)
72 #define ODM_COMP_RSSI_MONITOR BIT(4)
73 #define ODM_COMP_CCK_PD BIT(5)
74 #define ODM_COMP_ANT_DIV BIT(6)
75 #define ODM_COMP_PWR_SAVE BIT(7)
76 #define ODM_COMP_PWR_TRAIN BIT(8)
77 #define ODM_COMP_RATE_ADAPTIVE BIT(9)
78 #define ODM_COMP_PATH_DIV BIT(10)
79 #define ODM_COMP_PSD BIT(11)
80 #define ODM_COMP_DYNAMIC_PRICCA BIT(12)
81 #define ODM_COMP_RXHP BIT(13)
83 #define ODM_COMP_EDCA_TURBO BIT(16)
84 #define ODM_COMP_EARLY_MODE BIT(17)
86 #define ODM_COMP_TX_PWR_TRACK BIT(24)
87 #define ODM_COMP_RX_GAIN_TRACK BIT(25)
88 #define ODM_COMP_CALIBRATION BIT(26)
89 /* Common Functions */
90 #define ODM_COMP_COMMON BIT(30)
91 #define ODM_COMP_INIT BIT(31)
93 /*------------------------Export Macro Definition---------------------------*/
94 #define RT_PRINTK(fmt, args...) printk("%s(): " fmt, __func__, ## args);
100 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
101 if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
103 printk("[ODM-8723A] "); \
107 #define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \
109 printk("Assertion failed! %s at ......\n", #expr); \
110 printk(" ......%s,%s,line=%d\n", __FILE__, __func__, __LINE__);\
115 void ODM_InitDebugSetting23a(struct dm_odm_t *pDM_Odm);
117 #endif /* __ODM_DBG_H__ */