1 #ifndef __MAC80211_DEBUG_H
2 #define __MAC80211_DEBUG_H
3 #include <net/cfg80211.h>
5 #ifdef CONFIG_MAC80211_OCB_DEBUG
6 #define MAC80211_OCB_DEBUG 1
8 #define MAC80211_OCB_DEBUG 0
11 #ifdef CONFIG_MAC80211_IBSS_DEBUG
12 #define MAC80211_IBSS_DEBUG 1
14 #define MAC80211_IBSS_DEBUG 0
17 #ifdef CONFIG_MAC80211_PS_DEBUG
18 #define MAC80211_PS_DEBUG 1
20 #define MAC80211_PS_DEBUG 0
23 #ifdef CONFIG_MAC80211_HT_DEBUG
24 #define MAC80211_HT_DEBUG 1
26 #define MAC80211_HT_DEBUG 0
29 #ifdef CONFIG_MAC80211_MPL_DEBUG
30 #define MAC80211_MPL_DEBUG 1
32 #define MAC80211_MPL_DEBUG 0
35 #ifdef CONFIG_MAC80211_MPATH_DEBUG
36 #define MAC80211_MPATH_DEBUG 1
38 #define MAC80211_MPATH_DEBUG 0
41 #ifdef CONFIG_MAC80211_MHWMP_DEBUG
42 #define MAC80211_MHWMP_DEBUG 1
44 #define MAC80211_MHWMP_DEBUG 0
47 #ifdef CONFIG_MAC80211_MESH_SYNC_DEBUG
48 #define MAC80211_MESH_SYNC_DEBUG 1
50 #define MAC80211_MESH_SYNC_DEBUG 0
53 #ifdef CONFIG_MAC80211_MESH_CSA_DEBUG
54 #define MAC80211_MESH_CSA_DEBUG 1
56 #define MAC80211_MESH_CSA_DEBUG 0
59 #ifdef CONFIG_MAC80211_MESH_PS_DEBUG
60 #define MAC80211_MESH_PS_DEBUG 1
62 #define MAC80211_MESH_PS_DEBUG 0
65 #ifdef CONFIG_MAC80211_TDLS_DEBUG
66 #define MAC80211_TDLS_DEBUG 1
68 #define MAC80211_TDLS_DEBUG 0
71 #ifdef CONFIG_MAC80211_STA_DEBUG
72 #define MAC80211_STA_DEBUG 1
74 #define MAC80211_STA_DEBUG 0
77 #ifdef CONFIG_MAC80211_MLME_DEBUG
78 #define MAC80211_MLME_DEBUG 1
80 #define MAC80211_MLME_DEBUG 0
83 #ifdef CONFIG_MAC80211_MESSAGE_TRACING
84 void __sdata_info(const char *fmt, ...) __printf(1, 2);
85 void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
86 void __sdata_err(const char *fmt, ...) __printf(1, 2);
87 void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
90 #define _sdata_info(sdata, fmt, ...) \
91 __sdata_info("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
92 #define _sdata_dbg(print, sdata, fmt, ...) \
93 __sdata_dbg(print, "%s: " fmt, (sdata)->name, ##__VA_ARGS__)
94 #define _sdata_err(sdata, fmt, ...) \
95 __sdata_err("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
96 #define _wiphy_dbg(print, wiphy, fmt, ...) \
97 __wiphy_dbg(wiphy, print, fmt, ##__VA_ARGS__)
99 #define _sdata_info(sdata, fmt, ...) \
101 pr_info("%s: " fmt, \
102 (sdata)->name, ##__VA_ARGS__); \
105 #define _sdata_dbg(print, sdata, fmt, ...) \
108 pr_debug("%s: " fmt, \
109 (sdata)->name, ##__VA_ARGS__); \
112 #define _sdata_err(sdata, fmt, ...) \
115 (sdata)->name, ##__VA_ARGS__); \
118 #define _wiphy_dbg(print, wiphy, fmt, ...) \
121 wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \
125 #define sdata_info(sdata, fmt, ...) \
126 _sdata_info(sdata, fmt, ##__VA_ARGS__)
127 #define sdata_err(sdata, fmt, ...) \
128 _sdata_err(sdata, fmt, ##__VA_ARGS__)
129 #define sdata_dbg(sdata, fmt, ...) \
130 _sdata_dbg(1, sdata, fmt, ##__VA_ARGS__)
132 #define ht_dbg(sdata, fmt, ...) \
133 _sdata_dbg(MAC80211_HT_DEBUG, \
134 sdata, fmt, ##__VA_ARGS__)
136 #define ht_dbg_ratelimited(sdata, fmt, ...) \
137 _sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(), \
138 sdata, fmt, ##__VA_ARGS__)
140 #define ocb_dbg(sdata, fmt, ...) \
141 _sdata_dbg(MAC80211_OCB_DEBUG, \
142 sdata, fmt, ##__VA_ARGS__)
144 #define ibss_dbg(sdata, fmt, ...) \
145 _sdata_dbg(MAC80211_IBSS_DEBUG, \
146 sdata, fmt, ##__VA_ARGS__)
148 #define ps_dbg(sdata, fmt, ...) \
149 _sdata_dbg(MAC80211_PS_DEBUG, \
150 sdata, fmt, ##__VA_ARGS__)
152 #define ps_dbg_hw(hw, fmt, ...) \
153 _wiphy_dbg(MAC80211_PS_DEBUG, \
154 (hw)->wiphy, fmt, ##__VA_ARGS__)
156 #define ps_dbg_ratelimited(sdata, fmt, ...) \
157 _sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(), \
158 sdata, fmt, ##__VA_ARGS__)
160 #define mpl_dbg(sdata, fmt, ...) \
161 _sdata_dbg(MAC80211_MPL_DEBUG, \
162 sdata, fmt, ##__VA_ARGS__)
164 #define mpath_dbg(sdata, fmt, ...) \
165 _sdata_dbg(MAC80211_MPATH_DEBUG, \
166 sdata, fmt, ##__VA_ARGS__)
168 #define mhwmp_dbg(sdata, fmt, ...) \
169 _sdata_dbg(MAC80211_MHWMP_DEBUG, \
170 sdata, fmt, ##__VA_ARGS__)
172 #define msync_dbg(sdata, fmt, ...) \
173 _sdata_dbg(MAC80211_MESH_SYNC_DEBUG, \
174 sdata, fmt, ##__VA_ARGS__)
176 #define mcsa_dbg(sdata, fmt, ...) \
177 _sdata_dbg(MAC80211_MESH_CSA_DEBUG, \
178 sdata, fmt, ##__VA_ARGS__)
180 #define mps_dbg(sdata, fmt, ...) \
181 _sdata_dbg(MAC80211_MESH_PS_DEBUG, \
182 sdata, fmt, ##__VA_ARGS__)
184 #define tdls_dbg(sdata, fmt, ...) \
185 _sdata_dbg(MAC80211_TDLS_DEBUG, \
186 sdata, fmt, ##__VA_ARGS__)
188 #define sta_dbg(sdata, fmt, ...) \
189 _sdata_dbg(MAC80211_STA_DEBUG, \
190 sdata, fmt, ##__VA_ARGS__)
192 #define mlme_dbg(sdata, fmt, ...) \
193 _sdata_dbg(MAC80211_MLME_DEBUG, \
194 sdata, fmt, ##__VA_ARGS__)
196 #define mlme_dbg_ratelimited(sdata, fmt, ...) \
197 _sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(), \
198 sdata, fmt, ##__VA_ARGS__)
200 #endif /* __MAC80211_DEBUG_H */