forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/wl_dbg.h
....@@ -1,16 +1,17 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
21 /*
32 * Minimal debug/trace/assert driver definitions for
43 * Broadcom 802.11 Networking Adapter.
54 *
6
- * Copyright (C) 1999-2019, Broadcom Corporation
7
- *
5
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
6
+ *
7
+ * Copyright (C) 1999-2017, Broadcom Corporation
8
+ *
89 * Unless you and Broadcom execute a separate written software license
910 * agreement governing use of this software, this software is licensed to you
1011 * under the terms of the GNU General Public License version 2 (the "GPL"),
1112 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
1213 * following added to such license:
13
- *
14
+ *
1415 * As a special exception, the copyright holders of this software give you
1516 * permission to link this software with independent modules, and to copy and
1617 * distribute the resulting executable under terms of your choice, provided that
....@@ -18,7 +19,7 @@
1819 * the license of that module. An independent module is a module which is not
1920 * derived from this software. The special exception does not apply to any
2021 * modifications of the software.
21
- *
22
+ *
2223 * Notwithstanding the above, under no circumstances may you combine this
2324 * software in any way with any other Broadcom software provided under a license
2425 * other than the GPL, without Broadcom's express prior written consent.
....@@ -26,18 +27,32 @@
2627 *
2728 * <<Broadcom-WL-IPTag/Open:>>
2829 *
29
- * $Id: wl_dbg.h 519338 2014-12-05 21:23:30Z $
30
+ * $Id: wl_dbg.h 697380 2017-05-03 11:34:25Z $
3031 */
31
-
3232
3333 #ifndef _wl_dbg_h_
3434 #define _wl_dbg_h_
35
+
36
+#if defined(EVENT_LOG_COMPILE)
37
+#include <event_log.h>
38
+#endif // endif
3539
3640 /* wl_msg_level is a bit vector with defs in wlioctl.h */
3741 extern uint32 wl_msg_level;
3842 extern uint32 wl_msg_level2;
3943
4044 #define WL_TIMESTAMP()
45
+
46
+#ifdef ENABLE_CORECAPTURE
47
+#define MAX_BACKTRACE_DEPTH 32
48
+extern int wl_print_backtrace(const char * prefix, void * i_backtrace, int i_backtrace_depth);
49
+#else
50
+#define wl_print_backtrace(a, b, c)
51
+#endif /* ENABLE_CORECAPTURE */
52
+
53
+#define WIFICC_CAPTURE(_reason)
54
+#define WIFICC_LOGDEBUGIF(_flags, _args)
55
+#define WIFICC_LOGDEBUG(_args)
4156
4257 #define WL_PRINT(args) do { WL_TIMESTAMP(); printf args; } while (0)
4358
....@@ -46,7 +61,7 @@
4661 #define WL_SRSCAN(args) _WL_SRSCAN args
4762 #else
4863 #define WL_SRSCAN(args)
49
-#endif
64
+#endif // endif
5065
5166 #if defined(BCMCONDITIONAL_LOGGING)
5267
....@@ -55,11 +70,18 @@
5570 /* DBGONLY() macro to reduce ifdefs in code for statements that are only needed when
5671 * BCMDBG is defined.
5772 */
58
-#define DBGONLY(x)
73
+#define DBGONLY(x) x
5974
6075 /* To disable a message completely ... until you need it again */
6176 #define WL_NONE(args)
62
-#define WL_ERROR(args) do {if (wl_msg_level & WL_ERROR_VAL) WL_PRINT(args);} while (0)
77
+#define WL_ERROR(args) do {if (wl_msg_level & WL_ERROR_VAL) WL_PRINT(args); \
78
+ else WIFICC_LOGDEBUG(args); } while (0)
79
+#define WL_SCAN_ERROR(args)
80
+#define WL_IE_ERROR(args)
81
+#define WL_AMSDU_ERROR(args)
82
+#define WL_ASSOC_ERROR(args)
83
+#define KM_ERR(args)
84
+
6385 #define WL_TRACE(args)
6486 #define WL_PRHDRS_MSG(args)
6587 #define WL_PRHDRS(i, p, f, t, r, l)
....@@ -68,13 +90,15 @@
6890 #define WL_TMP(args)
6991 #define WL_OID(args)
7092 #define WL_RATE(args) do {if (wl_msg_level & WL_RATE_VAL) WL_PRINT(args);} while (0)
71
-#define WL_ASSOC(args) do {if (wl_msg_level & WL_ASSOC_VAL) WL_PRINT(args);} while (0)
93
+#define WL_ASSOC(args) do {if (wl_msg_level & WL_ASSOC_VAL) WL_PRINT(args); \
94
+ else WIFICC_LOGDEBUG(args);} while (0)
7295 #define WL_PRUSR(m, b, n)
7396 #define WL_PS(args) do {if (wl_msg_level & WL_PS_VAL) WL_PRINT(args);} while (0)
7497
7598 #define WL_PORT(args)
7699 #define WL_DUAL(args)
77
-#define WL_REGULATORY(args) do {if (wl_msg_level & WL_REGULATORY_VAL) WL_PRINT(args);} while (0)
100
+#define WL_REGULATORY(args) do {if (wl_msg_level & WL_REGULATORY_VAL) WL_PRINT(args); \
101
+ else WIFICC_LOGDEBUG(args);} while (0)
78102
79103 #define WL_MPC(args)
80104 #define WL_APSTA(args)
....@@ -84,6 +108,7 @@
84108 #define WL_APSTA_BSSID(args)
85109 #define WL_BA(args)
86110 #define WL_MBSS(args)
111
+#define WL_MODE_SWITCH(args)
87112 #define WL_PROTO(args)
88113
89114 #define WL_CAC(args) do {if (wl_msg_level & WL_CAC_VAL) WL_PRINT(args);} while (0)
....@@ -113,10 +138,30 @@
113138 #define WL_L2FILTER(args)
114139 #define WL_MQ(args)
115140 #define WL_TXBF(args)
141
+#define WL_MUMIMO(args)
116142 #define WL_P2PO(args)
117143 #define WL_ROAM(args)
118144 #define WL_WNM(args)
145
+#define WL_NAT(args)
119146
147
+#ifdef WLMSG_MESH
148
+#define WL_MESH(args) WL_PRINT(args)
149
+#define WL_MESH_AMPE(args) WL_PRINT(args)
150
+#define WL_MESH_ROUTE(args) WL_PRINT(args)
151
+#define WL_MESH_BCN(args)
152
+#else
153
+#define WL_MESH(args)
154
+#define WL_MESH_AMPE(args)
155
+#define WL_MESH_ROUTE(args)
156
+#define WL_MESH_BCN(args)
157
+#endif // endif
158
+#ifdef WLMSG_NATOE
159
+#define WL_NAT(args) do {if (wl_msg_level2 & WL_NATOE_VAL) WL_PRINT(args);} while (0)
160
+#else
161
+#define WL_NAT(args)
162
+#endif // endif
163
+
164
+#define WL_PFN_ERROR(args)
120165
121166 #define WL_AMPDU_UPDN(args)
122167 #define WL_AMPDU_RX(args)
....@@ -138,6 +183,11 @@
138183 #define WL_PCIE(args)
139184 #define WL_TSLOG(w, s, i, j)
140185 #define WL_FBT(args)
186
+#define WL_MBO_DBG(args)
187
+#define WL_RANDMAC_DBG(args)
188
+#define WL_BAM_ERR(args)
189
+#define WL_ADPS(args)
190
+#define WL_OCE_DBG(args)
141191
142192 #define WL_ERROR_ON() (wl_msg_level & WL_ERROR_VAL)
143193 #define WL_TRACE_ON() 0
....@@ -179,6 +229,12 @@
179229 #define WL_TSLOG_ON() 0
180230 #define WL_WNM_ON() 0
181231 #define WL_PCIE_ON() 0
232
+#define WL_MUMIMO_ON() 0
233
+#define WL_MESH_ON() 0
234
+#define WL_MBO_DBG_ON() 0
235
+#define WL_RANDMAC_DBG_ON() 0
236
+#define WL_ADPS_ON() 0
237
+#define WL_OCE_DBG_ON() 0
182238
183239 #else /* !BCMDBG */
184240
....@@ -191,21 +247,135 @@
191247 #define WL_NONE(args)
192248
193249 #define WL_ERROR(args)
250
+
251
+#define KM_ERR(args)
252
+
253
+#define WL_AMPDU_ERR(args)
254
+
194255 #define WL_TRACE(args)
195256 #define WL_APSTA_UPDN(args)
196257 #define WL_APSTA_RX(args)
258
+
197259 #ifdef WLMSG_WSEC
260
+#if defined(EVENT_LOG_COMPILE) && defined(EVENT_LOG_COMPILE)
261
+#if defined(USE_EVENT_LOG_RA)
262
+#define WL_WSEC(args) EVENT_LOG_RA(EVENT_LOG_TAG_WL_WSEC_LOG, args)
263
+#define WL_WSEC_DUMP(args) EVENT_LOG_RA(EVENT_LOG_TAG_WL_WSEC_DUMP, args)
264
+#else
265
+#define WL_WSEC(args) EVENT_LOG_FAST_CAST_PAREN_ARGS(EVENT_LOG_TAG_WL_WSEC_LOG, args)
266
+#define WL_WSEC_DUMP(args) EVENT_LOG_FAST_CAST_PAREN_ARGS(EVENT_LOG_TAG_WL_WSEC_DUMP, args)
267
+#endif /* USE_EVENT_LOG_RA */
268
+#else
198269 #define WL_WSEC(args) WL_PRINT(args)
199270 #define WL_WSEC_DUMP(args) WL_PRINT(args)
271
+#endif /* EVENT_LOG_COMPILE */
200272 #else
201273 #define WL_WSEC(args)
202274 #define WL_WSEC_DUMP(args)
203
-#endif
275
+#endif /* WLMSG_WSEC */
276
+
277
+#ifdef WLMSG_MBO
278
+#if defined(EVENT_LOG_COMPILE) && defined(EVENT_LOG_COMPILE)
279
+#if defined(USE_EVENT_LOG_RA)
280
+#define WL_MBO_DBG(args) EVENT_LOG_RA(EVENT_LOG_TAG_MBO_DBG, args)
281
+#define WL_MBO_INFO(args) EVENT_LOG_RA(EVENT_LOG_TAG_MBO_INFO, args)
282
+#else
283
+#define WL_MBO_DBG(args) \
284
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_MBO_DBG, args)
285
+#define WL_MBO_INFO(args) \
286
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_MBO_INFO, args)
287
+#endif /* USE_EVENT_LOG_RA */
288
+#else
289
+#define WL_MBO_DBG(args) WL_PRINT(args)
290
+#define WL_MBO_INFO(args) WL_PRINT(args)
291
+#endif /* EVENT_LOG_COMPILE */
292
+#else
293
+#define WL_MBO_DBG(args)
294
+#define WL_MBO_INFO(args)
295
+#endif /* WLMSG_MBO */
296
+
297
+#define WL_MBO_ERR(args) WL_PRINT(args)
298
+
299
+#ifdef WLMSG_RANDMAC
300
+#if defined(EVENT_LOG_COMPILE) && defined(EVENT_LOG_COMPILE)
301
+#if defined(USE_EVENT_LOG_RA)
302
+#define WL_RANDMAC_DBG(args) EVENT_LOG_RA(EVENT_LOG_TAG_RANDMAC_DBG, args)
303
+#define WL_RANDMAC_INFO(args) EVENT_LOG_RA(EVENT_LOG_TAG_RANDMAC_INFO, args)
304
+#else
305
+#define WL_RANDMAC_DBG(args) \
306
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_RANDMAC_DBG, args)
307
+#define WL_RANDMAC_INFO(args) \
308
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_RANDMAC_INFO, args)
309
+#endif /* USE_EVENT_LOG_RA */
310
+#else
311
+#define WL_RANDMAC_DBG(args) WL_PRINT(args)
312
+#define WL_RANDMAC_INFO(args) WL_PRINT(args)
313
+#endif /* EVENT_LOG_COMPILE */
314
+#else
315
+#define WL_RANDMAC_DBG(args)
316
+#define WL_RANDMAC_INFO(args)
317
+#endif /* WLMSG_RANDMAC */
318
+
319
+#define WL_RANDMAC_ERR(args) WL_PRINT(args)
320
+
321
+#ifdef WLMSG_OCE
322
+#if defined(EVENT_LOG_COMPILE)
323
+#if defined(USE_EVENT_LOG_RA)
324
+#define WL_OCE_DBG(args) EVENT_LOG_RA(EVENT_LOG_TAG_OCE_DBG, args)
325
+#define WL_OCE_INFO(args) EVENT_LOG_RA(EVENT_LOG_TAG_OCE_INFO, args)
326
+#else
327
+#define WL_OCE_DBG(args) \
328
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_OCE_DBG, args)
329
+#define WL_OCE_INFO(args) \
330
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_OCE_INFO, args)
331
+#endif /* USE_EVENT_LOG_RA */
332
+#else
333
+#define WL_OCE_DBG(args) WL_PRINT(args)
334
+#define WL_OCE_INFO(args) WL_PRINT(args)
335
+#endif /* EVENT_LOG_COMPILE */
336
+#else
337
+#define WL_OCE_DBG(args)
338
+#define WL_OCE_INFO(args)
339
+#endif /* WLMSG_OCE */
340
+
341
+#define WL_OCE_ERR(args) WL_PRINT(args)
342
+
204343 #define WL_PCIE(args) do {if (wl_msg_level2 & WL_PCIE_VAL) WL_PRINT(args);} while (0)
205344 #define WL_PCIE_ON() (wl_msg_level2 & WL_PCIE_VAL)
206345 #define WL_PFN(args) do {if (wl_msg_level & WL_PFN_VAL) WL_PRINT(args);} while (0)
207346 #define WL_PFN_ON() (wl_msg_level & WL_PFN_VAL)
208
-#endif
347
+#endif // endif
348
+
349
+#ifdef WLMSG_BAM
350
+#if defined(EVENT_LOG_COMPILE)
351
+#ifdef USE_EVENT_LOG_RA
352
+#define WL_BAM_ERR(args) EVENT_LOG_RA(EVENT_LOG_TAG_BAM, args)
353
+#else
354
+#define WL_BAM_ERR(args) EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_BAM, args)
355
+#endif /* USE_EVENT_LOG_RA */
356
+#else
357
+#define WL_BAM_ERR(args) WL_PRINT(args)
358
+#endif /* EVENT_LOG_COMPILE */
359
+#endif /* WLMSG_BAM */
360
+
361
+#ifdef WLMSG_WNM_BSSTRANS
362
+#if defined(EVENT_LOG_COMPILE)
363
+#if defined(USE_EVENT_LOG_RA)
364
+#define WL_BSSTRANS_INFO(args) EVENT_LOG_RA(EVENT_LOG_TAG_WNM_BSSTRANS_INFO, args)
365
+#else
366
+#define WL_BSSTRANS_INFO(args) \
367
+ EVENT_LOG_COMPACT_CAST_PAREN_ARGS(EVENT_LOG_TAG_WNM_BSSTRANS_INFO, args)
368
+#endif /* USE_EVENT_LOG_RA */
369
+#else
370
+#define WL_BSSTRANS_INFO(args) WL_PRINT(args)
371
+#endif /* EVENT_LOG_COMPILE */
372
+#else
373
+#define WL_BSSTRANS_INFO(args)
374
+#endif /* WLMSG_WNM_BSSTRANS */
375
+
376
+#define WL_BSSTRANS_ERR(args) WL_PRINT(args)
377
+
378
+#define DBGERRONLY(x)
209379
210380 extern uint32 wl_msg_level;
211381 extern uint32 wl_msg_level2;