xref: /openbmc/linux/net/wireless/trace.h (revision 609e478b)
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM cfg80211
3 
4 #if !defined(__RDEV_OPS_TRACE) || defined(TRACE_HEADER_MULTI_READ)
5 #define __RDEV_OPS_TRACE
6 
7 #include <linux/tracepoint.h>
8 
9 #include <linux/rtnetlink.h>
10 #include <net/cfg80211.h>
11 #include "core.h"
12 
13 #define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)
14 #define MAC_ASSIGN(entry_mac, given_mac) do {			     \
15 	if (given_mac)						     \
16 		memcpy(__entry->entry_mac, given_mac, ETH_ALEN);     \
17 	else							     \
18 		memset(__entry->entry_mac, 0, ETH_ALEN);	     \
19 	} while (0)
20 #define MAC_PR_FMT "%pM"
21 #define MAC_PR_ARG(entry_mac) (__entry->entry_mac)
22 
23 #define MAXNAME		32
24 #define WIPHY_ENTRY	__array(char, wiphy_name, 32)
25 #define WIPHY_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(wiphy), MAXNAME)
26 #define WIPHY_PR_FMT	"%s"
27 #define WIPHY_PR_ARG	__entry->wiphy_name
28 
29 #define WDEV_ENTRY	__field(u32, id)
30 #define WDEV_ASSIGN	(__entry->id) = (!IS_ERR_OR_NULL(wdev)	\
31 					 ? wdev->identifier : 0)
32 #define WDEV_PR_FMT	"wdev(%u)"
33 #define WDEV_PR_ARG	(__entry->id)
34 
35 #define NETDEV_ENTRY	__array(char, name, IFNAMSIZ) \
36 			__field(int, ifindex)
37 #define NETDEV_ASSIGN					       \
38 	do {						       \
39 		memcpy(__entry->name, netdev->name, IFNAMSIZ); \
40 		(__entry->ifindex) = (netdev->ifindex);	       \
41 	} while (0)
42 #define NETDEV_PR_FMT	"netdev:%s(%d)"
43 #define NETDEV_PR_ARG	__entry->name, __entry->ifindex
44 
45 #define MESH_CFG_ENTRY __field(u16, dot11MeshRetryTimeout)		   \
46 		       __field(u16, dot11MeshConfirmTimeout)		   \
47 		       __field(u16, dot11MeshHoldingTimeout)		   \
48 		       __field(u16, dot11MeshMaxPeerLinks)		   \
49 		       __field(u8, dot11MeshMaxRetries)			   \
50 		       __field(u8, dot11MeshTTL)			   \
51 		       __field(u8, element_ttl)				   \
52 		       __field(bool, auto_open_plinks)			   \
53 		       __field(u32, dot11MeshNbrOffsetMaxNeighbor)	   \
54 		       __field(u8, dot11MeshHWMPmaxPREQretries)		   \
55 		       __field(u32, path_refresh_time)			   \
56 		       __field(u32, dot11MeshHWMPactivePathTimeout)	   \
57 		       __field(u16, min_discovery_timeout)		   \
58 		       __field(u16, dot11MeshHWMPpreqMinInterval)	   \
59 		       __field(u16, dot11MeshHWMPperrMinInterval)	   \
60 		       __field(u16, dot11MeshHWMPnetDiameterTraversalTime) \
61 		       __field(u8, dot11MeshHWMPRootMode)		   \
62 		       __field(u16, dot11MeshHWMPRannInterval)		   \
63 		       __field(bool, dot11MeshGateAnnouncementProtocol)	   \
64 		       __field(bool, dot11MeshForwarding)		   \
65 		       __field(s32, rssi_threshold)			   \
66 		       __field(u16, ht_opmode)				   \
67 		       __field(u32, dot11MeshHWMPactivePathToRootTimeout)  \
68 		       __field(u16, dot11MeshHWMProotInterval)		   \
69 		       __field(u16, dot11MeshHWMPconfirmationInterval)
70 #define MESH_CFG_ASSIGN							      \
71 	do {								      \
72 		__entry->dot11MeshRetryTimeout = conf->dot11MeshRetryTimeout; \
73 		__entry->dot11MeshConfirmTimeout =			      \
74 				conf->dot11MeshConfirmTimeout;		      \
75 		__entry->dot11MeshHoldingTimeout =			      \
76 				conf->dot11MeshHoldingTimeout;		      \
77 		__entry->dot11MeshMaxPeerLinks = conf->dot11MeshMaxPeerLinks; \
78 		__entry->dot11MeshMaxRetries = conf->dot11MeshMaxRetries;     \
79 		__entry->dot11MeshTTL = conf->dot11MeshTTL;		      \
80 		__entry->element_ttl = conf->element_ttl;		      \
81 		__entry->auto_open_plinks = conf->auto_open_plinks;	      \
82 		__entry->dot11MeshNbrOffsetMaxNeighbor =		      \
83 				conf->dot11MeshNbrOffsetMaxNeighbor;	      \
84 		__entry->dot11MeshHWMPmaxPREQretries =			      \
85 				conf->dot11MeshHWMPmaxPREQretries;	      \
86 		__entry->path_refresh_time = conf->path_refresh_time;	      \
87 		__entry->dot11MeshHWMPactivePathTimeout =		      \
88 				conf->dot11MeshHWMPactivePathTimeout;	      \
89 		__entry->min_discovery_timeout = conf->min_discovery_timeout; \
90 		__entry->dot11MeshHWMPpreqMinInterval =			      \
91 				conf->dot11MeshHWMPpreqMinInterval;	      \
92 		__entry->dot11MeshHWMPperrMinInterval =			      \
93 				conf->dot11MeshHWMPperrMinInterval;	      \
94 		__entry->dot11MeshHWMPnetDiameterTraversalTime =	      \
95 				conf->dot11MeshHWMPnetDiameterTraversalTime;  \
96 		__entry->dot11MeshHWMPRootMode = conf->dot11MeshHWMPRootMode; \
97 		__entry->dot11MeshHWMPRannInterval =			      \
98 				conf->dot11MeshHWMPRannInterval;	      \
99 		__entry->dot11MeshGateAnnouncementProtocol =		      \
100 				conf->dot11MeshGateAnnouncementProtocol;      \
101 		__entry->dot11MeshForwarding = conf->dot11MeshForwarding;     \
102 		__entry->rssi_threshold = conf->rssi_threshold;		      \
103 		__entry->ht_opmode = conf->ht_opmode;			      \
104 		__entry->dot11MeshHWMPactivePathToRootTimeout =		      \
105 				conf->dot11MeshHWMPactivePathToRootTimeout;   \
106 		__entry->dot11MeshHWMProotInterval =			      \
107 				conf->dot11MeshHWMProotInterval;	      \
108 		__entry->dot11MeshHWMPconfirmationInterval =		      \
109 				conf->dot11MeshHWMPconfirmationInterval;      \
110 	} while (0)
111 
112 #define CHAN_ENTRY __field(enum ieee80211_band, band) \
113 		   __field(u16, center_freq)
114 #define CHAN_ASSIGN(chan)					  \
115 	do {							  \
116 		if (chan) {					  \
117 			__entry->band = chan->band;		  \
118 			__entry->center_freq = chan->center_freq; \
119 		} else {					  \
120 			__entry->band = 0;			  \
121 			__entry->center_freq = 0;		  \
122 		}						  \
123 	} while (0)
124 #define CHAN_PR_FMT "band: %d, freq: %u"
125 #define CHAN_PR_ARG __entry->band, __entry->center_freq
126 
127 #define CHAN_DEF_ENTRY __field(enum ieee80211_band, band)		\
128 		       __field(u32, control_freq)			\
129 		       __field(u32, width)				\
130 		       __field(u32, center_freq1)			\
131 		       __field(u32, center_freq2)
132 #define CHAN_DEF_ASSIGN(chandef)					\
133 	do {								\
134 		if ((chandef) && (chandef)->chan) {			\
135 			__entry->band = (chandef)->chan->band;		\
136 			__entry->control_freq =				\
137 				(chandef)->chan->center_freq;		\
138 			__entry->width = (chandef)->width;		\
139 			__entry->center_freq1 = (chandef)->center_freq1;\
140 			__entry->center_freq2 = (chandef)->center_freq2;\
141 		} else {						\
142 			__entry->band = 0;				\
143 			__entry->control_freq = 0;			\
144 			__entry->width = 0;				\
145 			__entry->center_freq1 = 0;			\
146 			__entry->center_freq2 = 0;			\
147 		}							\
148 	} while (0)
149 #define CHAN_DEF_PR_FMT							\
150 	"band: %d, control freq: %u, width: %d, cf1: %u, cf2: %u"
151 #define CHAN_DEF_PR_ARG __entry->band, __entry->control_freq,		\
152 			__entry->width, __entry->center_freq1,		\
153 			__entry->center_freq2
154 
155 #define SINFO_ENTRY __field(int, generation)	    \
156 		    __field(u32, connected_time)    \
157 		    __field(u32, inactive_time)	    \
158 		    __field(u32, rx_bytes)	    \
159 		    __field(u32, tx_bytes)	    \
160 		    __field(u32, rx_packets)	    \
161 		    __field(u32, tx_packets)	    \
162 		    __field(u32, tx_retries)	    \
163 		    __field(u32, tx_failed)	    \
164 		    __field(u32, rx_dropped_misc)   \
165 		    __field(u32, beacon_loss_count) \
166 		    __field(u16, llid)		    \
167 		    __field(u16, plid)		    \
168 		    __field(u8, plink_state)
169 #define SINFO_ASSIGN						       \
170 	do {							       \
171 		__entry->generation = sinfo->generation;	       \
172 		__entry->connected_time = sinfo->connected_time;       \
173 		__entry->inactive_time = sinfo->inactive_time;	       \
174 		__entry->rx_bytes = sinfo->rx_bytes;		       \
175 		__entry->tx_bytes = sinfo->tx_bytes;		       \
176 		__entry->rx_packets = sinfo->rx_packets;	       \
177 		__entry->tx_packets = sinfo->tx_packets;	       \
178 		__entry->tx_retries = sinfo->tx_retries;	       \
179 		__entry->tx_failed = sinfo->tx_failed;		       \
180 		__entry->rx_dropped_misc = sinfo->rx_dropped_misc;     \
181 		__entry->beacon_loss_count = sinfo->beacon_loss_count; \
182 		__entry->llid = sinfo->llid;			       \
183 		__entry->plid = sinfo->plid;			       \
184 		__entry->plink_state = sinfo->plink_state;	       \
185 	} while (0)
186 
187 #define BOOL_TO_STR(bo) (bo) ? "true" : "false"
188 
189 #define QOS_MAP_ENTRY __field(u8, num_des)			\
190 		      __array(u8, dscp_exception,		\
191 			      2 * IEEE80211_QOS_MAP_MAX_EX)	\
192 		      __array(u8, up, IEEE80211_QOS_MAP_LEN_MIN)
193 #define QOS_MAP_ASSIGN(qos_map)					\
194 	do {							\
195 		if ((qos_map)) {				\
196 			__entry->num_des = (qos_map)->num_des;	\
197 			memcpy(__entry->dscp_exception,		\
198 			       &(qos_map)->dscp_exception,	\
199 			       2 * IEEE80211_QOS_MAP_MAX_EX);	\
200 			memcpy(__entry->up, &(qos_map)->up,	\
201 			       IEEE80211_QOS_MAP_LEN_MIN);	\
202 		} else {					\
203 			__entry->num_des = 0;			\
204 			memset(__entry->dscp_exception, 0,	\
205 			       2 * IEEE80211_QOS_MAP_MAX_EX);	\
206 			memset(__entry->up, 0,			\
207 			       IEEE80211_QOS_MAP_LEN_MIN);	\
208 		}						\
209 	} while (0)
210 
211 /*************************************************************
212  *			rdev->ops traces		     *
213  *************************************************************/
214 
215 TRACE_EVENT(rdev_suspend,
216 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_wowlan *wow),
217 	TP_ARGS(wiphy, wow),
218 	TP_STRUCT__entry(
219 		WIPHY_ENTRY
220 		__field(bool, any)
221 		__field(bool, disconnect)
222 		__field(bool, magic_pkt)
223 		__field(bool, gtk_rekey_failure)
224 		__field(bool, eap_identity_req)
225 		__field(bool, four_way_handshake)
226 		__field(bool, rfkill_release)
227 		__field(bool, valid_wow)
228 	),
229 	TP_fast_assign(
230 		WIPHY_ASSIGN;
231 		if (wow) {
232 			__entry->any = wow->any;
233 			__entry->disconnect = wow->disconnect;
234 			__entry->magic_pkt = wow->magic_pkt;
235 			__entry->gtk_rekey_failure = wow->gtk_rekey_failure;
236 			__entry->eap_identity_req = wow->eap_identity_req;
237 			__entry->four_way_handshake = wow->four_way_handshake;
238 			__entry->rfkill_release = wow->rfkill_release;
239 			__entry->valid_wow = true;
240 		} else {
241 			__entry->valid_wow = false;
242 		}
243 	),
244 	TP_printk(WIPHY_PR_FMT ", wow%s - any: %d, disconnect: %d, "
245 		  "magic pkt: %d, gtk rekey failure: %d, eap identify req: %d, "
246 		  "four way handshake: %d, rfkill release: %d.",
247 		  WIPHY_PR_ARG, __entry->valid_wow ? "" : "(Not configured!)",
248 		  __entry->any, __entry->disconnect, __entry->magic_pkt,
249 		  __entry->gtk_rekey_failure, __entry->eap_identity_req,
250 		  __entry->four_way_handshake, __entry->rfkill_release)
251 );
252 
253 TRACE_EVENT(rdev_return_int,
254 	TP_PROTO(struct wiphy *wiphy, int ret),
255 	TP_ARGS(wiphy, ret),
256 	TP_STRUCT__entry(
257 		WIPHY_ENTRY
258 		__field(int, ret)
259 	),
260 	TP_fast_assign(
261 		WIPHY_ASSIGN;
262 		__entry->ret = ret;
263 	),
264 	TP_printk(WIPHY_PR_FMT ", returned: %d", WIPHY_PR_ARG, __entry->ret)
265 );
266 
267 TRACE_EVENT(rdev_scan,
268 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_scan_request *request),
269 	TP_ARGS(wiphy, request),
270 	TP_STRUCT__entry(
271 		WIPHY_ENTRY
272 	),
273 	TP_fast_assign(
274 		WIPHY_ASSIGN;
275 	),
276 	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
277 );
278 
279 DECLARE_EVENT_CLASS(wiphy_only_evt,
280 	TP_PROTO(struct wiphy *wiphy),
281 	TP_ARGS(wiphy),
282 	TP_STRUCT__entry(
283 		WIPHY_ENTRY
284 	),
285 	TP_fast_assign(
286 		WIPHY_ASSIGN;
287 	),
288 	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
289 );
290 
291 DEFINE_EVENT(wiphy_only_evt, rdev_resume,
292 	TP_PROTO(struct wiphy *wiphy),
293 	TP_ARGS(wiphy)
294 );
295 
296 DEFINE_EVENT(wiphy_only_evt, rdev_return_void,
297 	TP_PROTO(struct wiphy *wiphy),
298 	TP_ARGS(wiphy)
299 );
300 
301 DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
302 	TP_PROTO(struct wiphy *wiphy),
303 	TP_ARGS(wiphy)
304 );
305 
306 DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,
307 	TP_PROTO(struct wiphy *wiphy),
308 	TP_ARGS(wiphy)
309 );
310 
311 DECLARE_EVENT_CLASS(wiphy_enabled_evt,
312 	TP_PROTO(struct wiphy *wiphy, bool enabled),
313 	TP_ARGS(wiphy, enabled),
314 	TP_STRUCT__entry(
315 		WIPHY_ENTRY
316 		__field(bool, enabled)
317 	),
318 	TP_fast_assign(
319 		WIPHY_ASSIGN;
320 		__entry->enabled = enabled;
321 	),
322 	TP_printk(WIPHY_PR_FMT ", %senabled ",
323 		  WIPHY_PR_ARG, __entry->enabled ? "" : "not ")
324 );
325 
326 DEFINE_EVENT(wiphy_enabled_evt, rdev_set_wakeup,
327 	TP_PROTO(struct wiphy *wiphy, bool enabled),
328 	TP_ARGS(wiphy, enabled)
329 );
330 
331 TRACE_EVENT(rdev_add_virtual_intf,
332 	TP_PROTO(struct wiphy *wiphy, char *name, enum nl80211_iftype type),
333 	TP_ARGS(wiphy, name, type),
334 	TP_STRUCT__entry(
335 		WIPHY_ENTRY
336 		__string(vir_intf_name, name ? name : "<noname>")
337 		__field(enum nl80211_iftype, type)
338 	),
339 	TP_fast_assign(
340 		WIPHY_ASSIGN;
341 		__assign_str(vir_intf_name, name ? name : "<noname>");
342 		__entry->type = type;
343 	),
344 	TP_printk(WIPHY_PR_FMT ", virtual intf name: %s, type: %d",
345 		  WIPHY_PR_ARG, __get_str(vir_intf_name), __entry->type)
346 );
347 
348 DECLARE_EVENT_CLASS(wiphy_wdev_evt,
349 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
350 	TP_ARGS(wiphy, wdev),
351 	TP_STRUCT__entry(
352 		WIPHY_ENTRY
353 		WDEV_ENTRY
354 	),
355 	TP_fast_assign(
356 		WIPHY_ASSIGN;
357 		WDEV_ASSIGN;
358 	),
359 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
360 );
361 
362 DEFINE_EVENT(wiphy_wdev_evt, rdev_return_wdev,
363 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
364 	TP_ARGS(wiphy, wdev)
365 );
366 
367 DEFINE_EVENT(wiphy_wdev_evt, rdev_del_virtual_intf,
368 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
369 	TP_ARGS(wiphy, wdev)
370 );
371 
372 TRACE_EVENT(rdev_change_virtual_intf,
373 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
374 		 enum nl80211_iftype type),
375 	TP_ARGS(wiphy, netdev, type),
376 	TP_STRUCT__entry(
377 		WIPHY_ENTRY
378 		NETDEV_ENTRY
379 		__field(enum nl80211_iftype, type)
380 	),
381 	TP_fast_assign(
382 		WIPHY_ASSIGN;
383 		NETDEV_ASSIGN;
384 		__entry->type = type;
385 	),
386 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", type: %d",
387 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->type)
388 );
389 
390 DECLARE_EVENT_CLASS(key_handle,
391 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
392 		 bool pairwise, const u8 *mac_addr),
393 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr),
394 	TP_STRUCT__entry(
395 		WIPHY_ENTRY
396 		NETDEV_ENTRY
397 		MAC_ENTRY(mac_addr)
398 		__field(u8, key_index)
399 		__field(bool, pairwise)
400 	),
401 	TP_fast_assign(
402 		WIPHY_ASSIGN;
403 		NETDEV_ASSIGN;
404 		MAC_ASSIGN(mac_addr, mac_addr);
405 		__entry->key_index = key_index;
406 		__entry->pairwise = pairwise;
407 	),
408 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key_index: %u, pairwise: %s, mac addr: " MAC_PR_FMT,
409 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
410 		  BOOL_TO_STR(__entry->pairwise), MAC_PR_ARG(mac_addr))
411 );
412 
413 DEFINE_EVENT(key_handle, rdev_add_key,
414 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
415 		 bool pairwise, const u8 *mac_addr),
416 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
417 );
418 
419 DEFINE_EVENT(key_handle, rdev_get_key,
420 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
421 		 bool pairwise, const u8 *mac_addr),
422 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
423 );
424 
425 DEFINE_EVENT(key_handle, rdev_del_key,
426 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
427 		 bool pairwise, const u8 *mac_addr),
428 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
429 );
430 
431 TRACE_EVENT(rdev_set_default_key,
432 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
433 		 bool unicast, bool multicast),
434 	TP_ARGS(wiphy, netdev, key_index, unicast, multicast),
435 	TP_STRUCT__entry(
436 		WIPHY_ENTRY
437 		NETDEV_ENTRY
438 		__field(u8, key_index)
439 		__field(bool, unicast)
440 		__field(bool, multicast)
441 	),
442 	TP_fast_assign(
443 		WIPHY_ASSIGN;
444 		NETDEV_ASSIGN;
445 		__entry->key_index = key_index;
446 		__entry->unicast = unicast;
447 		__entry->multicast = multicast;
448 	),
449 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u, unicast: %s, multicast: %s",
450 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
451 		  BOOL_TO_STR(__entry->unicast),
452 		  BOOL_TO_STR(__entry->multicast))
453 );
454 
455 TRACE_EVENT(rdev_set_default_mgmt_key,
456 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index),
457 	TP_ARGS(wiphy, netdev, key_index),
458 	TP_STRUCT__entry(
459 		WIPHY_ENTRY
460 		NETDEV_ENTRY
461 		__field(u8, key_index)
462 	),
463 	TP_fast_assign(
464 		WIPHY_ASSIGN;
465 		NETDEV_ASSIGN;
466 		__entry->key_index = key_index;
467 	),
468 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u",
469 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index)
470 );
471 
472 TRACE_EVENT(rdev_start_ap,
473 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
474 		 struct cfg80211_ap_settings *settings),
475 	TP_ARGS(wiphy, netdev, settings),
476 	TP_STRUCT__entry(
477 		WIPHY_ENTRY
478 		NETDEV_ENTRY
479 		CHAN_DEF_ENTRY
480 		__field(int, beacon_interval)
481 		__field(int, dtim_period)
482 		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
483 		__field(enum nl80211_hidden_ssid, hidden_ssid)
484 		__field(u32, wpa_ver)
485 		__field(bool, privacy)
486 		__field(enum nl80211_auth_type, auth_type)
487 		__field(int, inactivity_timeout)
488 	),
489 	TP_fast_assign(
490 		WIPHY_ASSIGN;
491 		NETDEV_ASSIGN;
492 		CHAN_DEF_ASSIGN(&settings->chandef);
493 		__entry->beacon_interval = settings->beacon_interval;
494 		__entry->dtim_period = settings->dtim_period;
495 		__entry->hidden_ssid = settings->hidden_ssid;
496 		__entry->wpa_ver = settings->crypto.wpa_versions;
497 		__entry->privacy = settings->privacy;
498 		__entry->auth_type = settings->auth_type;
499 		__entry->inactivity_timeout = settings->inactivity_timeout;
500 		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
501 		memcpy(__entry->ssid, settings->ssid, settings->ssid_len);
502 	),
503 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", AP settings - ssid: %s, "
504 		  CHAN_DEF_PR_FMT ", beacon interval: %d, dtim period: %d, "
505 		  "hidden ssid: %d, wpa versions: %u, privacy: %s, "
506 		  "auth type: %d, inactivity timeout: %d",
507 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_DEF_PR_ARG,
508 		  __entry->beacon_interval, __entry->dtim_period,
509 		  __entry->hidden_ssid, __entry->wpa_ver,
510 		  BOOL_TO_STR(__entry->privacy), __entry->auth_type,
511 		  __entry->inactivity_timeout)
512 );
513 
514 TRACE_EVENT(rdev_change_beacon,
515 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
516 		 struct cfg80211_beacon_data *info),
517 	TP_ARGS(wiphy, netdev, info),
518 	TP_STRUCT__entry(
519 		WIPHY_ENTRY
520 		NETDEV_ENTRY
521 		__dynamic_array(u8, head, info ? info->head_len : 0)
522 		__dynamic_array(u8, tail, info ? info->tail_len : 0)
523 		__dynamic_array(u8, beacon_ies, info ? info->beacon_ies_len : 0)
524 		__dynamic_array(u8, proberesp_ies,
525 				info ? info->proberesp_ies_len : 0)
526 		__dynamic_array(u8, assocresp_ies,
527 				info ? info->assocresp_ies_len : 0)
528 		__dynamic_array(u8, probe_resp, info ? info->probe_resp_len : 0)
529 	),
530 	TP_fast_assign(
531 		WIPHY_ASSIGN;
532 		NETDEV_ASSIGN;
533 		if (info) {
534 			if (info->head)
535 				memcpy(__get_dynamic_array(head), info->head,
536 				       info->head_len);
537 			if (info->tail)
538 				memcpy(__get_dynamic_array(tail), info->tail,
539 				       info->tail_len);
540 			if (info->beacon_ies)
541 				memcpy(__get_dynamic_array(beacon_ies),
542 				       info->beacon_ies, info->beacon_ies_len);
543 			if (info->proberesp_ies)
544 				memcpy(__get_dynamic_array(proberesp_ies),
545 				       info->proberesp_ies,
546 				       info->proberesp_ies_len);
547 			if (info->assocresp_ies)
548 				memcpy(__get_dynamic_array(assocresp_ies),
549 				       info->assocresp_ies,
550 				       info->assocresp_ies_len);
551 			if (info->probe_resp)
552 				memcpy(__get_dynamic_array(probe_resp),
553 				       info->probe_resp, info->probe_resp_len);
554 		}
555 	),
556 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG)
557 );
558 
559 DECLARE_EVENT_CLASS(wiphy_netdev_evt,
560 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
561 	TP_ARGS(wiphy, netdev),
562 	TP_STRUCT__entry(
563 		WIPHY_ENTRY
564 		NETDEV_ENTRY
565 	),
566 	TP_fast_assign(
567 		WIPHY_ASSIGN;
568 		NETDEV_ASSIGN;
569 	),
570 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG)
571 );
572 
573 DEFINE_EVENT(wiphy_netdev_evt, rdev_stop_ap,
574 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
575 	TP_ARGS(wiphy, netdev)
576 );
577 
578 DEFINE_EVENT(wiphy_netdev_evt, rdev_sched_scan_stop,
579 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
580 	TP_ARGS(wiphy, netdev)
581 );
582 
583 DEFINE_EVENT(wiphy_netdev_evt, rdev_set_rekey_data,
584 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
585 	TP_ARGS(wiphy, netdev)
586 );
587 
588 DEFINE_EVENT(wiphy_netdev_evt, rdev_get_mesh_config,
589 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
590 	TP_ARGS(wiphy, netdev)
591 );
592 
593 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_mesh,
594 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
595 	TP_ARGS(wiphy, netdev)
596 );
597 
598 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ibss,
599 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
600 	TP_ARGS(wiphy, netdev)
601 );
602 
603 DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa,
604 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
605 	TP_ARGS(wiphy, netdev)
606 );
607 
608 DECLARE_EVENT_CLASS(station_add_change,
609 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
610 		 struct station_parameters *params),
611 	TP_ARGS(wiphy, netdev, mac, params),
612 	TP_STRUCT__entry(
613 		WIPHY_ENTRY
614 		NETDEV_ENTRY
615 		MAC_ENTRY(sta_mac)
616 		__field(u32, sta_flags_mask)
617 		__field(u32, sta_flags_set)
618 		__field(u32, sta_modify_mask)
619 		__field(int, listen_interval)
620 		__field(u16, aid)
621 		__field(u8, plink_action)
622 		__field(u8, plink_state)
623 		__field(u8, uapsd_queues)
624 		__array(u8, ht_capa, (int)sizeof(struct ieee80211_ht_cap))
625 	),
626 	TP_fast_assign(
627 		WIPHY_ASSIGN;
628 		NETDEV_ASSIGN;
629 		MAC_ASSIGN(sta_mac, mac);
630 		__entry->sta_flags_mask = params->sta_flags_mask;
631 		__entry->sta_flags_set = params->sta_flags_set;
632 		__entry->sta_modify_mask = params->sta_modify_mask;
633 		__entry->listen_interval = params->listen_interval;
634 		__entry->aid = params->aid;
635 		__entry->plink_action = params->plink_action;
636 		__entry->plink_state = params->plink_state;
637 		__entry->uapsd_queues = params->uapsd_queues;
638 		memset(__entry->ht_capa, 0, sizeof(struct ieee80211_ht_cap));
639 		if (params->ht_capa)
640 			memcpy(__entry->ht_capa, params->ht_capa,
641 			       sizeof(struct ieee80211_ht_cap));
642 	),
643 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
644 		  ", station flags mask: %u, station flags set: %u, "
645 		  "station modify mask: %u, listen interval: %d, aid: %u, "
646 		  "plink action: %u, plink state: %u, uapsd queues: %u",
647 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
648 		  __entry->sta_flags_mask, __entry->sta_flags_set,
649 		  __entry->sta_modify_mask, __entry->listen_interval,
650 		  __entry->aid, __entry->plink_action, __entry->plink_state,
651 		  __entry->uapsd_queues)
652 );
653 
654 DEFINE_EVENT(station_add_change, rdev_add_station,
655 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
656 		 struct station_parameters *params),
657 	TP_ARGS(wiphy, netdev, mac, params)
658 );
659 
660 DEFINE_EVENT(station_add_change, rdev_change_station,
661 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
662 		 struct station_parameters *params),
663 	TP_ARGS(wiphy, netdev, mac, params)
664 );
665 
666 DECLARE_EVENT_CLASS(wiphy_netdev_mac_evt,
667 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
668 	TP_ARGS(wiphy, netdev, mac),
669 	TP_STRUCT__entry(
670 		WIPHY_ENTRY
671 		NETDEV_ENTRY
672 		MAC_ENTRY(sta_mac)
673 	),
674 	TP_fast_assign(
675 		WIPHY_ASSIGN;
676 		NETDEV_ASSIGN;
677 		MAC_ASSIGN(sta_mac, mac);
678 	),
679 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
680 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac))
681 );
682 
683 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_station,
684 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
685 	TP_ARGS(wiphy, netdev, mac)
686 );
687 
688 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station,
689 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
690 	TP_ARGS(wiphy, netdev, mac)
691 );
692 
693 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_mpath,
694 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
695 	TP_ARGS(wiphy, netdev, mac)
696 );
697 
698 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_set_wds_peer,
699 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
700 	TP_ARGS(wiphy, netdev, mac)
701 );
702 
703 TRACE_EVENT(rdev_dump_station,
704 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int idx,
705 		 u8 *mac),
706 	TP_ARGS(wiphy, netdev, idx, mac),
707 	TP_STRUCT__entry(
708 		WIPHY_ENTRY
709 		NETDEV_ENTRY
710 		MAC_ENTRY(sta_mac)
711 		__field(int, idx)
712 	),
713 	TP_fast_assign(
714 		WIPHY_ASSIGN;
715 		NETDEV_ASSIGN;
716 		MAC_ASSIGN(sta_mac, mac);
717 		__entry->idx = idx;
718 	),
719 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT ", idx: %d",
720 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
721 		  __entry->idx)
722 );
723 
724 TRACE_EVENT(rdev_return_int_station_info,
725 	TP_PROTO(struct wiphy *wiphy, int ret, struct station_info *sinfo),
726 	TP_ARGS(wiphy, ret, sinfo),
727 	TP_STRUCT__entry(
728 		WIPHY_ENTRY
729 		__field(int, ret)
730 		SINFO_ENTRY
731 	),
732 	TP_fast_assign(
733 		WIPHY_ASSIGN;
734 		__entry->ret = ret;
735 		SINFO_ASSIGN;
736 	),
737 	TP_printk(WIPHY_PR_FMT ", returned %d" ,
738 		  WIPHY_PR_ARG, __entry->ret)
739 );
740 
741 DECLARE_EVENT_CLASS(mpath_evt,
742 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
743 		 u8 *next_hop),
744 	TP_ARGS(wiphy, netdev, dst, next_hop),
745 	TP_STRUCT__entry(
746 		WIPHY_ENTRY
747 		NETDEV_ENTRY
748 		MAC_ENTRY(dst)
749 		MAC_ENTRY(next_hop)
750 	),
751 	TP_fast_assign(
752 		WIPHY_ASSIGN;
753 		NETDEV_ASSIGN;
754 		MAC_ASSIGN(dst, dst);
755 		MAC_ASSIGN(next_hop, next_hop);
756 	),
757 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: " MAC_PR_FMT ", next hop: " MAC_PR_FMT,
758 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dst),
759 		  MAC_PR_ARG(next_hop))
760 );
761 
762 DEFINE_EVENT(mpath_evt, rdev_add_mpath,
763 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
764 		 u8 *next_hop),
765 	TP_ARGS(wiphy, netdev, dst, next_hop)
766 );
767 
768 DEFINE_EVENT(mpath_evt, rdev_change_mpath,
769 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
770 		 u8 *next_hop),
771 	TP_ARGS(wiphy, netdev, dst, next_hop)
772 );
773 
774 DEFINE_EVENT(mpath_evt, rdev_get_mpath,
775 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
776 		 u8 *next_hop),
777 	TP_ARGS(wiphy, netdev, dst, next_hop)
778 );
779 
780 TRACE_EVENT(rdev_dump_mpath,
781 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int idx,
782 		 u8 *dst, u8 *next_hop),
783 	TP_ARGS(wiphy, netdev, idx, dst, next_hop),
784 	TP_STRUCT__entry(
785 		WIPHY_ENTRY
786 		NETDEV_ENTRY
787 		MAC_ENTRY(dst)
788 		MAC_ENTRY(next_hop)
789 		__field(int, idx)
790 	),
791 	TP_fast_assign(
792 		WIPHY_ASSIGN;
793 		NETDEV_ASSIGN;
794 		MAC_ASSIGN(dst, dst);
795 		MAC_ASSIGN(next_hop, next_hop);
796 		__entry->idx = idx;
797 	),
798 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: "
799 		  MAC_PR_FMT ", next hop: " MAC_PR_FMT,
800 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, MAC_PR_ARG(dst),
801 		  MAC_PR_ARG(next_hop))
802 );
803 
804 TRACE_EVENT(rdev_return_int_mpath_info,
805 	TP_PROTO(struct wiphy *wiphy, int ret, struct mpath_info *pinfo),
806 	TP_ARGS(wiphy, ret, pinfo),
807 	TP_STRUCT__entry(
808 		WIPHY_ENTRY
809 		__field(int, ret)
810 		__field(int, generation)
811 		__field(u32, filled)
812 		__field(u32, frame_qlen)
813 		__field(u32, sn)
814 		__field(u32, metric)
815 		__field(u32, exptime)
816 		__field(u32, discovery_timeout)
817 		__field(u8, discovery_retries)
818 		__field(u8, flags)
819 	),
820 	TP_fast_assign(
821 		WIPHY_ASSIGN;
822 		__entry->ret = ret;
823 		__entry->generation = pinfo->generation;
824 		__entry->filled = pinfo->filled;
825 		__entry->frame_qlen = pinfo->frame_qlen;
826 		__entry->sn = pinfo->sn;
827 		__entry->metric = pinfo->metric;
828 		__entry->exptime = pinfo->exptime;
829 		__entry->discovery_timeout = pinfo->discovery_timeout;
830 		__entry->discovery_retries = pinfo->discovery_retries;
831 		__entry->flags = pinfo->flags;
832 	),
833 	TP_printk(WIPHY_PR_FMT ", returned %d. mpath info - generation: %d, "
834 		  "filled: %u, frame qlen: %u, sn: %u, metric: %u, exptime: %u,"
835 		  " discovery timeout: %u, discovery retries: %u, flags: %u",
836 		  WIPHY_PR_ARG, __entry->ret, __entry->generation,
837 		  __entry->filled, __entry->frame_qlen, __entry->sn,
838 		  __entry->metric, __entry->exptime, __entry->discovery_timeout,
839 		  __entry->discovery_retries, __entry->flags)
840 );
841 
842 TRACE_EVENT(rdev_return_int_mesh_config,
843 	TP_PROTO(struct wiphy *wiphy, int ret, struct mesh_config *conf),
844 	TP_ARGS(wiphy, ret, conf),
845 	TP_STRUCT__entry(
846 		WIPHY_ENTRY
847 		MESH_CFG_ENTRY
848 		__field(int, ret)
849 	),
850 	TP_fast_assign(
851 		WIPHY_ASSIGN;
852 		MESH_CFG_ASSIGN;
853 		__entry->ret = ret;
854 	),
855 	TP_printk(WIPHY_PR_FMT ", returned: %d",
856 		  WIPHY_PR_ARG, __entry->ret)
857 );
858 
859 TRACE_EVENT(rdev_update_mesh_config,
860 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 mask,
861 		 const struct mesh_config *conf),
862 	TP_ARGS(wiphy, netdev, mask, conf),
863 	TP_STRUCT__entry(
864 		WIPHY_ENTRY
865 		NETDEV_ENTRY
866 		MESH_CFG_ENTRY
867 		__field(u32, mask)
868 	),
869 	TP_fast_assign(
870 		WIPHY_ASSIGN;
871 		NETDEV_ASSIGN;
872 		MESH_CFG_ASSIGN;
873 		__entry->mask = mask;
874 	),
875 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mask: %u",
876 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->mask)
877 );
878 
879 TRACE_EVENT(rdev_join_mesh,
880 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
881 		 const struct mesh_config *conf,
882 		 const struct mesh_setup *setup),
883 	TP_ARGS(wiphy, netdev, conf, setup),
884 	TP_STRUCT__entry(
885 		WIPHY_ENTRY
886 		NETDEV_ENTRY
887 		MESH_CFG_ENTRY
888 	),
889 	TP_fast_assign(
890 		WIPHY_ASSIGN;
891 		NETDEV_ASSIGN;
892 		MESH_CFG_ASSIGN;
893 	),
894 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
895 		  WIPHY_PR_ARG, NETDEV_PR_ARG)
896 );
897 
898 TRACE_EVENT(rdev_change_bss,
899 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
900 		 struct bss_parameters *params),
901 	TP_ARGS(wiphy, netdev, params),
902 	TP_STRUCT__entry(
903 		WIPHY_ENTRY
904 		NETDEV_ENTRY
905 		__field(int, use_cts_prot)
906 		__field(int, use_short_preamble)
907 		__field(int, use_short_slot_time)
908 		__field(int, ap_isolate)
909 		__field(int, ht_opmode)
910 	),
911 	TP_fast_assign(
912 		WIPHY_ASSIGN;
913 		NETDEV_ASSIGN;
914 		__entry->use_cts_prot = params->use_cts_prot;
915 		__entry->use_short_preamble = params->use_short_preamble;
916 		__entry->use_short_slot_time = params->use_short_slot_time;
917 		__entry->ap_isolate = params->ap_isolate;
918 		__entry->ht_opmode = params->ht_opmode;
919 	),
920 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", use cts prot: %d, "
921 		  "use short preamble: %d, use short slot time: %d, "
922 		  "ap isolate: %d, ht opmode: %d",
923 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->use_cts_prot,
924 		  __entry->use_short_preamble, __entry->use_short_slot_time,
925 		  __entry->ap_isolate, __entry->ht_opmode)
926 );
927 
928 TRACE_EVENT(rdev_set_txq_params,
929 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
930 		 struct ieee80211_txq_params *params),
931 	TP_ARGS(wiphy, netdev, params),
932 	TP_STRUCT__entry(
933 		WIPHY_ENTRY
934 		NETDEV_ENTRY
935 		__field(enum nl80211_ac, ac)
936 		__field(u16, txop)
937 		__field(u16, cwmin)
938 		__field(u16, cwmax)
939 		__field(u8, aifs)
940 	),
941 	TP_fast_assign(
942 		WIPHY_ASSIGN;
943 		NETDEV_ASSIGN;
944 		__entry->ac = params->ac;
945 		__entry->txop = params->txop;
946 		__entry->cwmin = params->cwmin;
947 		__entry->cwmax = params->cwmax;
948 		__entry->aifs = params->aifs;
949 	),
950 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", ac: %d, txop: %u, cwmin: %u, cwmax: %u, aifs: %u",
951 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ac, __entry->txop,
952 		  __entry->cwmin, __entry->cwmax, __entry->aifs)
953 );
954 
955 TRACE_EVENT(rdev_libertas_set_mesh_channel,
956 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
957 		 struct ieee80211_channel *chan),
958 	TP_ARGS(wiphy, netdev, chan),
959 	TP_STRUCT__entry(
960 		WIPHY_ENTRY
961 		NETDEV_ENTRY
962 		CHAN_ENTRY
963 	),
964 	TP_fast_assign(
965 		WIPHY_ASSIGN;
966 		NETDEV_ASSIGN;
967 		CHAN_ASSIGN(chan);
968 	),
969 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_PR_FMT, WIPHY_PR_ARG,
970 		  NETDEV_PR_ARG, CHAN_PR_ARG)
971 );
972 
973 TRACE_EVENT(rdev_set_monitor_channel,
974 	TP_PROTO(struct wiphy *wiphy,
975 		 struct cfg80211_chan_def *chandef),
976 	TP_ARGS(wiphy, chandef),
977 	TP_STRUCT__entry(
978 		WIPHY_ENTRY
979 		CHAN_DEF_ENTRY
980 	),
981 	TP_fast_assign(
982 		WIPHY_ASSIGN;
983 		CHAN_DEF_ASSIGN(chandef);
984 	),
985 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
986 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
987 );
988 
989 TRACE_EVENT(rdev_auth,
990 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
991 		 struct cfg80211_auth_request *req),
992 	TP_ARGS(wiphy, netdev, req),
993 	TP_STRUCT__entry(
994 		WIPHY_ENTRY
995 		NETDEV_ENTRY
996 		MAC_ENTRY(bssid)
997 		__field(enum nl80211_auth_type, auth_type)
998 	),
999 	TP_fast_assign(
1000 		WIPHY_ASSIGN;
1001 		NETDEV_ASSIGN;
1002 		if (req->bss)
1003 			MAC_ASSIGN(bssid, req->bss->bssid);
1004 		else
1005 			memset(__entry->bssid, 0, ETH_ALEN);
1006 		__entry->auth_type = req->auth_type;
1007 	),
1008 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT,
1009 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->auth_type,
1010 		  MAC_PR_ARG(bssid))
1011 );
1012 
1013 TRACE_EVENT(rdev_assoc,
1014 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1015 		 struct cfg80211_assoc_request *req),
1016 	TP_ARGS(wiphy, netdev, req),
1017 	TP_STRUCT__entry(
1018 		WIPHY_ENTRY
1019 		NETDEV_ENTRY
1020 		MAC_ENTRY(bssid)
1021 		MAC_ENTRY(prev_bssid)
1022 		__field(bool, use_mfp)
1023 		__field(u32, flags)
1024 	),
1025 	TP_fast_assign(
1026 		WIPHY_ASSIGN;
1027 		NETDEV_ASSIGN;
1028 		if (req->bss)
1029 			MAC_ASSIGN(bssid, req->bss->bssid);
1030 		else
1031 			memset(__entry->bssid, 0, ETH_ALEN);
1032 		MAC_ASSIGN(prev_bssid, req->prev_bssid);
1033 		__entry->use_mfp = req->use_mfp;
1034 		__entry->flags = req->flags;
1035 	),
1036 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
1037 		  ", previous bssid: " MAC_PR_FMT ", use mfp: %s, flags: %u",
1038 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
1039 		  MAC_PR_ARG(prev_bssid), BOOL_TO_STR(__entry->use_mfp),
1040 		  __entry->flags)
1041 );
1042 
1043 TRACE_EVENT(rdev_deauth,
1044 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1045 		 struct cfg80211_deauth_request *req),
1046 	TP_ARGS(wiphy, netdev, req),
1047 	TP_STRUCT__entry(
1048 		WIPHY_ENTRY
1049 		NETDEV_ENTRY
1050 		MAC_ENTRY(bssid)
1051 		__field(u16, reason_code)
1052 	),
1053 	TP_fast_assign(
1054 		WIPHY_ASSIGN;
1055 		NETDEV_ASSIGN;
1056 		MAC_ASSIGN(bssid, req->bssid);
1057 		__entry->reason_code = req->reason_code;
1058 	),
1059 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", reason: %u",
1060 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
1061 		  __entry->reason_code)
1062 );
1063 
1064 TRACE_EVENT(rdev_disassoc,
1065 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1066 		 struct cfg80211_disassoc_request *req),
1067 	TP_ARGS(wiphy, netdev, req),
1068 	TP_STRUCT__entry(
1069 		WIPHY_ENTRY
1070 		NETDEV_ENTRY
1071 		MAC_ENTRY(bssid)
1072 		__field(u16, reason_code)
1073 		__field(bool, local_state_change)
1074 	),
1075 	TP_fast_assign(
1076 		WIPHY_ASSIGN;
1077 		NETDEV_ASSIGN;
1078 		if (req->bss)
1079 			MAC_ASSIGN(bssid, req->bss->bssid);
1080 		else
1081 			memset(__entry->bssid, 0, ETH_ALEN);
1082 		__entry->reason_code = req->reason_code;
1083 		__entry->local_state_change = req->local_state_change;
1084 	),
1085 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
1086 		  ", reason: %u, local state change: %s",
1087 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
1088 		  __entry->reason_code,
1089 		  BOOL_TO_STR(__entry->local_state_change))
1090 );
1091 
1092 TRACE_EVENT(rdev_mgmt_tx_cancel_wait,
1093 	TP_PROTO(struct wiphy *wiphy,
1094 		 struct wireless_dev *wdev, u64 cookie),
1095 	TP_ARGS(wiphy, wdev, cookie),
1096 	TP_STRUCT__entry(
1097 		WIPHY_ENTRY
1098 		WDEV_ENTRY
1099 		__field(u64, cookie)
1100 	),
1101 	TP_fast_assign(
1102 		WIPHY_ASSIGN;
1103 		WDEV_ASSIGN;
1104 		__entry->cookie = cookie;
1105 	),
1106 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu ",
1107 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
1108 );
1109 
1110 TRACE_EVENT(rdev_set_power_mgmt,
1111 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1112 		 bool enabled, int timeout),
1113 	TP_ARGS(wiphy, netdev, enabled, timeout),
1114 	TP_STRUCT__entry(
1115 		WIPHY_ENTRY
1116 		NETDEV_ENTRY
1117 		__field(bool, enabled)
1118 		__field(int, timeout)
1119 	),
1120 	TP_fast_assign(
1121 		WIPHY_ASSIGN;
1122 		NETDEV_ASSIGN;
1123 		__entry->enabled = enabled;
1124 		__entry->timeout = timeout;
1125 	),
1126 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %senabled, timeout: %d ",
1127 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
1128 		  __entry->enabled ? "" : "not ", __entry->timeout)
1129 );
1130 
1131 TRACE_EVENT(rdev_connect,
1132 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1133 		 struct cfg80211_connect_params *sme),
1134 	TP_ARGS(wiphy, netdev, sme),
1135 	TP_STRUCT__entry(
1136 		WIPHY_ENTRY
1137 		NETDEV_ENTRY
1138 		MAC_ENTRY(bssid)
1139 		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
1140 		__field(enum nl80211_auth_type, auth_type)
1141 		__field(bool, privacy)
1142 		__field(u32, wpa_versions)
1143 		__field(u32, flags)
1144 	),
1145 	TP_fast_assign(
1146 		WIPHY_ASSIGN;
1147 		NETDEV_ASSIGN;
1148 		MAC_ASSIGN(bssid, sme->bssid);
1149 		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
1150 		memcpy(__entry->ssid, sme->ssid, sme->ssid_len);
1151 		__entry->auth_type = sme->auth_type;
1152 		__entry->privacy = sme->privacy;
1153 		__entry->wpa_versions = sme->crypto.wpa_versions;
1154 		__entry->flags = sme->flags;
1155 	),
1156 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
1157 		  ", ssid: %s, auth type: %d, privacy: %s, wpa versions: %u, "
1158 		  "flags: %u",
1159 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid,
1160 		  __entry->auth_type, BOOL_TO_STR(__entry->privacy),
1161 		  __entry->wpa_versions, __entry->flags)
1162 );
1163 
1164 TRACE_EVENT(rdev_set_cqm_rssi_config,
1165 	TP_PROTO(struct wiphy *wiphy,
1166 		 struct net_device *netdev, s32 rssi_thold,
1167 		 u32 rssi_hyst),
1168 	TP_ARGS(wiphy, netdev, rssi_thold, rssi_hyst),
1169 	TP_STRUCT__entry(
1170 		WIPHY_ENTRY
1171 		NETDEV_ENTRY
1172 		__field(s32, rssi_thold)
1173 		__field(u32, rssi_hyst)
1174 	),
1175 	TP_fast_assign(
1176 		WIPHY_ASSIGN;
1177 		NETDEV_ASSIGN;
1178 		__entry->rssi_thold = rssi_thold;
1179 		__entry->rssi_hyst = rssi_hyst;
1180 	),
1181 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
1182 		  ", rssi_thold: %d, rssi_hyst: %u ",
1183 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
1184 		 __entry->rssi_thold, __entry->rssi_hyst)
1185 );
1186 
1187 TRACE_EVENT(rdev_set_cqm_txe_config,
1188 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 rate,
1189 		 u32 pkts, u32 intvl),
1190 	TP_ARGS(wiphy, netdev, rate, pkts, intvl),
1191 	TP_STRUCT__entry(
1192 		WIPHY_ENTRY
1193 		NETDEV_ENTRY
1194 		__field(u32, rate)
1195 		__field(u32, pkts)
1196 		__field(u32, intvl)
1197 	),
1198 	TP_fast_assign(
1199 		WIPHY_ASSIGN;
1200 		NETDEV_ASSIGN;
1201 		__entry->rate = rate;
1202 		__entry->pkts = pkts;
1203 		__entry->intvl = intvl;
1204 	),
1205 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", rate: %u, packets: %u, interval: %u",
1206 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->rate, __entry->pkts,
1207 		  __entry->intvl)
1208 );
1209 
1210 TRACE_EVENT(rdev_disconnect,
1211 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1212 		 u16 reason_code),
1213 	TP_ARGS(wiphy, netdev, reason_code),
1214 	TP_STRUCT__entry(
1215 		WIPHY_ENTRY
1216 		NETDEV_ENTRY
1217 		__field(u16, reason_code)
1218 	),
1219 	TP_fast_assign(
1220 		WIPHY_ASSIGN;
1221 		NETDEV_ASSIGN;
1222 		__entry->reason_code = reason_code;
1223 	),
1224 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", reason code: %u", WIPHY_PR_ARG,
1225 		  NETDEV_PR_ARG, __entry->reason_code)
1226 );
1227 
1228 TRACE_EVENT(rdev_join_ibss,
1229 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1230 		 struct cfg80211_ibss_params *params),
1231 	TP_ARGS(wiphy, netdev, params),
1232 	TP_STRUCT__entry(
1233 		WIPHY_ENTRY
1234 		NETDEV_ENTRY
1235 		MAC_ENTRY(bssid)
1236 		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
1237 	),
1238 	TP_fast_assign(
1239 		WIPHY_ASSIGN;
1240 		NETDEV_ASSIGN;
1241 		MAC_ASSIGN(bssid, params->bssid);
1242 		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
1243 		memcpy(__entry->ssid, params->ssid, params->ssid_len);
1244 	),
1245 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", ssid: %s",
1246 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid)
1247 );
1248 
1249 TRACE_EVENT(rdev_set_wiphy_params,
1250 	TP_PROTO(struct wiphy *wiphy, u32 changed),
1251 	TP_ARGS(wiphy, changed),
1252 	TP_STRUCT__entry(
1253 		WIPHY_ENTRY
1254 		__field(u32, changed)
1255 	),
1256 	TP_fast_assign(
1257 		WIPHY_ASSIGN;
1258 		__entry->changed = changed;
1259 	),
1260 	TP_printk(WIPHY_PR_FMT ", changed: %u",
1261 		  WIPHY_PR_ARG, __entry->changed)
1262 );
1263 
1264 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_tx_power,
1265 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1266 	TP_ARGS(wiphy, wdev)
1267 );
1268 
1269 TRACE_EVENT(rdev_set_tx_power,
1270 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1271 		 enum nl80211_tx_power_setting type, int mbm),
1272 	TP_ARGS(wiphy, wdev, type, mbm),
1273 	TP_STRUCT__entry(
1274 		WIPHY_ENTRY
1275 		WDEV_ENTRY
1276 		__field(enum nl80211_tx_power_setting, type)
1277 		__field(int, mbm)
1278 	),
1279 	TP_fast_assign(
1280 		WIPHY_ASSIGN;
1281 		WDEV_ASSIGN;
1282 		__entry->type = type;
1283 		__entry->mbm = mbm;
1284 	),
1285 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type: %u, mbm: %d",
1286 		  WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
1287 );
1288 
1289 TRACE_EVENT(rdev_return_int_int,
1290 	TP_PROTO(struct wiphy *wiphy, int func_ret, int func_fill),
1291 	TP_ARGS(wiphy, func_ret, func_fill),
1292 	TP_STRUCT__entry(
1293 		WIPHY_ENTRY
1294 		__field(int, func_ret)
1295 		__field(int, func_fill)
1296 	),
1297 	TP_fast_assign(
1298 		WIPHY_ASSIGN;
1299 		__entry->func_ret = func_ret;
1300 		__entry->func_fill = func_fill;
1301 	),
1302 	TP_printk(WIPHY_PR_FMT ", function returns: %d, function filled: %d",
1303 		  WIPHY_PR_ARG, __entry->func_ret, __entry->func_fill)
1304 );
1305 
1306 #ifdef CONFIG_NL80211_TESTMODE
1307 TRACE_EVENT(rdev_testmode_cmd,
1308 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1309 	TP_ARGS(wiphy, wdev),
1310 	TP_STRUCT__entry(
1311 		WIPHY_ENTRY
1312 		WDEV_ENTRY
1313 	),
1314 	TP_fast_assign(
1315 		WIPHY_ASSIGN;
1316 		WDEV_ASSIGN;
1317 	),
1318 	TP_printk(WIPHY_PR_FMT WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
1319 );
1320 
1321 TRACE_EVENT(rdev_testmode_dump,
1322 	TP_PROTO(struct wiphy *wiphy),
1323 	TP_ARGS(wiphy),
1324 	TP_STRUCT__entry(
1325 		WIPHY_ENTRY
1326 	),
1327 	TP_fast_assign(
1328 		WIPHY_ASSIGN;
1329 	),
1330 	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
1331 );
1332 #endif /* CONFIG_NL80211_TESTMODE */
1333 
1334 TRACE_EVENT(rdev_set_bitrate_mask,
1335 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1336 		 const u8 *peer, const struct cfg80211_bitrate_mask *mask),
1337 	TP_ARGS(wiphy, netdev, peer, mask),
1338 	TP_STRUCT__entry(
1339 		WIPHY_ENTRY
1340 		NETDEV_ENTRY
1341 		MAC_ENTRY(peer)
1342 	),
1343 	TP_fast_assign(
1344 		WIPHY_ASSIGN;
1345 		NETDEV_ASSIGN;
1346 		MAC_ASSIGN(peer, peer);
1347 	),
1348 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
1349 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
1350 );
1351 
1352 TRACE_EVENT(rdev_mgmt_frame_register,
1353 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1354 		 u16 frame_type, bool reg),
1355 	TP_ARGS(wiphy, wdev, frame_type, reg),
1356 	TP_STRUCT__entry(
1357 		WIPHY_ENTRY
1358 		WDEV_ENTRY
1359 		__field(u16, frame_type)
1360 		__field(bool, reg)
1361 	),
1362 	TP_fast_assign(
1363 		WIPHY_ASSIGN;
1364 		WDEV_ASSIGN;
1365 		__entry->frame_type = frame_type;
1366 		__entry->reg = reg;
1367 	),
1368 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", frame_type: 0x%.2x, reg: %s ",
1369 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->frame_type,
1370 		  __entry->reg ? "true" : "false")
1371 );
1372 
1373 TRACE_EVENT(rdev_return_int_tx_rx,
1374 	TP_PROTO(struct wiphy *wiphy, int ret, u32 tx, u32 rx),
1375 	TP_ARGS(wiphy, ret, tx, rx),
1376 	TP_STRUCT__entry(
1377 		WIPHY_ENTRY
1378 		__field(int, ret)
1379 		__field(u32, tx)
1380 		__field(u32, rx)
1381 	),
1382 	TP_fast_assign(
1383 		WIPHY_ASSIGN;
1384 		__entry->ret = ret;
1385 		__entry->tx = tx;
1386 		__entry->rx = rx;
1387 	),
1388 	TP_printk(WIPHY_PR_FMT ", returned %d, tx: %u, rx: %u",
1389 		  WIPHY_PR_ARG, __entry->ret, __entry->tx, __entry->rx)
1390 );
1391 
1392 TRACE_EVENT(rdev_return_void_tx_rx,
1393 	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 tx_max,
1394 		 u32 rx, u32 rx_max),
1395 	TP_ARGS(wiphy, tx, tx_max, rx, rx_max),
1396 	TP_STRUCT__entry(
1397 		WIPHY_ENTRY
1398 		__field(u32, tx)
1399 		__field(u32, tx_max)
1400 		__field(u32, rx)
1401 		__field(u32, rx_max)
1402 	),
1403 	TP_fast_assign(
1404 		WIPHY_ASSIGN;
1405 		__entry->tx = tx;
1406 		__entry->tx_max = tx_max;
1407 		__entry->rx = rx;
1408 		__entry->rx_max = rx_max;
1409 	),
1410 	TP_printk(WIPHY_PR_FMT ", tx: %u, tx_max: %u, rx: %u, rx_max: %u ",
1411 		  WIPHY_PR_ARG, __entry->tx, __entry->tx_max, __entry->rx,
1412 		  __entry->rx_max)
1413 );
1414 
1415 DECLARE_EVENT_CLASS(tx_rx_evt,
1416 	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
1417 	TP_ARGS(wiphy, rx, tx),
1418 	TP_STRUCT__entry(
1419 		WIPHY_ENTRY
1420 		__field(u32, tx)
1421 		__field(u32, rx)
1422 	),
1423 	TP_fast_assign(
1424 		WIPHY_ASSIGN;
1425 		__entry->tx = tx;
1426 		__entry->rx = rx;
1427 	),
1428 	TP_printk(WIPHY_PR_FMT ", tx: %u, rx: %u ",
1429 		  WIPHY_PR_ARG, __entry->tx, __entry->rx)
1430 );
1431 
1432 DEFINE_EVENT(tx_rx_evt, rdev_set_antenna,
1433 	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
1434 	TP_ARGS(wiphy, rx, tx)
1435 );
1436 
1437 TRACE_EVENT(rdev_sched_scan_start,
1438 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1439 		 struct cfg80211_sched_scan_request *request),
1440 	TP_ARGS(wiphy, netdev, request),
1441 	TP_STRUCT__entry(
1442 		WIPHY_ENTRY
1443 		NETDEV_ENTRY
1444 	),
1445 	TP_fast_assign(
1446 		WIPHY_ASSIGN;
1447 		NETDEV_ASSIGN;
1448 	),
1449 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
1450 		  WIPHY_PR_ARG, NETDEV_PR_ARG)
1451 );
1452 
1453 TRACE_EVENT(rdev_tdls_mgmt,
1454 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1455 		 u8 *peer, u8 action_code, u8 dialog_token,
1456 		 u16 status_code, u32 peer_capability,
1457 		 bool initiator, const u8 *buf, size_t len),
1458 	TP_ARGS(wiphy, netdev, peer, action_code, dialog_token, status_code,
1459 		peer_capability, initiator, buf, len),
1460 	TP_STRUCT__entry(
1461 		WIPHY_ENTRY
1462 		NETDEV_ENTRY
1463 		MAC_ENTRY(peer)
1464 		__field(u8, action_code)
1465 		__field(u8, dialog_token)
1466 		__field(u16, status_code)
1467 		__field(u32, peer_capability)
1468 		__field(bool, initiator)
1469 		__dynamic_array(u8, buf, len)
1470 	),
1471 	TP_fast_assign(
1472 		WIPHY_ASSIGN;
1473 		NETDEV_ASSIGN;
1474 		MAC_ASSIGN(peer, peer);
1475 		__entry->action_code = action_code;
1476 		__entry->dialog_token = dialog_token;
1477 		__entry->status_code = status_code;
1478 		__entry->peer_capability = peer_capability;
1479 		__entry->initiator = initiator;
1480 		memcpy(__get_dynamic_array(buf), buf, len);
1481 	),
1482 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", action_code: %u, "
1483 		  "dialog_token: %u, status_code: %u, peer_capability: %u "
1484 		  "initiator: %s buf: %#.2x ",
1485 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
1486 		  __entry->action_code, __entry->dialog_token,
1487 		  __entry->status_code, __entry->peer_capability,
1488 		  BOOL_TO_STR(__entry->initiator),
1489 		  ((u8 *)__get_dynamic_array(buf))[0])
1490 );
1491 
1492 TRACE_EVENT(rdev_dump_survey,
1493 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int idx),
1494 	TP_ARGS(wiphy, netdev, idx),
1495 	TP_STRUCT__entry(
1496 		WIPHY_ENTRY
1497 		NETDEV_ENTRY
1498 		__field(int, idx)
1499 	),
1500 	TP_fast_assign(
1501 		WIPHY_ASSIGN;
1502 		NETDEV_ASSIGN;
1503 		__entry->idx = idx;
1504 	),
1505 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d",
1506 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx)
1507 );
1508 
1509 TRACE_EVENT(rdev_return_int_survey_info,
1510 	TP_PROTO(struct wiphy *wiphy, int ret, struct survey_info *info),
1511 	TP_ARGS(wiphy, ret, info),
1512 	TP_STRUCT__entry(
1513 		WIPHY_ENTRY
1514 		CHAN_ENTRY
1515 		__field(int, ret)
1516 		__field(u64, channel_time)
1517 		__field(u64, channel_time_busy)
1518 		__field(u64, channel_time_ext_busy)
1519 		__field(u64, channel_time_rx)
1520 		__field(u64, channel_time_tx)
1521 		__field(u32, filled)
1522 		__field(s8, noise)
1523 	),
1524 	TP_fast_assign(
1525 		WIPHY_ASSIGN;
1526 		CHAN_ASSIGN(info->channel);
1527 		__entry->ret = ret;
1528 		__entry->channel_time = info->channel_time;
1529 		__entry->channel_time_busy = info->channel_time_busy;
1530 		__entry->channel_time_ext_busy = info->channel_time_ext_busy;
1531 		__entry->channel_time_rx = info->channel_time_rx;
1532 		__entry->channel_time_tx = info->channel_time_tx;
1533 		__entry->filled = info->filled;
1534 		__entry->noise = info->noise;
1535 	),
1536 	TP_printk(WIPHY_PR_FMT ", returned: %d, " CHAN_PR_FMT
1537 		  ", channel time: %llu, channel time busy: %llu, "
1538 		  "channel time extension busy: %llu, channel time rx: %llu, "
1539 		  "channel time tx: %llu, filled: %u, noise: %d",
1540 		  WIPHY_PR_ARG, __entry->ret, CHAN_PR_ARG,
1541 		  __entry->channel_time, __entry->channel_time_busy,
1542 		  __entry->channel_time_ext_busy, __entry->channel_time_rx,
1543 		  __entry->channel_time_tx, __entry->filled, __entry->noise)
1544 );
1545 
1546 TRACE_EVENT(rdev_tdls_oper,
1547 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1548 		 u8 *peer, enum nl80211_tdls_operation oper),
1549 	TP_ARGS(wiphy, netdev, peer, oper),
1550 	TP_STRUCT__entry(
1551 		WIPHY_ENTRY
1552 		NETDEV_ENTRY
1553 		MAC_ENTRY(peer)
1554 		__field(enum nl80211_tdls_operation, oper)
1555 	),
1556 	TP_fast_assign(
1557 		WIPHY_ASSIGN;
1558 		NETDEV_ASSIGN;
1559 		MAC_ASSIGN(peer, peer);
1560 		__entry->oper = oper;
1561 	),
1562 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", oper: %d",
1563 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper)
1564 );
1565 
1566 DECLARE_EVENT_CLASS(rdev_pmksa,
1567 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1568 		 struct cfg80211_pmksa *pmksa),
1569 	TP_ARGS(wiphy, netdev, pmksa),
1570 	TP_STRUCT__entry(
1571 		WIPHY_ENTRY
1572 		NETDEV_ENTRY
1573 		MAC_ENTRY(bssid)
1574 	),
1575 	TP_fast_assign(
1576 		WIPHY_ASSIGN;
1577 		NETDEV_ASSIGN;
1578 		MAC_ASSIGN(bssid, pmksa->bssid);
1579 	),
1580 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT,
1581 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid))
1582 );
1583 
1584 TRACE_EVENT(rdev_probe_client,
1585 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1586 		 const u8 *peer),
1587 	TP_ARGS(wiphy, netdev, peer),
1588 	TP_STRUCT__entry(
1589 		WIPHY_ENTRY
1590 		NETDEV_ENTRY
1591 		MAC_ENTRY(peer)
1592 	),
1593 	TP_fast_assign(
1594 		WIPHY_ASSIGN;
1595 		NETDEV_ASSIGN;
1596 		MAC_ASSIGN(peer, peer);
1597 	),
1598 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
1599 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
1600 );
1601 
1602 DEFINE_EVENT(rdev_pmksa, rdev_set_pmksa,
1603 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1604 		 struct cfg80211_pmksa *pmksa),
1605 	TP_ARGS(wiphy, netdev, pmksa)
1606 );
1607 
1608 DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
1609 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1610 		 struct cfg80211_pmksa *pmksa),
1611 	TP_ARGS(wiphy, netdev, pmksa)
1612 );
1613 
1614 TRACE_EVENT(rdev_remain_on_channel,
1615 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1616 		 struct ieee80211_channel *chan,
1617 		 unsigned int duration),
1618 	TP_ARGS(wiphy, wdev, chan, duration),
1619 	TP_STRUCT__entry(
1620 		WIPHY_ENTRY
1621 		WDEV_ENTRY
1622 		CHAN_ENTRY
1623 		__field(unsigned int, duration)
1624 	),
1625 	TP_fast_assign(
1626 		WIPHY_ASSIGN;
1627 		WDEV_ASSIGN;
1628 		CHAN_ASSIGN(chan);
1629 		__entry->duration = duration;
1630 	),
1631 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", duration: %u",
1632 		  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
1633 );
1634 
1635 TRACE_EVENT(rdev_return_int_cookie,
1636 	TP_PROTO(struct wiphy *wiphy, int ret, u64 cookie),
1637 	TP_ARGS(wiphy, ret, cookie),
1638 	TP_STRUCT__entry(
1639 		WIPHY_ENTRY
1640 		__field(int, ret)
1641 		__field(u64, cookie)
1642 	),
1643 	TP_fast_assign(
1644 		WIPHY_ASSIGN;
1645 		__entry->ret = ret;
1646 		__entry->cookie = cookie;
1647 	),
1648 	TP_printk(WIPHY_PR_FMT ", returned %d, cookie: %llu",
1649 		  WIPHY_PR_ARG, __entry->ret, __entry->cookie)
1650 );
1651 
1652 TRACE_EVENT(rdev_cancel_remain_on_channel,
1653 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
1654 	TP_ARGS(wiphy, wdev, cookie),
1655 	TP_STRUCT__entry(
1656 		WIPHY_ENTRY
1657 		WDEV_ENTRY
1658 		__field(u64, cookie)
1659 	),
1660 	TP_fast_assign(
1661 		WIPHY_ASSIGN;
1662 		WDEV_ASSIGN;
1663 		__entry->cookie = cookie;
1664 	),
1665 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu",
1666 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
1667 );
1668 
1669 TRACE_EVENT(rdev_mgmt_tx,
1670 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1671 		 struct cfg80211_mgmt_tx_params *params),
1672 	TP_ARGS(wiphy, wdev, params),
1673 	TP_STRUCT__entry(
1674 		WIPHY_ENTRY
1675 		WDEV_ENTRY
1676 		CHAN_ENTRY
1677 		__field(bool, offchan)
1678 		__field(unsigned int, wait)
1679 		__field(bool, no_cck)
1680 		__field(bool, dont_wait_for_ack)
1681 	),
1682 	TP_fast_assign(
1683 		WIPHY_ASSIGN;
1684 		WDEV_ASSIGN;
1685 		CHAN_ASSIGN(params->chan);
1686 		__entry->offchan = params->offchan;
1687 		__entry->wait = params->wait;
1688 		__entry->no_cck = params->no_cck;
1689 		__entry->dont_wait_for_ack = params->dont_wait_for_ack;
1690 	),
1691 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", offchan: %s,"
1692 		  " wait: %u, no cck: %s, dont wait for ack: %s",
1693 		  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
1694 		  BOOL_TO_STR(__entry->offchan), __entry->wait,
1695 		  BOOL_TO_STR(__entry->no_cck),
1696 		  BOOL_TO_STR(__entry->dont_wait_for_ack))
1697 );
1698 
1699 TRACE_EVENT(rdev_set_noack_map,
1700 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1701 		 u16 noack_map),
1702 	TP_ARGS(wiphy, netdev, noack_map),
1703 	TP_STRUCT__entry(
1704 		WIPHY_ENTRY
1705 		NETDEV_ENTRY
1706 		__field(u16, noack_map)
1707 	),
1708 	TP_fast_assign(
1709 		WIPHY_ASSIGN;
1710 		NETDEV_ASSIGN;
1711 		__entry->noack_map = noack_map;
1712 	),
1713 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", noack_map: %u",
1714 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map)
1715 );
1716 
1717 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel,
1718 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1719 	TP_ARGS(wiphy, wdev)
1720 );
1721 
1722 TRACE_EVENT(rdev_return_chandef,
1723 	TP_PROTO(struct wiphy *wiphy, int ret,
1724 		 struct cfg80211_chan_def *chandef),
1725 	TP_ARGS(wiphy, ret, chandef),
1726 	TP_STRUCT__entry(
1727 		WIPHY_ENTRY
1728 		__field(int, ret)
1729 		CHAN_DEF_ENTRY
1730 	),
1731 	TP_fast_assign(
1732 		WIPHY_ASSIGN;
1733 		if (ret == 0)
1734 			CHAN_DEF_ASSIGN(chandef);
1735 		else
1736 			CHAN_DEF_ASSIGN((struct cfg80211_chan_def *)NULL);
1737 		__entry->ret = ret;
1738 	),
1739 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", ret: %d",
1740 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->ret)
1741 );
1742 
1743 DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
1744 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1745 	TP_ARGS(wiphy, wdev)
1746 );
1747 
1748 DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
1749 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1750 	TP_ARGS(wiphy, wdev)
1751 );
1752 
1753 TRACE_EVENT(rdev_set_mac_acl,
1754 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1755 		 struct cfg80211_acl_data *params),
1756 	TP_ARGS(wiphy, netdev, params),
1757 	TP_STRUCT__entry(
1758 		WIPHY_ENTRY
1759 		NETDEV_ENTRY
1760 		__field(u32, acl_policy)
1761 	),
1762 	TP_fast_assign(
1763 		WIPHY_ASSIGN;
1764 		NETDEV_ASSIGN;
1765 		__entry->acl_policy = params->acl_policy;
1766 	),
1767 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", acl policy: %d",
1768 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->acl_policy)
1769 );
1770 
1771 TRACE_EVENT(rdev_update_ft_ies,
1772 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1773 		 struct cfg80211_update_ft_ies_params *ftie),
1774 	TP_ARGS(wiphy, netdev, ftie),
1775 	TP_STRUCT__entry(
1776 		WIPHY_ENTRY
1777 		NETDEV_ENTRY
1778 		__field(u16, md)
1779 		__dynamic_array(u8, ie, ftie->ie_len)
1780 	),
1781 	TP_fast_assign(
1782 		WIPHY_ASSIGN;
1783 		NETDEV_ASSIGN;
1784 		__entry->md = ftie->md;
1785 		memcpy(__get_dynamic_array(ie), ftie->ie, ftie->ie_len);
1786 	),
1787 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", md: 0x%x",
1788 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->md)
1789 );
1790 
1791 TRACE_EVENT(rdev_crit_proto_start,
1792 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1793 		 enum nl80211_crit_proto_id protocol, u16 duration),
1794 	TP_ARGS(wiphy, wdev, protocol, duration),
1795 	TP_STRUCT__entry(
1796 		WIPHY_ENTRY
1797 		WDEV_ENTRY
1798 		__field(u16, proto)
1799 		__field(u16, duration)
1800 	),
1801 	TP_fast_assign(
1802 		WIPHY_ASSIGN;
1803 		WDEV_ASSIGN;
1804 		__entry->proto = protocol;
1805 		__entry->duration = duration;
1806 	),
1807 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", proto=%x, duration=%u",
1808 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->proto, __entry->duration)
1809 );
1810 
1811 TRACE_EVENT(rdev_crit_proto_stop,
1812 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1813 	TP_ARGS(wiphy, wdev),
1814 	TP_STRUCT__entry(
1815 		WIPHY_ENTRY
1816 		WDEV_ENTRY
1817 	),
1818 	TP_fast_assign(
1819 		WIPHY_ASSIGN;
1820 		WDEV_ASSIGN;
1821 	),
1822 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
1823 		  WIPHY_PR_ARG, WDEV_PR_ARG)
1824 );
1825 
1826 TRACE_EVENT(rdev_channel_switch,
1827 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1828 		 struct cfg80211_csa_settings *params),
1829 	TP_ARGS(wiphy, netdev, params),
1830 	TP_STRUCT__entry(
1831 		WIPHY_ENTRY
1832 		NETDEV_ENTRY
1833 		CHAN_DEF_ENTRY
1834 		__field(bool, radar_required)
1835 		__field(bool, block_tx)
1836 		__field(u8, count)
1837 		__dynamic_array(u16, bcn_ofs, params->n_counter_offsets_beacon)
1838 		__dynamic_array(u16, pres_ofs, params->n_counter_offsets_presp)
1839 	),
1840 	TP_fast_assign(
1841 		WIPHY_ASSIGN;
1842 		NETDEV_ASSIGN;
1843 		CHAN_DEF_ASSIGN(&params->chandef);
1844 		__entry->radar_required = params->radar_required;
1845 		__entry->block_tx = params->block_tx;
1846 		__entry->count = params->count;
1847 		memcpy(__get_dynamic_array(bcn_ofs),
1848 		       params->counter_offsets_beacon,
1849 		       params->n_counter_offsets_beacon * sizeof(u16));
1850 
1851 		/* probe response offsets are optional */
1852 		if (params->n_counter_offsets_presp)
1853 			memcpy(__get_dynamic_array(pres_ofs),
1854 			       params->counter_offsets_presp,
1855 			       params->n_counter_offsets_presp * sizeof(u16));
1856 	),
1857 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
1858 		  ", block_tx: %d, count: %u, radar_required: %d",
1859 		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
1860 		  __entry->block_tx, __entry->count, __entry->radar_required)
1861 );
1862 
1863 TRACE_EVENT(rdev_set_qos_map,
1864 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1865 		 struct cfg80211_qos_map *qos_map),
1866 	TP_ARGS(wiphy, netdev, qos_map),
1867 	TP_STRUCT__entry(
1868 		WIPHY_ENTRY
1869 		NETDEV_ENTRY
1870 		QOS_MAP_ENTRY
1871 	),
1872 	TP_fast_assign(
1873 		WIPHY_ASSIGN;
1874 		NETDEV_ASSIGN;
1875 		QOS_MAP_ASSIGN(qos_map);
1876 	),
1877 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", num_des: %u",
1878 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->num_des)
1879 );
1880 
1881 TRACE_EVENT(rdev_set_ap_chanwidth,
1882 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1883 		 struct cfg80211_chan_def *chandef),
1884 	TP_ARGS(wiphy, netdev, chandef),
1885 	TP_STRUCT__entry(
1886 		WIPHY_ENTRY
1887 		NETDEV_ENTRY
1888 		CHAN_DEF_ENTRY
1889 	),
1890 	TP_fast_assign(
1891 		WIPHY_ASSIGN;
1892 		NETDEV_ASSIGN;
1893 		CHAN_DEF_ASSIGN(chandef);
1894 	),
1895 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
1896 		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
1897 );
1898 
1899 TRACE_EVENT(rdev_add_tx_ts,
1900 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1901 		 u8 tsid, const u8 *peer, u8 user_prio, u16 admitted_time),
1902 	TP_ARGS(wiphy, netdev, tsid, peer, user_prio, admitted_time),
1903 	TP_STRUCT__entry(
1904 		WIPHY_ENTRY
1905 		NETDEV_ENTRY
1906 		MAC_ENTRY(peer)
1907 		__field(u8, tsid)
1908 		__field(u8, user_prio)
1909 		__field(u16, admitted_time)
1910 	),
1911 	TP_fast_assign(
1912 		WIPHY_ASSIGN;
1913 		NETDEV_ASSIGN;
1914 		MAC_ASSIGN(peer, peer);
1915 		__entry->tsid = tsid;
1916 		__entry->user_prio = user_prio;
1917 		__entry->admitted_time = admitted_time;
1918 	),
1919 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", TSID %d, UP %d, time %d",
1920 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
1921 		  __entry->tsid, __entry->user_prio, __entry->admitted_time)
1922 );
1923 
1924 TRACE_EVENT(rdev_del_tx_ts,
1925 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1926 		 u8 tsid, const u8 *peer),
1927 	TP_ARGS(wiphy, netdev, tsid, peer),
1928 	TP_STRUCT__entry(
1929 		WIPHY_ENTRY
1930 		NETDEV_ENTRY
1931 		MAC_ENTRY(peer)
1932 		__field(u8, tsid)
1933 	),
1934 	TP_fast_assign(
1935 		WIPHY_ASSIGN;
1936 		NETDEV_ASSIGN;
1937 		MAC_ASSIGN(peer, peer);
1938 		__entry->tsid = tsid;
1939 	),
1940 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", TSID %d",
1941 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tsid)
1942 );
1943 
1944 /*************************************************************
1945  *	     cfg80211 exported functions traces		     *
1946  *************************************************************/
1947 
1948 TRACE_EVENT(cfg80211_return_bool,
1949 	TP_PROTO(bool ret),
1950 	TP_ARGS(ret),
1951 	TP_STRUCT__entry(
1952 		__field(bool, ret)
1953 	),
1954 	TP_fast_assign(
1955 		__entry->ret = ret;
1956 	),
1957 	TP_printk("returned %s", BOOL_TO_STR(__entry->ret))
1958 );
1959 
1960 DECLARE_EVENT_CLASS(cfg80211_netdev_mac_evt,
1961 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
1962 	TP_ARGS(netdev, macaddr),
1963 	TP_STRUCT__entry(
1964 		NETDEV_ENTRY
1965 		MAC_ENTRY(macaddr)
1966 	),
1967 	TP_fast_assign(
1968 		NETDEV_ASSIGN;
1969 		MAC_ASSIGN(macaddr, macaddr);
1970 	),
1971 	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
1972 		  NETDEV_PR_ARG, MAC_PR_ARG(macaddr))
1973 );
1974 
1975 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_notify_new_peer_candidate,
1976 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
1977 	TP_ARGS(netdev, macaddr)
1978 );
1979 
1980 DECLARE_EVENT_CLASS(netdev_evt_only,
1981 	TP_PROTO(struct net_device *netdev),
1982 	TP_ARGS(netdev),
1983 	TP_STRUCT__entry(
1984 		NETDEV_ENTRY
1985 	),
1986 	TP_fast_assign(
1987 		NETDEV_ASSIGN;
1988 	),
1989 	TP_printk(NETDEV_PR_FMT , NETDEV_PR_ARG)
1990 );
1991 
1992 DEFINE_EVENT(netdev_evt_only, cfg80211_send_rx_auth,
1993 	TP_PROTO(struct net_device *netdev),
1994 	TP_ARGS(netdev)
1995 );
1996 
1997 TRACE_EVENT(cfg80211_send_rx_assoc,
1998 	TP_PROTO(struct net_device *netdev, struct cfg80211_bss *bss),
1999 	TP_ARGS(netdev, bss),
2000 	TP_STRUCT__entry(
2001 		NETDEV_ENTRY
2002 		MAC_ENTRY(bssid)
2003 		CHAN_ENTRY
2004 	),
2005 	TP_fast_assign(
2006 		NETDEV_ASSIGN;
2007 		MAC_ASSIGN(bssid, bss->bssid);
2008 		CHAN_ASSIGN(bss->channel);
2009 	),
2010 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", " CHAN_PR_FMT,
2011 		  NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
2012 );
2013 
2014 DECLARE_EVENT_CLASS(netdev_frame_event,
2015 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2016 	TP_ARGS(netdev, buf, len),
2017 	TP_STRUCT__entry(
2018 		NETDEV_ENTRY
2019 		__dynamic_array(u8, frame, len)
2020 	),
2021 	TP_fast_assign(
2022 		NETDEV_ASSIGN;
2023 		memcpy(__get_dynamic_array(frame), buf, len);
2024 	),
2025 	TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x",
2026 		  NETDEV_PR_ARG,
2027 		  le16_to_cpup((__le16 *)__get_dynamic_array(frame)))
2028 );
2029 
2030 DEFINE_EVENT(netdev_frame_event, cfg80211_rx_unprot_mlme_mgmt,
2031 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2032 	TP_ARGS(netdev, buf, len)
2033 );
2034 
2035 DEFINE_EVENT(netdev_frame_event, cfg80211_rx_mlme_mgmt,
2036 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2037 	TP_ARGS(netdev, buf, len)
2038 );
2039 
2040 TRACE_EVENT(cfg80211_tx_mlme_mgmt,
2041 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2042 	TP_ARGS(netdev, buf, len),
2043 	TP_STRUCT__entry(
2044 		NETDEV_ENTRY
2045 		__dynamic_array(u8, frame, len)
2046 	),
2047 	TP_fast_assign(
2048 		NETDEV_ASSIGN;
2049 		memcpy(__get_dynamic_array(frame), buf, len);
2050 	),
2051 	TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x",
2052 		  NETDEV_PR_ARG,
2053 		  le16_to_cpup((__le16 *)__get_dynamic_array(frame)))
2054 );
2055 
2056 DECLARE_EVENT_CLASS(netdev_mac_evt,
2057 	TP_PROTO(struct net_device *netdev, const u8 *mac),
2058 	TP_ARGS(netdev, mac),
2059 	TP_STRUCT__entry(
2060 		NETDEV_ENTRY
2061 		MAC_ENTRY(mac)
2062 	),
2063 	TP_fast_assign(
2064 		NETDEV_ASSIGN;
2065 		MAC_ASSIGN(mac, mac)
2066 	),
2067 	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
2068 		  NETDEV_PR_ARG, MAC_PR_ARG(mac))
2069 );
2070 
2071 DEFINE_EVENT(netdev_mac_evt, cfg80211_send_auth_timeout,
2072 	TP_PROTO(struct net_device *netdev, const u8 *mac),
2073 	TP_ARGS(netdev, mac)
2074 );
2075 
2076 DEFINE_EVENT(netdev_mac_evt, cfg80211_send_assoc_timeout,
2077 	TP_PROTO(struct net_device *netdev, const u8 *mac),
2078 	TP_ARGS(netdev, mac)
2079 );
2080 
2081 TRACE_EVENT(cfg80211_michael_mic_failure,
2082 	TP_PROTO(struct net_device *netdev, const u8 *addr,
2083 		 enum nl80211_key_type key_type, int key_id, const u8 *tsc),
2084 	TP_ARGS(netdev, addr, key_type, key_id, tsc),
2085 	TP_STRUCT__entry(
2086 		NETDEV_ENTRY
2087 		MAC_ENTRY(addr)
2088 		__field(enum nl80211_key_type, key_type)
2089 		__field(int, key_id)
2090 		__array(u8, tsc, 6)
2091 	),
2092 	TP_fast_assign(
2093 		NETDEV_ASSIGN;
2094 		MAC_ASSIGN(addr, addr);
2095 		__entry->key_type = key_type;
2096 		__entry->key_id = key_id;
2097 		if (tsc)
2098 			memcpy(__entry->tsc, tsc, 6);
2099 	),
2100 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", key type: %d, key id: %d, tsc: %pm",
2101 		  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->key_type,
2102 		  __entry->key_id, __entry->tsc)
2103 );
2104 
2105 TRACE_EVENT(cfg80211_ready_on_channel,
2106 	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
2107 		 struct ieee80211_channel *chan,
2108 		 unsigned int duration),
2109 	TP_ARGS(wdev, cookie, chan, duration),
2110 	TP_STRUCT__entry(
2111 		WDEV_ENTRY
2112 		__field(u64, cookie)
2113 		CHAN_ENTRY
2114 		__field(unsigned int, duration)
2115 	),
2116 	TP_fast_assign(
2117 		WDEV_ASSIGN;
2118 		__entry->cookie = cookie;
2119 		CHAN_ASSIGN(chan);
2120 		__entry->duration = duration;
2121 	),
2122 	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
2123 		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
2124 		  __entry->duration)
2125 );
2126 
2127 TRACE_EVENT(cfg80211_ready_on_channel_expired,
2128 	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
2129 		 struct ieee80211_channel *chan),
2130 	TP_ARGS(wdev, cookie, chan),
2131 	TP_STRUCT__entry(
2132 		WDEV_ENTRY
2133 		__field(u64, cookie)
2134 		CHAN_ENTRY
2135 	),
2136 	TP_fast_assign(
2137 		WDEV_ASSIGN;
2138 		__entry->cookie = cookie;
2139 		CHAN_ASSIGN(chan);
2140 	),
2141 	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
2142 		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
2143 );
2144 
2145 TRACE_EVENT(cfg80211_new_sta,
2146 	TP_PROTO(struct net_device *netdev, const u8 *mac_addr,
2147 		 struct station_info *sinfo),
2148 	TP_ARGS(netdev, mac_addr, sinfo),
2149 	TP_STRUCT__entry(
2150 		NETDEV_ENTRY
2151 		MAC_ENTRY(mac_addr)
2152 		SINFO_ENTRY
2153 	),
2154 	TP_fast_assign(
2155 		NETDEV_ASSIGN;
2156 		MAC_ASSIGN(mac_addr, mac_addr);
2157 		SINFO_ASSIGN;
2158 	),
2159 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT,
2160 		  NETDEV_PR_ARG, MAC_PR_ARG(mac_addr))
2161 );
2162 
2163 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta,
2164 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
2165 	TP_ARGS(netdev, macaddr)
2166 );
2167 
2168 TRACE_EVENT(cfg80211_rx_mgmt,
2169 	TP_PROTO(struct wireless_dev *wdev, int freq, int sig_mbm),
2170 	TP_ARGS(wdev, freq, sig_mbm),
2171 	TP_STRUCT__entry(
2172 		WDEV_ENTRY
2173 		__field(int, freq)
2174 		__field(int, sig_mbm)
2175 	),
2176 	TP_fast_assign(
2177 		WDEV_ASSIGN;
2178 		__entry->freq = freq;
2179 		__entry->sig_mbm = sig_mbm;
2180 	),
2181 	TP_printk(WDEV_PR_FMT ", freq: %d, sig mbm: %d",
2182 		  WDEV_PR_ARG, __entry->freq, __entry->sig_mbm)
2183 );
2184 
2185 TRACE_EVENT(cfg80211_mgmt_tx_status,
2186 	TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
2187 	TP_ARGS(wdev, cookie, ack),
2188 	TP_STRUCT__entry(
2189 		WDEV_ENTRY
2190 		__field(u64, cookie)
2191 		__field(bool, ack)
2192 	),
2193 	TP_fast_assign(
2194 		WDEV_ASSIGN;
2195 		__entry->cookie = cookie;
2196 		__entry->ack = ack;
2197 	),
2198 	TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
2199 		  WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
2200 );
2201 
2202 TRACE_EVENT(cfg80211_cqm_rssi_notify,
2203 	TP_PROTO(struct net_device *netdev,
2204 		 enum nl80211_cqm_rssi_threshold_event rssi_event),
2205 	TP_ARGS(netdev, rssi_event),
2206 	TP_STRUCT__entry(
2207 		NETDEV_ENTRY
2208 		__field(enum nl80211_cqm_rssi_threshold_event, rssi_event)
2209 	),
2210 	TP_fast_assign(
2211 		NETDEV_ASSIGN;
2212 		__entry->rssi_event = rssi_event;
2213 	),
2214 	TP_printk(NETDEV_PR_FMT ", rssi event: %d",
2215 		  NETDEV_PR_ARG, __entry->rssi_event)
2216 );
2217 
2218 TRACE_EVENT(cfg80211_reg_can_beacon,
2219 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
2220 		 enum nl80211_iftype iftype),
2221 	TP_ARGS(wiphy, chandef, iftype),
2222 	TP_STRUCT__entry(
2223 		WIPHY_ENTRY
2224 		CHAN_DEF_ENTRY
2225 		__field(enum nl80211_iftype, iftype)
2226 	),
2227 	TP_fast_assign(
2228 		WIPHY_ASSIGN;
2229 		CHAN_DEF_ASSIGN(chandef);
2230 		__entry->iftype = iftype;
2231 	),
2232 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d",
2233 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype)
2234 );
2235 
2236 TRACE_EVENT(cfg80211_chandef_dfs_required,
2237 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
2238 	TP_ARGS(wiphy, chandef),
2239 	TP_STRUCT__entry(
2240 		WIPHY_ENTRY
2241 		CHAN_DEF_ENTRY
2242 	),
2243 	TP_fast_assign(
2244 		WIPHY_ASSIGN;
2245 		CHAN_DEF_ASSIGN(chandef);
2246 	),
2247 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
2248 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
2249 );
2250 
2251 TRACE_EVENT(cfg80211_ch_switch_notify,
2252 	TP_PROTO(struct net_device *netdev,
2253 		 struct cfg80211_chan_def *chandef),
2254 	TP_ARGS(netdev, chandef),
2255 	TP_STRUCT__entry(
2256 		NETDEV_ENTRY
2257 		CHAN_DEF_ENTRY
2258 	),
2259 	TP_fast_assign(
2260 		NETDEV_ASSIGN;
2261 		CHAN_DEF_ASSIGN(chandef);
2262 	),
2263 	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
2264 		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
2265 );
2266 
2267 TRACE_EVENT(cfg80211_radar_event,
2268 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
2269 	TP_ARGS(wiphy, chandef),
2270 	TP_STRUCT__entry(
2271 		WIPHY_ENTRY
2272 		CHAN_DEF_ENTRY
2273 	),
2274 	TP_fast_assign(
2275 		WIPHY_ASSIGN;
2276 		CHAN_DEF_ASSIGN(chandef);
2277 	),
2278 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
2279 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
2280 );
2281 
2282 TRACE_EVENT(cfg80211_cac_event,
2283 	TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt),
2284 	TP_ARGS(netdev, evt),
2285 	TP_STRUCT__entry(
2286 		NETDEV_ENTRY
2287 		__field(enum nl80211_radar_event, evt)
2288 	),
2289 	TP_fast_assign(
2290 		NETDEV_ASSIGN;
2291 		__entry->evt = evt;
2292 	),
2293 	TP_printk(NETDEV_PR_FMT ",  event: %d",
2294 		  NETDEV_PR_ARG, __entry->evt)
2295 );
2296 
2297 DECLARE_EVENT_CLASS(cfg80211_rx_evt,
2298 	TP_PROTO(struct net_device *netdev, const u8 *addr),
2299 	TP_ARGS(netdev, addr),
2300 	TP_STRUCT__entry(
2301 		NETDEV_ENTRY
2302 		MAC_ENTRY(addr)
2303 	),
2304 	TP_fast_assign(
2305 		NETDEV_ASSIGN;
2306 		MAC_ASSIGN(addr, addr);
2307 	),
2308 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT, NETDEV_PR_ARG, MAC_PR_ARG(addr))
2309 );
2310 
2311 DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_spurious_frame,
2312 	TP_PROTO(struct net_device *netdev, const u8 *addr),
2313 	TP_ARGS(netdev, addr)
2314 );
2315 
2316 DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_unexpected_4addr_frame,
2317 	TP_PROTO(struct net_device *netdev, const u8 *addr),
2318 	TP_ARGS(netdev, addr)
2319 );
2320 
2321 TRACE_EVENT(cfg80211_ibss_joined,
2322 	TP_PROTO(struct net_device *netdev, const u8 *bssid,
2323 		 struct ieee80211_channel *channel),
2324 	TP_ARGS(netdev, bssid, channel),
2325 	TP_STRUCT__entry(
2326 		NETDEV_ENTRY
2327 		MAC_ENTRY(bssid)
2328 		CHAN_ENTRY
2329 	),
2330 	TP_fast_assign(
2331 		NETDEV_ASSIGN;
2332 		MAC_ASSIGN(bssid, bssid);
2333 		CHAN_ASSIGN(channel);
2334 	),
2335 	TP_printk(NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", " CHAN_PR_FMT,
2336 		  NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
2337 );
2338 
2339 TRACE_EVENT(cfg80211_probe_status,
2340 	TP_PROTO(struct net_device *netdev, const u8 *addr, u64 cookie,
2341 		 bool acked),
2342 	TP_ARGS(netdev, addr, cookie, acked),
2343 	TP_STRUCT__entry(
2344 		NETDEV_ENTRY
2345 		MAC_ENTRY(addr)
2346 		__field(u64, cookie)
2347 		__field(bool, acked)
2348 	),
2349 	TP_fast_assign(
2350 		NETDEV_ASSIGN;
2351 		MAC_ASSIGN(addr, addr);
2352 		__entry->cookie = cookie;
2353 		__entry->acked = acked;
2354 	),
2355 	TP_printk(NETDEV_PR_FMT " addr:" MAC_PR_FMT ", cookie: %llu, acked: %s",
2356 		  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->cookie,
2357 		  BOOL_TO_STR(__entry->acked))
2358 );
2359 
2360 TRACE_EVENT(cfg80211_cqm_pktloss_notify,
2361 	TP_PROTO(struct net_device *netdev, const u8 *peer, u32 num_packets),
2362 	TP_ARGS(netdev, peer, num_packets),
2363 	TP_STRUCT__entry(
2364 		NETDEV_ENTRY
2365 		MAC_ENTRY(peer)
2366 		__field(u32, num_packets)
2367 	),
2368 	TP_fast_assign(
2369 		NETDEV_ASSIGN;
2370 		MAC_ASSIGN(peer, peer);
2371 		__entry->num_packets = num_packets;
2372 	),
2373 	TP_printk(NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", num of lost packets: %u",
2374 		  NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->num_packets)
2375 );
2376 
2377 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_gtk_rekey_notify,
2378 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
2379 	TP_ARGS(netdev, macaddr)
2380 );
2381 
2382 TRACE_EVENT(cfg80211_pmksa_candidate_notify,
2383 	TP_PROTO(struct net_device *netdev, int index, const u8 *bssid,
2384 		 bool preauth),
2385 	TP_ARGS(netdev, index, bssid, preauth),
2386 	TP_STRUCT__entry(
2387 		NETDEV_ENTRY
2388 		__field(int, index)
2389 		MAC_ENTRY(bssid)
2390 		__field(bool, preauth)
2391 	),
2392 	TP_fast_assign(
2393 		NETDEV_ASSIGN;
2394 		__entry->index = index;
2395 		MAC_ASSIGN(bssid, bssid);
2396 		__entry->preauth = preauth;
2397 	),
2398 	TP_printk(NETDEV_PR_FMT ", index:%d, bssid: " MAC_PR_FMT ", pre auth: %s",
2399 		  NETDEV_PR_ARG, __entry->index, MAC_PR_ARG(bssid),
2400 		  BOOL_TO_STR(__entry->preauth))
2401 );
2402 
2403 TRACE_EVENT(cfg80211_report_obss_beacon,
2404 	TP_PROTO(struct wiphy *wiphy, const u8 *frame, size_t len,
2405 		 int freq, int sig_dbm),
2406 	TP_ARGS(wiphy, frame, len, freq, sig_dbm),
2407 	TP_STRUCT__entry(
2408 		WIPHY_ENTRY
2409 		__field(int, freq)
2410 		__field(int, sig_dbm)
2411 	),
2412 	TP_fast_assign(
2413 		WIPHY_ASSIGN;
2414 		__entry->freq = freq;
2415 		__entry->sig_dbm = sig_dbm;
2416 	),
2417 	TP_printk(WIPHY_PR_FMT ", freq: %d, sig_dbm: %d",
2418 		  WIPHY_PR_ARG, __entry->freq, __entry->sig_dbm)
2419 );
2420 
2421 TRACE_EVENT(cfg80211_tdls_oper_request,
2422 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer,
2423 		 enum nl80211_tdls_operation oper, u16 reason_code),
2424 	TP_ARGS(wiphy, netdev, peer, oper, reason_code),
2425 	TP_STRUCT__entry(
2426 		WIPHY_ENTRY
2427 		NETDEV_ENTRY
2428 		MAC_ENTRY(peer)
2429 		__field(enum nl80211_tdls_operation, oper)
2430 		__field(u16, reason_code)
2431 	),
2432 	TP_fast_assign(
2433 		WIPHY_ASSIGN;
2434 		NETDEV_ASSIGN;
2435 		MAC_ASSIGN(peer, peer);
2436 		__entry->oper = oper;
2437 		__entry->reason_code = reason_code;
2438 	),
2439 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", oper: %d, reason_code %u",
2440 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper,
2441 		  __entry->reason_code)
2442 	);
2443 
2444 TRACE_EVENT(cfg80211_scan_done,
2445 	TP_PROTO(struct cfg80211_scan_request *request, bool aborted),
2446 	TP_ARGS(request, aborted),
2447 	TP_STRUCT__entry(
2448 		__field(u32, n_channels)
2449 		__dynamic_array(u8, ie, request ? request->ie_len : 0)
2450 		__array(u32, rates, IEEE80211_NUM_BANDS)
2451 		__field(u32, wdev_id)
2452 		MAC_ENTRY(wiphy_mac)
2453 		__field(bool, no_cck)
2454 		__field(bool, aborted)
2455 	),
2456 	TP_fast_assign(
2457 		if (request) {
2458 			memcpy(__get_dynamic_array(ie), request->ie,
2459 			       request->ie_len);
2460 			memcpy(__entry->rates, request->rates,
2461 			       IEEE80211_NUM_BANDS);
2462 			__entry->wdev_id = request->wdev ?
2463 					request->wdev->identifier : 0;
2464 			if (request->wiphy)
2465 				MAC_ASSIGN(wiphy_mac,
2466 					   request->wiphy->perm_addr);
2467 			__entry->no_cck = request->no_cck;
2468 		}
2469 		__entry->aborted = aborted;
2470 	),
2471 	TP_printk("aborted: %s", BOOL_TO_STR(__entry->aborted))
2472 );
2473 
2474 DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_results,
2475 	TP_PROTO(struct wiphy *wiphy),
2476 	TP_ARGS(wiphy)
2477 );
2478 
2479 DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_stopped,
2480 	TP_PROTO(struct wiphy *wiphy),
2481 	TP_ARGS(wiphy)
2482 );
2483 
2484 TRACE_EVENT(cfg80211_get_bss,
2485 	TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
2486 		 const u8 *bssid, const u8 *ssid, size_t ssid_len,
2487 		 u16 capa_mask, u16 capa_val),
2488 	TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, capa_mask, capa_val),
2489 	TP_STRUCT__entry(
2490 		WIPHY_ENTRY
2491 		CHAN_ENTRY
2492 		MAC_ENTRY(bssid)
2493 		__dynamic_array(u8, ssid, ssid_len)
2494 		__field(u16, capa_mask)
2495 		__field(u16, capa_val)
2496 	),
2497 	TP_fast_assign(
2498 		WIPHY_ASSIGN;
2499 		CHAN_ASSIGN(channel);
2500 		MAC_ASSIGN(bssid, bssid);
2501 		memcpy(__get_dynamic_array(ssid), ssid, ssid_len);
2502 		__entry->capa_mask = capa_mask;
2503 		__entry->capa_val = capa_val;
2504 	),
2505 	TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", " MAC_PR_FMT ", buf: %#.2x, "
2506 		  "capa_mask: %d, capa_val: %u", WIPHY_PR_ARG, CHAN_PR_ARG,
2507 		  MAC_PR_ARG(bssid), ((u8 *)__get_dynamic_array(ssid))[0],
2508 		  __entry->capa_mask, __entry->capa_val)
2509 );
2510 
2511 TRACE_EVENT(cfg80211_inform_bss_width_frame,
2512 	TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
2513 		 enum nl80211_bss_scan_width scan_width,
2514 		 struct ieee80211_mgmt *mgmt, size_t len,
2515 		 s32 signal),
2516 	TP_ARGS(wiphy, channel, scan_width, mgmt, len, signal),
2517 	TP_STRUCT__entry(
2518 		WIPHY_ENTRY
2519 		CHAN_ENTRY
2520 		__field(enum nl80211_bss_scan_width, scan_width)
2521 		__dynamic_array(u8, mgmt, len)
2522 		__field(s32, signal)
2523 	),
2524 	TP_fast_assign(
2525 		WIPHY_ASSIGN;
2526 		CHAN_ASSIGN(channel);
2527 		__entry->scan_width = scan_width;
2528 		if (mgmt)
2529 			memcpy(__get_dynamic_array(mgmt), mgmt, len);
2530 		__entry->signal = signal;
2531 	),
2532 	TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT "(scan_width: %d) signal: %d",
2533 		  WIPHY_PR_ARG, CHAN_PR_ARG, __entry->scan_width,
2534 		  __entry->signal)
2535 );
2536 
2537 DECLARE_EVENT_CLASS(cfg80211_bss_evt,
2538 	TP_PROTO(struct cfg80211_bss *pub),
2539 	TP_ARGS(pub),
2540 	TP_STRUCT__entry(
2541 		MAC_ENTRY(bssid)
2542 		CHAN_ENTRY
2543 	),
2544 	TP_fast_assign(
2545 		MAC_ASSIGN(bssid, pub->bssid);
2546 		CHAN_ASSIGN(pub->channel);
2547 	),
2548 	TP_printk(MAC_PR_FMT ", " CHAN_PR_FMT, MAC_PR_ARG(bssid), CHAN_PR_ARG)
2549 );
2550 
2551 DEFINE_EVENT(cfg80211_bss_evt, cfg80211_return_bss,
2552 	TP_PROTO(struct cfg80211_bss *pub),
2553 	TP_ARGS(pub)
2554 );
2555 
2556 TRACE_EVENT(cfg80211_return_uint,
2557 	TP_PROTO(unsigned int ret),
2558 	TP_ARGS(ret),
2559 	TP_STRUCT__entry(
2560 		__field(unsigned int, ret)
2561 	),
2562 	TP_fast_assign(
2563 		__entry->ret = ret;
2564 	),
2565 	TP_printk("ret: %d", __entry->ret)
2566 );
2567 
2568 TRACE_EVENT(cfg80211_return_u32,
2569 	TP_PROTO(u32 ret),
2570 	TP_ARGS(ret),
2571 	TP_STRUCT__entry(
2572 		__field(u32, ret)
2573 	),
2574 	TP_fast_assign(
2575 		__entry->ret = ret;
2576 	),
2577 	TP_printk("ret: %u", __entry->ret)
2578 );
2579 
2580 TRACE_EVENT(cfg80211_report_wowlan_wakeup,
2581 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2582 		 struct cfg80211_wowlan_wakeup *wakeup),
2583 	TP_ARGS(wiphy, wdev, wakeup),
2584 	TP_STRUCT__entry(
2585 		WIPHY_ENTRY
2586 		WDEV_ENTRY
2587 		__field(bool, non_wireless)
2588 		__field(bool, disconnect)
2589 		__field(bool, magic_pkt)
2590 		__field(bool, gtk_rekey_failure)
2591 		__field(bool, eap_identity_req)
2592 		__field(bool, four_way_handshake)
2593 		__field(bool, rfkill_release)
2594 		__field(s32, pattern_idx)
2595 		__field(u32, packet_len)
2596 		__dynamic_array(u8, packet,
2597 				wakeup ? wakeup->packet_present_len : 0)
2598 	),
2599 	TP_fast_assign(
2600 		WIPHY_ASSIGN;
2601 		WDEV_ASSIGN;
2602 		__entry->non_wireless = !wakeup;
2603 		__entry->disconnect = wakeup ? wakeup->disconnect : false;
2604 		__entry->magic_pkt = wakeup ? wakeup->magic_pkt : false;
2605 		__entry->gtk_rekey_failure = wakeup ? wakeup->gtk_rekey_failure : false;
2606 		__entry->eap_identity_req = wakeup ? wakeup->eap_identity_req : false;
2607 		__entry->four_way_handshake = wakeup ? wakeup->four_way_handshake : false;
2608 		__entry->rfkill_release = wakeup ? wakeup->rfkill_release : false;
2609 		__entry->pattern_idx = wakeup ? wakeup->pattern_idx : false;
2610 		__entry->packet_len = wakeup ? wakeup->packet_len : false;
2611 		if (wakeup && wakeup->packet && wakeup->packet_present_len)
2612 			memcpy(__get_dynamic_array(packet), wakeup->packet,
2613 			       wakeup->packet_present_len);
2614 	),
2615 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
2616 );
2617 
2618 TRACE_EVENT(cfg80211_ft_event,
2619 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2620 		 struct cfg80211_ft_event_params *ft_event),
2621 	TP_ARGS(wiphy, netdev, ft_event),
2622 	TP_STRUCT__entry(
2623 		WIPHY_ENTRY
2624 		NETDEV_ENTRY
2625 		__dynamic_array(u8, ies, ft_event->ies_len)
2626 		MAC_ENTRY(target_ap)
2627 		__dynamic_array(u8, ric_ies, ft_event->ric_ies_len)
2628 	),
2629 	TP_fast_assign(
2630 		WIPHY_ASSIGN;
2631 		NETDEV_ASSIGN;
2632 		if (ft_event->ies)
2633 			memcpy(__get_dynamic_array(ies), ft_event->ies,
2634 			       ft_event->ies_len);
2635 		MAC_ASSIGN(target_ap, ft_event->target_ap);
2636 		if (ft_event->ric_ies)
2637 			memcpy(__get_dynamic_array(ric_ies), ft_event->ric_ies,
2638 			       ft_event->ric_ies_len);
2639 	),
2640 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", target_ap: " MAC_PR_FMT,
2641 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
2642 );
2643 
2644 TRACE_EVENT(cfg80211_stop_iface,
2645 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2646 	TP_ARGS(wiphy, wdev),
2647 	TP_STRUCT__entry(
2648 		WIPHY_ENTRY
2649 		WDEV_ENTRY
2650 	),
2651 	TP_fast_assign(
2652 		WIPHY_ASSIGN;
2653 		WDEV_ASSIGN;
2654 	),
2655 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
2656 		  WIPHY_PR_ARG, WDEV_PR_ARG)
2657 );
2658 
2659 #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
2660 
2661 #undef TRACE_INCLUDE_PATH
2662 #define TRACE_INCLUDE_PATH .
2663 #undef TRACE_INCLUDE_FILE
2664 #define TRACE_INCLUDE_FILE trace
2665 #include <trace/define_trace.h>
2666