Linux Audio

Check our new training course

Loading...
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * Portions
  4 * Copyright (C) 2022 - 2023 Intel Corporation
  5 */
  6#ifndef __MAC80211_DEBUG_H
  7#define __MAC80211_DEBUG_H
  8#include <net/cfg80211.h>
  9
 10#ifdef CONFIG_MAC80211_OCB_DEBUG
 11#define MAC80211_OCB_DEBUG 1
 12#else
 13#define MAC80211_OCB_DEBUG 0
 14#endif
 15
 16#ifdef CONFIG_MAC80211_IBSS_DEBUG
 17#define MAC80211_IBSS_DEBUG 1
 18#else
 19#define MAC80211_IBSS_DEBUG 0
 20#endif
 21
 22#ifdef CONFIG_MAC80211_PS_DEBUG
 23#define MAC80211_PS_DEBUG 1
 24#else
 25#define MAC80211_PS_DEBUG 0
 26#endif
 27
 28#ifdef CONFIG_MAC80211_HT_DEBUG
 29#define MAC80211_HT_DEBUG 1
 30#else
 31#define MAC80211_HT_DEBUG 0
 32#endif
 33
 34#ifdef CONFIG_MAC80211_MPL_DEBUG
 35#define MAC80211_MPL_DEBUG 1
 36#else
 37#define MAC80211_MPL_DEBUG 0
 38#endif
 39
 40#ifdef CONFIG_MAC80211_MPATH_DEBUG
 41#define MAC80211_MPATH_DEBUG 1
 42#else
 43#define MAC80211_MPATH_DEBUG 0
 44#endif
 45
 46#ifdef CONFIG_MAC80211_MHWMP_DEBUG
 47#define MAC80211_MHWMP_DEBUG 1
 48#else
 49#define MAC80211_MHWMP_DEBUG 0
 50#endif
 51
 52#ifdef CONFIG_MAC80211_MESH_SYNC_DEBUG
 53#define MAC80211_MESH_SYNC_DEBUG 1
 54#else
 55#define MAC80211_MESH_SYNC_DEBUG 0
 56#endif
 57
 58#ifdef CONFIG_MAC80211_MESH_CSA_DEBUG
 59#define MAC80211_MESH_CSA_DEBUG 1
 60#else
 61#define MAC80211_MESH_CSA_DEBUG 0
 62#endif
 63
 64#ifdef CONFIG_MAC80211_MESH_PS_DEBUG
 65#define MAC80211_MESH_PS_DEBUG 1
 66#else
 67#define MAC80211_MESH_PS_DEBUG 0
 68#endif
 69
 70#ifdef CONFIG_MAC80211_TDLS_DEBUG
 71#define MAC80211_TDLS_DEBUG 1
 72#else
 73#define MAC80211_TDLS_DEBUG 0
 74#endif
 75
 76#ifdef CONFIG_MAC80211_STA_DEBUG
 77#define MAC80211_STA_DEBUG 1
 78#else
 79#define MAC80211_STA_DEBUG 0
 80#endif
 81
 82#ifdef CONFIG_MAC80211_MLME_DEBUG
 83#define MAC80211_MLME_DEBUG 1
 84#else
 85#define MAC80211_MLME_DEBUG 0
 86#endif
 87
 88#ifdef CONFIG_MAC80211_MESSAGE_TRACING
 89void __sdata_info(const char *fmt, ...) __printf(1, 2);
 90void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
 91void __sdata_err(const char *fmt, ...) __printf(1, 2);
 92void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
 93	__printf(3, 4);
 94
 95#define _sdata_info(sdata, fmt, ...)					\
 96	__sdata_info("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
 97#define _sdata_dbg(print, sdata, fmt, ...)				\
 98	__sdata_dbg(print, "%s: " fmt, (sdata)->name, ##__VA_ARGS__)
 99#define _sdata_err(sdata, fmt, ...)					\
100	__sdata_err("%s: " fmt, (sdata)->name, ##__VA_ARGS__)
101#define _wiphy_dbg(print, wiphy, fmt, ...)				\
102	__wiphy_dbg(wiphy, print, fmt, ##__VA_ARGS__)
103#else
104#define _sdata_info(sdata, fmt, ...)					\
105do {									\
106	pr_info("%s: " fmt,						\
107		(sdata)->name, ##__VA_ARGS__);				\
108} while (0)
109
110#define _sdata_dbg(print, sdata, fmt, ...)				\
111do {									\
112	if (print)							\
113		pr_debug("%s: " fmt,					\
114			 (sdata)->name, ##__VA_ARGS__);			\
115} while (0)
116
117#define _sdata_err(sdata, fmt, ...)					\
118do {									\
119	pr_err("%s: " fmt,						\
120	       (sdata)->name, ##__VA_ARGS__);				\
121} while (0)
122
123#define _wiphy_dbg(print, wiphy, fmt, ...)				\
124do {									\
125	if (print)							\
126		wiphy_dbg((wiphy), fmt, ##__VA_ARGS__);			\
127} while (0)
128#endif
129
130#define sdata_info(sdata, fmt, ...)					\
131	_sdata_info(sdata, fmt, ##__VA_ARGS__)
132#define sdata_err(sdata, fmt, ...)					\
133	_sdata_err(sdata, fmt, ##__VA_ARGS__)
134#define sdata_dbg(sdata, fmt, ...)					\
135	_sdata_dbg(1, sdata, fmt, ##__VA_ARGS__)
136
137#define link_info(link, fmt, ...)					\
138	do {								\
139		if (ieee80211_vif_is_mld(&(link)->sdata->vif))          \
140			_sdata_info((link)->sdata, "[link %d] " fmt,	\
141				    (link)->link_id,			\
142				    ##__VA_ARGS__);			\
143		else							\
144			_sdata_info((link)->sdata, fmt, ##__VA_ARGS__);	\
145	} while (0)
146#define link_err(link, fmt, ...)					\
147	do {								\
148		if (ieee80211_vif_is_mld(&(link)->sdata->vif))          \
149			_sdata_err((link)->sdata, "[link %d] " fmt,	\
150				   (link)->link_id,			\
151				   ##__VA_ARGS__);			\
152		else							\
153			_sdata_err((link)->sdata, fmt, ##__VA_ARGS__);	\
154	} while (0)
155#define _link_id_dbg(print, sdata, link_id, fmt, ...)			\
156	do {								\
157		if (ieee80211_vif_is_mld(&(sdata)->vif))		\
158			_sdata_dbg(print, sdata, "[link %d] " fmt,	\
159				   link_id, ##__VA_ARGS__);		\
160		else							\
161			_sdata_dbg(print, sdata, fmt, ##__VA_ARGS__);	\
162	} while (0)
163#define link_dbg(link, fmt, ...)					\
164	_link_id_dbg(1, (link)->sdata, (link)->link_id,			\
165		     fmt, ##__VA_ARGS__)
166
167#define ht_dbg(sdata, fmt, ...)						\
168	_sdata_dbg(MAC80211_HT_DEBUG,					\
169		   sdata, fmt, ##__VA_ARGS__)
170
171#define ht_dbg_ratelimited(sdata, fmt, ...)				\
172	_sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(),		\
173		   sdata, fmt, ##__VA_ARGS__)
174
175#define ocb_dbg(sdata, fmt, ...)					\
176	_sdata_dbg(MAC80211_OCB_DEBUG,					\
177		   sdata, fmt, ##__VA_ARGS__)
178
179#define ibss_dbg(sdata, fmt, ...)					\
180	_sdata_dbg(MAC80211_IBSS_DEBUG,					\
181		   sdata, fmt, ##__VA_ARGS__)
182
183#define ps_dbg(sdata, fmt, ...)						\
184	_sdata_dbg(MAC80211_PS_DEBUG,					\
185		   sdata, fmt, ##__VA_ARGS__)
186
187#define ps_dbg_hw(hw, fmt, ...)						\
188	_wiphy_dbg(MAC80211_PS_DEBUG,					\
189		   (hw)->wiphy, fmt, ##__VA_ARGS__)
190
191#define ps_dbg_ratelimited(sdata, fmt, ...)				\
192	_sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(),		\
193		   sdata, fmt, ##__VA_ARGS__)
194
195#define mpl_dbg(sdata, fmt, ...)					\
196	_sdata_dbg(MAC80211_MPL_DEBUG,					\
197		   sdata, fmt, ##__VA_ARGS__)
198
199#define mpath_dbg(sdata, fmt, ...)					\
200	_sdata_dbg(MAC80211_MPATH_DEBUG,				\
201		   sdata, fmt, ##__VA_ARGS__)
202
203#define mhwmp_dbg(sdata, fmt, ...)					\
204	_sdata_dbg(MAC80211_MHWMP_DEBUG,				\
205		   sdata, fmt, ##__VA_ARGS__)
206
207#define msync_dbg(sdata, fmt, ...)					\
208	_sdata_dbg(MAC80211_MESH_SYNC_DEBUG,				\
209		   sdata, fmt, ##__VA_ARGS__)
210
211#define mcsa_dbg(sdata, fmt, ...)					\
212	_sdata_dbg(MAC80211_MESH_CSA_DEBUG,				\
213		   sdata, fmt, ##__VA_ARGS__)
214
215#define mps_dbg(sdata, fmt, ...)					\
216	_sdata_dbg(MAC80211_MESH_PS_DEBUG,				\
217		   sdata, fmt, ##__VA_ARGS__)
218
219#define tdls_dbg(sdata, fmt, ...)					\
220	_sdata_dbg(MAC80211_TDLS_DEBUG,					\
221		   sdata, fmt, ##__VA_ARGS__)
222
223#define sta_dbg(sdata, fmt, ...)					\
224	_sdata_dbg(MAC80211_STA_DEBUG,					\
225		   sdata, fmt, ##__VA_ARGS__)
226
227#define mlme_dbg(sdata, fmt, ...)					\
228	_sdata_dbg(MAC80211_MLME_DEBUG,					\
229		   sdata, fmt, ##__VA_ARGS__)
230#define mlme_link_id_dbg(sdata, link_id, fmt, ...)			\
231	_link_id_dbg(MAC80211_MLME_DEBUG, sdata, link_id,		\
232		     fmt, ##__VA_ARGS__)
233
234#define mlme_dbg_ratelimited(sdata, fmt, ...)				\
235	_sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(),		\
236		   sdata, fmt, ##__VA_ARGS__)
237
238#endif /* __MAC80211_DEBUG_H */
v3.15
 
 
 
 
 
  1#ifndef __MAC80211_DEBUG_H
  2#define __MAC80211_DEBUG_H
  3#include <net/cfg80211.h>
  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
 47#ifdef CONFIG_MAC80211_MESH_CSA_DEBUG
 48#define MAC80211_MESH_CSA_DEBUG 1
 49#else
 50#define MAC80211_MESH_CSA_DEBUG 0
 51#endif
 52
 53#ifdef CONFIG_MAC80211_MESH_PS_DEBUG
 54#define MAC80211_MESH_PS_DEBUG 1
 55#else
 56#define MAC80211_MESH_PS_DEBUG 0
 57#endif
 58
 59#ifdef CONFIG_MAC80211_TDLS_DEBUG
 60#define MAC80211_TDLS_DEBUG 1
 61#else
 62#define MAC80211_TDLS_DEBUG 0
 63#endif
 64
 65#ifdef CONFIG_MAC80211_STA_DEBUG
 66#define MAC80211_STA_DEBUG 1
 67#else
 68#define MAC80211_STA_DEBUG 0
 69#endif
 70
 71#ifdef CONFIG_MAC80211_MLME_DEBUG
 72#define MAC80211_MLME_DEBUG 1
 73#else
 74#define MAC80211_MLME_DEBUG 0
 75#endif
 76
 77#ifdef CONFIG_MAC80211_MESSAGE_TRACING
 78void __sdata_info(const char *fmt, ...) __printf(1, 2);
 79void __sdata_dbg(bool print, const char *fmt, ...) __printf(2, 3);
 80void __sdata_err(const char *fmt, ...) __printf(1, 2);
 81void __wiphy_dbg(struct wiphy *wiphy, bool print, const char *fmt, ...)
 82	__printf(3, 4);
 83
 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__)
 92#else
 93#define _sdata_info(sdata, fmt, ...)					\
 94do {									\
 95	pr_info("%s: " fmt,						\
 96		(sdata)->name, ##__VA_ARGS__);				\
 97} while (0)
 98
 99#define _sdata_dbg(print, sdata, fmt, ...)				\
100do {									\
101	if (print)							\
102		pr_debug("%s: " fmt,					\
103			 (sdata)->name, ##__VA_ARGS__);			\
104} while (0)
105
106#define _sdata_err(sdata, fmt, ...)					\
107do {									\
108	pr_err("%s: " fmt,						\
109	       (sdata)->name, ##__VA_ARGS__);				\
110} while (0)
111
112#define _wiphy_dbg(print, wiphy, fmt, ...)				\
113do {									\
114	if (print)							\
115		wiphy_dbg((wiphy), fmt, ##__VA_ARGS__);			\
116} while (0)
117#endif
118
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__)
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126#define ht_dbg(sdata, fmt, ...)						\
127	_sdata_dbg(MAC80211_HT_DEBUG,					\
128		   sdata, fmt, ##__VA_ARGS__)
129
130#define ht_dbg_ratelimited(sdata, fmt, ...)				\
131	_sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(),		\
132		   sdata, fmt, ##__VA_ARGS__)
133
 
 
 
 
134#define ibss_dbg(sdata, fmt, ...)					\
135	_sdata_dbg(MAC80211_IBSS_DEBUG,					\
136		   sdata, fmt, ##__VA_ARGS__)
137
138#define ps_dbg(sdata, fmt, ...)						\
139	_sdata_dbg(MAC80211_PS_DEBUG,					\
140		   sdata, fmt, ##__VA_ARGS__)
141
142#define ps_dbg_hw(hw, fmt, ...)						\
143	_wiphy_dbg(MAC80211_PS_DEBUG,					\
144		   (hw)->wiphy, fmt, ##__VA_ARGS__)
145
146#define ps_dbg_ratelimited(sdata, fmt, ...)				\
147	_sdata_dbg(MAC80211_PS_DEBUG && net_ratelimit(),		\
148		   sdata, fmt, ##__VA_ARGS__)
149
150#define mpl_dbg(sdata, fmt, ...)					\
151	_sdata_dbg(MAC80211_MPL_DEBUG,					\
152		   sdata, fmt, ##__VA_ARGS__)
153
154#define mpath_dbg(sdata, fmt, ...)					\
155	_sdata_dbg(MAC80211_MPATH_DEBUG,				\
156		   sdata, fmt, ##__VA_ARGS__)
157
158#define mhwmp_dbg(sdata, fmt, ...)					\
159	_sdata_dbg(MAC80211_MHWMP_DEBUG,				\
160		   sdata, fmt, ##__VA_ARGS__)
161
162#define msync_dbg(sdata, fmt, ...)					\
163	_sdata_dbg(MAC80211_MESH_SYNC_DEBUG,				\
164		   sdata, fmt, ##__VA_ARGS__)
165
166#define mcsa_dbg(sdata, fmt, ...)					\
167	_sdata_dbg(MAC80211_MESH_CSA_DEBUG,				\
168		   sdata, fmt, ##__VA_ARGS__)
169
170#define mps_dbg(sdata, fmt, ...)					\
171	_sdata_dbg(MAC80211_MESH_PS_DEBUG,				\
172		   sdata, fmt, ##__VA_ARGS__)
173
174#define tdls_dbg(sdata, fmt, ...)					\
175	_sdata_dbg(MAC80211_TDLS_DEBUG,					\
176		   sdata, fmt, ##__VA_ARGS__)
177
178#define sta_dbg(sdata, fmt, ...)					\
179	_sdata_dbg(MAC80211_STA_DEBUG,					\
180		   sdata, fmt, ##__VA_ARGS__)
181
182#define mlme_dbg(sdata, fmt, ...)					\
183	_sdata_dbg(MAC80211_MLME_DEBUG,					\
184		   sdata, fmt, ##__VA_ARGS__)
 
 
 
185
186#define mlme_dbg_ratelimited(sdata, fmt, ...)				\
187	_sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(),		\
188		   sdata, fmt, ##__VA_ARGS__)
189
190#endif /* __MAC80211_DEBUG_H */