.. | .. |
---|
1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 1 | /* |
---|
3 | 2 | * Minimal debug/trace/assert driver definitions for |
---|
4 | 3 | * Broadcom 802.11 Networking Adapter. |
---|
5 | 4 | * |
---|
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 | + * |
---|
8 | 9 | * Unless you and Broadcom execute a separate written software license |
---|
9 | 10 | * agreement governing use of this software, this software is licensed to you |
---|
10 | 11 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
---|
11 | 12 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
---|
12 | 13 | * following added to such license: |
---|
13 | | - * |
---|
| 14 | + * |
---|
14 | 15 | * As a special exception, the copyright holders of this software give you |
---|
15 | 16 | * permission to link this software with independent modules, and to copy and |
---|
16 | 17 | * distribute the resulting executable under terms of your choice, provided that |
---|
.. | .. |
---|
18 | 19 | * the license of that module. An independent module is a module which is not |
---|
19 | 20 | * derived from this software. The special exception does not apply to any |
---|
20 | 21 | * modifications of the software. |
---|
21 | | - * |
---|
| 22 | + * |
---|
22 | 23 | * Notwithstanding the above, under no circumstances may you combine this |
---|
23 | 24 | * software in any way with any other Broadcom software provided under a license |
---|
24 | 25 | * other than the GPL, without Broadcom's express prior written consent. |
---|
.. | .. |
---|
26 | 27 | * |
---|
27 | 28 | * <<Broadcom-WL-IPTag/Open:>> |
---|
28 | 29 | * |
---|
29 | | - * $Id: wl_dbg.h 519338 2014-12-05 21:23:30Z $ |
---|
| 30 | + * $Id: wl_dbg.h 697380 2017-05-03 11:34:25Z $ |
---|
30 | 31 | */ |
---|
31 | | - |
---|
32 | 32 | |
---|
33 | 33 | #ifndef _wl_dbg_h_ |
---|
34 | 34 | #define _wl_dbg_h_ |
---|
| 35 | + |
---|
| 36 | +#if defined(EVENT_LOG_COMPILE) |
---|
| 37 | +#include <event_log.h> |
---|
| 38 | +#endif // endif |
---|
35 | 39 | |
---|
36 | 40 | /* wl_msg_level is a bit vector with defs in wlioctl.h */ |
---|
37 | 41 | extern uint32 wl_msg_level; |
---|
38 | 42 | extern uint32 wl_msg_level2; |
---|
39 | 43 | |
---|
40 | 44 | #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) |
---|
41 | 56 | |
---|
42 | 57 | #define WL_PRINT(args) do { WL_TIMESTAMP(); printf args; } while (0) |
---|
43 | 58 | |
---|
.. | .. |
---|
46 | 61 | #define WL_SRSCAN(args) _WL_SRSCAN args |
---|
47 | 62 | #else |
---|
48 | 63 | #define WL_SRSCAN(args) |
---|
49 | | -#endif |
---|
| 64 | +#endif // endif |
---|
50 | 65 | |
---|
51 | 66 | #if defined(BCMCONDITIONAL_LOGGING) |
---|
52 | 67 | |
---|
.. | .. |
---|
55 | 70 | /* DBGONLY() macro to reduce ifdefs in code for statements that are only needed when |
---|
56 | 71 | * BCMDBG is defined. |
---|
57 | 72 | */ |
---|
58 | | -#define DBGONLY(x) |
---|
| 73 | +#define DBGONLY(x) x |
---|
59 | 74 | |
---|
60 | 75 | /* To disable a message completely ... until you need it again */ |
---|
61 | 76 | #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 | + |
---|
63 | 85 | #define WL_TRACE(args) |
---|
64 | 86 | #define WL_PRHDRS_MSG(args) |
---|
65 | 87 | #define WL_PRHDRS(i, p, f, t, r, l) |
---|
.. | .. |
---|
68 | 90 | #define WL_TMP(args) |
---|
69 | 91 | #define WL_OID(args) |
---|
70 | 92 | #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) |
---|
72 | 95 | #define WL_PRUSR(m, b, n) |
---|
73 | 96 | #define WL_PS(args) do {if (wl_msg_level & WL_PS_VAL) WL_PRINT(args);} while (0) |
---|
74 | 97 | |
---|
75 | 98 | #define WL_PORT(args) |
---|
76 | 99 | #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) |
---|
78 | 102 | |
---|
79 | 103 | #define WL_MPC(args) |
---|
80 | 104 | #define WL_APSTA(args) |
---|
.. | .. |
---|
84 | 108 | #define WL_APSTA_BSSID(args) |
---|
85 | 109 | #define WL_BA(args) |
---|
86 | 110 | #define WL_MBSS(args) |
---|
| 111 | +#define WL_MODE_SWITCH(args) |
---|
87 | 112 | #define WL_PROTO(args) |
---|
88 | 113 | |
---|
89 | 114 | #define WL_CAC(args) do {if (wl_msg_level & WL_CAC_VAL) WL_PRINT(args);} while (0) |
---|
.. | .. |
---|
113 | 138 | #define WL_L2FILTER(args) |
---|
114 | 139 | #define WL_MQ(args) |
---|
115 | 140 | #define WL_TXBF(args) |
---|
| 141 | +#define WL_MUMIMO(args) |
---|
116 | 142 | #define WL_P2PO(args) |
---|
117 | 143 | #define WL_ROAM(args) |
---|
118 | 144 | #define WL_WNM(args) |
---|
| 145 | +#define WL_NAT(args) |
---|
119 | 146 | |
---|
| 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) |
---|
120 | 165 | |
---|
121 | 166 | #define WL_AMPDU_UPDN(args) |
---|
122 | 167 | #define WL_AMPDU_RX(args) |
---|
.. | .. |
---|
138 | 183 | #define WL_PCIE(args) |
---|
139 | 184 | #define WL_TSLOG(w, s, i, j) |
---|
140 | 185 | #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) |
---|
141 | 191 | |
---|
142 | 192 | #define WL_ERROR_ON() (wl_msg_level & WL_ERROR_VAL) |
---|
143 | 193 | #define WL_TRACE_ON() 0 |
---|
.. | .. |
---|
179 | 229 | #define WL_TSLOG_ON() 0 |
---|
180 | 230 | #define WL_WNM_ON() 0 |
---|
181 | 231 | #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 |
---|
182 | 238 | |
---|
183 | 239 | #else /* !BCMDBG */ |
---|
184 | 240 | |
---|
.. | .. |
---|
191 | 247 | #define WL_NONE(args) |
---|
192 | 248 | |
---|
193 | 249 | #define WL_ERROR(args) |
---|
| 250 | + |
---|
| 251 | +#define KM_ERR(args) |
---|
| 252 | + |
---|
| 253 | +#define WL_AMPDU_ERR(args) |
---|
| 254 | + |
---|
194 | 255 | #define WL_TRACE(args) |
---|
195 | 256 | #define WL_APSTA_UPDN(args) |
---|
196 | 257 | #define WL_APSTA_RX(args) |
---|
| 258 | + |
---|
197 | 259 | #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 |
---|
198 | 269 | #define WL_WSEC(args) WL_PRINT(args) |
---|
199 | 270 | #define WL_WSEC_DUMP(args) WL_PRINT(args) |
---|
| 271 | +#endif /* EVENT_LOG_COMPILE */ |
---|
200 | 272 | #else |
---|
201 | 273 | #define WL_WSEC(args) |
---|
202 | 274 | #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 | + |
---|
204 | 343 | #define WL_PCIE(args) do {if (wl_msg_level2 & WL_PCIE_VAL) WL_PRINT(args);} while (0) |
---|
205 | 344 | #define WL_PCIE_ON() (wl_msg_level2 & WL_PCIE_VAL) |
---|
206 | 345 | #define WL_PFN(args) do {if (wl_msg_level & WL_PFN_VAL) WL_PRINT(args);} while (0) |
---|
207 | 346 | #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) |
---|
209 | 379 | |
---|
210 | 380 | extern uint32 wl_msg_level; |
---|
211 | 381 | extern uint32 wl_msg_level2; |
---|