xref: /openbmc/linux/net/wireless/trace.h (revision d07479b2)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM cfg80211
4 
5 #if !defined(__RDEV_OPS_TRACE) || defined(TRACE_HEADER_MULTI_READ)
6 #define __RDEV_OPS_TRACE
7 
8 #include <linux/tracepoint.h>
9 
10 #include <linux/rtnetlink.h>
11 #include <linux/etherdevice.h>
12 #include <net/cfg80211.h>
13 #include "core.h"
14 
15 #define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)
16 #define MAC_ASSIGN(entry_mac, given_mac) do {			     \
17 	if (given_mac)						     \
18 		memcpy(__entry->entry_mac, given_mac, ETH_ALEN);     \
19 	else							     \
20 		eth_zero_addr(__entry->entry_mac);		     \
21 	} while (0)
22 #define MAC_PR_FMT "%pM"
23 #define MAC_PR_ARG(entry_mac) (__entry->entry_mac)
24 
25 #define MAXNAME		32
26 #define WIPHY_ENTRY	__array(char, wiphy_name, 32)
27 #define WIPHY_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(wiphy), MAXNAME)
28 #define WIPHY_PR_FMT	"%s"
29 #define WIPHY_PR_ARG	__entry->wiphy_name
30 
31 #define WDEV_ENTRY	__field(u32, id)
32 #define WDEV_ASSIGN	(__entry->id) = (!IS_ERR_OR_NULL(wdev)	\
33 					 ? wdev->identifier : 0)
34 #define WDEV_PR_FMT	"wdev(%u)"
35 #define WDEV_PR_ARG	(__entry->id)
36 
37 #define NETDEV_ENTRY	__array(char, name, IFNAMSIZ) \
38 			__field(int, ifindex)
39 #define NETDEV_ASSIGN					       \
40 	do {						       \
41 		memcpy(__entry->name, netdev->name, IFNAMSIZ); \
42 		(__entry->ifindex) = (netdev->ifindex);	       \
43 	} while (0)
44 #define NETDEV_PR_FMT	"netdev:%s(%d)"
45 #define NETDEV_PR_ARG	__entry->name, __entry->ifindex
46 
47 #define MESH_CFG_ENTRY __field(u16, dot11MeshRetryTimeout)		   \
48 		       __field(u16, dot11MeshConfirmTimeout)		   \
49 		       __field(u16, dot11MeshHoldingTimeout)		   \
50 		       __field(u16, dot11MeshMaxPeerLinks)		   \
51 		       __field(u8, dot11MeshMaxRetries)			   \
52 		       __field(u8, dot11MeshTTL)			   \
53 		       __field(u8, element_ttl)				   \
54 		       __field(bool, auto_open_plinks)			   \
55 		       __field(u32, dot11MeshNbrOffsetMaxNeighbor)	   \
56 		       __field(u8, dot11MeshHWMPmaxPREQretries)		   \
57 		       __field(u32, path_refresh_time)			   \
58 		       __field(u32, dot11MeshHWMPactivePathTimeout)	   \
59 		       __field(u16, min_discovery_timeout)		   \
60 		       __field(u16, dot11MeshHWMPpreqMinInterval)	   \
61 		       __field(u16, dot11MeshHWMPperrMinInterval)	   \
62 		       __field(u16, dot11MeshHWMPnetDiameterTraversalTime) \
63 		       __field(u8, dot11MeshHWMPRootMode)		   \
64 		       __field(u16, dot11MeshHWMPRannInterval)		   \
65 		       __field(bool, dot11MeshGateAnnouncementProtocol)	   \
66 		       __field(bool, dot11MeshForwarding)		   \
67 		       __field(s32, rssi_threshold)			   \
68 		       __field(u16, ht_opmode)				   \
69 		       __field(u32, dot11MeshHWMPactivePathToRootTimeout)  \
70 		       __field(u16, dot11MeshHWMProotInterval)		   \
71 		       __field(u16, dot11MeshHWMPconfirmationInterval)	   \
72 		       __field(bool, dot11MeshNolearn)
73 #define MESH_CFG_ASSIGN							      \
74 	do {								      \
75 		__entry->dot11MeshRetryTimeout = conf->dot11MeshRetryTimeout; \
76 		__entry->dot11MeshConfirmTimeout =			      \
77 				conf->dot11MeshConfirmTimeout;		      \
78 		__entry->dot11MeshHoldingTimeout =			      \
79 				conf->dot11MeshHoldingTimeout;		      \
80 		__entry->dot11MeshMaxPeerLinks = conf->dot11MeshMaxPeerLinks; \
81 		__entry->dot11MeshMaxRetries = conf->dot11MeshMaxRetries;     \
82 		__entry->dot11MeshTTL = conf->dot11MeshTTL;		      \
83 		__entry->element_ttl = conf->element_ttl;		      \
84 		__entry->auto_open_plinks = conf->auto_open_plinks;	      \
85 		__entry->dot11MeshNbrOffsetMaxNeighbor =		      \
86 				conf->dot11MeshNbrOffsetMaxNeighbor;	      \
87 		__entry->dot11MeshHWMPmaxPREQretries =			      \
88 				conf->dot11MeshHWMPmaxPREQretries;	      \
89 		__entry->path_refresh_time = conf->path_refresh_time;	      \
90 		__entry->dot11MeshHWMPactivePathTimeout =		      \
91 				conf->dot11MeshHWMPactivePathTimeout;	      \
92 		__entry->min_discovery_timeout = conf->min_discovery_timeout; \
93 		__entry->dot11MeshHWMPpreqMinInterval =			      \
94 				conf->dot11MeshHWMPpreqMinInterval;	      \
95 		__entry->dot11MeshHWMPperrMinInterval =			      \
96 				conf->dot11MeshHWMPperrMinInterval;	      \
97 		__entry->dot11MeshHWMPnetDiameterTraversalTime =	      \
98 				conf->dot11MeshHWMPnetDiameterTraversalTime;  \
99 		__entry->dot11MeshHWMPRootMode = conf->dot11MeshHWMPRootMode; \
100 		__entry->dot11MeshHWMPRannInterval =			      \
101 				conf->dot11MeshHWMPRannInterval;	      \
102 		__entry->dot11MeshGateAnnouncementProtocol =		      \
103 				conf->dot11MeshGateAnnouncementProtocol;      \
104 		__entry->dot11MeshForwarding = conf->dot11MeshForwarding;     \
105 		__entry->rssi_threshold = conf->rssi_threshold;		      \
106 		__entry->ht_opmode = conf->ht_opmode;			      \
107 		__entry->dot11MeshHWMPactivePathToRootTimeout =		      \
108 				conf->dot11MeshHWMPactivePathToRootTimeout;   \
109 		__entry->dot11MeshHWMProotInterval =			      \
110 				conf->dot11MeshHWMProotInterval;	      \
111 		__entry->dot11MeshHWMPconfirmationInterval =		      \
112 				conf->dot11MeshHWMPconfirmationInterval;      \
113 		__entry->dot11MeshNolearn = conf->dot11MeshNolearn;	      \
114 	} while (0)
115 
116 #define CHAN_ENTRY __field(enum nl80211_band, band) \
117 		   __field(u32, center_freq)		\
118 		   __field(u16, freq_offset)
119 #define CHAN_ASSIGN(chan)					  \
120 	do {							  \
121 		if (chan) {					  \
122 			__entry->band = chan->band;		  \
123 			__entry->center_freq = chan->center_freq; \
124 			__entry->freq_offset = chan->freq_offset; \
125 		} else {					  \
126 			__entry->band = 0;			  \
127 			__entry->center_freq = 0;		  \
128 			__entry->freq_offset = 0;		  \
129 		}						  \
130 	} while (0)
131 #define CHAN_PR_FMT "band: %d, freq: %u.%03u"
132 #define CHAN_PR_ARG __entry->band, __entry->center_freq, __entry->freq_offset
133 
134 #define CHAN_DEF_ENTRY __field(enum nl80211_band, band)		\
135 		       __field(u32, control_freq)			\
136 		       __field(u32, freq_offset)			\
137 		       __field(u32, width)				\
138 		       __field(u32, center_freq1)			\
139 		       __field(u32, freq1_offset)			\
140 		       __field(u32, center_freq2)
141 #define CHAN_DEF_ASSIGN(chandef)					\
142 	do {								\
143 		if ((chandef) && (chandef)->chan) {			\
144 			__entry->band = (chandef)->chan->band;		\
145 			__entry->control_freq =				\
146 				(chandef)->chan->center_freq;		\
147 			__entry->freq_offset =				\
148 				(chandef)->chan->freq_offset;		\
149 			__entry->width = (chandef)->width;		\
150 			__entry->center_freq1 = (chandef)->center_freq1;\
151 			__entry->freq1_offset = (chandef)->freq1_offset;\
152 			__entry->center_freq2 = (chandef)->center_freq2;\
153 		} else {						\
154 			__entry->band = 0;				\
155 			__entry->control_freq = 0;			\
156 			__entry->freq_offset = 0;			\
157 			__entry->width = 0;				\
158 			__entry->center_freq1 = 0;			\
159 			__entry->freq1_offset = 0;			\
160 			__entry->center_freq2 = 0;			\
161 		}							\
162 	} while (0)
163 #define CHAN_DEF_PR_FMT							\
164 	"band: %d, control freq: %u.%03u, width: %d, cf1: %u.%03u, cf2: %u"
165 #define CHAN_DEF_PR_ARG __entry->band, __entry->control_freq,		\
166 			__entry->freq_offset, __entry->width,		\
167 			__entry->center_freq1, __entry->freq1_offset,	\
168 			__entry->center_freq2
169 
170 #define FILS_AAD_ASSIGN(fa)						\
171 	do {								\
172 		if (fa) {						\
173 			ether_addr_copy(__entry->macaddr, fa->macaddr);	\
174 			__entry->kek_len = fa->kek_len;			\
175 		} else {						\
176 			eth_zero_addr(__entry->macaddr);		\
177 			__entry->kek_len = 0;				\
178 		}							\
179 	} while (0)
180 #define FILS_AAD_PR_FMT							\
181 	"macaddr: %pM, kek_len: %d"
182 
183 #define SINFO_ENTRY __field(int, generation)	    \
184 		    __field(u32, connected_time)    \
185 		    __field(u32, inactive_time)	    \
186 		    __field(u32, rx_bytes)	    \
187 		    __field(u32, tx_bytes)	    \
188 		    __field(u32, rx_packets)	    \
189 		    __field(u32, tx_packets)	    \
190 		    __field(u32, tx_retries)	    \
191 		    __field(u32, tx_failed)	    \
192 		    __field(u32, rx_dropped_misc)   \
193 		    __field(u32, beacon_loss_count) \
194 		    __field(u16, llid)		    \
195 		    __field(u16, plid)		    \
196 		    __field(u8, plink_state)
197 #define SINFO_ASSIGN						       \
198 	do {							       \
199 		__entry->generation = sinfo->generation;	       \
200 		__entry->connected_time = sinfo->connected_time;       \
201 		__entry->inactive_time = sinfo->inactive_time;	       \
202 		__entry->rx_bytes = sinfo->rx_bytes;		       \
203 		__entry->tx_bytes = sinfo->tx_bytes;		       \
204 		__entry->rx_packets = sinfo->rx_packets;	       \
205 		__entry->tx_packets = sinfo->tx_packets;	       \
206 		__entry->tx_retries = sinfo->tx_retries;	       \
207 		__entry->tx_failed = sinfo->tx_failed;		       \
208 		__entry->rx_dropped_misc = sinfo->rx_dropped_misc;     \
209 		__entry->beacon_loss_count = sinfo->beacon_loss_count; \
210 		__entry->llid = sinfo->llid;			       \
211 		__entry->plid = sinfo->plid;			       \
212 		__entry->plink_state = sinfo->plink_state;	       \
213 	} while (0)
214 
215 #define BOOL_TO_STR(bo) (bo) ? "true" : "false"
216 
217 #define QOS_MAP_ENTRY __field(u8, num_des)			\
218 		      __array(u8, dscp_exception,		\
219 			      2 * IEEE80211_QOS_MAP_MAX_EX)	\
220 		      __array(u8, up, IEEE80211_QOS_MAP_LEN_MIN)
221 #define QOS_MAP_ASSIGN(qos_map)					\
222 	do {							\
223 		if ((qos_map)) {				\
224 			__entry->num_des = (qos_map)->num_des;	\
225 			memcpy(__entry->dscp_exception,		\
226 			       &(qos_map)->dscp_exception,	\
227 			       2 * IEEE80211_QOS_MAP_MAX_EX);	\
228 			memcpy(__entry->up, &(qos_map)->up,	\
229 			       IEEE80211_QOS_MAP_LEN_MIN);	\
230 		} else {					\
231 			__entry->num_des = 0;			\
232 			memset(__entry->dscp_exception, 0,	\
233 			       2 * IEEE80211_QOS_MAP_MAX_EX);	\
234 			memset(__entry->up, 0,			\
235 			       IEEE80211_QOS_MAP_LEN_MIN);	\
236 		}						\
237 	} while (0)
238 
239 /*************************************************************
240  *			rdev->ops traces		     *
241  *************************************************************/
242 
243 TRACE_EVENT(rdev_suspend,
244 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_wowlan *wow),
245 	TP_ARGS(wiphy, wow),
246 	TP_STRUCT__entry(
247 		WIPHY_ENTRY
248 		__field(bool, any)
249 		__field(bool, disconnect)
250 		__field(bool, magic_pkt)
251 		__field(bool, gtk_rekey_failure)
252 		__field(bool, eap_identity_req)
253 		__field(bool, four_way_handshake)
254 		__field(bool, rfkill_release)
255 		__field(bool, valid_wow)
256 	),
257 	TP_fast_assign(
258 		WIPHY_ASSIGN;
259 		if (wow) {
260 			__entry->any = wow->any;
261 			__entry->disconnect = wow->disconnect;
262 			__entry->magic_pkt = wow->magic_pkt;
263 			__entry->gtk_rekey_failure = wow->gtk_rekey_failure;
264 			__entry->eap_identity_req = wow->eap_identity_req;
265 			__entry->four_way_handshake = wow->four_way_handshake;
266 			__entry->rfkill_release = wow->rfkill_release;
267 			__entry->valid_wow = true;
268 		} else {
269 			__entry->valid_wow = false;
270 		}
271 	),
272 	TP_printk(WIPHY_PR_FMT ", wow%s - any: %d, disconnect: %d, "
273 		  "magic pkt: %d, gtk rekey failure: %d, eap identify req: %d, "
274 		  "four way handshake: %d, rfkill release: %d.",
275 		  WIPHY_PR_ARG, __entry->valid_wow ? "" : "(Not configured!)",
276 		  __entry->any, __entry->disconnect, __entry->magic_pkt,
277 		  __entry->gtk_rekey_failure, __entry->eap_identity_req,
278 		  __entry->four_way_handshake, __entry->rfkill_release)
279 );
280 
281 TRACE_EVENT(rdev_return_int,
282 	TP_PROTO(struct wiphy *wiphy, int ret),
283 	TP_ARGS(wiphy, ret),
284 	TP_STRUCT__entry(
285 		WIPHY_ENTRY
286 		__field(int, ret)
287 	),
288 	TP_fast_assign(
289 		WIPHY_ASSIGN;
290 		__entry->ret = ret;
291 	),
292 	TP_printk(WIPHY_PR_FMT ", returned: %d", WIPHY_PR_ARG, __entry->ret)
293 );
294 
295 TRACE_EVENT(rdev_scan,
296 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_scan_request *request),
297 	TP_ARGS(wiphy, request),
298 	TP_STRUCT__entry(
299 		WIPHY_ENTRY
300 	),
301 	TP_fast_assign(
302 		WIPHY_ASSIGN;
303 	),
304 	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
305 );
306 
307 DECLARE_EVENT_CLASS(wiphy_only_evt,
308 	TP_PROTO(struct wiphy *wiphy),
309 	TP_ARGS(wiphy),
310 	TP_STRUCT__entry(
311 		WIPHY_ENTRY
312 	),
313 	TP_fast_assign(
314 		WIPHY_ASSIGN;
315 	),
316 	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
317 );
318 
319 DEFINE_EVENT(wiphy_only_evt, rdev_resume,
320 	TP_PROTO(struct wiphy *wiphy),
321 	TP_ARGS(wiphy)
322 );
323 
324 DEFINE_EVENT(wiphy_only_evt, rdev_return_void,
325 	TP_PROTO(struct wiphy *wiphy),
326 	TP_ARGS(wiphy)
327 );
328 
329 DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
330 	TP_PROTO(struct wiphy *wiphy),
331 	TP_ARGS(wiphy)
332 );
333 
334 DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,
335 	TP_PROTO(struct wiphy *wiphy),
336 	TP_ARGS(wiphy)
337 );
338 
339 DECLARE_EVENT_CLASS(wiphy_enabled_evt,
340 	TP_PROTO(struct wiphy *wiphy, bool enabled),
341 	TP_ARGS(wiphy, enabled),
342 	TP_STRUCT__entry(
343 		WIPHY_ENTRY
344 		__field(bool, enabled)
345 	),
346 	TP_fast_assign(
347 		WIPHY_ASSIGN;
348 		__entry->enabled = enabled;
349 	),
350 	TP_printk(WIPHY_PR_FMT ", %senabled ",
351 		  WIPHY_PR_ARG, __entry->enabled ? "" : "not ")
352 );
353 
354 DEFINE_EVENT(wiphy_enabled_evt, rdev_set_wakeup,
355 	TP_PROTO(struct wiphy *wiphy, bool enabled),
356 	TP_ARGS(wiphy, enabled)
357 );
358 
359 TRACE_EVENT(rdev_add_virtual_intf,
360 	TP_PROTO(struct wiphy *wiphy, char *name, enum nl80211_iftype type),
361 	TP_ARGS(wiphy, name, type),
362 	TP_STRUCT__entry(
363 		WIPHY_ENTRY
364 		__string(vir_intf_name, name ? name : "<noname>")
365 		__field(enum nl80211_iftype, type)
366 	),
367 	TP_fast_assign(
368 		WIPHY_ASSIGN;
369 		__assign_str(vir_intf_name, name ? name : "<noname>");
370 		__entry->type = type;
371 	),
372 	TP_printk(WIPHY_PR_FMT ", virtual intf name: %s, type: %d",
373 		  WIPHY_PR_ARG, __get_str(vir_intf_name), __entry->type)
374 );
375 
376 DECLARE_EVENT_CLASS(wiphy_wdev_evt,
377 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
378 	TP_ARGS(wiphy, wdev),
379 	TP_STRUCT__entry(
380 		WIPHY_ENTRY
381 		WDEV_ENTRY
382 	),
383 	TP_fast_assign(
384 		WIPHY_ASSIGN;
385 		WDEV_ASSIGN;
386 	),
387 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
388 );
389 
390 DECLARE_EVENT_CLASS(wiphy_wdev_cookie_evt,
391 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
392 	TP_ARGS(wiphy, wdev, cookie),
393 	TP_STRUCT__entry(
394 		WIPHY_ENTRY
395 		WDEV_ENTRY
396 		__field(u64, cookie)
397 	),
398 	TP_fast_assign(
399 		WIPHY_ASSIGN;
400 		WDEV_ASSIGN;
401 		__entry->cookie = cookie;
402 	),
403 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %lld",
404 		  WIPHY_PR_ARG, WDEV_PR_ARG,
405 		  (unsigned long long)__entry->cookie)
406 );
407 
408 DEFINE_EVENT(wiphy_wdev_evt, rdev_return_wdev,
409 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
410 	TP_ARGS(wiphy, wdev)
411 );
412 
413 DEFINE_EVENT(wiphy_wdev_evt, rdev_del_virtual_intf,
414 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
415 	TP_ARGS(wiphy, wdev)
416 );
417 
418 TRACE_EVENT(rdev_change_virtual_intf,
419 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
420 		 enum nl80211_iftype type),
421 	TP_ARGS(wiphy, netdev, type),
422 	TP_STRUCT__entry(
423 		WIPHY_ENTRY
424 		NETDEV_ENTRY
425 		__field(enum nl80211_iftype, type)
426 	),
427 	TP_fast_assign(
428 		WIPHY_ASSIGN;
429 		NETDEV_ASSIGN;
430 		__entry->type = type;
431 	),
432 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", type: %d",
433 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->type)
434 );
435 
436 DECLARE_EVENT_CLASS(key_handle,
437 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
438 		 bool pairwise, const u8 *mac_addr),
439 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr),
440 	TP_STRUCT__entry(
441 		WIPHY_ENTRY
442 		NETDEV_ENTRY
443 		MAC_ENTRY(mac_addr)
444 		__field(u8, key_index)
445 		__field(bool, pairwise)
446 	),
447 	TP_fast_assign(
448 		WIPHY_ASSIGN;
449 		NETDEV_ASSIGN;
450 		MAC_ASSIGN(mac_addr, mac_addr);
451 		__entry->key_index = key_index;
452 		__entry->pairwise = pairwise;
453 	),
454 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key_index: %u, pairwise: %s, mac addr: " MAC_PR_FMT,
455 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
456 		  BOOL_TO_STR(__entry->pairwise), MAC_PR_ARG(mac_addr))
457 );
458 
459 DEFINE_EVENT(key_handle, rdev_get_key,
460 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
461 		 bool pairwise, const u8 *mac_addr),
462 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
463 );
464 
465 DEFINE_EVENT(key_handle, rdev_del_key,
466 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
467 		 bool pairwise, const u8 *mac_addr),
468 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
469 );
470 
471 TRACE_EVENT(rdev_add_key,
472 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
473 		 bool pairwise, const u8 *mac_addr, u8 mode),
474 	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr, mode),
475 	TP_STRUCT__entry(
476 		WIPHY_ENTRY
477 		NETDEV_ENTRY
478 		MAC_ENTRY(mac_addr)
479 		__field(u8, key_index)
480 		__field(bool, pairwise)
481 		__field(u8, mode)
482 	),
483 	TP_fast_assign(
484 		WIPHY_ASSIGN;
485 		NETDEV_ASSIGN;
486 		MAC_ASSIGN(mac_addr, mac_addr);
487 		__entry->key_index = key_index;
488 		__entry->pairwise = pairwise;
489 		__entry->mode = mode;
490 	),
491 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key_index: %u, "
492 		  "mode: %u, pairwise: %s, mac addr: " MAC_PR_FMT,
493 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
494 		  __entry->mode, BOOL_TO_STR(__entry->pairwise),
495 		  MAC_PR_ARG(mac_addr))
496 );
497 
498 TRACE_EVENT(rdev_set_default_key,
499 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
500 		 bool unicast, bool multicast),
501 	TP_ARGS(wiphy, netdev, key_index, unicast, multicast),
502 	TP_STRUCT__entry(
503 		WIPHY_ENTRY
504 		NETDEV_ENTRY
505 		__field(u8, key_index)
506 		__field(bool, unicast)
507 		__field(bool, multicast)
508 	),
509 	TP_fast_assign(
510 		WIPHY_ASSIGN;
511 		NETDEV_ASSIGN;
512 		__entry->key_index = key_index;
513 		__entry->unicast = unicast;
514 		__entry->multicast = multicast;
515 	),
516 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u, unicast: %s, multicast: %s",
517 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
518 		  BOOL_TO_STR(__entry->unicast),
519 		  BOOL_TO_STR(__entry->multicast))
520 );
521 
522 TRACE_EVENT(rdev_set_default_mgmt_key,
523 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index),
524 	TP_ARGS(wiphy, netdev, key_index),
525 	TP_STRUCT__entry(
526 		WIPHY_ENTRY
527 		NETDEV_ENTRY
528 		__field(u8, key_index)
529 	),
530 	TP_fast_assign(
531 		WIPHY_ASSIGN;
532 		NETDEV_ASSIGN;
533 		__entry->key_index = key_index;
534 	),
535 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u",
536 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index)
537 );
538 
539 TRACE_EVENT(rdev_set_default_beacon_key,
540 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index),
541 	TP_ARGS(wiphy, netdev, key_index),
542 	TP_STRUCT__entry(
543 		WIPHY_ENTRY
544 		NETDEV_ENTRY
545 		__field(u8, key_index)
546 	),
547 	TP_fast_assign(
548 		WIPHY_ASSIGN;
549 		NETDEV_ASSIGN;
550 		__entry->key_index = key_index;
551 	),
552 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u",
553 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index)
554 );
555 
556 TRACE_EVENT(rdev_start_ap,
557 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
558 		 struct cfg80211_ap_settings *settings),
559 	TP_ARGS(wiphy, netdev, settings),
560 	TP_STRUCT__entry(
561 		WIPHY_ENTRY
562 		NETDEV_ENTRY
563 		CHAN_DEF_ENTRY
564 		__field(int, beacon_interval)
565 		__field(int, dtim_period)
566 		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
567 		__field(enum nl80211_hidden_ssid, hidden_ssid)
568 		__field(u32, wpa_ver)
569 		__field(bool, privacy)
570 		__field(enum nl80211_auth_type, auth_type)
571 		__field(int, inactivity_timeout)
572 		__field(unsigned int, link_id)
573 	),
574 	TP_fast_assign(
575 		WIPHY_ASSIGN;
576 		NETDEV_ASSIGN;
577 		CHAN_DEF_ASSIGN(&settings->chandef);
578 		__entry->beacon_interval = settings->beacon_interval;
579 		__entry->dtim_period = settings->dtim_period;
580 		__entry->hidden_ssid = settings->hidden_ssid;
581 		__entry->wpa_ver = settings->crypto.wpa_versions;
582 		__entry->privacy = settings->privacy;
583 		__entry->auth_type = settings->auth_type;
584 		__entry->inactivity_timeout = settings->inactivity_timeout;
585 		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
586 		memcpy(__entry->ssid, settings->ssid, settings->ssid_len);
587 		__entry->link_id = settings->beacon.link_id;
588 	),
589 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", AP settings - ssid: %s, "
590 		  CHAN_DEF_PR_FMT ", beacon interval: %d, dtim period: %d, "
591 		  "hidden ssid: %d, wpa versions: %u, privacy: %s, "
592 		  "auth type: %d, inactivity timeout: %d, link_id: %d",
593 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_DEF_PR_ARG,
594 		  __entry->beacon_interval, __entry->dtim_period,
595 		  __entry->hidden_ssid, __entry->wpa_ver,
596 		  BOOL_TO_STR(__entry->privacy), __entry->auth_type,
597 		  __entry->inactivity_timeout, __entry->link_id)
598 );
599 
600 TRACE_EVENT(rdev_change_beacon,
601 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
602 		 struct cfg80211_beacon_data *info),
603 	TP_ARGS(wiphy, netdev, info),
604 	TP_STRUCT__entry(
605 		WIPHY_ENTRY
606 		NETDEV_ENTRY
607 		__field(int, link_id)
608 		__dynamic_array(u8, head, info ? info->head_len : 0)
609 		__dynamic_array(u8, tail, info ? info->tail_len : 0)
610 		__dynamic_array(u8, beacon_ies, info ? info->beacon_ies_len : 0)
611 		__dynamic_array(u8, proberesp_ies,
612 				info ? info->proberesp_ies_len : 0)
613 		__dynamic_array(u8, assocresp_ies,
614 				info ? info->assocresp_ies_len : 0)
615 		__dynamic_array(u8, probe_resp, info ? info->probe_resp_len : 0)
616 	),
617 	TP_fast_assign(
618 		WIPHY_ASSIGN;
619 		NETDEV_ASSIGN;
620 		if (info) {
621 			__entry->link_id = info->link_id;
622 			if (info->head)
623 				memcpy(__get_dynamic_array(head), info->head,
624 				       info->head_len);
625 			if (info->tail)
626 				memcpy(__get_dynamic_array(tail), info->tail,
627 				       info->tail_len);
628 			if (info->beacon_ies)
629 				memcpy(__get_dynamic_array(beacon_ies),
630 				       info->beacon_ies, info->beacon_ies_len);
631 			if (info->proberesp_ies)
632 				memcpy(__get_dynamic_array(proberesp_ies),
633 				       info->proberesp_ies,
634 				       info->proberesp_ies_len);
635 			if (info->assocresp_ies)
636 				memcpy(__get_dynamic_array(assocresp_ies),
637 				       info->assocresp_ies,
638 				       info->assocresp_ies_len);
639 			if (info->probe_resp)
640 				memcpy(__get_dynamic_array(probe_resp),
641 				       info->probe_resp, info->probe_resp_len);
642 		} else {
643 			__entry->link_id = -1;
644 		}
645 	),
646 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id:%d",
647 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id)
648 );
649 
650 TRACE_EVENT(rdev_stop_ap,
651 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
652 		 unsigned int link_id),
653 	TP_ARGS(wiphy, netdev, link_id),
654 	TP_STRUCT__entry(
655 		WIPHY_ENTRY
656 		NETDEV_ENTRY
657 		__field(unsigned int, link_id)
658 	),
659 	TP_fast_assign(
660 		WIPHY_ASSIGN;
661 		NETDEV_ASSIGN;
662 		__entry->link_id = link_id;
663 	),
664 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d",
665 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id)
666 );
667 
668 DECLARE_EVENT_CLASS(wiphy_netdev_evt,
669 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
670 	TP_ARGS(wiphy, netdev),
671 	TP_STRUCT__entry(
672 		WIPHY_ENTRY
673 		NETDEV_ENTRY
674 	),
675 	TP_fast_assign(
676 		WIPHY_ASSIGN;
677 		NETDEV_ASSIGN;
678 	),
679 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG)
680 );
681 
682 DEFINE_EVENT(wiphy_netdev_evt, rdev_set_rekey_data,
683 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
684 	TP_ARGS(wiphy, netdev)
685 );
686 
687 DEFINE_EVENT(wiphy_netdev_evt, rdev_get_mesh_config,
688 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
689 	TP_ARGS(wiphy, netdev)
690 );
691 
692 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_mesh,
693 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
694 	TP_ARGS(wiphy, netdev)
695 );
696 
697 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ibss,
698 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
699 	TP_ARGS(wiphy, netdev)
700 );
701 
702 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ocb,
703 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
704 	TP_ARGS(wiphy, netdev)
705 );
706 
707 DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa,
708 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
709 	TP_ARGS(wiphy, netdev)
710 );
711 
712 DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac,
713 	     TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
714 	     TP_ARGS(wiphy, netdev)
715 );
716 
717 DECLARE_EVENT_CLASS(station_add_change,
718 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
719 		 struct station_parameters *params),
720 	TP_ARGS(wiphy, netdev, mac, params),
721 	TP_STRUCT__entry(
722 		WIPHY_ENTRY
723 		NETDEV_ENTRY
724 		MAC_ENTRY(sta_mac)
725 		__field(u32, sta_flags_mask)
726 		__field(u32, sta_flags_set)
727 		__field(u32, sta_modify_mask)
728 		__field(int, listen_interval)
729 		__field(u16, capability)
730 		__field(u16, aid)
731 		__field(u8, plink_action)
732 		__field(u8, plink_state)
733 		__field(u8, uapsd_queues)
734 		__field(u8, max_sp)
735 		__field(u8, opmode_notif)
736 		__field(bool, opmode_notif_used)
737 		__array(u8, ht_capa, (int)sizeof(struct ieee80211_ht_cap))
738 		__array(u8, vht_capa, (int)sizeof(struct ieee80211_vht_cap))
739 		__array(char, vlan, IFNAMSIZ)
740 		__dynamic_array(u8, supported_rates,
741 				params->link_sta_params.supported_rates_len)
742 		__dynamic_array(u8, ext_capab, params->ext_capab_len)
743 		__dynamic_array(u8, supported_channels,
744 				params->supported_channels_len)
745 		__dynamic_array(u8, supported_oper_classes,
746 				params->supported_oper_classes_len)
747 	),
748 	TP_fast_assign(
749 		WIPHY_ASSIGN;
750 		NETDEV_ASSIGN;
751 		MAC_ASSIGN(sta_mac, mac);
752 		__entry->sta_flags_mask = params->sta_flags_mask;
753 		__entry->sta_flags_set = params->sta_flags_set;
754 		__entry->sta_modify_mask = params->sta_modify_mask;
755 		__entry->listen_interval = params->listen_interval;
756 		__entry->aid = params->aid;
757 		__entry->plink_action = params->plink_action;
758 		__entry->plink_state = params->plink_state;
759 		__entry->uapsd_queues = params->uapsd_queues;
760 		memset(__entry->ht_capa, 0, sizeof(struct ieee80211_ht_cap));
761 		if (params->link_sta_params.ht_capa)
762 			memcpy(__entry->ht_capa,
763 			       params->link_sta_params.ht_capa,
764 			       sizeof(struct ieee80211_ht_cap));
765 		memset(__entry->vht_capa, 0, sizeof(struct ieee80211_vht_cap));
766 		if (params->link_sta_params.vht_capa)
767 			memcpy(__entry->vht_capa,
768 			       params->link_sta_params.vht_capa,
769 			       sizeof(struct ieee80211_vht_cap));
770 		memset(__entry->vlan, 0, sizeof(__entry->vlan));
771 		if (params->vlan)
772 			memcpy(__entry->vlan, params->vlan->name, IFNAMSIZ);
773 		if (params->link_sta_params.supported_rates &&
774 		    params->link_sta_params.supported_rates_len)
775 			memcpy(__get_dynamic_array(supported_rates),
776 			       params->link_sta_params.supported_rates,
777 			       params->link_sta_params.supported_rates_len);
778 		if (params->ext_capab && params->ext_capab_len)
779 			memcpy(__get_dynamic_array(ext_capab),
780 			       params->ext_capab,
781 			       params->ext_capab_len);
782 		if (params->supported_channels &&
783 		    params->supported_channels_len)
784 			memcpy(__get_dynamic_array(supported_channels),
785 			       params->supported_channels,
786 			       params->supported_channels_len);
787 		if (params->supported_oper_classes &&
788 		    params->supported_oper_classes_len)
789 			memcpy(__get_dynamic_array(supported_oper_classes),
790 			       params->supported_oper_classes,
791 			       params->supported_oper_classes_len);
792 		__entry->max_sp = params->max_sp;
793 		__entry->capability = params->capability;
794 		__entry->opmode_notif = params->link_sta_params.opmode_notif;
795 		__entry->opmode_notif_used =
796 			params->link_sta_params.opmode_notif_used;
797 	),
798 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
799 		  ", station flags mask: %u, station flags set: %u, "
800 		  "station modify mask: %u, listen interval: %d, aid: %u, "
801 		  "plink action: %u, plink state: %u, uapsd queues: %u, vlan:%s",
802 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
803 		  __entry->sta_flags_mask, __entry->sta_flags_set,
804 		  __entry->sta_modify_mask, __entry->listen_interval,
805 		  __entry->aid, __entry->plink_action, __entry->plink_state,
806 		  __entry->uapsd_queues, __entry->vlan)
807 );
808 
809 DEFINE_EVENT(station_add_change, rdev_add_station,
810 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
811 		 struct station_parameters *params),
812 	TP_ARGS(wiphy, netdev, mac, params)
813 );
814 
815 DEFINE_EVENT(station_add_change, rdev_change_station,
816 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
817 		 struct station_parameters *params),
818 	TP_ARGS(wiphy, netdev, mac, params)
819 );
820 
821 DECLARE_EVENT_CLASS(wiphy_netdev_mac_evt,
822 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
823 	TP_ARGS(wiphy, netdev, mac),
824 	TP_STRUCT__entry(
825 		WIPHY_ENTRY
826 		NETDEV_ENTRY
827 		MAC_ENTRY(sta_mac)
828 	),
829 	TP_fast_assign(
830 		WIPHY_ASSIGN;
831 		NETDEV_ASSIGN;
832 		MAC_ASSIGN(sta_mac, mac);
833 	),
834 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
835 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac))
836 );
837 
838 DECLARE_EVENT_CLASS(station_del,
839 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
840 		 struct station_del_parameters *params),
841 	TP_ARGS(wiphy, netdev, params),
842 	TP_STRUCT__entry(
843 		WIPHY_ENTRY
844 		NETDEV_ENTRY
845 		MAC_ENTRY(sta_mac)
846 		__field(u8, subtype)
847 		__field(u16, reason_code)
848 	),
849 	TP_fast_assign(
850 		WIPHY_ASSIGN;
851 		NETDEV_ASSIGN;
852 		MAC_ASSIGN(sta_mac, params->mac);
853 		__entry->subtype = params->subtype;
854 		__entry->reason_code = params->reason_code;
855 	),
856 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
857 		  ", subtype: %u, reason_code: %u",
858 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
859 		  __entry->subtype, __entry->reason_code)
860 );
861 
862 DEFINE_EVENT(station_del, rdev_del_station,
863 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
864 		 struct station_del_parameters *params),
865 	TP_ARGS(wiphy, netdev, params)
866 );
867 
868 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station,
869 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
870 	TP_ARGS(wiphy, netdev, mac)
871 );
872 
873 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_mpath,
874 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
875 	TP_ARGS(wiphy, netdev, mac)
876 );
877 
878 TRACE_EVENT(rdev_dump_station,
879 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
880 		 u8 *mac),
881 	TP_ARGS(wiphy, netdev, _idx, mac),
882 	TP_STRUCT__entry(
883 		WIPHY_ENTRY
884 		NETDEV_ENTRY
885 		MAC_ENTRY(sta_mac)
886 		__field(int, idx)
887 	),
888 	TP_fast_assign(
889 		WIPHY_ASSIGN;
890 		NETDEV_ASSIGN;
891 		MAC_ASSIGN(sta_mac, mac);
892 		__entry->idx = _idx;
893 	),
894 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT ", idx: %d",
895 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
896 		  __entry->idx)
897 );
898 
899 TRACE_EVENT(rdev_return_int_station_info,
900 	TP_PROTO(struct wiphy *wiphy, int ret, struct station_info *sinfo),
901 	TP_ARGS(wiphy, ret, sinfo),
902 	TP_STRUCT__entry(
903 		WIPHY_ENTRY
904 		__field(int, ret)
905 		SINFO_ENTRY
906 	),
907 	TP_fast_assign(
908 		WIPHY_ASSIGN;
909 		__entry->ret = ret;
910 		SINFO_ASSIGN;
911 	),
912 	TP_printk(WIPHY_PR_FMT ", returned %d" ,
913 		  WIPHY_PR_ARG, __entry->ret)
914 );
915 
916 DECLARE_EVENT_CLASS(mpath_evt,
917 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
918 		 u8 *next_hop),
919 	TP_ARGS(wiphy, netdev, dst, next_hop),
920 	TP_STRUCT__entry(
921 		WIPHY_ENTRY
922 		NETDEV_ENTRY
923 		MAC_ENTRY(dst)
924 		MAC_ENTRY(next_hop)
925 	),
926 	TP_fast_assign(
927 		WIPHY_ASSIGN;
928 		NETDEV_ASSIGN;
929 		MAC_ASSIGN(dst, dst);
930 		MAC_ASSIGN(next_hop, next_hop);
931 	),
932 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: " MAC_PR_FMT ", next hop: " MAC_PR_FMT,
933 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dst),
934 		  MAC_PR_ARG(next_hop))
935 );
936 
937 DEFINE_EVENT(mpath_evt, rdev_add_mpath,
938 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
939 		 u8 *next_hop),
940 	TP_ARGS(wiphy, netdev, dst, next_hop)
941 );
942 
943 DEFINE_EVENT(mpath_evt, rdev_change_mpath,
944 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
945 		 u8 *next_hop),
946 	TP_ARGS(wiphy, netdev, dst, next_hop)
947 );
948 
949 DEFINE_EVENT(mpath_evt, rdev_get_mpath,
950 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
951 		 u8 *next_hop),
952 	TP_ARGS(wiphy, netdev, dst, next_hop)
953 );
954 
955 TRACE_EVENT(rdev_dump_mpath,
956 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
957 		 u8 *dst, u8 *next_hop),
958 	TP_ARGS(wiphy, netdev, _idx, dst, next_hop),
959 	TP_STRUCT__entry(
960 		WIPHY_ENTRY
961 		NETDEV_ENTRY
962 		MAC_ENTRY(dst)
963 		MAC_ENTRY(next_hop)
964 		__field(int, idx)
965 	),
966 	TP_fast_assign(
967 		WIPHY_ASSIGN;
968 		NETDEV_ASSIGN;
969 		MAC_ASSIGN(dst, dst);
970 		MAC_ASSIGN(next_hop, next_hop);
971 		__entry->idx = _idx;
972 	),
973 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: "
974 		  MAC_PR_FMT ", next hop: " MAC_PR_FMT,
975 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, MAC_PR_ARG(dst),
976 		  MAC_PR_ARG(next_hop))
977 );
978 
979 TRACE_EVENT(rdev_get_mpp,
980 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
981 		 u8 *dst, u8 *mpp),
982 	TP_ARGS(wiphy, netdev, dst, mpp),
983 	TP_STRUCT__entry(
984 		WIPHY_ENTRY
985 		NETDEV_ENTRY
986 		MAC_ENTRY(dst)
987 		MAC_ENTRY(mpp)
988 	),
989 	TP_fast_assign(
990 		WIPHY_ASSIGN;
991 		NETDEV_ASSIGN;
992 		MAC_ASSIGN(dst, dst);
993 		MAC_ASSIGN(mpp, mpp);
994 	),
995 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: " MAC_PR_FMT
996 		  ", mpp: " MAC_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG,
997 		  MAC_PR_ARG(dst), MAC_PR_ARG(mpp))
998 );
999 
1000 TRACE_EVENT(rdev_dump_mpp,
1001 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
1002 		 u8 *dst, u8 *mpp),
1003 	TP_ARGS(wiphy, netdev, _idx, mpp, dst),
1004 	TP_STRUCT__entry(
1005 		WIPHY_ENTRY
1006 		NETDEV_ENTRY
1007 		MAC_ENTRY(dst)
1008 		MAC_ENTRY(mpp)
1009 		__field(int, idx)
1010 	),
1011 	TP_fast_assign(
1012 		WIPHY_ASSIGN;
1013 		NETDEV_ASSIGN;
1014 		MAC_ASSIGN(dst, dst);
1015 		MAC_ASSIGN(mpp, mpp);
1016 		__entry->idx = _idx;
1017 	),
1018 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: "
1019 		  MAC_PR_FMT ", mpp: " MAC_PR_FMT,
1020 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, MAC_PR_ARG(dst),
1021 		  MAC_PR_ARG(mpp))
1022 );
1023 
1024 TRACE_EVENT(rdev_return_int_mpath_info,
1025 	TP_PROTO(struct wiphy *wiphy, int ret, struct mpath_info *pinfo),
1026 	TP_ARGS(wiphy, ret, pinfo),
1027 	TP_STRUCT__entry(
1028 		WIPHY_ENTRY
1029 		__field(int, ret)
1030 		__field(int, generation)
1031 		__field(u32, filled)
1032 		__field(u32, frame_qlen)
1033 		__field(u32, sn)
1034 		__field(u32, metric)
1035 		__field(u32, exptime)
1036 		__field(u32, discovery_timeout)
1037 		__field(u8, discovery_retries)
1038 		__field(u8, flags)
1039 	),
1040 	TP_fast_assign(
1041 		WIPHY_ASSIGN;
1042 		__entry->ret = ret;
1043 		__entry->generation = pinfo->generation;
1044 		__entry->filled = pinfo->filled;
1045 		__entry->frame_qlen = pinfo->frame_qlen;
1046 		__entry->sn = pinfo->sn;
1047 		__entry->metric = pinfo->metric;
1048 		__entry->exptime = pinfo->exptime;
1049 		__entry->discovery_timeout = pinfo->discovery_timeout;
1050 		__entry->discovery_retries = pinfo->discovery_retries;
1051 		__entry->flags = pinfo->flags;
1052 	),
1053 	TP_printk(WIPHY_PR_FMT ", returned %d. mpath info - generation: %d, "
1054 		  "filled: %u, frame qlen: %u, sn: %u, metric: %u, exptime: %u,"
1055 		  " discovery timeout: %u, discovery retries: %u, flags: %u",
1056 		  WIPHY_PR_ARG, __entry->ret, __entry->generation,
1057 		  __entry->filled, __entry->frame_qlen, __entry->sn,
1058 		  __entry->metric, __entry->exptime, __entry->discovery_timeout,
1059 		  __entry->discovery_retries, __entry->flags)
1060 );
1061 
1062 TRACE_EVENT(rdev_return_int_mesh_config,
1063 	TP_PROTO(struct wiphy *wiphy, int ret, struct mesh_config *conf),
1064 	TP_ARGS(wiphy, ret, conf),
1065 	TP_STRUCT__entry(
1066 		WIPHY_ENTRY
1067 		MESH_CFG_ENTRY
1068 		__field(int, ret)
1069 	),
1070 	TP_fast_assign(
1071 		WIPHY_ASSIGN;
1072 		MESH_CFG_ASSIGN;
1073 		__entry->ret = ret;
1074 	),
1075 	TP_printk(WIPHY_PR_FMT ", returned: %d",
1076 		  WIPHY_PR_ARG, __entry->ret)
1077 );
1078 
1079 TRACE_EVENT(rdev_update_mesh_config,
1080 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 mask,
1081 		 const struct mesh_config *conf),
1082 	TP_ARGS(wiphy, netdev, mask, conf),
1083 	TP_STRUCT__entry(
1084 		WIPHY_ENTRY
1085 		NETDEV_ENTRY
1086 		MESH_CFG_ENTRY
1087 		__field(u32, mask)
1088 	),
1089 	TP_fast_assign(
1090 		WIPHY_ASSIGN;
1091 		NETDEV_ASSIGN;
1092 		MESH_CFG_ASSIGN;
1093 		__entry->mask = mask;
1094 	),
1095 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mask: %u",
1096 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->mask)
1097 );
1098 
1099 TRACE_EVENT(rdev_join_mesh,
1100 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1101 		 const struct mesh_config *conf,
1102 		 const struct mesh_setup *setup),
1103 	TP_ARGS(wiphy, netdev, conf, setup),
1104 	TP_STRUCT__entry(
1105 		WIPHY_ENTRY
1106 		NETDEV_ENTRY
1107 		MESH_CFG_ENTRY
1108 	),
1109 	TP_fast_assign(
1110 		WIPHY_ASSIGN;
1111 		NETDEV_ASSIGN;
1112 		MESH_CFG_ASSIGN;
1113 	),
1114 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
1115 		  WIPHY_PR_ARG, NETDEV_PR_ARG)
1116 );
1117 
1118 TRACE_EVENT(rdev_change_bss,
1119 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1120 		 struct bss_parameters *params),
1121 	TP_ARGS(wiphy, netdev, params),
1122 	TP_STRUCT__entry(
1123 		WIPHY_ENTRY
1124 		NETDEV_ENTRY
1125 		__field(int, use_cts_prot)
1126 		__field(int, use_short_preamble)
1127 		__field(int, use_short_slot_time)
1128 		__field(int, ap_isolate)
1129 		__field(int, ht_opmode)
1130 	),
1131 	TP_fast_assign(
1132 		WIPHY_ASSIGN;
1133 		NETDEV_ASSIGN;
1134 		__entry->use_cts_prot = params->use_cts_prot;
1135 		__entry->use_short_preamble = params->use_short_preamble;
1136 		__entry->use_short_slot_time = params->use_short_slot_time;
1137 		__entry->ap_isolate = params->ap_isolate;
1138 		__entry->ht_opmode = params->ht_opmode;
1139 	),
1140 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", use cts prot: %d, "
1141 		  "use short preamble: %d, use short slot time: %d, "
1142 		  "ap isolate: %d, ht opmode: %d",
1143 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->use_cts_prot,
1144 		  __entry->use_short_preamble, __entry->use_short_slot_time,
1145 		  __entry->ap_isolate, __entry->ht_opmode)
1146 );
1147 
1148 TRACE_EVENT(rdev_set_txq_params,
1149 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1150 		 struct ieee80211_txq_params *params),
1151 	TP_ARGS(wiphy, netdev, params),
1152 	TP_STRUCT__entry(
1153 		WIPHY_ENTRY
1154 		NETDEV_ENTRY
1155 		__field(enum nl80211_ac, ac)
1156 		__field(u16, txop)
1157 		__field(u16, cwmin)
1158 		__field(u16, cwmax)
1159 		__field(u8, aifs)
1160 	),
1161 	TP_fast_assign(
1162 		WIPHY_ASSIGN;
1163 		NETDEV_ASSIGN;
1164 		__entry->ac = params->ac;
1165 		__entry->txop = params->txop;
1166 		__entry->cwmin = params->cwmin;
1167 		__entry->cwmax = params->cwmax;
1168 		__entry->aifs = params->aifs;
1169 	),
1170 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", ac: %d, txop: %u, cwmin: %u, cwmax: %u, aifs: %u",
1171 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ac, __entry->txop,
1172 		  __entry->cwmin, __entry->cwmax, __entry->aifs)
1173 );
1174 
1175 TRACE_EVENT(rdev_libertas_set_mesh_channel,
1176 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1177 		 struct ieee80211_channel *chan),
1178 	TP_ARGS(wiphy, netdev, chan),
1179 	TP_STRUCT__entry(
1180 		WIPHY_ENTRY
1181 		NETDEV_ENTRY
1182 		CHAN_ENTRY
1183 	),
1184 	TP_fast_assign(
1185 		WIPHY_ASSIGN;
1186 		NETDEV_ASSIGN;
1187 		CHAN_ASSIGN(chan);
1188 	),
1189 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_PR_FMT, WIPHY_PR_ARG,
1190 		  NETDEV_PR_ARG, CHAN_PR_ARG)
1191 );
1192 
1193 TRACE_EVENT(rdev_set_monitor_channel,
1194 	TP_PROTO(struct wiphy *wiphy,
1195 		 struct cfg80211_chan_def *chandef),
1196 	TP_ARGS(wiphy, chandef),
1197 	TP_STRUCT__entry(
1198 		WIPHY_ENTRY
1199 		CHAN_DEF_ENTRY
1200 	),
1201 	TP_fast_assign(
1202 		WIPHY_ASSIGN;
1203 		CHAN_DEF_ASSIGN(chandef);
1204 	),
1205 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
1206 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
1207 );
1208 
1209 TRACE_EVENT(rdev_auth,
1210 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1211 		 struct cfg80211_auth_request *req),
1212 	TP_ARGS(wiphy, netdev, req),
1213 	TP_STRUCT__entry(
1214 		WIPHY_ENTRY
1215 		NETDEV_ENTRY
1216 		MAC_ENTRY(bssid)
1217 		__field(enum nl80211_auth_type, auth_type)
1218 	),
1219 	TP_fast_assign(
1220 		WIPHY_ASSIGN;
1221 		NETDEV_ASSIGN;
1222 		if (req->bss)
1223 			MAC_ASSIGN(bssid, req->bss->bssid);
1224 		else
1225 			eth_zero_addr(__entry->bssid);
1226 		__entry->auth_type = req->auth_type;
1227 	),
1228 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT,
1229 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->auth_type,
1230 		  MAC_PR_ARG(bssid))
1231 );
1232 
1233 TRACE_EVENT(rdev_assoc,
1234 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1235 		 struct cfg80211_assoc_request *req),
1236 	TP_ARGS(wiphy, netdev, req),
1237 	TP_STRUCT__entry(
1238 		WIPHY_ENTRY
1239 		NETDEV_ENTRY
1240 		MAC_ENTRY(bssid)
1241 		MAC_ENTRY(prev_bssid)
1242 		__field(bool, use_mfp)
1243 		__field(u32, flags)
1244 		__dynamic_array(u8, elements, req->ie_len)
1245 		__array(u8, ht_capa, sizeof(struct ieee80211_ht_cap))
1246 		__array(u8, ht_capa_mask, sizeof(struct ieee80211_ht_cap))
1247 		__array(u8, vht_capa, sizeof(struct ieee80211_vht_cap))
1248 		__array(u8, vht_capa_mask, sizeof(struct ieee80211_vht_cap))
1249 		__dynamic_array(u8, fils_kek, req->fils_kek_len)
1250 		__dynamic_array(u8, fils_nonces,
1251 				req->fils_nonces ? 2 * FILS_NONCE_LEN : 0)
1252 	),
1253 	TP_fast_assign(
1254 		WIPHY_ASSIGN;
1255 		NETDEV_ASSIGN;
1256 		if (req->bss)
1257 			MAC_ASSIGN(bssid, req->bss->bssid);
1258 		else
1259 			eth_zero_addr(__entry->bssid);
1260 		MAC_ASSIGN(prev_bssid, req->prev_bssid);
1261 		__entry->use_mfp = req->use_mfp;
1262 		__entry->flags = req->flags;
1263 		if (req->ie)
1264 			memcpy(__get_dynamic_array(elements),
1265 			       req->ie, req->ie_len);
1266 		memcpy(__entry->ht_capa, &req->ht_capa, sizeof(req->ht_capa));
1267 		memcpy(__entry->ht_capa_mask, &req->ht_capa_mask,
1268 		       sizeof(req->ht_capa_mask));
1269 		memcpy(__entry->vht_capa, &req->vht_capa, sizeof(req->vht_capa));
1270 		memcpy(__entry->vht_capa_mask, &req->vht_capa_mask,
1271 		       sizeof(req->vht_capa_mask));
1272 		if (req->fils_kek)
1273 			memcpy(__get_dynamic_array(fils_kek),
1274 			       req->fils_kek, req->fils_kek_len);
1275 		if (req->fils_nonces)
1276 			memcpy(__get_dynamic_array(fils_nonces),
1277 			       req->fils_nonces, 2 * FILS_NONCE_LEN);
1278 	),
1279 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
1280 		  ", previous bssid: " MAC_PR_FMT ", use mfp: %s, flags: %u",
1281 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
1282 		  MAC_PR_ARG(prev_bssid), BOOL_TO_STR(__entry->use_mfp),
1283 		  __entry->flags)
1284 );
1285 
1286 TRACE_EVENT(rdev_deauth,
1287 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1288 		 struct cfg80211_deauth_request *req),
1289 	TP_ARGS(wiphy, netdev, req),
1290 	TP_STRUCT__entry(
1291 		WIPHY_ENTRY
1292 		NETDEV_ENTRY
1293 		MAC_ENTRY(bssid)
1294 		__field(u16, reason_code)
1295 	),
1296 	TP_fast_assign(
1297 		WIPHY_ASSIGN;
1298 		NETDEV_ASSIGN;
1299 		MAC_ASSIGN(bssid, req->bssid);
1300 		__entry->reason_code = req->reason_code;
1301 	),
1302 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", reason: %u",
1303 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
1304 		  __entry->reason_code)
1305 );
1306 
1307 TRACE_EVENT(rdev_disassoc,
1308 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1309 		 struct cfg80211_disassoc_request *req),
1310 	TP_ARGS(wiphy, netdev, req),
1311 	TP_STRUCT__entry(
1312 		WIPHY_ENTRY
1313 		NETDEV_ENTRY
1314 		MAC_ENTRY(bssid)
1315 		__field(u16, reason_code)
1316 		__field(bool, local_state_change)
1317 	),
1318 	TP_fast_assign(
1319 		WIPHY_ASSIGN;
1320 		NETDEV_ASSIGN;
1321 		MAC_ASSIGN(bssid, req->ap_addr);
1322 		__entry->reason_code = req->reason_code;
1323 		__entry->local_state_change = req->local_state_change;
1324 	),
1325 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
1326 		  ", reason: %u, local state change: %s",
1327 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
1328 		  __entry->reason_code,
1329 		  BOOL_TO_STR(__entry->local_state_change))
1330 );
1331 
1332 TRACE_EVENT(rdev_mgmt_tx_cancel_wait,
1333 	TP_PROTO(struct wiphy *wiphy,
1334 		 struct wireless_dev *wdev, u64 cookie),
1335 	TP_ARGS(wiphy, wdev, cookie),
1336 	TP_STRUCT__entry(
1337 		WIPHY_ENTRY
1338 		WDEV_ENTRY
1339 		__field(u64, cookie)
1340 	),
1341 	TP_fast_assign(
1342 		WIPHY_ASSIGN;
1343 		WDEV_ASSIGN;
1344 		__entry->cookie = cookie;
1345 	),
1346 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu ",
1347 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
1348 );
1349 
1350 TRACE_EVENT(rdev_set_power_mgmt,
1351 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1352 		 bool enabled, int timeout),
1353 	TP_ARGS(wiphy, netdev, enabled, timeout),
1354 	TP_STRUCT__entry(
1355 		WIPHY_ENTRY
1356 		NETDEV_ENTRY
1357 		__field(bool, enabled)
1358 		__field(int, timeout)
1359 	),
1360 	TP_fast_assign(
1361 		WIPHY_ASSIGN;
1362 		NETDEV_ASSIGN;
1363 		__entry->enabled = enabled;
1364 		__entry->timeout = timeout;
1365 	),
1366 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %senabled, timeout: %d ",
1367 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
1368 		  __entry->enabled ? "" : "not ", __entry->timeout)
1369 );
1370 
1371 TRACE_EVENT(rdev_connect,
1372 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1373 		 struct cfg80211_connect_params *sme),
1374 	TP_ARGS(wiphy, netdev, sme),
1375 	TP_STRUCT__entry(
1376 		WIPHY_ENTRY
1377 		NETDEV_ENTRY
1378 		MAC_ENTRY(bssid)
1379 		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
1380 		__field(enum nl80211_auth_type, auth_type)
1381 		__field(bool, privacy)
1382 		__field(u32, wpa_versions)
1383 		__field(u32, flags)
1384 		MAC_ENTRY(prev_bssid)
1385 	),
1386 	TP_fast_assign(
1387 		WIPHY_ASSIGN;
1388 		NETDEV_ASSIGN;
1389 		MAC_ASSIGN(bssid, sme->bssid);
1390 		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
1391 		memcpy(__entry->ssid, sme->ssid, sme->ssid_len);
1392 		__entry->auth_type = sme->auth_type;
1393 		__entry->privacy = sme->privacy;
1394 		__entry->wpa_versions = sme->crypto.wpa_versions;
1395 		__entry->flags = sme->flags;
1396 		MAC_ASSIGN(prev_bssid, sme->prev_bssid);
1397 	),
1398 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
1399 		  ", ssid: %s, auth type: %d, privacy: %s, wpa versions: %u, "
1400 		  "flags: %u, previous bssid: " MAC_PR_FMT,
1401 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid,
1402 		  __entry->auth_type, BOOL_TO_STR(__entry->privacy),
1403 		  __entry->wpa_versions, __entry->flags, MAC_PR_ARG(prev_bssid))
1404 );
1405 
1406 TRACE_EVENT(rdev_update_connect_params,
1407 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1408 		 struct cfg80211_connect_params *sme, u32 changed),
1409 	TP_ARGS(wiphy, netdev, sme, changed),
1410 	TP_STRUCT__entry(
1411 		WIPHY_ENTRY
1412 		NETDEV_ENTRY
1413 		__field(u32, changed)
1414 	),
1415 	TP_fast_assign(
1416 		WIPHY_ASSIGN;
1417 		NETDEV_ASSIGN;
1418 		__entry->changed = changed;
1419 	),
1420 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", parameters changed: %u",
1421 		  WIPHY_PR_ARG, NETDEV_PR_ARG,  __entry->changed)
1422 );
1423 
1424 TRACE_EVENT(rdev_set_cqm_rssi_config,
1425 	TP_PROTO(struct wiphy *wiphy,
1426 		 struct net_device *netdev, s32 rssi_thold,
1427 		 u32 rssi_hyst),
1428 	TP_ARGS(wiphy, netdev, rssi_thold, rssi_hyst),
1429 	TP_STRUCT__entry(
1430 		WIPHY_ENTRY
1431 		NETDEV_ENTRY
1432 		__field(s32, rssi_thold)
1433 		__field(u32, rssi_hyst)
1434 	),
1435 	TP_fast_assign(
1436 		WIPHY_ASSIGN;
1437 		NETDEV_ASSIGN;
1438 		__entry->rssi_thold = rssi_thold;
1439 		__entry->rssi_hyst = rssi_hyst;
1440 	),
1441 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
1442 		  ", rssi_thold: %d, rssi_hyst: %u ",
1443 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
1444 		 __entry->rssi_thold, __entry->rssi_hyst)
1445 );
1446 
1447 TRACE_EVENT(rdev_set_cqm_rssi_range_config,
1448 	TP_PROTO(struct wiphy *wiphy,
1449 		 struct net_device *netdev, s32 low, s32 high),
1450 	TP_ARGS(wiphy, netdev, low, high),
1451 	TP_STRUCT__entry(
1452 		WIPHY_ENTRY
1453 		NETDEV_ENTRY
1454 		__field(s32, rssi_low)
1455 		__field(s32, rssi_high)
1456 	),
1457 	TP_fast_assign(
1458 		WIPHY_ASSIGN;
1459 		NETDEV_ASSIGN;
1460 		__entry->rssi_low = low;
1461 		__entry->rssi_high = high;
1462 	),
1463 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
1464 		  ", range: %d - %d ",
1465 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
1466 		  __entry->rssi_low, __entry->rssi_high)
1467 );
1468 
1469 TRACE_EVENT(rdev_set_cqm_txe_config,
1470 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 rate,
1471 		 u32 pkts, u32 intvl),
1472 	TP_ARGS(wiphy, netdev, rate, pkts, intvl),
1473 	TP_STRUCT__entry(
1474 		WIPHY_ENTRY
1475 		NETDEV_ENTRY
1476 		__field(u32, rate)
1477 		__field(u32, pkts)
1478 		__field(u32, intvl)
1479 	),
1480 	TP_fast_assign(
1481 		WIPHY_ASSIGN;
1482 		NETDEV_ASSIGN;
1483 		__entry->rate = rate;
1484 		__entry->pkts = pkts;
1485 		__entry->intvl = intvl;
1486 	),
1487 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", rate: %u, packets: %u, interval: %u",
1488 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->rate, __entry->pkts,
1489 		  __entry->intvl)
1490 );
1491 
1492 TRACE_EVENT(rdev_disconnect,
1493 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1494 		 u16 reason_code),
1495 	TP_ARGS(wiphy, netdev, reason_code),
1496 	TP_STRUCT__entry(
1497 		WIPHY_ENTRY
1498 		NETDEV_ENTRY
1499 		__field(u16, reason_code)
1500 	),
1501 	TP_fast_assign(
1502 		WIPHY_ASSIGN;
1503 		NETDEV_ASSIGN;
1504 		__entry->reason_code = reason_code;
1505 	),
1506 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", reason code: %u", WIPHY_PR_ARG,
1507 		  NETDEV_PR_ARG, __entry->reason_code)
1508 );
1509 
1510 TRACE_EVENT(rdev_join_ibss,
1511 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1512 		 struct cfg80211_ibss_params *params),
1513 	TP_ARGS(wiphy, netdev, params),
1514 	TP_STRUCT__entry(
1515 		WIPHY_ENTRY
1516 		NETDEV_ENTRY
1517 		MAC_ENTRY(bssid)
1518 		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
1519 	),
1520 	TP_fast_assign(
1521 		WIPHY_ASSIGN;
1522 		NETDEV_ASSIGN;
1523 		MAC_ASSIGN(bssid, params->bssid);
1524 		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
1525 		memcpy(__entry->ssid, params->ssid, params->ssid_len);
1526 	),
1527 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", ssid: %s",
1528 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid)
1529 );
1530 
1531 TRACE_EVENT(rdev_join_ocb,
1532 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1533 		 const struct ocb_setup *setup),
1534 	TP_ARGS(wiphy, netdev, setup),
1535 	TP_STRUCT__entry(
1536 		WIPHY_ENTRY
1537 		NETDEV_ENTRY
1538 	),
1539 	TP_fast_assign(
1540 		WIPHY_ASSIGN;
1541 		NETDEV_ASSIGN;
1542 	),
1543 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
1544 		  WIPHY_PR_ARG, NETDEV_PR_ARG)
1545 );
1546 
1547 TRACE_EVENT(rdev_set_wiphy_params,
1548 	TP_PROTO(struct wiphy *wiphy, u32 changed),
1549 	TP_ARGS(wiphy, changed),
1550 	TP_STRUCT__entry(
1551 		WIPHY_ENTRY
1552 		__field(u32, changed)
1553 	),
1554 	TP_fast_assign(
1555 		WIPHY_ASSIGN;
1556 		__entry->changed = changed;
1557 	),
1558 	TP_printk(WIPHY_PR_FMT ", changed: %u",
1559 		  WIPHY_PR_ARG, __entry->changed)
1560 );
1561 
1562 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_tx_power,
1563 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1564 	TP_ARGS(wiphy, wdev)
1565 );
1566 
1567 TRACE_EVENT(rdev_set_tx_power,
1568 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1569 		 enum nl80211_tx_power_setting type, int mbm),
1570 	TP_ARGS(wiphy, wdev, type, mbm),
1571 	TP_STRUCT__entry(
1572 		WIPHY_ENTRY
1573 		WDEV_ENTRY
1574 		__field(enum nl80211_tx_power_setting, type)
1575 		__field(int, mbm)
1576 	),
1577 	TP_fast_assign(
1578 		WIPHY_ASSIGN;
1579 		WDEV_ASSIGN;
1580 		__entry->type = type;
1581 		__entry->mbm = mbm;
1582 	),
1583 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type: %u, mbm: %d",
1584 		  WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
1585 );
1586 
1587 TRACE_EVENT(rdev_return_int_int,
1588 	TP_PROTO(struct wiphy *wiphy, int func_ret, int func_fill),
1589 	TP_ARGS(wiphy, func_ret, func_fill),
1590 	TP_STRUCT__entry(
1591 		WIPHY_ENTRY
1592 		__field(int, func_ret)
1593 		__field(int, func_fill)
1594 	),
1595 	TP_fast_assign(
1596 		WIPHY_ASSIGN;
1597 		__entry->func_ret = func_ret;
1598 		__entry->func_fill = func_fill;
1599 	),
1600 	TP_printk(WIPHY_PR_FMT ", function returns: %d, function filled: %d",
1601 		  WIPHY_PR_ARG, __entry->func_ret, __entry->func_fill)
1602 );
1603 
1604 #ifdef CONFIG_NL80211_TESTMODE
1605 TRACE_EVENT(rdev_testmode_cmd,
1606 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1607 	TP_ARGS(wiphy, wdev),
1608 	TP_STRUCT__entry(
1609 		WIPHY_ENTRY
1610 		WDEV_ENTRY
1611 	),
1612 	TP_fast_assign(
1613 		WIPHY_ASSIGN;
1614 		WDEV_ASSIGN;
1615 	),
1616 	TP_printk(WIPHY_PR_FMT WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
1617 );
1618 
1619 TRACE_EVENT(rdev_testmode_dump,
1620 	TP_PROTO(struct wiphy *wiphy),
1621 	TP_ARGS(wiphy),
1622 	TP_STRUCT__entry(
1623 		WIPHY_ENTRY
1624 	),
1625 	TP_fast_assign(
1626 		WIPHY_ASSIGN;
1627 	),
1628 	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
1629 );
1630 #endif /* CONFIG_NL80211_TESTMODE */
1631 
1632 TRACE_EVENT(rdev_set_bitrate_mask,
1633 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1634 		 unsigned int link_id,
1635 		 const u8 *peer, const struct cfg80211_bitrate_mask *mask),
1636 	TP_ARGS(wiphy, netdev, link_id, peer, mask),
1637 	TP_STRUCT__entry(
1638 		WIPHY_ENTRY
1639 		NETDEV_ENTRY
1640 		__field(unsigned int, link_id)
1641 		MAC_ENTRY(peer)
1642 	),
1643 	TP_fast_assign(
1644 		WIPHY_ASSIGN;
1645 		NETDEV_ASSIGN;
1646 		__entry->link_id = link_id;
1647 		MAC_ASSIGN(peer, peer);
1648 	),
1649 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, peer: " MAC_PR_FMT,
1650 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
1651 		  MAC_PR_ARG(peer))
1652 );
1653 
1654 TRACE_EVENT(rdev_update_mgmt_frame_registrations,
1655 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1656 		 struct mgmt_frame_regs *upd),
1657 	TP_ARGS(wiphy, wdev, upd),
1658 	TP_STRUCT__entry(
1659 		WIPHY_ENTRY
1660 		WDEV_ENTRY
1661 		__field(u16, global_stypes)
1662 		__field(u16, interface_stypes)
1663 	),
1664 	TP_fast_assign(
1665 		WIPHY_ASSIGN;
1666 		WDEV_ASSIGN;
1667 		__entry->global_stypes = upd->global_stypes;
1668 		__entry->interface_stypes = upd->interface_stypes;
1669 	),
1670 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", global: 0x%.2x, intf: 0x%.2x",
1671 		  WIPHY_PR_ARG, WDEV_PR_ARG,
1672 		  __entry->global_stypes, __entry->interface_stypes)
1673 );
1674 
1675 TRACE_EVENT(rdev_return_int_tx_rx,
1676 	TP_PROTO(struct wiphy *wiphy, int ret, u32 tx, u32 rx),
1677 	TP_ARGS(wiphy, ret, tx, rx),
1678 	TP_STRUCT__entry(
1679 		WIPHY_ENTRY
1680 		__field(int, ret)
1681 		__field(u32, tx)
1682 		__field(u32, rx)
1683 	),
1684 	TP_fast_assign(
1685 		WIPHY_ASSIGN;
1686 		__entry->ret = ret;
1687 		__entry->tx = tx;
1688 		__entry->rx = rx;
1689 	),
1690 	TP_printk(WIPHY_PR_FMT ", returned %d, tx: %u, rx: %u",
1691 		  WIPHY_PR_ARG, __entry->ret, __entry->tx, __entry->rx)
1692 );
1693 
1694 TRACE_EVENT(rdev_return_void_tx_rx,
1695 	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 tx_max,
1696 		 u32 rx, u32 rx_max),
1697 	TP_ARGS(wiphy, tx, tx_max, rx, rx_max),
1698 	TP_STRUCT__entry(
1699 		WIPHY_ENTRY
1700 		__field(u32, tx)
1701 		__field(u32, tx_max)
1702 		__field(u32, rx)
1703 		__field(u32, rx_max)
1704 	),
1705 	TP_fast_assign(
1706 		WIPHY_ASSIGN;
1707 		__entry->tx = tx;
1708 		__entry->tx_max = tx_max;
1709 		__entry->rx = rx;
1710 		__entry->rx_max = rx_max;
1711 	),
1712 	TP_printk(WIPHY_PR_FMT ", tx: %u, tx_max: %u, rx: %u, rx_max: %u ",
1713 		  WIPHY_PR_ARG, __entry->tx, __entry->tx_max, __entry->rx,
1714 		  __entry->rx_max)
1715 );
1716 
1717 DECLARE_EVENT_CLASS(tx_rx_evt,
1718 	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
1719 	TP_ARGS(wiphy, rx, tx),
1720 	TP_STRUCT__entry(
1721 		WIPHY_ENTRY
1722 		__field(u32, tx)
1723 		__field(u32, rx)
1724 	),
1725 	TP_fast_assign(
1726 		WIPHY_ASSIGN;
1727 		__entry->tx = tx;
1728 		__entry->rx = rx;
1729 	),
1730 	TP_printk(WIPHY_PR_FMT ", tx: %u, rx: %u ",
1731 		  WIPHY_PR_ARG, __entry->tx, __entry->rx)
1732 );
1733 
1734 DEFINE_EVENT(tx_rx_evt, rdev_set_antenna,
1735 	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
1736 	TP_ARGS(wiphy, rx, tx)
1737 );
1738 
1739 DECLARE_EVENT_CLASS(wiphy_netdev_id_evt,
1740 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
1741 	TP_ARGS(wiphy, netdev, id),
1742 	TP_STRUCT__entry(
1743 		WIPHY_ENTRY
1744 		NETDEV_ENTRY
1745 		__field(u64, id)
1746 	),
1747 	TP_fast_assign(
1748 		WIPHY_ASSIGN;
1749 		NETDEV_ASSIGN;
1750 		__entry->id = id;
1751 	),
1752 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", id: %llu",
1753 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->id)
1754 );
1755 
1756 DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_start,
1757 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
1758 	TP_ARGS(wiphy, netdev, id)
1759 );
1760 
1761 DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_stop,
1762 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
1763 	TP_ARGS(wiphy, netdev, id)
1764 );
1765 
1766 TRACE_EVENT(rdev_tdls_mgmt,
1767 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1768 		 u8 *peer, u8 action_code, u8 dialog_token,
1769 		 u16 status_code, u32 peer_capability,
1770 		 bool initiator, const u8 *buf, size_t len),
1771 	TP_ARGS(wiphy, netdev, peer, action_code, dialog_token, status_code,
1772 		peer_capability, initiator, buf, len),
1773 	TP_STRUCT__entry(
1774 		WIPHY_ENTRY
1775 		NETDEV_ENTRY
1776 		MAC_ENTRY(peer)
1777 		__field(u8, action_code)
1778 		__field(u8, dialog_token)
1779 		__field(u16, status_code)
1780 		__field(u32, peer_capability)
1781 		__field(bool, initiator)
1782 		__dynamic_array(u8, buf, len)
1783 	),
1784 	TP_fast_assign(
1785 		WIPHY_ASSIGN;
1786 		NETDEV_ASSIGN;
1787 		MAC_ASSIGN(peer, peer);
1788 		__entry->action_code = action_code;
1789 		__entry->dialog_token = dialog_token;
1790 		__entry->status_code = status_code;
1791 		__entry->peer_capability = peer_capability;
1792 		__entry->initiator = initiator;
1793 		memcpy(__get_dynamic_array(buf), buf, len);
1794 	),
1795 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", action_code: %u, "
1796 		  "dialog_token: %u, status_code: %u, peer_capability: %u "
1797 		  "initiator: %s buf: %#.2x ",
1798 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
1799 		  __entry->action_code, __entry->dialog_token,
1800 		  __entry->status_code, __entry->peer_capability,
1801 		  BOOL_TO_STR(__entry->initiator),
1802 		  ((u8 *)__get_dynamic_array(buf))[0])
1803 );
1804 
1805 TRACE_EVENT(rdev_dump_survey,
1806 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx),
1807 	TP_ARGS(wiphy, netdev, _idx),
1808 	TP_STRUCT__entry(
1809 		WIPHY_ENTRY
1810 		NETDEV_ENTRY
1811 		__field(int, idx)
1812 	),
1813 	TP_fast_assign(
1814 		WIPHY_ASSIGN;
1815 		NETDEV_ASSIGN;
1816 		__entry->idx = _idx;
1817 	),
1818 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d",
1819 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx)
1820 );
1821 
1822 TRACE_EVENT(rdev_return_int_survey_info,
1823 	TP_PROTO(struct wiphy *wiphy, int ret, struct survey_info *info),
1824 	TP_ARGS(wiphy, ret, info),
1825 	TP_STRUCT__entry(
1826 		WIPHY_ENTRY
1827 		CHAN_ENTRY
1828 		__field(int, ret)
1829 		__field(u64, time)
1830 		__field(u64, time_busy)
1831 		__field(u64, time_ext_busy)
1832 		__field(u64, time_rx)
1833 		__field(u64, time_tx)
1834 		__field(u64, time_scan)
1835 		__field(u32, filled)
1836 		__field(s8, noise)
1837 	),
1838 	TP_fast_assign(
1839 		WIPHY_ASSIGN;
1840 		CHAN_ASSIGN(info->channel);
1841 		__entry->ret = ret;
1842 		__entry->time = info->time;
1843 		__entry->time_busy = info->time_busy;
1844 		__entry->time_ext_busy = info->time_ext_busy;
1845 		__entry->time_rx = info->time_rx;
1846 		__entry->time_tx = info->time_tx;
1847 		__entry->time_scan = info->time_scan;
1848 		__entry->filled = info->filled;
1849 		__entry->noise = info->noise;
1850 	),
1851 	TP_printk(WIPHY_PR_FMT ", returned: %d, " CHAN_PR_FMT
1852 		  ", channel time: %llu, channel time busy: %llu, "
1853 		  "channel time extension busy: %llu, channel time rx: %llu, "
1854 		  "channel time tx: %llu, scan time: %llu, filled: %u, noise: %d",
1855 		  WIPHY_PR_ARG, __entry->ret, CHAN_PR_ARG,
1856 		  __entry->time, __entry->time_busy,
1857 		  __entry->time_ext_busy, __entry->time_rx,
1858 		  __entry->time_tx, __entry->time_scan,
1859 		  __entry->filled, __entry->noise)
1860 );
1861 
1862 TRACE_EVENT(rdev_tdls_oper,
1863 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1864 		 u8 *peer, enum nl80211_tdls_operation oper),
1865 	TP_ARGS(wiphy, netdev, peer, oper),
1866 	TP_STRUCT__entry(
1867 		WIPHY_ENTRY
1868 		NETDEV_ENTRY
1869 		MAC_ENTRY(peer)
1870 		__field(enum nl80211_tdls_operation, oper)
1871 	),
1872 	TP_fast_assign(
1873 		WIPHY_ASSIGN;
1874 		NETDEV_ASSIGN;
1875 		MAC_ASSIGN(peer, peer);
1876 		__entry->oper = oper;
1877 	),
1878 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", oper: %d",
1879 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper)
1880 );
1881 
1882 DECLARE_EVENT_CLASS(rdev_pmksa,
1883 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1884 		 struct cfg80211_pmksa *pmksa),
1885 	TP_ARGS(wiphy, netdev, pmksa),
1886 	TP_STRUCT__entry(
1887 		WIPHY_ENTRY
1888 		NETDEV_ENTRY
1889 		MAC_ENTRY(bssid)
1890 	),
1891 	TP_fast_assign(
1892 		WIPHY_ASSIGN;
1893 		NETDEV_ASSIGN;
1894 		MAC_ASSIGN(bssid, pmksa->bssid);
1895 	),
1896 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT,
1897 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid))
1898 );
1899 
1900 TRACE_EVENT(rdev_probe_client,
1901 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1902 		 const u8 *peer),
1903 	TP_ARGS(wiphy, netdev, peer),
1904 	TP_STRUCT__entry(
1905 		WIPHY_ENTRY
1906 		NETDEV_ENTRY
1907 		MAC_ENTRY(peer)
1908 	),
1909 	TP_fast_assign(
1910 		WIPHY_ASSIGN;
1911 		NETDEV_ASSIGN;
1912 		MAC_ASSIGN(peer, peer);
1913 	),
1914 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
1915 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
1916 );
1917 
1918 DEFINE_EVENT(rdev_pmksa, rdev_set_pmksa,
1919 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1920 		 struct cfg80211_pmksa *pmksa),
1921 	TP_ARGS(wiphy, netdev, pmksa)
1922 );
1923 
1924 DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
1925 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1926 		 struct cfg80211_pmksa *pmksa),
1927 	TP_ARGS(wiphy, netdev, pmksa)
1928 );
1929 
1930 TRACE_EVENT(rdev_remain_on_channel,
1931 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1932 		 struct ieee80211_channel *chan,
1933 		 unsigned int duration),
1934 	TP_ARGS(wiphy, wdev, chan, duration),
1935 	TP_STRUCT__entry(
1936 		WIPHY_ENTRY
1937 		WDEV_ENTRY
1938 		CHAN_ENTRY
1939 		__field(unsigned int, duration)
1940 	),
1941 	TP_fast_assign(
1942 		WIPHY_ASSIGN;
1943 		WDEV_ASSIGN;
1944 		CHAN_ASSIGN(chan);
1945 		__entry->duration = duration;
1946 	),
1947 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", duration: %u",
1948 		  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
1949 );
1950 
1951 TRACE_EVENT(rdev_return_int_cookie,
1952 	TP_PROTO(struct wiphy *wiphy, int ret, u64 cookie),
1953 	TP_ARGS(wiphy, ret, cookie),
1954 	TP_STRUCT__entry(
1955 		WIPHY_ENTRY
1956 		__field(int, ret)
1957 		__field(u64, cookie)
1958 	),
1959 	TP_fast_assign(
1960 		WIPHY_ASSIGN;
1961 		__entry->ret = ret;
1962 		__entry->cookie = cookie;
1963 	),
1964 	TP_printk(WIPHY_PR_FMT ", returned %d, cookie: %llu",
1965 		  WIPHY_PR_ARG, __entry->ret, __entry->cookie)
1966 );
1967 
1968 TRACE_EVENT(rdev_cancel_remain_on_channel,
1969 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
1970 	TP_ARGS(wiphy, wdev, cookie),
1971 	TP_STRUCT__entry(
1972 		WIPHY_ENTRY
1973 		WDEV_ENTRY
1974 		__field(u64, cookie)
1975 	),
1976 	TP_fast_assign(
1977 		WIPHY_ASSIGN;
1978 		WDEV_ASSIGN;
1979 		__entry->cookie = cookie;
1980 	),
1981 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu",
1982 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
1983 );
1984 
1985 TRACE_EVENT(rdev_mgmt_tx,
1986 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1987 		 struct cfg80211_mgmt_tx_params *params),
1988 	TP_ARGS(wiphy, wdev, params),
1989 	TP_STRUCT__entry(
1990 		WIPHY_ENTRY
1991 		WDEV_ENTRY
1992 		CHAN_ENTRY
1993 		__field(bool, offchan)
1994 		__field(unsigned int, wait)
1995 		__field(bool, no_cck)
1996 		__field(bool, dont_wait_for_ack)
1997 	),
1998 	TP_fast_assign(
1999 		WIPHY_ASSIGN;
2000 		WDEV_ASSIGN;
2001 		CHAN_ASSIGN(params->chan);
2002 		__entry->offchan = params->offchan;
2003 		__entry->wait = params->wait;
2004 		__entry->no_cck = params->no_cck;
2005 		__entry->dont_wait_for_ack = params->dont_wait_for_ack;
2006 	),
2007 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", offchan: %s,"
2008 		  " wait: %u, no cck: %s, dont wait for ack: %s",
2009 		  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
2010 		  BOOL_TO_STR(__entry->offchan), __entry->wait,
2011 		  BOOL_TO_STR(__entry->no_cck),
2012 		  BOOL_TO_STR(__entry->dont_wait_for_ack))
2013 );
2014 
2015 TRACE_EVENT(rdev_tx_control_port,
2016 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2017 		 const u8 *buf, size_t len, const u8 *dest, __be16 proto,
2018 		 bool unencrypted, int link_id),
2019 	TP_ARGS(wiphy, netdev, buf, len, dest, proto, unencrypted, link_id),
2020 	TP_STRUCT__entry(
2021 		WIPHY_ENTRY
2022 		NETDEV_ENTRY
2023 		MAC_ENTRY(dest)
2024 		__field(__be16, proto)
2025 		__field(bool, unencrypted)
2026 		__field(int, link_id)
2027 	),
2028 	TP_fast_assign(
2029 		WIPHY_ASSIGN;
2030 		NETDEV_ASSIGN;
2031 		MAC_ASSIGN(dest, dest);
2032 		__entry->proto = proto;
2033 		__entry->unencrypted = unencrypted;
2034 		__entry->link_id = link_id;
2035 	),
2036 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ","
2037 		  " proto: 0x%x, unencrypted: %s, link: %d",
2038 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dest),
2039 		  be16_to_cpu(__entry->proto),
2040 		  BOOL_TO_STR(__entry->unencrypted),
2041 		  __entry->link_id)
2042 );
2043 
2044 TRACE_EVENT(rdev_set_noack_map,
2045 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2046 		 u16 noack_map),
2047 	TP_ARGS(wiphy, netdev, noack_map),
2048 	TP_STRUCT__entry(
2049 		WIPHY_ENTRY
2050 		NETDEV_ENTRY
2051 		__field(u16, noack_map)
2052 	),
2053 	TP_fast_assign(
2054 		WIPHY_ASSIGN;
2055 		NETDEV_ASSIGN;
2056 		__entry->noack_map = noack_map;
2057 	),
2058 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", noack_map: %u",
2059 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map)
2060 );
2061 
2062 DECLARE_EVENT_CLASS(wiphy_wdev_link_evt,
2063 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2064 		 unsigned int link_id),
2065 	TP_ARGS(wiphy, wdev, link_id),
2066 	TP_STRUCT__entry(
2067 		WIPHY_ENTRY
2068 		WDEV_ENTRY
2069 		__field(unsigned int, link_id)
2070 	),
2071 	TP_fast_assign(
2072 		WIPHY_ASSIGN;
2073 		WDEV_ASSIGN;
2074 		__entry->link_id = link_id;
2075 	),
2076 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %u",
2077 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id)
2078 );
2079 
2080 DEFINE_EVENT(wiphy_wdev_link_evt, rdev_get_channel,
2081 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2082 		 unsigned int link_id),
2083 	TP_ARGS(wiphy, wdev, link_id)
2084 );
2085 
2086 TRACE_EVENT(rdev_return_chandef,
2087 	TP_PROTO(struct wiphy *wiphy, int ret,
2088 		 struct cfg80211_chan_def *chandef),
2089 	TP_ARGS(wiphy, ret, chandef),
2090 	TP_STRUCT__entry(
2091 		WIPHY_ENTRY
2092 		__field(int, ret)
2093 		CHAN_DEF_ENTRY
2094 	),
2095 	TP_fast_assign(
2096 		WIPHY_ASSIGN;
2097 		if (ret == 0)
2098 			CHAN_DEF_ASSIGN(chandef);
2099 		else
2100 			CHAN_DEF_ASSIGN((struct cfg80211_chan_def *)NULL);
2101 		__entry->ret = ret;
2102 	),
2103 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", ret: %d",
2104 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->ret)
2105 );
2106 
2107 DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
2108 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2109 	TP_ARGS(wiphy, wdev)
2110 );
2111 
2112 DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
2113 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2114 	TP_ARGS(wiphy, wdev)
2115 );
2116 
2117 TRACE_EVENT(rdev_start_nan,
2118 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2119 		 struct cfg80211_nan_conf *conf),
2120 	TP_ARGS(wiphy, wdev, conf),
2121 	TP_STRUCT__entry(
2122 		WIPHY_ENTRY
2123 		WDEV_ENTRY
2124 		__field(u8, master_pref)
2125 		__field(u8, bands)
2126 	),
2127 	TP_fast_assign(
2128 		WIPHY_ASSIGN;
2129 		WDEV_ASSIGN;
2130 		__entry->master_pref = conf->master_pref;
2131 		__entry->bands = conf->bands;
2132 	),
2133 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT
2134 		  ", master preference: %u, bands: 0x%0x",
2135 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->master_pref,
2136 		  __entry->bands)
2137 );
2138 
2139 TRACE_EVENT(rdev_nan_change_conf,
2140 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2141 		 struct cfg80211_nan_conf *conf, u32 changes),
2142 	TP_ARGS(wiphy, wdev, conf, changes),
2143 	TP_STRUCT__entry(
2144 		WIPHY_ENTRY
2145 		WDEV_ENTRY
2146 		__field(u8, master_pref)
2147 		__field(u8, bands)
2148 		__field(u32, changes)
2149 	),
2150 	TP_fast_assign(
2151 		WIPHY_ASSIGN;
2152 		WDEV_ASSIGN;
2153 		__entry->master_pref = conf->master_pref;
2154 		__entry->bands = conf->bands;
2155 		__entry->changes = changes;
2156 	),
2157 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT
2158 		  ", master preference: %u, bands: 0x%0x, changes: %x",
2159 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->master_pref,
2160 		  __entry->bands, __entry->changes)
2161 );
2162 
2163 DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_nan,
2164 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2165 	TP_ARGS(wiphy, wdev)
2166 );
2167 
2168 TRACE_EVENT(rdev_add_nan_func,
2169 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2170 		 const struct cfg80211_nan_func *func),
2171 	TP_ARGS(wiphy, wdev, func),
2172 	TP_STRUCT__entry(
2173 		WIPHY_ENTRY
2174 		WDEV_ENTRY
2175 		__field(u8, func_type)
2176 		__field(u64, cookie)
2177 	),
2178 	TP_fast_assign(
2179 		WIPHY_ASSIGN;
2180 		WDEV_ASSIGN;
2181 		__entry->func_type = func->type;
2182 		__entry->cookie = func->cookie
2183 	),
2184 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type=%u, cookie=%llu",
2185 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->func_type,
2186 		  __entry->cookie)
2187 );
2188 
2189 TRACE_EVENT(rdev_del_nan_func,
2190 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2191 		 u64 cookie),
2192 	TP_ARGS(wiphy, wdev, cookie),
2193 	TP_STRUCT__entry(
2194 		WIPHY_ENTRY
2195 		WDEV_ENTRY
2196 		__field(u64, cookie)
2197 	),
2198 	TP_fast_assign(
2199 		WIPHY_ASSIGN;
2200 		WDEV_ASSIGN;
2201 		__entry->cookie = cookie;
2202 	),
2203 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie=%llu",
2204 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
2205 );
2206 
2207 TRACE_EVENT(rdev_set_mac_acl,
2208 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2209 		 struct cfg80211_acl_data *params),
2210 	TP_ARGS(wiphy, netdev, params),
2211 	TP_STRUCT__entry(
2212 		WIPHY_ENTRY
2213 		NETDEV_ENTRY
2214 		__field(u32, acl_policy)
2215 	),
2216 	TP_fast_assign(
2217 		WIPHY_ASSIGN;
2218 		NETDEV_ASSIGN;
2219 		__entry->acl_policy = params->acl_policy;
2220 	),
2221 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", acl policy: %d",
2222 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->acl_policy)
2223 );
2224 
2225 TRACE_EVENT(rdev_update_ft_ies,
2226 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2227 		 struct cfg80211_update_ft_ies_params *ftie),
2228 	TP_ARGS(wiphy, netdev, ftie),
2229 	TP_STRUCT__entry(
2230 		WIPHY_ENTRY
2231 		NETDEV_ENTRY
2232 		__field(u16, md)
2233 		__dynamic_array(u8, ie, ftie->ie_len)
2234 	),
2235 	TP_fast_assign(
2236 		WIPHY_ASSIGN;
2237 		NETDEV_ASSIGN;
2238 		__entry->md = ftie->md;
2239 		memcpy(__get_dynamic_array(ie), ftie->ie, ftie->ie_len);
2240 	),
2241 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", md: 0x%x",
2242 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->md)
2243 );
2244 
2245 TRACE_EVENT(rdev_crit_proto_start,
2246 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2247 		 enum nl80211_crit_proto_id protocol, u16 duration),
2248 	TP_ARGS(wiphy, wdev, protocol, duration),
2249 	TP_STRUCT__entry(
2250 		WIPHY_ENTRY
2251 		WDEV_ENTRY
2252 		__field(u16, proto)
2253 		__field(u16, duration)
2254 	),
2255 	TP_fast_assign(
2256 		WIPHY_ASSIGN;
2257 		WDEV_ASSIGN;
2258 		__entry->proto = protocol;
2259 		__entry->duration = duration;
2260 	),
2261 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", proto=%x, duration=%u",
2262 		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->proto, __entry->duration)
2263 );
2264 
2265 TRACE_EVENT(rdev_crit_proto_stop,
2266 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2267 	TP_ARGS(wiphy, wdev),
2268 	TP_STRUCT__entry(
2269 		WIPHY_ENTRY
2270 		WDEV_ENTRY
2271 	),
2272 	TP_fast_assign(
2273 		WIPHY_ASSIGN;
2274 		WDEV_ASSIGN;
2275 	),
2276 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
2277 		  WIPHY_PR_ARG, WDEV_PR_ARG)
2278 );
2279 
2280 TRACE_EVENT(rdev_channel_switch,
2281 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2282 		 struct cfg80211_csa_settings *params),
2283 	TP_ARGS(wiphy, netdev, params),
2284 	TP_STRUCT__entry(
2285 		WIPHY_ENTRY
2286 		NETDEV_ENTRY
2287 		CHAN_DEF_ENTRY
2288 		__field(bool, radar_required)
2289 		__field(bool, block_tx)
2290 		__field(u8, count)
2291 		__dynamic_array(u16, bcn_ofs, params->n_counter_offsets_beacon)
2292 		__dynamic_array(u16, pres_ofs, params->n_counter_offsets_presp)
2293 	),
2294 	TP_fast_assign(
2295 		WIPHY_ASSIGN;
2296 		NETDEV_ASSIGN;
2297 		CHAN_DEF_ASSIGN(&params->chandef);
2298 		__entry->radar_required = params->radar_required;
2299 		__entry->block_tx = params->block_tx;
2300 		__entry->count = params->count;
2301 		memcpy(__get_dynamic_array(bcn_ofs),
2302 		       params->counter_offsets_beacon,
2303 		       params->n_counter_offsets_beacon * sizeof(u16));
2304 
2305 		/* probe response offsets are optional */
2306 		if (params->n_counter_offsets_presp)
2307 			memcpy(__get_dynamic_array(pres_ofs),
2308 			       params->counter_offsets_presp,
2309 			       params->n_counter_offsets_presp * sizeof(u16));
2310 	),
2311 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
2312 		  ", block_tx: %d, count: %u, radar_required: %d",
2313 		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2314 		  __entry->block_tx, __entry->count, __entry->radar_required)
2315 );
2316 
2317 TRACE_EVENT(rdev_set_qos_map,
2318 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2319 		 struct cfg80211_qos_map *qos_map),
2320 	TP_ARGS(wiphy, netdev, qos_map),
2321 	TP_STRUCT__entry(
2322 		WIPHY_ENTRY
2323 		NETDEV_ENTRY
2324 		QOS_MAP_ENTRY
2325 	),
2326 	TP_fast_assign(
2327 		WIPHY_ASSIGN;
2328 		NETDEV_ASSIGN;
2329 		QOS_MAP_ASSIGN(qos_map);
2330 	),
2331 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", num_des: %u",
2332 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->num_des)
2333 );
2334 
2335 TRACE_EVENT(rdev_set_ap_chanwidth,
2336 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2337 		 unsigned int link_id,
2338 		 struct cfg80211_chan_def *chandef),
2339 	TP_ARGS(wiphy, netdev, link_id, chandef),
2340 	TP_STRUCT__entry(
2341 		WIPHY_ENTRY
2342 		NETDEV_ENTRY
2343 		CHAN_DEF_ENTRY
2344 		__field(unsigned int, link_id)
2345 	),
2346 	TP_fast_assign(
2347 		WIPHY_ASSIGN;
2348 		NETDEV_ASSIGN;
2349 		CHAN_DEF_ASSIGN(chandef);
2350 		__entry->link_id = link_id;
2351 	),
2352 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
2353 		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2354 		  __entry->link_id)
2355 );
2356 
2357 TRACE_EVENT(rdev_add_tx_ts,
2358 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2359 		 u8 tsid, const u8 *peer, u8 user_prio, u16 admitted_time),
2360 	TP_ARGS(wiphy, netdev, tsid, peer, user_prio, admitted_time),
2361 	TP_STRUCT__entry(
2362 		WIPHY_ENTRY
2363 		NETDEV_ENTRY
2364 		MAC_ENTRY(peer)
2365 		__field(u8, tsid)
2366 		__field(u8, user_prio)
2367 		__field(u16, admitted_time)
2368 	),
2369 	TP_fast_assign(
2370 		WIPHY_ASSIGN;
2371 		NETDEV_ASSIGN;
2372 		MAC_ASSIGN(peer, peer);
2373 		__entry->tsid = tsid;
2374 		__entry->user_prio = user_prio;
2375 		__entry->admitted_time = admitted_time;
2376 	),
2377 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", TSID %d, UP %d, time %d",
2378 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
2379 		  __entry->tsid, __entry->user_prio, __entry->admitted_time)
2380 );
2381 
2382 TRACE_EVENT(rdev_del_tx_ts,
2383 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2384 		 u8 tsid, const u8 *peer),
2385 	TP_ARGS(wiphy, netdev, tsid, peer),
2386 	TP_STRUCT__entry(
2387 		WIPHY_ENTRY
2388 		NETDEV_ENTRY
2389 		MAC_ENTRY(peer)
2390 		__field(u8, tsid)
2391 	),
2392 	TP_fast_assign(
2393 		WIPHY_ASSIGN;
2394 		NETDEV_ASSIGN;
2395 		MAC_ASSIGN(peer, peer);
2396 		__entry->tsid = tsid;
2397 	),
2398 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", TSID %d",
2399 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tsid)
2400 );
2401 
2402 TRACE_EVENT(rdev_tdls_channel_switch,
2403 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2404 		 const u8 *addr, u8 oper_class,
2405 		 struct cfg80211_chan_def *chandef),
2406 	TP_ARGS(wiphy, netdev, addr, oper_class, chandef),
2407 	TP_STRUCT__entry(
2408 		WIPHY_ENTRY
2409 		NETDEV_ENTRY
2410 		MAC_ENTRY(addr)
2411 		__field(u8, oper_class)
2412 		CHAN_DEF_ENTRY
2413 	),
2414 	TP_fast_assign(
2415 		WIPHY_ASSIGN;
2416 		NETDEV_ASSIGN;
2417 		MAC_ASSIGN(addr, addr);
2418 		CHAN_DEF_ASSIGN(chandef);
2419 	),
2420 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT
2421 		  " oper class %d, " CHAN_DEF_PR_FMT,
2422 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(addr),
2423 		  __entry->oper_class, CHAN_DEF_PR_ARG)
2424 );
2425 
2426 TRACE_EVENT(rdev_tdls_cancel_channel_switch,
2427 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2428 		 const u8 *addr),
2429 	TP_ARGS(wiphy, netdev, addr),
2430 	TP_STRUCT__entry(
2431 		WIPHY_ENTRY
2432 		NETDEV_ENTRY
2433 		MAC_ENTRY(addr)
2434 	),
2435 	TP_fast_assign(
2436 		WIPHY_ASSIGN;
2437 		NETDEV_ASSIGN;
2438 		MAC_ASSIGN(addr, addr);
2439 	),
2440 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
2441 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(addr))
2442 );
2443 
2444 TRACE_EVENT(rdev_set_pmk,
2445 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2446 		 struct cfg80211_pmk_conf *pmk_conf),
2447 
2448 	TP_ARGS(wiphy, netdev, pmk_conf),
2449 
2450 	TP_STRUCT__entry(
2451 		WIPHY_ENTRY
2452 		NETDEV_ENTRY
2453 		MAC_ENTRY(aa)
2454 		__field(u8, pmk_len)
2455 		__field(u8, pmk_r0_name_len)
2456 		__dynamic_array(u8, pmk, pmk_conf->pmk_len)
2457 		__dynamic_array(u8, pmk_r0_name, WLAN_PMK_NAME_LEN)
2458 	),
2459 
2460 	TP_fast_assign(
2461 		WIPHY_ASSIGN;
2462 		NETDEV_ASSIGN;
2463 		MAC_ASSIGN(aa, pmk_conf->aa);
2464 		__entry->pmk_len = pmk_conf->pmk_len;
2465 		__entry->pmk_r0_name_len =
2466 		pmk_conf->pmk_r0_name ? WLAN_PMK_NAME_LEN : 0;
2467 		memcpy(__get_dynamic_array(pmk), pmk_conf->pmk,
2468 		       pmk_conf->pmk_len);
2469 		memcpy(__get_dynamic_array(pmk_r0_name), pmk_conf->pmk_r0_name,
2470 		       pmk_conf->pmk_r0_name ? WLAN_PMK_NAME_LEN : 0);
2471 	),
2472 
2473 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT
2474 		  "pmk_len=%u, pmk: %s pmk_r0_name: %s", WIPHY_PR_ARG,
2475 		  NETDEV_PR_ARG, MAC_PR_ARG(aa), __entry->pmk_len,
2476 		  __print_array(__get_dynamic_array(pmk),
2477 				__get_dynamic_array_len(pmk), 1),
2478 		  __entry->pmk_r0_name_len ?
2479 		  __print_array(__get_dynamic_array(pmk_r0_name),
2480 				__get_dynamic_array_len(pmk_r0_name), 1) : "")
2481 );
2482 
2483 TRACE_EVENT(rdev_del_pmk,
2484 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *aa),
2485 
2486 	TP_ARGS(wiphy, netdev, aa),
2487 
2488 	TP_STRUCT__entry(
2489 		WIPHY_ENTRY
2490 		NETDEV_ENTRY
2491 		MAC_ENTRY(aa)
2492 	),
2493 
2494 	TP_fast_assign(
2495 		WIPHY_ASSIGN;
2496 		NETDEV_ASSIGN;
2497 		MAC_ASSIGN(aa, aa);
2498 	),
2499 
2500 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
2501 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(aa))
2502 );
2503 
2504 TRACE_EVENT(rdev_external_auth,
2505 	    TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2506 		     struct cfg80211_external_auth_params *params),
2507 	    TP_ARGS(wiphy, netdev, params),
2508 	    TP_STRUCT__entry(WIPHY_ENTRY
2509 			     NETDEV_ENTRY
2510 			     MAC_ENTRY(bssid)
2511 			     __array(u8, ssid, IEEE80211_MAX_SSID_LEN + 1)
2512 			     __field(u16, status)
2513 	    ),
2514 	    TP_fast_assign(WIPHY_ASSIGN;
2515 			   NETDEV_ASSIGN;
2516 			   MAC_ASSIGN(bssid, params->bssid);
2517 			   memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
2518 			   memcpy(__entry->ssid, params->ssid.ssid,
2519 				  params->ssid.ssid_len);
2520 			   __entry->status = params->status;
2521 	    ),
2522 	    TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
2523 		      ", ssid: %s, status: %u", WIPHY_PR_ARG, NETDEV_PR_ARG,
2524 		      __entry->bssid, __entry->ssid, __entry->status)
2525 );
2526 
2527 TRACE_EVENT(rdev_start_radar_detection,
2528 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2529 		 struct cfg80211_chan_def *chandef,
2530 		 u32 cac_time_ms),
2531 	TP_ARGS(wiphy, netdev, chandef, cac_time_ms),
2532 	TP_STRUCT__entry(
2533 		WIPHY_ENTRY
2534 		NETDEV_ENTRY
2535 		CHAN_DEF_ENTRY
2536 		__field(u32, cac_time_ms)
2537 	),
2538 	TP_fast_assign(
2539 		WIPHY_ASSIGN;
2540 		NETDEV_ASSIGN;
2541 		CHAN_DEF_ASSIGN(chandef);
2542 		__entry->cac_time_ms = cac_time_ms;
2543 	),
2544 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
2545 		  ", cac_time_ms=%u",
2546 		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2547 		  __entry->cac_time_ms)
2548 );
2549 
2550 TRACE_EVENT(rdev_set_mcast_rate,
2551 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2552 		 int *mcast_rate),
2553 	TP_ARGS(wiphy, netdev, mcast_rate),
2554 	TP_STRUCT__entry(
2555 		WIPHY_ENTRY
2556 		NETDEV_ENTRY
2557 		__array(int, mcast_rate, NUM_NL80211_BANDS)
2558 	),
2559 	TP_fast_assign(
2560 		WIPHY_ASSIGN;
2561 		NETDEV_ASSIGN;
2562 		memcpy(__entry->mcast_rate, mcast_rate,
2563 		       sizeof(int) * NUM_NL80211_BANDS);
2564 	),
2565 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", "
2566 		  "mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 6GHz=0x%x, 60GHz=0x%x]",
2567 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
2568 		  __entry->mcast_rate[NL80211_BAND_2GHZ],
2569 		  __entry->mcast_rate[NL80211_BAND_5GHZ],
2570 		  __entry->mcast_rate[NL80211_BAND_6GHZ],
2571 		  __entry->mcast_rate[NL80211_BAND_60GHZ])
2572 );
2573 
2574 TRACE_EVENT(rdev_set_coalesce,
2575 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_coalesce *coalesce),
2576 	TP_ARGS(wiphy, coalesce),
2577 	TP_STRUCT__entry(
2578 		WIPHY_ENTRY
2579 		__field(int, n_rules)
2580 	),
2581 	TP_fast_assign(
2582 		WIPHY_ASSIGN;
2583 		__entry->n_rules = coalesce ? coalesce->n_rules : 0;
2584 	),
2585 	TP_printk(WIPHY_PR_FMT ", n_rules=%d",
2586 		  WIPHY_PR_ARG, __entry->n_rules)
2587 );
2588 
2589 DEFINE_EVENT(wiphy_wdev_evt, rdev_abort_scan,
2590 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2591 	TP_ARGS(wiphy, wdev)
2592 );
2593 
2594 TRACE_EVENT(rdev_set_multicast_to_unicast,
2595 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2596 		 const bool enabled),
2597 	TP_ARGS(wiphy, netdev, enabled),
2598 	TP_STRUCT__entry(
2599 		WIPHY_ENTRY
2600 		NETDEV_ENTRY
2601 		__field(bool, enabled)
2602 	),
2603 	TP_fast_assign(
2604 		WIPHY_ASSIGN;
2605 		NETDEV_ASSIGN;
2606 		__entry->enabled = enabled;
2607 	),
2608 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", unicast: %s",
2609 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
2610 		  BOOL_TO_STR(__entry->enabled))
2611 );
2612 
2613 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_txq_stats,
2614 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2615 	TP_ARGS(wiphy, wdev)
2616 );
2617 
2618 TRACE_EVENT(rdev_get_ftm_responder_stats,
2619 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2620 		 struct cfg80211_ftm_responder_stats *ftm_stats),
2621 
2622 	TP_ARGS(wiphy, netdev, ftm_stats),
2623 
2624 	TP_STRUCT__entry(
2625 		WIPHY_ENTRY
2626 		NETDEV_ENTRY
2627 		__field(u64, timestamp)
2628 		__field(u32, success_num)
2629 		__field(u32, partial_num)
2630 		__field(u32, failed_num)
2631 		__field(u32, asap_num)
2632 		__field(u32, non_asap_num)
2633 		__field(u64, duration)
2634 		__field(u32, unknown_triggers)
2635 		__field(u32, reschedule)
2636 		__field(u32, out_of_window)
2637 	),
2638 
2639 	TP_fast_assign(
2640 		WIPHY_ASSIGN;
2641 		NETDEV_ASSIGN;
2642 		__entry->success_num = ftm_stats->success_num;
2643 		__entry->partial_num = ftm_stats->partial_num;
2644 		__entry->failed_num = ftm_stats->failed_num;
2645 		__entry->asap_num = ftm_stats->asap_num;
2646 		__entry->non_asap_num = ftm_stats->non_asap_num;
2647 		__entry->duration = ftm_stats->total_duration_ms;
2648 		__entry->unknown_triggers = ftm_stats->unknown_triggers_num;
2649 		__entry->reschedule = ftm_stats->reschedule_requests_num;
2650 		__entry->out_of_window = ftm_stats->out_of_window_triggers_num;
2651 	),
2652 
2653 	TP_printk(WIPHY_PR_FMT "Ftm responder stats: success %u, partial %u, "
2654 		"failed %u, asap %u, non asap %u, total duration %llu, unknown "
2655 		"triggers %u, rescheduled %u, out of window %u", WIPHY_PR_ARG,
2656 		__entry->success_num, __entry->partial_num, __entry->failed_num,
2657 		__entry->asap_num, __entry->non_asap_num, __entry->duration,
2658 		__entry->unknown_triggers, __entry->reschedule,
2659 		__entry->out_of_window)
2660 );
2661 
2662 DEFINE_EVENT(wiphy_wdev_cookie_evt, rdev_start_pmsr,
2663 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
2664 	TP_ARGS(wiphy, wdev, cookie)
2665 );
2666 
2667 DEFINE_EVENT(wiphy_wdev_cookie_evt, rdev_abort_pmsr,
2668 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
2669 	TP_ARGS(wiphy, wdev, cookie)
2670 );
2671 
2672 TRACE_EVENT(rdev_set_fils_aad,
2673 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2674 		 struct cfg80211_fils_aad *fils_aad),
2675 	TP_ARGS(wiphy, netdev, fils_aad),
2676 	TP_STRUCT__entry(WIPHY_ENTRY
2677 		NETDEV_ENTRY
2678 		__array(u8, macaddr, ETH_ALEN)
2679 		__field(u8, kek_len)
2680 	),
2681 	TP_fast_assign(WIPHY_ASSIGN;
2682 		NETDEV_ASSIGN;
2683 		FILS_AAD_ASSIGN(fils_aad);
2684 	),
2685 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " FILS_AAD_PR_FMT,
2686 		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->macaddr,
2687 		  __entry->kek_len)
2688 );
2689 
2690 TRACE_EVENT(rdev_update_owe_info,
2691 	    TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2692 		     struct cfg80211_update_owe_info *owe_info),
2693 	    TP_ARGS(wiphy, netdev, owe_info),
2694 	    TP_STRUCT__entry(WIPHY_ENTRY
2695 			     NETDEV_ENTRY
2696 			     MAC_ENTRY(peer)
2697 			     __field(u16, status)
2698 			     __dynamic_array(u8, ie, owe_info->ie_len)),
2699 	    TP_fast_assign(WIPHY_ASSIGN;
2700 			   NETDEV_ASSIGN;
2701 			   MAC_ASSIGN(peer, owe_info->peer);
2702 			   __entry->status = owe_info->status;
2703 			   memcpy(__get_dynamic_array(ie),
2704 				  owe_info->ie, owe_info->ie_len);),
2705 	    TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT
2706 		  " status %d", WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
2707 		  __entry->status)
2708 );
2709 
2710 TRACE_EVENT(rdev_probe_mesh_link,
2711 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2712 		 const u8 *dest, const u8 *buf, size_t len),
2713 	TP_ARGS(wiphy, netdev, dest, buf, len),
2714 	TP_STRUCT__entry(
2715 		WIPHY_ENTRY
2716 		NETDEV_ENTRY
2717 		MAC_ENTRY(dest)
2718 	),
2719 	TP_fast_assign(
2720 		WIPHY_ASSIGN;
2721 		NETDEV_ASSIGN;
2722 		MAC_ASSIGN(dest, dest);
2723 	),
2724 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
2725 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dest))
2726 );
2727 
2728 TRACE_EVENT(rdev_set_tid_config,
2729 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2730 		 struct cfg80211_tid_config *tid_conf),
2731 	TP_ARGS(wiphy, netdev, tid_conf),
2732 	TP_STRUCT__entry(
2733 		WIPHY_ENTRY
2734 		NETDEV_ENTRY
2735 		MAC_ENTRY(peer)
2736 	),
2737 	TP_fast_assign(
2738 		WIPHY_ASSIGN;
2739 		NETDEV_ASSIGN;
2740 		MAC_ASSIGN(peer, tid_conf->peer);
2741 	),
2742 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
2743 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
2744 );
2745 
2746 TRACE_EVENT(rdev_reset_tid_config,
2747 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2748 		 const u8 *peer, u8 tids),
2749 	TP_ARGS(wiphy, netdev, peer, tids),
2750 	TP_STRUCT__entry(
2751 		WIPHY_ENTRY
2752 		NETDEV_ENTRY
2753 		MAC_ENTRY(peer)
2754 		__field(u8, tids)
2755 	),
2756 	TP_fast_assign(
2757 		WIPHY_ASSIGN;
2758 		NETDEV_ASSIGN;
2759 		MAC_ASSIGN(peer, peer);
2760 		__entry->tids = tids;
2761 	),
2762 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", tids: 0x%x",
2763 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tids)
2764 );
2765 
2766 TRACE_EVENT(rdev_set_sar_specs,
2767 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_sar_specs *sar),
2768 	TP_ARGS(wiphy, sar),
2769 	TP_STRUCT__entry(
2770 		WIPHY_ENTRY
2771 		__field(u16, type)
2772 		__field(u16, num)
2773 	),
2774 	TP_fast_assign(
2775 		WIPHY_ASSIGN;
2776 		__entry->type = sar->type;
2777 		__entry->num = sar->num_sub_specs;
2778 
2779 	),
2780 	TP_printk(WIPHY_PR_FMT ", Set type:%d, num_specs:%d",
2781 		  WIPHY_PR_ARG, __entry->type, __entry->num)
2782 );
2783 
2784 TRACE_EVENT(rdev_color_change,
2785 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2786 		 struct cfg80211_color_change_settings *params),
2787 	TP_ARGS(wiphy, netdev, params),
2788 	TP_STRUCT__entry(
2789 		WIPHY_ENTRY
2790 		NETDEV_ENTRY
2791 		__field(u8, count)
2792 		__field(u16, bcn_ofs)
2793 		__field(u16, pres_ofs)
2794 	),
2795 	TP_fast_assign(
2796 		WIPHY_ASSIGN;
2797 		NETDEV_ASSIGN;
2798 		__entry->count = params->count;
2799 		__entry->bcn_ofs = params->counter_offset_beacon;
2800 		__entry->pres_ofs = params->counter_offset_presp;
2801 	),
2802 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
2803 		  ", count: %u",
2804 		  WIPHY_PR_ARG, NETDEV_PR_ARG,
2805 		  __entry->count)
2806 );
2807 
2808 TRACE_EVENT(rdev_set_radar_background,
2809 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
2810 
2811 	TP_ARGS(wiphy, chandef),
2812 
2813 	TP_STRUCT__entry(
2814 		WIPHY_ENTRY
2815 		CHAN_DEF_ENTRY
2816 	),
2817 
2818 	TP_fast_assign(
2819 		WIPHY_ASSIGN;
2820 		CHAN_DEF_ASSIGN(chandef)
2821 	),
2822 
2823 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
2824 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
2825 );
2826 
2827 DEFINE_EVENT(wiphy_wdev_link_evt, rdev_add_intf_link,
2828 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2829 		 unsigned int link_id),
2830 	TP_ARGS(wiphy, wdev, link_id)
2831 );
2832 
2833 DEFINE_EVENT(wiphy_wdev_link_evt, rdev_del_intf_link,
2834 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2835 		 unsigned int link_id),
2836 	TP_ARGS(wiphy, wdev, link_id)
2837 );
2838 
2839 /*************************************************************
2840  *	     cfg80211 exported functions traces		     *
2841  *************************************************************/
2842 
2843 TRACE_EVENT(cfg80211_return_bool,
2844 	TP_PROTO(bool ret),
2845 	TP_ARGS(ret),
2846 	TP_STRUCT__entry(
2847 		__field(bool, ret)
2848 	),
2849 	TP_fast_assign(
2850 		__entry->ret = ret;
2851 	),
2852 	TP_printk("returned %s", BOOL_TO_STR(__entry->ret))
2853 );
2854 
2855 DECLARE_EVENT_CLASS(cfg80211_netdev_mac_evt,
2856 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
2857 	TP_ARGS(netdev, macaddr),
2858 	TP_STRUCT__entry(
2859 		NETDEV_ENTRY
2860 		MAC_ENTRY(macaddr)
2861 	),
2862 	TP_fast_assign(
2863 		NETDEV_ASSIGN;
2864 		MAC_ASSIGN(macaddr, macaddr);
2865 	),
2866 	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
2867 		  NETDEV_PR_ARG, MAC_PR_ARG(macaddr))
2868 );
2869 
2870 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_notify_new_peer_candidate,
2871 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
2872 	TP_ARGS(netdev, macaddr)
2873 );
2874 
2875 DECLARE_EVENT_CLASS(netdev_evt_only,
2876 	TP_PROTO(struct net_device *netdev),
2877 	TP_ARGS(netdev),
2878 	TP_STRUCT__entry(
2879 		NETDEV_ENTRY
2880 	),
2881 	TP_fast_assign(
2882 		NETDEV_ASSIGN;
2883 	),
2884 	TP_printk(NETDEV_PR_FMT , NETDEV_PR_ARG)
2885 );
2886 
2887 DEFINE_EVENT(netdev_evt_only, cfg80211_send_rx_auth,
2888 	TP_PROTO(struct net_device *netdev),
2889 	TP_ARGS(netdev)
2890 );
2891 
2892 TRACE_EVENT(cfg80211_send_rx_assoc,
2893 	TP_PROTO(struct net_device *netdev,
2894 		 struct cfg80211_rx_assoc_resp *data),
2895 	TP_ARGS(netdev, data),
2896 	TP_STRUCT__entry(
2897 		NETDEV_ENTRY
2898 		MAC_ENTRY(ap_addr)
2899 	),
2900 	TP_fast_assign(
2901 		NETDEV_ASSIGN;
2902 		MAC_ASSIGN(ap_addr,
2903 			   data->ap_mld_addr ?: data->links[0].bss->bssid);
2904 	),
2905 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT,
2906 		  NETDEV_PR_ARG, MAC_PR_ARG(ap_addr))
2907 );
2908 
2909 DECLARE_EVENT_CLASS(netdev_frame_event,
2910 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2911 	TP_ARGS(netdev, buf, len),
2912 	TP_STRUCT__entry(
2913 		NETDEV_ENTRY
2914 		__dynamic_array(u8, frame, len)
2915 	),
2916 	TP_fast_assign(
2917 		NETDEV_ASSIGN;
2918 		memcpy(__get_dynamic_array(frame), buf, len);
2919 	),
2920 	TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x",
2921 		  NETDEV_PR_ARG,
2922 		  le16_to_cpup((__le16 *)__get_dynamic_array(frame)))
2923 );
2924 
2925 DEFINE_EVENT(netdev_frame_event, cfg80211_rx_unprot_mlme_mgmt,
2926 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2927 	TP_ARGS(netdev, buf, len)
2928 );
2929 
2930 DEFINE_EVENT(netdev_frame_event, cfg80211_rx_mlme_mgmt,
2931 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2932 	TP_ARGS(netdev, buf, len)
2933 );
2934 
2935 TRACE_EVENT(cfg80211_tx_mlme_mgmt,
2936 	TP_PROTO(struct net_device *netdev, const u8 *buf, int len,
2937 		 bool reconnect),
2938 	TP_ARGS(netdev, buf, len, reconnect),
2939 	TP_STRUCT__entry(
2940 		NETDEV_ENTRY
2941 		__dynamic_array(u8, frame, len)
2942 		__field(int, reconnect)
2943 	),
2944 	TP_fast_assign(
2945 		NETDEV_ASSIGN;
2946 		memcpy(__get_dynamic_array(frame), buf, len);
2947 		__entry->reconnect = reconnect;
2948 	),
2949 	TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x reconnect:%d",
2950 		  NETDEV_PR_ARG,
2951 		  le16_to_cpup((__le16 *)__get_dynamic_array(frame)),
2952 		  __entry->reconnect)
2953 );
2954 
2955 DECLARE_EVENT_CLASS(netdev_mac_evt,
2956 	TP_PROTO(struct net_device *netdev, const u8 *mac),
2957 	TP_ARGS(netdev, mac),
2958 	TP_STRUCT__entry(
2959 		NETDEV_ENTRY
2960 		MAC_ENTRY(mac)
2961 	),
2962 	TP_fast_assign(
2963 		NETDEV_ASSIGN;
2964 		MAC_ASSIGN(mac, mac)
2965 	),
2966 	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
2967 		  NETDEV_PR_ARG, MAC_PR_ARG(mac))
2968 );
2969 
2970 DEFINE_EVENT(netdev_mac_evt, cfg80211_send_auth_timeout,
2971 	TP_PROTO(struct net_device *netdev, const u8 *mac),
2972 	TP_ARGS(netdev, mac)
2973 );
2974 
2975 TRACE_EVENT(cfg80211_send_assoc_failure,
2976 	TP_PROTO(struct net_device *netdev,
2977 		 struct cfg80211_assoc_failure *data),
2978 	TP_ARGS(netdev, data),
2979 	TP_STRUCT__entry(
2980 		NETDEV_ENTRY
2981 		MAC_ENTRY(ap_addr)
2982 		__field(bool, timeout)
2983 	),
2984 	TP_fast_assign(
2985 		NETDEV_ASSIGN;
2986 		MAC_ASSIGN(ap_addr, data->ap_mld_addr ?: data->bss[0]->bssid);
2987 		__entry->timeout = data->timeout;
2988 	),
2989 	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT ", timeout: %d",
2990 		  NETDEV_PR_ARG, MAC_PR_ARG(ap_addr), __entry->timeout)
2991 );
2992 
2993 TRACE_EVENT(cfg80211_michael_mic_failure,
2994 	TP_PROTO(struct net_device *netdev, const u8 *addr,
2995 		 enum nl80211_key_type key_type, int key_id, const u8 *tsc),
2996 	TP_ARGS(netdev, addr, key_type, key_id, tsc),
2997 	TP_STRUCT__entry(
2998 		NETDEV_ENTRY
2999 		MAC_ENTRY(addr)
3000 		__field(enum nl80211_key_type, key_type)
3001 		__field(int, key_id)
3002 		__array(u8, tsc, 6)
3003 	),
3004 	TP_fast_assign(
3005 		NETDEV_ASSIGN;
3006 		MAC_ASSIGN(addr, addr);
3007 		__entry->key_type = key_type;
3008 		__entry->key_id = key_id;
3009 		if (tsc)
3010 			memcpy(__entry->tsc, tsc, 6);
3011 	),
3012 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", key type: %d, key id: %d, tsc: %pm",
3013 		  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->key_type,
3014 		  __entry->key_id, __entry->tsc)
3015 );
3016 
3017 TRACE_EVENT(cfg80211_ready_on_channel,
3018 	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
3019 		 struct ieee80211_channel *chan,
3020 		 unsigned int duration),
3021 	TP_ARGS(wdev, cookie, chan, duration),
3022 	TP_STRUCT__entry(
3023 		WDEV_ENTRY
3024 		__field(u64, cookie)
3025 		CHAN_ENTRY
3026 		__field(unsigned int, duration)
3027 	),
3028 	TP_fast_assign(
3029 		WDEV_ASSIGN;
3030 		__entry->cookie = cookie;
3031 		CHAN_ASSIGN(chan);
3032 		__entry->duration = duration;
3033 	),
3034 	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
3035 		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
3036 		  __entry->duration)
3037 );
3038 
3039 TRACE_EVENT(cfg80211_ready_on_channel_expired,
3040 	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
3041 		 struct ieee80211_channel *chan),
3042 	TP_ARGS(wdev, cookie, chan),
3043 	TP_STRUCT__entry(
3044 		WDEV_ENTRY
3045 		__field(u64, cookie)
3046 		CHAN_ENTRY
3047 	),
3048 	TP_fast_assign(
3049 		WDEV_ASSIGN;
3050 		__entry->cookie = cookie;
3051 		CHAN_ASSIGN(chan);
3052 	),
3053 	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
3054 		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
3055 );
3056 
3057 TRACE_EVENT(cfg80211_tx_mgmt_expired,
3058 	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
3059 		 struct ieee80211_channel *chan),
3060 	TP_ARGS(wdev, cookie, chan),
3061 	TP_STRUCT__entry(
3062 		WDEV_ENTRY
3063 		__field(u64, cookie)
3064 		CHAN_ENTRY
3065 	),
3066 	TP_fast_assign(
3067 		WDEV_ASSIGN;
3068 		__entry->cookie = cookie;
3069 		CHAN_ASSIGN(chan);
3070 	),
3071 	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
3072 		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
3073 );
3074 
3075 TRACE_EVENT(cfg80211_new_sta,
3076 	TP_PROTO(struct net_device *netdev, const u8 *mac_addr,
3077 		 struct station_info *sinfo),
3078 	TP_ARGS(netdev, mac_addr, sinfo),
3079 	TP_STRUCT__entry(
3080 		NETDEV_ENTRY
3081 		MAC_ENTRY(mac_addr)
3082 		SINFO_ENTRY
3083 	),
3084 	TP_fast_assign(
3085 		NETDEV_ASSIGN;
3086 		MAC_ASSIGN(mac_addr, mac_addr);
3087 		SINFO_ASSIGN;
3088 	),
3089 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT,
3090 		  NETDEV_PR_ARG, MAC_PR_ARG(mac_addr))
3091 );
3092 
3093 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta,
3094 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
3095 	TP_ARGS(netdev, macaddr)
3096 );
3097 
3098 TRACE_EVENT(cfg80211_rx_mgmt,
3099 	TP_PROTO(struct wireless_dev *wdev, struct cfg80211_rx_info *info),
3100 	TP_ARGS(wdev, info),
3101 	TP_STRUCT__entry(
3102 		WDEV_ENTRY
3103 		__field(int, freq)
3104 		__field(int, sig_dbm)
3105 	),
3106 	TP_fast_assign(
3107 		WDEV_ASSIGN;
3108 		__entry->freq = info->freq;
3109 		__entry->sig_dbm = info->sig_dbm;
3110 	),
3111 	TP_printk(WDEV_PR_FMT ", freq: "KHZ_F", sig dbm: %d",
3112 		  WDEV_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
3113 );
3114 
3115 TRACE_EVENT(cfg80211_mgmt_tx_status,
3116 	TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
3117 	TP_ARGS(wdev, cookie, ack),
3118 	TP_STRUCT__entry(
3119 		WDEV_ENTRY
3120 		__field(u64, cookie)
3121 		__field(bool, ack)
3122 	),
3123 	TP_fast_assign(
3124 		WDEV_ASSIGN;
3125 		__entry->cookie = cookie;
3126 		__entry->ack = ack;
3127 	),
3128 	TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
3129 		  WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
3130 );
3131 
3132 TRACE_EVENT(cfg80211_control_port_tx_status,
3133 	TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
3134 	TP_ARGS(wdev, cookie, ack),
3135 	TP_STRUCT__entry(
3136 		WDEV_ENTRY
3137 		__field(u64, cookie)
3138 		__field(bool, ack)
3139 	),
3140 	TP_fast_assign(
3141 		WDEV_ASSIGN;
3142 		__entry->cookie = cookie;
3143 		__entry->ack = ack;
3144 	),
3145 	TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
3146 		  WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
3147 );
3148 
3149 TRACE_EVENT(cfg80211_rx_control_port,
3150 	TP_PROTO(struct net_device *netdev, struct sk_buff *skb,
3151 		 bool unencrypted),
3152 	TP_ARGS(netdev, skb, unencrypted),
3153 	TP_STRUCT__entry(
3154 		NETDEV_ENTRY
3155 		__field(int, len)
3156 		MAC_ENTRY(from)
3157 		__field(u16, proto)
3158 		__field(bool, unencrypted)
3159 	),
3160 	TP_fast_assign(
3161 		NETDEV_ASSIGN;
3162 		__entry->len = skb->len;
3163 		MAC_ASSIGN(from, eth_hdr(skb)->h_source);
3164 		__entry->proto = be16_to_cpu(skb->protocol);
3165 		__entry->unencrypted = unencrypted;
3166 	),
3167 	TP_printk(NETDEV_PR_FMT ", len=%d, " MAC_PR_FMT ", proto: 0x%x, unencrypted: %s",
3168 		  NETDEV_PR_ARG, __entry->len, MAC_PR_ARG(from),
3169 		  __entry->proto, BOOL_TO_STR(__entry->unencrypted))
3170 );
3171 
3172 TRACE_EVENT(cfg80211_cqm_rssi_notify,
3173 	TP_PROTO(struct net_device *netdev,
3174 		 enum nl80211_cqm_rssi_threshold_event rssi_event,
3175 		 s32 rssi_level),
3176 	TP_ARGS(netdev, rssi_event, rssi_level),
3177 	TP_STRUCT__entry(
3178 		NETDEV_ENTRY
3179 		__field(enum nl80211_cqm_rssi_threshold_event, rssi_event)
3180 		__field(s32, rssi_level)
3181 	),
3182 	TP_fast_assign(
3183 		NETDEV_ASSIGN;
3184 		__entry->rssi_event = rssi_event;
3185 		__entry->rssi_level = rssi_level;
3186 	),
3187 	TP_printk(NETDEV_PR_FMT ", rssi event: %d, level: %d",
3188 		  NETDEV_PR_ARG, __entry->rssi_event, __entry->rssi_level)
3189 );
3190 
3191 TRACE_EVENT(cfg80211_reg_can_beacon,
3192 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
3193 		 enum nl80211_iftype iftype, bool check_no_ir),
3194 	TP_ARGS(wiphy, chandef, iftype, check_no_ir),
3195 	TP_STRUCT__entry(
3196 		WIPHY_ENTRY
3197 		CHAN_DEF_ENTRY
3198 		__field(enum nl80211_iftype, iftype)
3199 		__field(bool, check_no_ir)
3200 	),
3201 	TP_fast_assign(
3202 		WIPHY_ASSIGN;
3203 		CHAN_DEF_ASSIGN(chandef);
3204 		__entry->iftype = iftype;
3205 		__entry->check_no_ir = check_no_ir;
3206 	),
3207 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d check_no_ir=%s",
3208 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype,
3209 		  BOOL_TO_STR(__entry->check_no_ir))
3210 );
3211 
3212 TRACE_EVENT(cfg80211_chandef_dfs_required,
3213 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
3214 	TP_ARGS(wiphy, chandef),
3215 	TP_STRUCT__entry(
3216 		WIPHY_ENTRY
3217 		CHAN_DEF_ENTRY
3218 	),
3219 	TP_fast_assign(
3220 		WIPHY_ASSIGN;
3221 		CHAN_DEF_ASSIGN(chandef);
3222 	),
3223 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
3224 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
3225 );
3226 
3227 TRACE_EVENT(cfg80211_ch_switch_notify,
3228 	TP_PROTO(struct net_device *netdev,
3229 		 struct cfg80211_chan_def *chandef,
3230 		 unsigned int link_id),
3231 	TP_ARGS(netdev, chandef, link_id),
3232 	TP_STRUCT__entry(
3233 		NETDEV_ENTRY
3234 		CHAN_DEF_ENTRY
3235 		__field(unsigned int, link_id)
3236 	),
3237 	TP_fast_assign(
3238 		NETDEV_ASSIGN;
3239 		CHAN_DEF_ASSIGN(chandef);
3240 		__entry->link_id = link_id;
3241 	),
3242 	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
3243 		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id)
3244 );
3245 
3246 TRACE_EVENT(cfg80211_ch_switch_started_notify,
3247 	TP_PROTO(struct net_device *netdev,
3248 		 struct cfg80211_chan_def *chandef),
3249 	TP_ARGS(netdev, chandef),
3250 	TP_STRUCT__entry(
3251 		NETDEV_ENTRY
3252 		CHAN_DEF_ENTRY
3253 	),
3254 	TP_fast_assign(
3255 		NETDEV_ASSIGN;
3256 		CHAN_DEF_ASSIGN(chandef);
3257 	),
3258 	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
3259 		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
3260 );
3261 
3262 TRACE_EVENT(cfg80211_radar_event,
3263 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
3264 		 bool offchan),
3265 	TP_ARGS(wiphy, chandef, offchan),
3266 	TP_STRUCT__entry(
3267 		WIPHY_ENTRY
3268 		CHAN_DEF_ENTRY
3269 		__field(bool, offchan)
3270 	),
3271 	TP_fast_assign(
3272 		WIPHY_ASSIGN;
3273 		CHAN_DEF_ASSIGN(chandef);
3274 		__entry->offchan = offchan;
3275 	),
3276 	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", offchan %d",
3277 		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->offchan)
3278 );
3279 
3280 TRACE_EVENT(cfg80211_cac_event,
3281 	TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt),
3282 	TP_ARGS(netdev, evt),
3283 	TP_STRUCT__entry(
3284 		NETDEV_ENTRY
3285 		__field(enum nl80211_radar_event, evt)
3286 	),
3287 	TP_fast_assign(
3288 		NETDEV_ASSIGN;
3289 		__entry->evt = evt;
3290 	),
3291 	TP_printk(NETDEV_PR_FMT ",  event: %d",
3292 		  NETDEV_PR_ARG, __entry->evt)
3293 );
3294 
3295 DECLARE_EVENT_CLASS(cfg80211_rx_evt,
3296 	TP_PROTO(struct net_device *netdev, const u8 *addr),
3297 	TP_ARGS(netdev, addr),
3298 	TP_STRUCT__entry(
3299 		NETDEV_ENTRY
3300 		MAC_ENTRY(addr)
3301 	),
3302 	TP_fast_assign(
3303 		NETDEV_ASSIGN;
3304 		MAC_ASSIGN(addr, addr);
3305 	),
3306 	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT, NETDEV_PR_ARG, MAC_PR_ARG(addr))
3307 );
3308 
3309 DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_spurious_frame,
3310 	TP_PROTO(struct net_device *netdev, const u8 *addr),
3311 	TP_ARGS(netdev, addr)
3312 );
3313 
3314 DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_unexpected_4addr_frame,
3315 	TP_PROTO(struct net_device *netdev, const u8 *addr),
3316 	TP_ARGS(netdev, addr)
3317 );
3318 
3319 TRACE_EVENT(cfg80211_ibss_joined,
3320 	TP_PROTO(struct net_device *netdev, const u8 *bssid,
3321 		 struct ieee80211_channel *channel),
3322 	TP_ARGS(netdev, bssid, channel),
3323 	TP_STRUCT__entry(
3324 		NETDEV_ENTRY
3325 		MAC_ENTRY(bssid)
3326 		CHAN_ENTRY
3327 	),
3328 	TP_fast_assign(
3329 		NETDEV_ASSIGN;
3330 		MAC_ASSIGN(bssid, bssid);
3331 		CHAN_ASSIGN(channel);
3332 	),
3333 	TP_printk(NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", " CHAN_PR_FMT,
3334 		  NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
3335 );
3336 
3337 TRACE_EVENT(cfg80211_probe_status,
3338 	TP_PROTO(struct net_device *netdev, const u8 *addr, u64 cookie,
3339 		 bool acked),
3340 	TP_ARGS(netdev, addr, cookie, acked),
3341 	TP_STRUCT__entry(
3342 		NETDEV_ENTRY
3343 		MAC_ENTRY(addr)
3344 		__field(u64, cookie)
3345 		__field(bool, acked)
3346 	),
3347 	TP_fast_assign(
3348 		NETDEV_ASSIGN;
3349 		MAC_ASSIGN(addr, addr);
3350 		__entry->cookie = cookie;
3351 		__entry->acked = acked;
3352 	),
3353 	TP_printk(NETDEV_PR_FMT " addr:" MAC_PR_FMT ", cookie: %llu, acked: %s",
3354 		  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->cookie,
3355 		  BOOL_TO_STR(__entry->acked))
3356 );
3357 
3358 TRACE_EVENT(cfg80211_cqm_pktloss_notify,
3359 	TP_PROTO(struct net_device *netdev, const u8 *peer, u32 num_packets),
3360 	TP_ARGS(netdev, peer, num_packets),
3361 	TP_STRUCT__entry(
3362 		NETDEV_ENTRY
3363 		MAC_ENTRY(peer)
3364 		__field(u32, num_packets)
3365 	),
3366 	TP_fast_assign(
3367 		NETDEV_ASSIGN;
3368 		MAC_ASSIGN(peer, peer);
3369 		__entry->num_packets = num_packets;
3370 	),
3371 	TP_printk(NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", num of lost packets: %u",
3372 		  NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->num_packets)
3373 );
3374 
3375 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_gtk_rekey_notify,
3376 	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
3377 	TP_ARGS(netdev, macaddr)
3378 );
3379 
3380 TRACE_EVENT(cfg80211_pmksa_candidate_notify,
3381 	TP_PROTO(struct net_device *netdev, int index, const u8 *bssid,
3382 		 bool preauth),
3383 	TP_ARGS(netdev, index, bssid, preauth),
3384 	TP_STRUCT__entry(
3385 		NETDEV_ENTRY
3386 		__field(int, index)
3387 		MAC_ENTRY(bssid)
3388 		__field(bool, preauth)
3389 	),
3390 	TP_fast_assign(
3391 		NETDEV_ASSIGN;
3392 		__entry->index = index;
3393 		MAC_ASSIGN(bssid, bssid);
3394 		__entry->preauth = preauth;
3395 	),
3396 	TP_printk(NETDEV_PR_FMT ", index:%d, bssid: " MAC_PR_FMT ", pre auth: %s",
3397 		  NETDEV_PR_ARG, __entry->index, MAC_PR_ARG(bssid),
3398 		  BOOL_TO_STR(__entry->preauth))
3399 );
3400 
3401 TRACE_EVENT(cfg80211_report_obss_beacon,
3402 	TP_PROTO(struct wiphy *wiphy, const u8 *frame, size_t len,
3403 		 int freq, int sig_dbm),
3404 	TP_ARGS(wiphy, frame, len, freq, sig_dbm),
3405 	TP_STRUCT__entry(
3406 		WIPHY_ENTRY
3407 		__field(int, freq)
3408 		__field(int, sig_dbm)
3409 	),
3410 	TP_fast_assign(
3411 		WIPHY_ASSIGN;
3412 		__entry->freq = freq;
3413 		__entry->sig_dbm = sig_dbm;
3414 	),
3415 	TP_printk(WIPHY_PR_FMT ", freq: "KHZ_F", sig_dbm: %d",
3416 		  WIPHY_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
3417 );
3418 
3419 TRACE_EVENT(cfg80211_tdls_oper_request,
3420 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer,
3421 		 enum nl80211_tdls_operation oper, u16 reason_code),
3422 	TP_ARGS(wiphy, netdev, peer, oper, reason_code),
3423 	TP_STRUCT__entry(
3424 		WIPHY_ENTRY
3425 		NETDEV_ENTRY
3426 		MAC_ENTRY(peer)
3427 		__field(enum nl80211_tdls_operation, oper)
3428 		__field(u16, reason_code)
3429 	),
3430 	TP_fast_assign(
3431 		WIPHY_ASSIGN;
3432 		NETDEV_ASSIGN;
3433 		MAC_ASSIGN(peer, peer);
3434 		__entry->oper = oper;
3435 		__entry->reason_code = reason_code;
3436 	),
3437 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", oper: %d, reason_code %u",
3438 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper,
3439 		  __entry->reason_code)
3440 	);
3441 
3442 TRACE_EVENT(cfg80211_scan_done,
3443 	TP_PROTO(struct cfg80211_scan_request *request,
3444 		 struct cfg80211_scan_info *info),
3445 	TP_ARGS(request, info),
3446 	TP_STRUCT__entry(
3447 		__field(u32, n_channels)
3448 		__dynamic_array(u8, ie, request ? request->ie_len : 0)
3449 		__array(u32, rates, NUM_NL80211_BANDS)
3450 		__field(u32, wdev_id)
3451 		MAC_ENTRY(wiphy_mac)
3452 		__field(bool, no_cck)
3453 		__field(bool, aborted)
3454 		__field(u64, scan_start_tsf)
3455 		MAC_ENTRY(tsf_bssid)
3456 	),
3457 	TP_fast_assign(
3458 		if (request) {
3459 			memcpy(__get_dynamic_array(ie), request->ie,
3460 			       request->ie_len);
3461 			memcpy(__entry->rates, request->rates,
3462 			       NUM_NL80211_BANDS);
3463 			__entry->wdev_id = request->wdev ?
3464 					request->wdev->identifier : 0;
3465 			if (request->wiphy)
3466 				MAC_ASSIGN(wiphy_mac,
3467 					   request->wiphy->perm_addr);
3468 			__entry->no_cck = request->no_cck;
3469 		}
3470 		if (info) {
3471 			__entry->aborted = info->aborted;
3472 			__entry->scan_start_tsf = info->scan_start_tsf;
3473 			MAC_ASSIGN(tsf_bssid, info->tsf_bssid);
3474 		}
3475 	),
3476 	TP_printk("aborted: %s, scan start (TSF): %llu, tsf_bssid: " MAC_PR_FMT,
3477 		  BOOL_TO_STR(__entry->aborted),
3478 		  (unsigned long long)__entry->scan_start_tsf,
3479 		  MAC_PR_ARG(tsf_bssid))
3480 );
3481 
3482 DECLARE_EVENT_CLASS(wiphy_id_evt,
3483 	TP_PROTO(struct wiphy *wiphy, u64 id),
3484 	TP_ARGS(wiphy, id),
3485 	TP_STRUCT__entry(
3486 		WIPHY_ENTRY
3487 		__field(u64, id)
3488 	),
3489 	TP_fast_assign(
3490 		WIPHY_ASSIGN;
3491 		__entry->id = id;
3492 	),
3493 	TP_printk(WIPHY_PR_FMT ", id: %llu", WIPHY_PR_ARG, __entry->id)
3494 );
3495 
3496 DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_stopped,
3497 	TP_PROTO(struct wiphy *wiphy, u64 id),
3498 	TP_ARGS(wiphy, id)
3499 );
3500 
3501 DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_results,
3502 	TP_PROTO(struct wiphy *wiphy, u64 id),
3503 	TP_ARGS(wiphy, id)
3504 );
3505 
3506 TRACE_EVENT(cfg80211_get_bss,
3507 	TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
3508 		 const u8 *bssid, const u8 *ssid, size_t ssid_len,
3509 		 enum ieee80211_bss_type bss_type,
3510 		 enum ieee80211_privacy privacy),
3511 	TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, bss_type, privacy),
3512 	TP_STRUCT__entry(
3513 		WIPHY_ENTRY
3514 		CHAN_ENTRY
3515 		MAC_ENTRY(bssid)
3516 		__dynamic_array(u8, ssid, ssid_len)
3517 		__field(enum ieee80211_bss_type, bss_type)
3518 		__field(enum ieee80211_privacy, privacy)
3519 	),
3520 	TP_fast_assign(
3521 		WIPHY_ASSIGN;
3522 		CHAN_ASSIGN(channel);
3523 		MAC_ASSIGN(bssid, bssid);
3524 		memcpy(__get_dynamic_array(ssid), ssid, ssid_len);
3525 		__entry->bss_type = bss_type;
3526 		__entry->privacy = privacy;
3527 	),
3528 	TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", " MAC_PR_FMT
3529 		  ", buf: %#.2x, bss_type: %d, privacy: %d",
3530 		  WIPHY_PR_ARG, CHAN_PR_ARG, MAC_PR_ARG(bssid),
3531 		  ((u8 *)__get_dynamic_array(ssid))[0], __entry->bss_type,
3532 		  __entry->privacy)
3533 );
3534 
3535 TRACE_EVENT(cfg80211_inform_bss_frame,
3536 	TP_PROTO(struct wiphy *wiphy, struct cfg80211_inform_bss *data,
3537 		 struct ieee80211_mgmt *mgmt, size_t len),
3538 	TP_ARGS(wiphy, data, mgmt, len),
3539 	TP_STRUCT__entry(
3540 		WIPHY_ENTRY
3541 		CHAN_ENTRY
3542 		__field(enum nl80211_bss_scan_width, scan_width)
3543 		__dynamic_array(u8, mgmt, len)
3544 		__field(s32, signal)
3545 		__field(u64, ts_boottime)
3546 		__field(u64, parent_tsf)
3547 		MAC_ENTRY(parent_bssid)
3548 	),
3549 	TP_fast_assign(
3550 		WIPHY_ASSIGN;
3551 		CHAN_ASSIGN(data->chan);
3552 		__entry->scan_width = data->scan_width;
3553 		if (mgmt)
3554 			memcpy(__get_dynamic_array(mgmt), mgmt, len);
3555 		__entry->signal = data->signal;
3556 		__entry->ts_boottime = data->boottime_ns;
3557 		__entry->parent_tsf = data->parent_tsf;
3558 		MAC_ASSIGN(parent_bssid, data->parent_bssid);
3559 	),
3560 	TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT
3561 		  "(scan_width: %d) signal: %d, tsb:%llu, detect_tsf:%llu, tsf_bssid: "
3562 		  MAC_PR_FMT, WIPHY_PR_ARG, CHAN_PR_ARG, __entry->scan_width,
3563 		  __entry->signal, (unsigned long long)__entry->ts_boottime,
3564 		  (unsigned long long)__entry->parent_tsf,
3565 		  MAC_PR_ARG(parent_bssid))
3566 );
3567 
3568 DECLARE_EVENT_CLASS(cfg80211_bss_evt,
3569 	TP_PROTO(struct cfg80211_bss *pub),
3570 	TP_ARGS(pub),
3571 	TP_STRUCT__entry(
3572 		MAC_ENTRY(bssid)
3573 		CHAN_ENTRY
3574 	),
3575 	TP_fast_assign(
3576 		MAC_ASSIGN(bssid, pub->bssid);
3577 		CHAN_ASSIGN(pub->channel);
3578 	),
3579 	TP_printk(MAC_PR_FMT ", " CHAN_PR_FMT, MAC_PR_ARG(bssid), CHAN_PR_ARG)
3580 );
3581 
3582 DEFINE_EVENT(cfg80211_bss_evt, cfg80211_return_bss,
3583 	TP_PROTO(struct cfg80211_bss *pub),
3584 	TP_ARGS(pub)
3585 );
3586 
3587 TRACE_EVENT(cfg80211_return_uint,
3588 	TP_PROTO(unsigned int ret),
3589 	TP_ARGS(ret),
3590 	TP_STRUCT__entry(
3591 		__field(unsigned int, ret)
3592 	),
3593 	TP_fast_assign(
3594 		__entry->ret = ret;
3595 	),
3596 	TP_printk("ret: %d", __entry->ret)
3597 );
3598 
3599 TRACE_EVENT(cfg80211_return_u32,
3600 	TP_PROTO(u32 ret),
3601 	TP_ARGS(ret),
3602 	TP_STRUCT__entry(
3603 		__field(u32, ret)
3604 	),
3605 	TP_fast_assign(
3606 		__entry->ret = ret;
3607 	),
3608 	TP_printk("ret: %u", __entry->ret)
3609 );
3610 
3611 TRACE_EVENT(cfg80211_report_wowlan_wakeup,
3612 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
3613 		 struct cfg80211_wowlan_wakeup *wakeup),
3614 	TP_ARGS(wiphy, wdev, wakeup),
3615 	TP_STRUCT__entry(
3616 		WIPHY_ENTRY
3617 		WDEV_ENTRY
3618 		__field(bool, non_wireless)
3619 		__field(bool, disconnect)
3620 		__field(bool, magic_pkt)
3621 		__field(bool, gtk_rekey_failure)
3622 		__field(bool, eap_identity_req)
3623 		__field(bool, four_way_handshake)
3624 		__field(bool, rfkill_release)
3625 		__field(s32, pattern_idx)
3626 		__field(u32, packet_len)
3627 		__dynamic_array(u8, packet,
3628 				wakeup ? wakeup->packet_present_len : 0)
3629 	),
3630 	TP_fast_assign(
3631 		WIPHY_ASSIGN;
3632 		WDEV_ASSIGN;
3633 		__entry->non_wireless = !wakeup;
3634 		__entry->disconnect = wakeup ? wakeup->disconnect : false;
3635 		__entry->magic_pkt = wakeup ? wakeup->magic_pkt : false;
3636 		__entry->gtk_rekey_failure = wakeup ? wakeup->gtk_rekey_failure : false;
3637 		__entry->eap_identity_req = wakeup ? wakeup->eap_identity_req : false;
3638 		__entry->four_way_handshake = wakeup ? wakeup->four_way_handshake : false;
3639 		__entry->rfkill_release = wakeup ? wakeup->rfkill_release : false;
3640 		__entry->pattern_idx = wakeup ? wakeup->pattern_idx : false;
3641 		__entry->packet_len = wakeup ? wakeup->packet_len : false;
3642 		if (wakeup && wakeup->packet && wakeup->packet_present_len)
3643 			memcpy(__get_dynamic_array(packet), wakeup->packet,
3644 			       wakeup->packet_present_len);
3645 	),
3646 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
3647 );
3648 
3649 TRACE_EVENT(cfg80211_ft_event,
3650 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3651 		 struct cfg80211_ft_event_params *ft_event),
3652 	TP_ARGS(wiphy, netdev, ft_event),
3653 	TP_STRUCT__entry(
3654 		WIPHY_ENTRY
3655 		NETDEV_ENTRY
3656 		__dynamic_array(u8, ies, ft_event->ies_len)
3657 		MAC_ENTRY(target_ap)
3658 		__dynamic_array(u8, ric_ies, ft_event->ric_ies_len)
3659 	),
3660 	TP_fast_assign(
3661 		WIPHY_ASSIGN;
3662 		NETDEV_ASSIGN;
3663 		if (ft_event->ies)
3664 			memcpy(__get_dynamic_array(ies), ft_event->ies,
3665 			       ft_event->ies_len);
3666 		MAC_ASSIGN(target_ap, ft_event->target_ap);
3667 		if (ft_event->ric_ies)
3668 			memcpy(__get_dynamic_array(ric_ies), ft_event->ric_ies,
3669 			       ft_event->ric_ies_len);
3670 	),
3671 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", target_ap: " MAC_PR_FMT,
3672 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
3673 );
3674 
3675 TRACE_EVENT(cfg80211_stop_iface,
3676 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
3677 	TP_ARGS(wiphy, wdev),
3678 	TP_STRUCT__entry(
3679 		WIPHY_ENTRY
3680 		WDEV_ENTRY
3681 	),
3682 	TP_fast_assign(
3683 		WIPHY_ASSIGN;
3684 		WDEV_ASSIGN;
3685 	),
3686 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
3687 		  WIPHY_PR_ARG, WDEV_PR_ARG)
3688 );
3689 
3690 TRACE_EVENT(cfg80211_pmsr_report,
3691 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
3692 		 u64 cookie, const u8 *addr),
3693 	TP_ARGS(wiphy, wdev, cookie, addr),
3694 	TP_STRUCT__entry(
3695 		WIPHY_ENTRY
3696 		WDEV_ENTRY
3697 		__field(u64, cookie)
3698 		MAC_ENTRY(addr)
3699 	),
3700 	TP_fast_assign(
3701 		WIPHY_ASSIGN;
3702 		WDEV_ASSIGN;
3703 		__entry->cookie = cookie;
3704 		MAC_ASSIGN(addr, addr);
3705 	),
3706 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie:%lld, " MAC_PR_FMT,
3707 		  WIPHY_PR_ARG, WDEV_PR_ARG,
3708 		  (unsigned long long)__entry->cookie,
3709 		  MAC_PR_ARG(addr))
3710 );
3711 
3712 TRACE_EVENT(cfg80211_pmsr_complete,
3713 	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
3714 	TP_ARGS(wiphy, wdev, cookie),
3715 	TP_STRUCT__entry(
3716 		WIPHY_ENTRY
3717 		WDEV_ENTRY
3718 		__field(u64, cookie)
3719 	),
3720 	TP_fast_assign(
3721 		WIPHY_ASSIGN;
3722 		WDEV_ASSIGN;
3723 		__entry->cookie = cookie;
3724 	),
3725 	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie:%lld",
3726 		  WIPHY_PR_ARG, WDEV_PR_ARG,
3727 		  (unsigned long long)__entry->cookie)
3728 );
3729 
3730 TRACE_EVENT(cfg80211_update_owe_info_event,
3731 	    TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3732 		     struct cfg80211_update_owe_info *owe_info),
3733 	    TP_ARGS(wiphy, netdev, owe_info),
3734 	    TP_STRUCT__entry(WIPHY_ENTRY
3735 			     NETDEV_ENTRY
3736 			     MAC_ENTRY(peer)
3737 			     __dynamic_array(u8, ie, owe_info->ie_len)),
3738 	    TP_fast_assign(WIPHY_ASSIGN;
3739 			   NETDEV_ASSIGN;
3740 			   MAC_ASSIGN(peer, owe_info->peer);
3741 			   memcpy(__get_dynamic_array(ie), owe_info->ie,
3742 				  owe_info->ie_len);),
3743 	    TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
3744 		      WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
3745 );
3746 
3747 TRACE_EVENT(cfg80211_bss_color_notify,
3748 	TP_PROTO(struct net_device *netdev,
3749 		 enum nl80211_commands cmd,
3750 		 u8 count, u64 color_bitmap),
3751 	TP_ARGS(netdev, cmd, count, color_bitmap),
3752 	TP_STRUCT__entry(
3753 		NETDEV_ENTRY
3754 		__field(u32, cmd)
3755 		__field(u8, count)
3756 		__field(u64, color_bitmap)
3757 	),
3758 	TP_fast_assign(
3759 		NETDEV_ASSIGN;
3760 		__entry->cmd = cmd;
3761 		__entry->count = count;
3762 		__entry->color_bitmap = color_bitmap;
3763 	),
3764 	TP_printk(NETDEV_PR_FMT ", cmd: %x, count: %u, bitmap: %llx",
3765 		  NETDEV_PR_ARG, __entry->cmd, __entry->count,
3766 		  __entry->color_bitmap)
3767 );
3768 
3769 TRACE_EVENT(cfg80211_assoc_comeback,
3770 	TP_PROTO(struct wireless_dev *wdev, const u8 *ap_addr, u32 timeout),
3771 	TP_ARGS(wdev, ap_addr, timeout),
3772 	TP_STRUCT__entry(
3773 		WDEV_ENTRY
3774 		MAC_ENTRY(ap_addr)
3775 		__field(u32, timeout)
3776 	),
3777 	TP_fast_assign(
3778 		WDEV_ASSIGN;
3779 		MAC_ASSIGN(ap_addr, ap_addr);
3780 		__entry->timeout = timeout;
3781 	),
3782 	TP_printk(WDEV_PR_FMT ", " MAC_PR_FMT ", timeout: %u TUs",
3783 		  WDEV_PR_ARG, MAC_PR_ARG(ap_addr), __entry->timeout)
3784 );
3785 
3786 DECLARE_EVENT_CLASS(link_station_add_mod,
3787 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3788 		 struct link_station_parameters *params),
3789 	TP_ARGS(wiphy, netdev, params),
3790 	TP_STRUCT__entry(
3791 		WIPHY_ENTRY
3792 		NETDEV_ENTRY
3793 		__array(u8, mld_mac, 6)
3794 		__array(u8, link_mac, 6)
3795 		__field(u32, link_id)
3796 		__dynamic_array(u8, supported_rates,
3797 				params->supported_rates_len)
3798 		__array(u8, ht_capa, (int)sizeof(struct ieee80211_ht_cap))
3799 		__array(u8, vht_capa, (int)sizeof(struct ieee80211_vht_cap))
3800 		__field(u8, opmode_notif)
3801 		__field(bool, opmode_notif_used)
3802 		__dynamic_array(u8, he_capa, params->he_capa_len)
3803 		__array(u8, he_6ghz_capa, (int)sizeof(struct ieee80211_he_6ghz_capa))
3804 		__dynamic_array(u8, eht_capa, params->eht_capa_len)
3805 	),
3806 	TP_fast_assign(
3807 		WIPHY_ASSIGN;
3808 		NETDEV_ASSIGN;
3809 		memset(__entry->mld_mac, 0, 6);
3810 		memset(__entry->link_mac, 0, 6);
3811 		if (params->mld_mac)
3812 			memcpy(__entry->mld_mac, params->mld_mac, 6);
3813 		if (params->link_mac)
3814 			memcpy(__entry->link_mac, params->link_mac, 6);
3815 		__entry->link_id = params->link_id;
3816 		if (params->supported_rates && params->supported_rates_len)
3817 			memcpy(__get_dynamic_array(supported_rates),
3818 			       params->supported_rates,
3819 			       params->supported_rates_len);
3820 		memset(__entry->ht_capa, 0, sizeof(struct ieee80211_ht_cap));
3821 		if (params->ht_capa)
3822 			memcpy(__entry->ht_capa, params->ht_capa,
3823 			       sizeof(struct ieee80211_ht_cap));
3824 		memset(__entry->vht_capa, 0, sizeof(struct ieee80211_vht_cap));
3825 		if (params->vht_capa)
3826 			memcpy(__entry->vht_capa, params->vht_capa,
3827 			       sizeof(struct ieee80211_vht_cap));
3828 		__entry->opmode_notif = params->opmode_notif;
3829 		__entry->opmode_notif_used = params->opmode_notif_used;
3830 		if (params->he_capa && params->he_capa_len)
3831 			memcpy(__get_dynamic_array(he_capa), params->he_capa,
3832 			       params->he_capa_len);
3833 		memset(__entry->he_6ghz_capa, 0, sizeof(struct ieee80211_he_6ghz_capa));
3834 		if (params->he_6ghz_capa)
3835 			memcpy(__entry->he_6ghz_capa, params->he_6ghz_capa,
3836 			       sizeof(struct ieee80211_he_6ghz_capa));
3837 		if (params->eht_capa && params->eht_capa_len)
3838 			memcpy(__get_dynamic_array(eht_capa), params->eht_capa,
3839 			       params->eht_capa_len);
3840 	),
3841 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
3842 		  ", link mac: " MAC_PR_FMT ", link id: %u",
3843 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(mld_mac),
3844 		  MAC_PR_ARG(link_mac), __entry->link_id)
3845 );
3846 
3847 DEFINE_EVENT(link_station_add_mod, rdev_add_link_station,
3848 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3849 		 struct link_station_parameters *params),
3850 	TP_ARGS(wiphy, netdev, params)
3851 );
3852 
3853 DEFINE_EVENT(link_station_add_mod, rdev_mod_link_station,
3854 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3855 		 struct link_station_parameters *params),
3856 	TP_ARGS(wiphy, netdev, params)
3857 );
3858 
3859 TRACE_EVENT(rdev_del_link_station,
3860 	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3861 		 struct link_station_del_parameters *params),
3862 	TP_ARGS(wiphy, netdev, params),
3863 	TP_STRUCT__entry(
3864 		WIPHY_ENTRY
3865 		NETDEV_ENTRY
3866 		__array(u8, mld_mac, 6)
3867 		__field(u32, link_id)
3868 	),
3869 	TP_fast_assign(
3870 		WIPHY_ASSIGN;
3871 		NETDEV_ASSIGN;
3872 		memset(__entry->mld_mac, 0, 6);
3873 		if (params->mld_mac)
3874 			memcpy(__entry->mld_mac, params->mld_mac, 6);
3875 		__entry->link_id = params->link_id;
3876 	),
3877 	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
3878 		  ", link id: %u",
3879 		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(mld_mac),
3880 		  __entry->link_id)
3881 );
3882 
3883 #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
3884 
3885 #undef TRACE_INCLUDE_PATH
3886 #define TRACE_INCLUDE_PATH .
3887 #undef TRACE_INCLUDE_FILE
3888 #define TRACE_INCLUDE_FILE trace
3889 #include <trace/define_trace.h>
3890