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