29 #ifndef __iwl_debug_h__
30 #define __iwl_debug_h__
35 static inline bool iwl_have_debug_level(
u32 level)
47 #define IWL_ERR(m, f, a...) __iwl_err((m)->dev, false, false, f, ## a)
48 #define IWL_ERR_DEV(d, f, a...) __iwl_err((d), false, false, f, ## a)
49 #define IWL_WARN(m, f, a...) __iwl_warn((m)->dev, f, ## a)
50 #define IWL_INFO(m, f, a...) __iwl_info((m)->dev, f, ## a)
51 #define IWL_CRIT(m, f, a...) __iwl_crit((m)->dev, f, ## a)
53 #if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING)
54 void __iwl_dbg(
struct device *dev,
56 const char *fmt, ...) __printf(5, 6);
65 #define iwl_print_hex_error(m, p, len) \
67 print_hex_dump(KERN_ERR, "iwl data: ", \
68 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
71 #define IWL_DEBUG(m, level, fmt, args...) \
72 __iwl_dbg((m)->dev, level, false, __func__, fmt, ##args)
73 #define IWL_DEBUG_DEV(dev, level, fmt, args...) \
74 __iwl_dbg((dev), level, false, __func__, fmt, ##args)
75 #define IWL_DEBUG_LIMIT(m, level, fmt, args...) \
76 __iwl_dbg((m)->dev, level, true, __func__, fmt, ##args)
78 #ifdef CONFIG_IWLWIFI_DEBUG
79 #define iwl_print_hex_dump(m, level, p, len) \
81 if (iwl_have_debug_level(level)) \
82 print_hex_dump(KERN_DEBUG, "iwl data: ", \
83 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
86 #define iwl_print_hex_dump(m, level, p, len)
114 #define IWL_DL_INFO 0x00000001
115 #define IWL_DL_MAC80211 0x00000002
116 #define IWL_DL_HCMD 0x00000004
117 #define IWL_DL_STATE 0x00000008
119 #define IWL_DL_EEPROM 0x00000040
120 #define IWL_DL_RADIO 0x00000080
122 #define IWL_DL_POWER 0x00000100
123 #define IWL_DL_TEMP 0x00000200
124 #define IWL_DL_SCAN 0x00000800
126 #define IWL_DL_ASSOC 0x00001000
127 #define IWL_DL_DROP 0x00002000
128 #define IWL_DL_COEX 0x00008000
130 #define IWL_DL_FW 0x00010000
131 #define IWL_DL_RF_KILL 0x00020000
132 #define IWL_DL_FW_ERRORS 0x00040000
133 #define IWL_DL_LED 0x00080000
135 #define IWL_DL_RATE 0x00100000
136 #define IWL_DL_CALIB 0x00200000
137 #define IWL_DL_WEP 0x00400000
138 #define IWL_DL_TX 0x00800000
140 #define IWL_DL_RX 0x01000000
141 #define IWL_DL_ISR 0x02000000
142 #define IWL_DL_HT 0x04000000
144 #define IWL_DL_11H 0x10000000
145 #define IWL_DL_STATS 0x20000000
146 #define IWL_DL_TX_REPLY 0x40000000
147 #define IWL_DL_TX_QUEUES 0x80000000
149 #define IWL_DEBUG_INFO(p, f, a...) IWL_DEBUG(p, IWL_DL_INFO, f, ## a)
150 #define IWL_DEBUG_MAC80211(p, f, a...) IWL_DEBUG(p, IWL_DL_MAC80211, f, ## a)
151 #define IWL_DEBUG_TEMP(p, f, a...) IWL_DEBUG(p, IWL_DL_TEMP, f, ## a)
152 #define IWL_DEBUG_SCAN(p, f, a...) IWL_DEBUG(p, IWL_DL_SCAN, f, ## a)
153 #define IWL_DEBUG_RX(p, f, a...) IWL_DEBUG(p, IWL_DL_RX, f, ## a)
154 #define IWL_DEBUG_TX(p, f, a...) IWL_DEBUG(p, IWL_DL_TX, f, ## a)
155 #define IWL_DEBUG_ISR(p, f, a...) IWL_DEBUG(p, IWL_DL_ISR, f, ## a)
156 #define IWL_DEBUG_LED(p, f, a...) IWL_DEBUG(p, IWL_DL_LED, f, ## a)
157 #define IWL_DEBUG_WEP(p, f, a...) IWL_DEBUG(p, IWL_DL_WEP, f, ## a)
158 #define IWL_DEBUG_HC(p, f, a...) IWL_DEBUG(p, IWL_DL_HCMD, f, ## a)
159 #define IWL_DEBUG_EEPROM(d, f, a...) IWL_DEBUG_DEV(d, IWL_DL_EEPROM, f, ## a)
160 #define IWL_DEBUG_CALIB(p, f, a...) IWL_DEBUG(p, IWL_DL_CALIB, f, ## a)
161 #define IWL_DEBUG_FW(p, f, a...) IWL_DEBUG(p, IWL_DL_FW, f, ## a)
162 #define IWL_DEBUG_RF_KILL(p, f, a...) IWL_DEBUG(p, IWL_DL_RF_KILL, f, ## a)
163 #define IWL_DEBUG_FW_ERRORS(p, f, a...) IWL_DEBUG(p, IWL_DL_FW_ERRORS, f, ## a)
164 #define IWL_DEBUG_DROP(p, f, a...) IWL_DEBUG(p, IWL_DL_DROP, f, ## a)
165 #define IWL_DEBUG_DROP_LIMIT(p, f, a...) \
166 IWL_DEBUG_LIMIT(p, IWL_DL_DROP, f, ## a)
167 #define IWL_DEBUG_COEX(p, f, a...) IWL_DEBUG(p, IWL_DL_COEX, f, ## a)
168 #define IWL_DEBUG_RATE(p, f, a...) IWL_DEBUG(p, IWL_DL_RATE, f, ## a)
169 #define IWL_DEBUG_RATE_LIMIT(p, f, a...) \
170 IWL_DEBUG_LIMIT(p, IWL_DL_RATE, f, ## a)
171 #define IWL_DEBUG_ASSOC(p, f, a...) \
172 IWL_DEBUG(p, IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
173 #define IWL_DEBUG_ASSOC_LIMIT(p, f, a...) \
174 IWL_DEBUG_LIMIT(p, IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
175 #define IWL_DEBUG_HT(p, f, a...) IWL_DEBUG(p, IWL_DL_HT, f, ## a)
176 #define IWL_DEBUG_STATS(p, f, a...) IWL_DEBUG(p, IWL_DL_STATS, f, ## a)
177 #define IWL_DEBUG_STATS_LIMIT(p, f, a...) \
178 IWL_DEBUG_LIMIT(p, IWL_DL_STATS, f, ## a)
179 #define IWL_DEBUG_TX_REPLY(p, f, a...) IWL_DEBUG(p, IWL_DL_TX_REPLY, f, ## a)
180 #define IWL_DEBUG_TX_QUEUES(p, f, a...) IWL_DEBUG(p, IWL_DL_TX_QUEUES, f, ## a)
181 #define IWL_DEBUG_RADIO(p, f, a...) IWL_DEBUG(p, IWL_DL_RADIO, f, ## a)
182 #define IWL_DEBUG_POWER(p, f, a...) IWL_DEBUG(p, IWL_DL_POWER, f, ## a)
183 #define IWL_DEBUG_11H(p, f, a...) IWL_DEBUG(p, IWL_DL_11H, f, ## a)