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