1 /** @file wifi-debug.h
2  *
3  *  @brief WLAN Debug Header
4  *
5  *  Copyright 2008-2024 NXP
6  *
7  *  SPDX-License-Identifier: BSD-3-Clause
8  *
9  */
10 
11 #ifndef __WIFI_DEBUG_H__
12 #define __WIFI_DEBUG_H__
13 
14 #include <mlan_api.h>
15 #include <wmlog.h>
16 
17 #define wscan_e(...) wmlog_e("wscan", ##__VA_ARGS__)
18 #define wscan_w(...) wmlog_w("wscan", ##__VA_ARGS__)
19 
20 #if CONFIG_WIFI_SCAN_DEBUG
21 #define wscan_d(...) wmlog("wscan", ##__VA_ARGS__)
22 #else
23 #define wscan_d(...)
24 #endif /* ! CONFIG_WIFI_SCAN_DEBUG */
25 
26 #define wifi_e(...) wmlog_e("wifi", ##__VA_ARGS__)
27 #define wifi_w(...) wmlog_w("wifi", ##__VA_ARGS__)
28 
29 #if CONFIG_WIFI_EXTRA_DEBUG
30 #define wifi_d(...) wmlog("wifi", ##__VA_ARGS__)
31 #else
32 #define wifi_d(...)
33 #endif /* ! CONFIG_WIFI_EXTRA_DEBUG */
34 
35 #define ampdu_e(...) wmlog_e("ampdu", ##__VA_ARGS__)
36 #define ampdu_w(...) wmlog_w("ampdu", ##__VA_ARGS__)
37 
38 #if CONFIG_WIFI_AMPDU_DEBUG
39 #define ampdu_d(...) wmlog("ampdu", ##__VA_ARGS__)
40 #else
41 #define ampdu_d(...)
42 #endif /* ! CONFIG_WIFI_AMPDU_DEBUG */
43 
44 #define w_tmr_e(...) wmlog_e("w_tmr", ##__VA_ARGS__)
45 #define w_tmr_w(...) wmlog_w("w_tmr", ##__VA_ARGS__)
46 
47 #if CONFIG_WIFI_TIMER_DEBUG
48 #define w_tmr_d(...) wmlog("w_tmr", ##__VA_ARGS__)
49 #else
50 #define w_tmr_d(...)
51 #endif /* CONFIG_WIFI_TIMER_DEBUG */
52 
53 #define w_mem_e(...) wmlog_e("w_mem", ##__VA_ARGS__)
54 #define w_mem_w(...) wmlog_w("w_mem", ##__VA_ARGS__)
55 
56 #if CONFIG_WIFI_MEM_DEBUG
57 #define w_mem_d(...) wmlog("w_mem", ##__VA_ARGS__)
58 #else
59 #define w_mem_d(...)
60 #endif /* ! CONFIG_WIFI_MEM_DEBUG */
61 
62 #define w_pkt_e(...) wmlog_e("w_pkt", ##__VA_ARGS__)
63 #define w_pkt_w(...) wmlog_w("w_pkt", ##__VA_ARGS__)
64 
65 #if CONFIG_WIFI_PKT_DEBUG
66 #define w_pkt_d(...) wmlog("w_pkt", ##__VA_ARGS__)
67 #else
68 #define w_pkt_d(...)
69 #endif /* ! CONFIG_WIFI_PKT_DEBUG */
70 
71 #define wevt_e(...) wmlog_e("wevt", ##__VA_ARGS__)
72 #define wevt_w(...) wmlog_w("wevt", ##__VA_ARGS__)
73 
74 #if CONFIG_WIFI_EVENTS_DEBUG
75 #define wevt_d(...) wmlog("wevt", ##__VA_ARGS__)
76 #else
77 #define wevt_d(...)
78 #endif /* ! CONFIG_WIFI_EVENTS_DEBUG */
79 
80 #define wcmdr_e(...) wmlog_e("wcmdr", ##__VA_ARGS__)
81 #define wcmdr_w(...) wmlog_w("wcmdr", ##__VA_ARGS__)
82 
83 #if CONFIG_WIFI_CMD_RESP_DEBUG
84 #define wcmdr_d(...) wmlog("wcmdr", ##__VA_ARGS__)
85 #else
86 #define wcmdr_d(...)
87 #endif /* ! CONFIG_WIFI_CMD_RESP_DEBUG */
88 
89 #define wuap_e(...) wmlog_e("uap", ##__VA_ARGS__)
90 #define wuap_w(...) wmlog_w("uap", ##__VA_ARGS__)
91 
92 #if CONFIG_WIFI_UAP_DEBUG
93 #define wuap_d(...) wmlog("uap", ##__VA_ARGS__)
94 #else
95 #define wuap_d(...)
96 #endif /* ! CONFIG_WIFI_UAP_DEBUG */
97 
98 void wifi_show_assoc_fail_reason(int status);
99 
100 #ifdef DUMP_PACKET_MAC
101 void dump_mac_addr(const char *msg, unsigned char *addr);
102 #endif /* DUMP_PACKET_MAC */
103 
104 #ifdef DEBUG_11N_AGGR
105 void dump_packet_header(const HostCmd_DS_COMMAND *cmd);
106 void dump_addba_req_rsp_packet(const HostCmd_DS_COMMAND *cmd);
107 #endif
108 
109 #ifdef DEBUG_11N_ASSOC
110 void dump_htcap_info(const MrvlIETypes_HTCap_t *htcap);
111 void dump_ht_info(const MrvlIETypes_HTInfo_t *htinfo);
112 #endif /* DEBUG_11N_ASSOC */
113 
114 #endif /* __WIFI_DEBUG_H__ */
115