net/mlx4_en: Fix setting initial MAC address
[linux-2.6/libata-dev.git] / net / mac80211 / debug.h
blob4ccc5ed6237dd00e5701c19908e55d413e83d506
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
7 #else
8 #define MAC80211_IBSS_DEBUG 0
9 #endif
11 #ifdef CONFIG_MAC80211_PS_DEBUG
12 #define MAC80211_PS_DEBUG 1
13 #else
14 #define MAC80211_PS_DEBUG 0
15 #endif
17 #ifdef CONFIG_MAC80211_HT_DEBUG
18 #define MAC80211_HT_DEBUG 1
19 #else
20 #define MAC80211_HT_DEBUG 0
21 #endif
23 #ifdef CONFIG_MAC80211_MPL_DEBUG
24 #define MAC80211_MPL_DEBUG 1
25 #else
26 #define MAC80211_MPL_DEBUG 0
27 #endif
29 #ifdef CONFIG_MAC80211_MPATH_DEBUG
30 #define MAC80211_MPATH_DEBUG 1
31 #else
32 #define MAC80211_MPATH_DEBUG 0
33 #endif
35 #ifdef CONFIG_MAC80211_MHWMP_DEBUG
36 #define MAC80211_MHWMP_DEBUG 1
37 #else
38 #define MAC80211_MHWMP_DEBUG 0
39 #endif
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
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
53 #ifdef CONFIG_MAC80211_TDLS_DEBUG
54 #define MAC80211_TDLS_DEBUG 1
55 #else
56 #define MAC80211_TDLS_DEBUG 0
57 #endif
59 #ifdef CONFIG_MAC80211_STA_DEBUG
60 #define MAC80211_STA_DEBUG 1
61 #else
62 #define MAC80211_STA_DEBUG 0
63 #endif
65 #ifdef CONFIG_MAC80211_MLME_DEBUG
66 #define MAC80211_MLME_DEBUG 1
67 #else
68 #define MAC80211_MLME_DEBUG 0
69 #endif
71 #ifdef CONFIG_MAC80211_MESSAGE_TRACING
72 void __sdata_info(const char *fmt, ...) __printf(1, 2);
73 void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
74 void __sdata_err(const char *fmt, ...) __printf(1, 2);
75 void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
76 __printf(3, 4);
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
87 #define _sdata_info(sdata, fmt, ...) \
88 do { \
89 pr_info("%s: " fmt, \
90 (sdata)->name, ##__VA_ARGS__); \
91 } while (0)
93 #define _sdata_dbg(print, sdata, fmt, ...) \
94 do { \
95 if (print) \
96 pr_debug("%s: " fmt, \
97 (sdata)->name, ##__VA_ARGS__); \
98 } while (0)
100 #define _sdata_err(sdata, fmt, ...) \
101 do { \
102 pr_err("%s: " fmt, \
103 (sdata)->name, ##__VA_ARGS__); \
104 } while (0)
106 #define _wiphy_dbg(print, wiphy, fmt, ...) \
107 do { \
108 if (print) \
109 wiphy_dbg((wiphy), fmt, ##__VA_ARGS__); \
110 } while (0)
111 #endif
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__)
120 #define ht_dbg(sdata, fmt, ...) \
121 _sdata_dbg(MAC80211_HT_DEBUG, \
122 sdata, fmt, ##__VA_ARGS__)
124 #define ht_dbg_ratelimited(sdata, fmt, ...) \
125 _sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(), \
126 sdata, fmt, ##__VA_ARGS__)
128 #define ibss_dbg(sdata, fmt, ...) \
129 _sdata_dbg(MAC80211_IBSS_DEBUG, \
130 sdata, fmt, ##__VA_ARGS__)
132 #define ps_dbg(sdata, fmt, ...) \
133 _sdata_dbg(MAC80211_PS_DEBUG, \
134 sdata, fmt, ##__VA_ARGS__)
136 #define ps_dbg_hw(hw, fmt, ...) \
137 _wiphy_dbg(MAC80211_PS_DEBUG, \
138 (hw)->wiphy, fmt, ##__VA_ARGS__)
140 #define ps_dbg_ratelimited(sdata, fmt, ...) \
141 _sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(), \
142 sdata, fmt, ##__VA_ARGS__)
144 #define mpl_dbg(sdata, fmt, ...) \
145 _sdata_dbg(MAC80211_MPL_DEBUG, \
146 sdata, fmt, ##__VA_ARGS__)
148 #define mpath_dbg(sdata, fmt, ...) \
149 _sdata_dbg(MAC80211_MPATH_DEBUG, \
150 sdata, fmt, ##__VA_ARGS__)
152 #define mhwmp_dbg(sdata, fmt, ...) \
153 _sdata_dbg(MAC80211_MHWMP_DEBUG, \
154 sdata, fmt, ##__VA_ARGS__)
156 #define msync_dbg(sdata, fmt, ...) \
157 _sdata_dbg(MAC80211_MESH_SYNC_DEBUG, \
158 sdata, fmt, ##__VA_ARGS__)
160 #define mps_dbg(sdata, fmt, ...) \
161 _sdata_dbg(MAC80211_MESH_PS_DEBUG, \
162 sdata, fmt, ##__VA_ARGS__)
164 #define tdls_dbg(sdata, fmt, ...) \
165 _sdata_dbg(MAC80211_TDLS_DEBUG, \
166 sdata, fmt, ##__VA_ARGS__)
168 #define sta_dbg(sdata, fmt, ...) \
169 _sdata_dbg(MAC80211_STA_DEBUG, \
170 sdata, fmt, ##__VA_ARGS__)
172 #define mlme_dbg(sdata, fmt, ...) \
173 _sdata_dbg(MAC80211_MLME_DEBUG, \
174 sdata, fmt, ##__VA_ARGS__)
176 #define mlme_dbg_ratelimited(sdata, fmt, ...) \
177 _sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(), \
178 sdata, fmt, ##__VA_ARGS__)
180 #endif /* __MAC80211_DEBUG_H */