1 #ifndef __MAC80211_DEBUG_H
2 #define __MAC80211_DEBUG_H
3 #include <net/cfg80211.h>
5 #ifdef CONFIG_MAC80211_IBSS_DEBUG
6 #define MAC80211_IBSS_DEBUG 1
8 #define MAC80211_IBSS_DEBUG 0
11 #ifdef CONFIG_MAC80211_PS_DEBUG
12 #define MAC80211_PS_DEBUG 1
14 #define MAC80211_PS_DEBUG 0
17 #ifdef CONFIG_MAC80211_HT_DEBUG
18 #define MAC80211_HT_DEBUG 1
20 #define MAC80211_HT_DEBUG 0
23 #ifdef CONFIG_MAC80211_MPL_DEBUG
24 #define MAC80211_MPL_DEBUG 1
26 #define MAC80211_MPL_DEBUG 0
29 #ifdef CONFIG_MAC80211_MPATH_DEBUG
30 #define MAC80211_MPATH_DEBUG 1
32 #define MAC80211_MPATH_DEBUG 0
35 #ifdef CONFIG_MAC80211_MHWMP_DEBUG
36 #define MAC80211_MHWMP_DEBUG 1
38 #define MAC80211_MHWMP_DEBUG 0
41 #ifdef CONFIG_MAC80211_MESH_SYNC_DEBUG
42 #define MAC80211_MESH_SYNC_DEBUG 1
44 #define MAC80211_MESH_SYNC_DEBUG 0
47 #ifdef CONFIG_MAC80211_MESH_CSA_DEBUG
48 #define MAC80211_MESH_CSA_DEBUG 1
50 #define MAC80211_MESH_CSA_DEBUG 0
53 #ifdef CONFIG_MAC80211_MESH_PS_DEBUG
54 #define MAC80211_MESH_PS_DEBUG 1
56 #define MAC80211_MESH_PS_DEBUG 0
59 #ifdef CONFIG_MAC80211_TDLS_DEBUG
60 #define MAC80211_TDLS_DEBUG 1
62 #define MAC80211_TDLS_DEBUG 0
65 #ifdef CONFIG_MAC80211_STA_DEBUG
66 #define MAC80211_STA_DEBUG 1
68 #define MAC80211_STA_DEBUG 0
71 #ifdef CONFIG_MAC80211_MLME_DEBUG
72 #define MAC80211_MLME_DEBUG 1
74 #define MAC80211_MLME_DEBUG 0
77 #ifdef CONFIG_MAC80211_MESSAGE_TRACING
78 void __sdata_info(const char *fmt
, ...) __printf(1, 2);
79 void __sdata_dbg(bool print
, const char *fmt
, ...) __printf(2, 3);
80 void __sdata_err(const char *fmt
, ...) __printf(1, 2);
81 void __wiphy_dbg(struct wiphy
*wiphy
, bool print
, const char *fmt
, ...)
84 #define _sdata_info(sdata, fmt, ...) \
85 __sdata_info("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
86 #define _sdata_dbg(print, sdata, fmt, ...) \
87 __sdata_dbg(print, "%s: " fmt, (sdata)->name, ##__VA_ARGS__)
88 #define _sdata_err(sdata, fmt, ...) \
89 __sdata_err("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
90 #define _wiphy_dbg(print, wiphy, fmt, ...) \
91 __wiphy_dbg(wiphy, print, fmt, ##__VA_ARGS__)
93 #define _sdata_info(sdata, fmt, ...) \
96 (sdata)->name, ##__VA_ARGS__); \
99 #define _sdata_dbg(print, sdata, fmt, ...) \
102 pr_debug("%s: " fmt, \
103 (sdata)->name, ##__VA_ARGS__); \
106 #define _sdata_err(sdata, fmt, ...) \
109 (sdata)->name, ##__VA_ARGS__); \
112 #define _wiphy_dbg(print, wiphy, fmt, ...) \
115 wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \
119 #define sdata_info(sdata, fmt, ...) \
120 _sdata_info(sdata, fmt, ##__VA_ARGS__)
121 #define sdata_err(sdata, fmt, ...) \
122 _sdata_err(sdata, fmt, ##__VA_ARGS__)
123 #define sdata_dbg(sdata, fmt, ...) \
124 _sdata_dbg(1, sdata, fmt, ##__VA_ARGS__)
126 #define ht_dbg(sdata, fmt, ...) \
127 _sdata_dbg(MAC80211_HT_DEBUG, \
128 sdata, fmt, ##__VA_ARGS__)
130 #define ht_dbg_ratelimited(sdata, fmt, ...) \
131 _sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(), \
132 sdata, fmt, ##__VA_ARGS__)
134 #define ibss_dbg(sdata, fmt, ...) \
135 _sdata_dbg(MAC80211_IBSS_DEBUG, \
136 sdata, fmt, ##__VA_ARGS__)
138 #define ps_dbg(sdata, fmt, ...) \
139 _sdata_dbg(MAC80211_PS_DEBUG, \
140 sdata, fmt, ##__VA_ARGS__)
142 #define ps_dbg_hw(hw, fmt, ...) \
143 _wiphy_dbg(MAC80211_PS_DEBUG, \
144 (hw)->wiphy, fmt, ##__VA_ARGS__)
146 #define ps_dbg_ratelimited(sdata, fmt, ...) \
147 _sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(), \
148 sdata, fmt, ##__VA_ARGS__)
150 #define mpl_dbg(sdata, fmt, ...) \
151 _sdata_dbg(MAC80211_MPL_DEBUG, \
152 sdata, fmt, ##__VA_ARGS__)
154 #define mpath_dbg(sdata, fmt, ...) \
155 _sdata_dbg(MAC80211_MPATH_DEBUG, \
156 sdata, fmt, ##__VA_ARGS__)
158 #define mhwmp_dbg(sdata, fmt, ...) \
159 _sdata_dbg(MAC80211_MHWMP_DEBUG, \
160 sdata, fmt, ##__VA_ARGS__)
162 #define msync_dbg(sdata, fmt, ...) \
163 _sdata_dbg(MAC80211_MESH_SYNC_DEBUG, \
164 sdata, fmt, ##__VA_ARGS__)
166 #define mcsa_dbg(sdata, fmt, ...) \
167 _sdata_dbg(MAC80211_MESH_CSA_DEBUG, \
168 sdata, fmt, ##__VA_ARGS__)
170 #define mps_dbg(sdata, fmt, ...) \
171 _sdata_dbg(MAC80211_MESH_PS_DEBUG, \
172 sdata, fmt, ##__VA_ARGS__)
174 #define tdls_dbg(sdata, fmt, ...) \
175 _sdata_dbg(MAC80211_TDLS_DEBUG, \
176 sdata, fmt, ##__VA_ARGS__)
178 #define sta_dbg(sdata, fmt, ...) \
179 _sdata_dbg(MAC80211_STA_DEBUG, \
180 sdata, fmt, ##__VA_ARGS__)
182 #define mlme_dbg(sdata, fmt, ...) \
183 _sdata_dbg(MAC80211_MLME_DEBUG, \
184 sdata, fmt, ##__VA_ARGS__)
186 #define mlme_dbg_ratelimited(sdata, fmt, ...) \
187 _sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(), \
188 sdata, fmt, ##__VA_ARGS__)
190 #endif /* __MAC80211_DEBUG_H */