Merge tag 'v3.10.82' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / mac80211 / debug.h
CommitLineData
bdcbd8e0
JB
1#ifndef __MAC80211_DEBUG_H
2#define __MAC80211_DEBUG_H
3fae0273 3#include <net/cfg80211.h>
bdcbd8e0
JB
4
5#ifdef CONFIG_MAC80211_IBSS_DEBUG
6#define MAC80211_IBSS_DEBUG 1
7#else
8#define MAC80211_IBSS_DEBUG 0
9#endif
10
11#ifdef CONFIG_MAC80211_PS_DEBUG
12#define MAC80211_PS_DEBUG 1
13#else
14#define MAC80211_PS_DEBUG 0
15#endif
16
17#ifdef CONFIG_MAC80211_HT_DEBUG
18#define MAC80211_HT_DEBUG 1
19#else
20#define MAC80211_HT_DEBUG 0
21#endif
22
23#ifdef CONFIG_MAC80211_MPL_DEBUG
24#define MAC80211_MPL_DEBUG 1
25#else
26#define MAC80211_MPL_DEBUG 0
27#endif
28
29#ifdef CONFIG_MAC80211_MPATH_DEBUG
30#define MAC80211_MPATH_DEBUG 1
31#else
32#define MAC80211_MPATH_DEBUG 0
33#endif
34
35#ifdef CONFIG_MAC80211_MHWMP_DEBUG
36#define MAC80211_MHWMP_DEBUG 1
37#else
38#define MAC80211_MHWMP_DEBUG 0
39#endif
40
41#ifdef CONFIG_MAC80211_MESH_SYNC_DEBUG
42#define MAC80211_MESH_SYNC_DEBUG 1
43#else
44#define MAC80211_MESH_SYNC_DEBUG 0
45#endif
46
3f52b7e3
MP
47#ifdef CONFIG_MAC80211_MESH_PS_DEBUG
48#define MAC80211_MESH_PS_DEBUG 1
49#else
50#define MAC80211_MESH_PS_DEBUG 0
51#endif
52
bdcbd8e0
JB
53#ifdef CONFIG_MAC80211_TDLS_DEBUG
54#define MAC80211_TDLS_DEBUG 1
55#else
56#define MAC80211_TDLS_DEBUG 0
57#endif
58
59#ifdef CONFIG_MAC80211_STA_DEBUG
60#define MAC80211_STA_DEBUG 1
61#else
62#define MAC80211_STA_DEBUG 0
63#endif
64
65#ifdef CONFIG_MAC80211_MLME_DEBUG
66#define MAC80211_MLME_DEBUG 1
67#else
68#define MAC80211_MLME_DEBUG 0
69#endif
70
3fae0273
JB
71#ifdef CONFIG_MAC80211_MESSAGE_TRACING
72void __sdata_info(const char *fmt, ...) __printf(1, 2);
73void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
74void __sdata_err(const char *fmt, ...) __printf(1, 2);
75void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
76 __printf(3, 4);
77
78#define _sdata_info(sdata, fmt, ...) \
79 __sdata_info("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
80#define _sdata_dbg(print, sdata, fmt, ...) \
81 __sdata_dbg(print, "%s: " fmt, (sdata)->name, ##__VA_ARGS__)
82#define _sdata_err(sdata, fmt, ...) \
83 __sdata_err("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
84#define _wiphy_dbg(print, wiphy, fmt, ...) \
85 __wiphy_dbg(wiphy, print, fmt, ##__VA_ARGS__)
86#else
bdcbd8e0
JB
87#define _sdata_info(sdata, fmt, ...) \
88do { \
89 pr_info("%s: " fmt, \
90 (sdata)->name, ##__VA_ARGS__); \
91} while (0)
92
93#define _sdata_dbg(print, sdata, fmt, ...) \
94do { \
95 if (print) \
96 pr_debug("%s: " fmt, \
97 (sdata)->name, ##__VA_ARGS__); \
98} while (0)
99
100#define _sdata_err(sdata, fmt, ...) \
101do { \
102 pr_err("%s: " fmt, \
103 (sdata)->name, ##__VA_ARGS__); \
104} while (0)
105
106#define _wiphy_dbg(print, wiphy, fmt, ...) \
107do { \
108 if (print) \
109 wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \
110} while (0)
3fae0273 111#endif
bdcbd8e0
JB
112
113#define sdata_info(sdata, fmt, ...) \
114 _sdata_info(sdata, fmt, ##__VA_ARGS__)
115#define sdata_err(sdata, fmt, ...) \
116 _sdata_err(sdata, fmt, ##__VA_ARGS__)
117#define sdata_dbg(sdata, fmt, ...) \
118 _sdata_dbg(1, sdata, fmt, ##__VA_ARGS__)
119
120#define ht_dbg(sdata, fmt, ...) \
121 _sdata_dbg(MAC80211_HT_DEBUG, \
122 sdata, fmt, ##__VA_ARGS__)
123
124#define ht_dbg_ratelimited(sdata, fmt, ...) \
125 _sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(), \
126 sdata, fmt, ##__VA_ARGS__)
127
128#define ibss_dbg(sdata, fmt, ...) \
129 _sdata_dbg(MAC80211_IBSS_DEBUG, \
130 sdata, fmt, ##__VA_ARGS__)
131
132#define ps_dbg(sdata, fmt, ...) \
133 _sdata_dbg(MAC80211_PS_DEBUG, \
134 sdata, fmt, ##__VA_ARGS__)
135
136#define ps_dbg_hw(hw, fmt, ...) \
137 _wiphy_dbg(MAC80211_PS_DEBUG, \
138 (hw)->wiphy, fmt, ##__VA_ARGS__)
139
140#define ps_dbg_ratelimited(sdata, fmt, ...) \
141 _sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(), \
142 sdata, fmt, ##__VA_ARGS__)
143
144#define mpl_dbg(sdata, fmt, ...) \
145 _sdata_dbg(MAC80211_MPL_DEBUG, \
146 sdata, fmt, ##__VA_ARGS__)
147
148#define mpath_dbg(sdata, fmt, ...) \
149 _sdata_dbg(MAC80211_MPATH_DEBUG, \
150 sdata, fmt, ##__VA_ARGS__)
151
152#define mhwmp_dbg(sdata, fmt, ...) \
153 _sdata_dbg(MAC80211_MHWMP_DEBUG, \
154 sdata, fmt, ##__VA_ARGS__)
155
156#define msync_dbg(sdata, fmt, ...) \
157 _sdata_dbg(MAC80211_MESH_SYNC_DEBUG, \
158 sdata, fmt, ##__VA_ARGS__)
159
3f52b7e3
MP
160#define mps_dbg(sdata, fmt, ...) \
161 _sdata_dbg(MAC80211_MESH_PS_DEBUG, \
162 sdata, fmt, ##__VA_ARGS__)
163
bdcbd8e0
JB
164#define tdls_dbg(sdata, fmt, ...) \
165 _sdata_dbg(MAC80211_TDLS_DEBUG, \
166 sdata, fmt, ##__VA_ARGS__)
167
168#define sta_dbg(sdata, fmt, ...) \
169 _sdata_dbg(MAC80211_STA_DEBUG, \
170 sdata, fmt, ##__VA_ARGS__)
171
172#define mlme_dbg(sdata, fmt, ...) \
173 _sdata_dbg(MAC80211_MLME_DEBUG, \
174 sdata, fmt, ##__VA_ARGS__)
175
176#define mlme_dbg_ratelimited(sdata, fmt, ...) \
177 _sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(), \
178 sdata, fmt, ##__VA_ARGS__)
179
180#endif /* __MAC80211_DEBUG_H */