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