xref: /openbmc/linux/net/mac80211/trace.h (revision b830f94f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Portions of this file
4 * Copyright(c) 2016-2017 Intel Deutschland GmbH
5 * Copyright (C) 2018 - 2019 Intel Corporation
6 */
7 
8 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
9 #define __MAC80211_DRIVER_TRACE
10 
11 #include <linux/tracepoint.h>
12 #include <net/mac80211.h>
13 #include "ieee80211_i.h"
14 
15 #undef TRACE_SYSTEM
16 #define TRACE_SYSTEM mac80211
17 
18 #define MAXNAME		32
19 #define LOCAL_ENTRY	__array(char, wiphy_name, 32)
20 #define LOCAL_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
21 #define LOCAL_PR_FMT	"%s"
22 #define LOCAL_PR_ARG	__entry->wiphy_name
23 
24 #define STA_ENTRY	__array(char, sta_addr, ETH_ALEN)
25 #define STA_ASSIGN	(sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
26 #define STA_NAMED_ASSIGN(s)	memcpy(__entry->sta_addr, (s)->addr, ETH_ALEN)
27 #define STA_PR_FMT	" sta:%pM"
28 #define STA_PR_ARG	__entry->sta_addr
29 
30 #define VIF_ENTRY	__field(enum nl80211_iftype, vif_type) __field(void *, sdata)	\
31 			__field(bool, p2p)						\
32 			__string(vif_name, sdata->name)
33 #define VIF_ASSIGN	__entry->vif_type = sdata->vif.type; __entry->sdata = sdata;	\
34 			__entry->p2p = sdata->vif.p2p;					\
35 			__assign_str(vif_name, sdata->name)
36 #define VIF_PR_FMT	" vif:%s(%d%s)"
37 #define VIF_PR_ARG	__get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
38 
39 #define CHANDEF_ENTRY	__field(u32, control_freq)					\
40 			__field(u32, chan_width)					\
41 			__field(u32, center_freq1)					\
42 			__field(u32, center_freq2)
43 #define CHANDEF_ASSIGN(c)							\
44 			__entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0;	\
45 			__entry->chan_width = (c) ? (c)->width : 0;			\
46 			__entry->center_freq1 = (c) ? (c)->center_freq1 : 0;		\
47 			__entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
48 #define CHANDEF_PR_FMT	" control:%d MHz width:%d center: %d/%d MHz"
49 #define CHANDEF_PR_ARG	__entry->control_freq, __entry->chan_width,			\
50 			__entry->center_freq1, __entry->center_freq2
51 
52 #define MIN_CHANDEF_ENTRY								\
53 			__field(u32, min_control_freq)					\
54 			__field(u32, min_chan_width)					\
55 			__field(u32, min_center_freq1)					\
56 			__field(u32, min_center_freq2)
57 
58 #define MIN_CHANDEF_ASSIGN(c)								\
59 			__entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0;	\
60 			__entry->min_chan_width = (c)->width;				\
61 			__entry->min_center_freq1 = (c)->center_freq1;			\
62 			__entry->min_center_freq2 = (c)->center_freq2;
63 #define MIN_CHANDEF_PR_FMT	" min_control:%d MHz min_width:%d min_center: %d/%d MHz"
64 #define MIN_CHANDEF_PR_ARG	__entry->min_control_freq, __entry->min_chan_width,	\
65 			__entry->min_center_freq1, __entry->min_center_freq2
66 
67 #define CHANCTX_ENTRY	CHANDEF_ENTRY							\
68 			MIN_CHANDEF_ENTRY						\
69 			__field(u8, rx_chains_static)					\
70 			__field(u8, rx_chains_dynamic)
71 #define CHANCTX_ASSIGN	CHANDEF_ASSIGN(&ctx->conf.def)					\
72 			MIN_CHANDEF_ASSIGN(&ctx->conf.min_def)				\
73 			__entry->rx_chains_static = ctx->conf.rx_chains_static;		\
74 			__entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
75 #define CHANCTX_PR_FMT	CHANDEF_PR_FMT MIN_CHANDEF_PR_FMT " chains:%d/%d"
76 #define CHANCTX_PR_ARG	CHANDEF_PR_ARG,	MIN_CHANDEF_PR_ARG,				\
77 			__entry->rx_chains_static, __entry->rx_chains_dynamic
78 
79 #define KEY_ENTRY	__field(u32, cipher)						\
80 			__field(u8, hw_key_idx)						\
81 			__field(u8, flags)						\
82 			__field(s8, keyidx)
83 #define KEY_ASSIGN(k)	__entry->cipher = (k)->cipher;					\
84 			__entry->flags = (k)->flags;					\
85 			__entry->keyidx = (k)->keyidx;					\
86 			__entry->hw_key_idx = (k)->hw_key_idx;
87 #define KEY_PR_FMT	" cipher:0x%x, flags=%#x, keyidx=%d, hw_key_idx=%d"
88 #define KEY_PR_ARG	__entry->cipher, __entry->flags, __entry->keyidx, __entry->hw_key_idx
89 
90 #define AMPDU_ACTION_ENTRY	__field(enum ieee80211_ampdu_mlme_action,		\
91 					ieee80211_ampdu_mlme_action)			\
92 				STA_ENTRY						\
93 				__field(u16, tid)					\
94 				__field(u16, ssn)					\
95 				__field(u16, buf_size)					\
96 				__field(bool, amsdu)					\
97 				__field(u16, timeout)					\
98 				__field(u16, action)
99 #define AMPDU_ACTION_ASSIGN	STA_NAMED_ASSIGN(params->sta);				\
100 				__entry->tid = params->tid;				\
101 				__entry->ssn = params->ssn;				\
102 				__entry->buf_size = params->buf_size;			\
103 				__entry->amsdu = params->amsdu;				\
104 				__entry->timeout = params->timeout;			\
105 				__entry->action = params->action;
106 #define AMPDU_ACTION_PR_FMT	STA_PR_FMT " tid %d, ssn %d, buf_size %u, amsdu %d, timeout %d action %d"
107 #define AMPDU_ACTION_PR_ARG	STA_PR_ARG, __entry->tid, __entry->ssn,			\
108 				__entry->buf_size, __entry->amsdu, __entry->timeout,	\
109 				__entry->action
110 
111 /*
112  * Tracing for driver callbacks.
113  */
114 
115 DECLARE_EVENT_CLASS(local_only_evt,
116 	TP_PROTO(struct ieee80211_local *local),
117 	TP_ARGS(local),
118 	TP_STRUCT__entry(
119 		LOCAL_ENTRY
120 	),
121 	TP_fast_assign(
122 		LOCAL_ASSIGN;
123 	),
124 	TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
125 );
126 
127 DECLARE_EVENT_CLASS(local_sdata_addr_evt,
128 	TP_PROTO(struct ieee80211_local *local,
129 		 struct ieee80211_sub_if_data *sdata),
130 	TP_ARGS(local, sdata),
131 
132 	TP_STRUCT__entry(
133 		LOCAL_ENTRY
134 		VIF_ENTRY
135 		__array(char, addr, ETH_ALEN)
136 	),
137 
138 	TP_fast_assign(
139 		LOCAL_ASSIGN;
140 		VIF_ASSIGN;
141 		memcpy(__entry->addr, sdata->vif.addr, ETH_ALEN);
142 	),
143 
144 	TP_printk(
145 		LOCAL_PR_FMT  VIF_PR_FMT " addr:%pM",
146 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
147 	)
148 );
149 
150 DECLARE_EVENT_CLASS(local_u32_evt,
151 	TP_PROTO(struct ieee80211_local *local, u32 value),
152 	TP_ARGS(local, value),
153 
154 	TP_STRUCT__entry(
155 		LOCAL_ENTRY
156 		__field(u32, value)
157 	),
158 
159 	TP_fast_assign(
160 		LOCAL_ASSIGN;
161 		__entry->value = value;
162 	),
163 
164 	TP_printk(
165 		LOCAL_PR_FMT " value:%d",
166 		LOCAL_PR_ARG, __entry->value
167 	)
168 );
169 
170 DECLARE_EVENT_CLASS(local_sdata_evt,
171 	TP_PROTO(struct ieee80211_local *local,
172 		 struct ieee80211_sub_if_data *sdata),
173 	TP_ARGS(local, sdata),
174 
175 	TP_STRUCT__entry(
176 		LOCAL_ENTRY
177 		VIF_ENTRY
178 	),
179 
180 	TP_fast_assign(
181 		LOCAL_ASSIGN;
182 		VIF_ASSIGN;
183 	),
184 
185 	TP_printk(
186 		LOCAL_PR_FMT VIF_PR_FMT,
187 		LOCAL_PR_ARG, VIF_PR_ARG
188 	)
189 );
190 
191 DEFINE_EVENT(local_only_evt, drv_return_void,
192 	TP_PROTO(struct ieee80211_local *local),
193 	TP_ARGS(local)
194 );
195 
196 TRACE_EVENT(drv_return_int,
197 	TP_PROTO(struct ieee80211_local *local, int ret),
198 	TP_ARGS(local, ret),
199 	TP_STRUCT__entry(
200 		LOCAL_ENTRY
201 		__field(int, ret)
202 	),
203 	TP_fast_assign(
204 		LOCAL_ASSIGN;
205 		__entry->ret = ret;
206 	),
207 	TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
208 );
209 
210 TRACE_EVENT(drv_return_bool,
211 	TP_PROTO(struct ieee80211_local *local, bool ret),
212 	TP_ARGS(local, ret),
213 	TP_STRUCT__entry(
214 		LOCAL_ENTRY
215 		__field(bool, ret)
216 	),
217 	TP_fast_assign(
218 		LOCAL_ASSIGN;
219 		__entry->ret = ret;
220 	),
221 	TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
222 		  "true" : "false")
223 );
224 
225 TRACE_EVENT(drv_return_u32,
226 	TP_PROTO(struct ieee80211_local *local, u32 ret),
227 	TP_ARGS(local, ret),
228 	TP_STRUCT__entry(
229 		LOCAL_ENTRY
230 		__field(u32, ret)
231 	),
232 	TP_fast_assign(
233 		LOCAL_ASSIGN;
234 		__entry->ret = ret;
235 	),
236 	TP_printk(LOCAL_PR_FMT " - %u", LOCAL_PR_ARG, __entry->ret)
237 );
238 
239 TRACE_EVENT(drv_return_u64,
240 	TP_PROTO(struct ieee80211_local *local, u64 ret),
241 	TP_ARGS(local, ret),
242 	TP_STRUCT__entry(
243 		LOCAL_ENTRY
244 		__field(u64, ret)
245 	),
246 	TP_fast_assign(
247 		LOCAL_ASSIGN;
248 		__entry->ret = ret;
249 	),
250 	TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
251 );
252 
253 DEFINE_EVENT(local_only_evt, drv_start,
254 	TP_PROTO(struct ieee80211_local *local),
255 	TP_ARGS(local)
256 );
257 
258 DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
259 	     TP_PROTO(struct ieee80211_local *local, u32 sset),
260 	     TP_ARGS(local, sset)
261 );
262 
263 DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
264 	     TP_PROTO(struct ieee80211_local *local, u32 sset),
265 	     TP_ARGS(local, sset)
266 );
267 
268 DEFINE_EVENT(local_only_evt, drv_get_et_stats,
269 	     TP_PROTO(struct ieee80211_local *local),
270 	     TP_ARGS(local)
271 );
272 
273 DEFINE_EVENT(local_only_evt, drv_suspend,
274 	TP_PROTO(struct ieee80211_local *local),
275 	TP_ARGS(local)
276 );
277 
278 DEFINE_EVENT(local_only_evt, drv_resume,
279 	TP_PROTO(struct ieee80211_local *local),
280 	TP_ARGS(local)
281 );
282 
283 TRACE_EVENT(drv_set_wakeup,
284 	TP_PROTO(struct ieee80211_local *local, bool enabled),
285 	TP_ARGS(local, enabled),
286 	TP_STRUCT__entry(
287 		LOCAL_ENTRY
288 		__field(bool, enabled)
289 	),
290 	TP_fast_assign(
291 		LOCAL_ASSIGN;
292 		__entry->enabled = enabled;
293 	),
294 	TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
295 );
296 
297 DEFINE_EVENT(local_only_evt, drv_stop,
298 	TP_PROTO(struct ieee80211_local *local),
299 	TP_ARGS(local)
300 );
301 
302 DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
303 	TP_PROTO(struct ieee80211_local *local,
304 		 struct ieee80211_sub_if_data *sdata),
305 	TP_ARGS(local, sdata)
306 );
307 
308 TRACE_EVENT(drv_change_interface,
309 	TP_PROTO(struct ieee80211_local *local,
310 		 struct ieee80211_sub_if_data *sdata,
311 		 enum nl80211_iftype type, bool p2p),
312 
313 	TP_ARGS(local, sdata, type, p2p),
314 
315 	TP_STRUCT__entry(
316 		LOCAL_ENTRY
317 		VIF_ENTRY
318 		__field(u32, new_type)
319 		__field(bool, new_p2p)
320 	),
321 
322 	TP_fast_assign(
323 		LOCAL_ASSIGN;
324 		VIF_ASSIGN;
325 		__entry->new_type = type;
326 		__entry->new_p2p = p2p;
327 	),
328 
329 	TP_printk(
330 		LOCAL_PR_FMT  VIF_PR_FMT " new type:%d%s",
331 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
332 		__entry->new_p2p ? "/p2p" : ""
333 	)
334 );
335 
336 DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
337 	TP_PROTO(struct ieee80211_local *local,
338 		 struct ieee80211_sub_if_data *sdata),
339 	TP_ARGS(local, sdata)
340 );
341 
342 TRACE_EVENT(drv_config,
343 	TP_PROTO(struct ieee80211_local *local,
344 		 u32 changed),
345 
346 	TP_ARGS(local, changed),
347 
348 	TP_STRUCT__entry(
349 		LOCAL_ENTRY
350 		__field(u32, changed)
351 		__field(u32, flags)
352 		__field(int, power_level)
353 		__field(int, dynamic_ps_timeout)
354 		__field(u16, listen_interval)
355 		__field(u8, long_frame_max_tx_count)
356 		__field(u8, short_frame_max_tx_count)
357 		CHANDEF_ENTRY
358 		__field(int, smps)
359 	),
360 
361 	TP_fast_assign(
362 		LOCAL_ASSIGN;
363 		__entry->changed = changed;
364 		__entry->flags = local->hw.conf.flags;
365 		__entry->power_level = local->hw.conf.power_level;
366 		__entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
367 		__entry->listen_interval = local->hw.conf.listen_interval;
368 		__entry->long_frame_max_tx_count =
369 			local->hw.conf.long_frame_max_tx_count;
370 		__entry->short_frame_max_tx_count =
371 			local->hw.conf.short_frame_max_tx_count;
372 		CHANDEF_ASSIGN(&local->hw.conf.chandef)
373 		__entry->smps = local->hw.conf.smps_mode;
374 	),
375 
376 	TP_printk(
377 		LOCAL_PR_FMT " ch:%#x" CHANDEF_PR_FMT,
378 		LOCAL_PR_ARG, __entry->changed, CHANDEF_PR_ARG
379 	)
380 );
381 
382 TRACE_EVENT(drv_bss_info_changed,
383 	TP_PROTO(struct ieee80211_local *local,
384 		 struct ieee80211_sub_if_data *sdata,
385 		 struct ieee80211_bss_conf *info,
386 		 u32 changed),
387 
388 	TP_ARGS(local, sdata, info, changed),
389 
390 	TP_STRUCT__entry(
391 		LOCAL_ENTRY
392 		VIF_ENTRY
393 		__field(u32, changed)
394 		__field(bool, assoc)
395 		__field(bool, ibss_joined)
396 		__field(bool, ibss_creator)
397 		__field(u16, aid)
398 		__field(bool, cts)
399 		__field(bool, shortpre)
400 		__field(bool, shortslot)
401 		__field(bool, enable_beacon)
402 		__field(u8, dtimper)
403 		__field(u16, bcnint)
404 		__field(u16, assoc_cap)
405 		__field(u64, sync_tsf)
406 		__field(u32, sync_device_ts)
407 		__field(u8, sync_dtim_count)
408 		__field(u32, basic_rates)
409 		__array(int, mcast_rate, NUM_NL80211_BANDS)
410 		__field(u16, ht_operation_mode)
411 		__field(s32, cqm_rssi_thold);
412 		__field(s32, cqm_rssi_hyst);
413 		__field(u32, channel_width);
414 		__field(u32, channel_cfreq1);
415 		__dynamic_array(u32, arp_addr_list,
416 				info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
417 					IEEE80211_BSS_ARP_ADDR_LIST_LEN :
418 					info->arp_addr_cnt);
419 		__field(int, arp_addr_cnt);
420 		__field(bool, qos);
421 		__field(bool, idle);
422 		__field(bool, ps);
423 		__dynamic_array(u8, ssid, info->ssid_len);
424 		__field(bool, hidden_ssid);
425 		__field(int, txpower)
426 		__field(u8, p2p_oppps_ctwindow)
427 	),
428 
429 	TP_fast_assign(
430 		LOCAL_ASSIGN;
431 		VIF_ASSIGN;
432 		__entry->changed = changed;
433 		__entry->aid = info->aid;
434 		__entry->assoc = info->assoc;
435 		__entry->ibss_joined = info->ibss_joined;
436 		__entry->ibss_creator = info->ibss_creator;
437 		__entry->shortpre = info->use_short_preamble;
438 		__entry->cts = info->use_cts_prot;
439 		__entry->shortslot = info->use_short_slot;
440 		__entry->enable_beacon = info->enable_beacon;
441 		__entry->dtimper = info->dtim_period;
442 		__entry->bcnint = info->beacon_int;
443 		__entry->assoc_cap = info->assoc_capability;
444 		__entry->sync_tsf = info->sync_tsf;
445 		__entry->sync_device_ts = info->sync_device_ts;
446 		__entry->sync_dtim_count = info->sync_dtim_count;
447 		__entry->basic_rates = info->basic_rates;
448 		memcpy(__entry->mcast_rate, info->mcast_rate,
449 		       sizeof(__entry->mcast_rate));
450 		__entry->ht_operation_mode = info->ht_operation_mode;
451 		__entry->cqm_rssi_thold = info->cqm_rssi_thold;
452 		__entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
453 		__entry->channel_width = info->chandef.width;
454 		__entry->channel_cfreq1 = info->chandef.center_freq1;
455 		__entry->arp_addr_cnt = info->arp_addr_cnt;
456 		memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
457 		       sizeof(u32) * (info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
458 					IEEE80211_BSS_ARP_ADDR_LIST_LEN :
459 					info->arp_addr_cnt));
460 		__entry->qos = info->qos;
461 		__entry->idle = info->idle;
462 		__entry->ps = info->ps;
463 		memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
464 		__entry->hidden_ssid = info->hidden_ssid;
465 		__entry->txpower = info->txpower;
466 		__entry->p2p_oppps_ctwindow = info->p2p_noa_attr.oppps_ctwindow;
467 	),
468 
469 	TP_printk(
470 		LOCAL_PR_FMT  VIF_PR_FMT " changed:%#x",
471 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
472 	)
473 );
474 
475 TRACE_EVENT(drv_prepare_multicast,
476 	TP_PROTO(struct ieee80211_local *local, int mc_count),
477 
478 	TP_ARGS(local, mc_count),
479 
480 	TP_STRUCT__entry(
481 		LOCAL_ENTRY
482 		__field(int, mc_count)
483 	),
484 
485 	TP_fast_assign(
486 		LOCAL_ASSIGN;
487 		__entry->mc_count = mc_count;
488 	),
489 
490 	TP_printk(
491 		LOCAL_PR_FMT " prepare mc (%d)",
492 		LOCAL_PR_ARG, __entry->mc_count
493 	)
494 );
495 
496 TRACE_EVENT(drv_configure_filter,
497 	TP_PROTO(struct ieee80211_local *local,
498 		 unsigned int changed_flags,
499 		 unsigned int *total_flags,
500 		 u64 multicast),
501 
502 	TP_ARGS(local, changed_flags, total_flags, multicast),
503 
504 	TP_STRUCT__entry(
505 		LOCAL_ENTRY
506 		__field(unsigned int, changed)
507 		__field(unsigned int, total)
508 		__field(u64, multicast)
509 	),
510 
511 	TP_fast_assign(
512 		LOCAL_ASSIGN;
513 		__entry->changed = changed_flags;
514 		__entry->total = *total_flags;
515 		__entry->multicast = multicast;
516 	),
517 
518 	TP_printk(
519 		LOCAL_PR_FMT " changed:%#x total:%#x",
520 		LOCAL_PR_ARG, __entry->changed, __entry->total
521 	)
522 );
523 
524 TRACE_EVENT(drv_config_iface_filter,
525 	TP_PROTO(struct ieee80211_local *local,
526 		 struct ieee80211_sub_if_data *sdata,
527 		 unsigned int filter_flags,
528 		 unsigned int changed_flags),
529 
530 	TP_ARGS(local, sdata, filter_flags, changed_flags),
531 
532 	TP_STRUCT__entry(
533 		LOCAL_ENTRY
534 		VIF_ENTRY
535 		__field(unsigned int, filter_flags)
536 		__field(unsigned int, changed_flags)
537 	),
538 
539 	TP_fast_assign(
540 		LOCAL_ASSIGN;
541 		VIF_ASSIGN;
542 		__entry->filter_flags = filter_flags;
543 		__entry->changed_flags = changed_flags;
544 	),
545 
546 	TP_printk(
547 		LOCAL_PR_FMT VIF_PR_FMT
548 		" filter_flags: %#x changed_flags: %#x",
549 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->filter_flags,
550 		__entry->changed_flags
551 	)
552 );
553 
554 TRACE_EVENT(drv_set_tim,
555 	TP_PROTO(struct ieee80211_local *local,
556 		 struct ieee80211_sta *sta, bool set),
557 
558 	TP_ARGS(local, sta, set),
559 
560 	TP_STRUCT__entry(
561 		LOCAL_ENTRY
562 		STA_ENTRY
563 		__field(bool, set)
564 	),
565 
566 	TP_fast_assign(
567 		LOCAL_ASSIGN;
568 		STA_ASSIGN;
569 		__entry->set = set;
570 	),
571 
572 	TP_printk(
573 		LOCAL_PR_FMT STA_PR_FMT " set:%d",
574 		LOCAL_PR_ARG, STA_PR_ARG, __entry->set
575 	)
576 );
577 
578 TRACE_EVENT(drv_set_key,
579 	TP_PROTO(struct ieee80211_local *local,
580 		 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
581 		 struct ieee80211_sta *sta,
582 		 struct ieee80211_key_conf *key),
583 
584 	TP_ARGS(local, cmd, sdata, sta, key),
585 
586 	TP_STRUCT__entry(
587 		LOCAL_ENTRY
588 		VIF_ENTRY
589 		STA_ENTRY
590 		KEY_ENTRY
591 	),
592 
593 	TP_fast_assign(
594 		LOCAL_ASSIGN;
595 		VIF_ASSIGN;
596 		STA_ASSIGN;
597 		KEY_ASSIGN(key);
598 	),
599 
600 	TP_printk(
601 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT KEY_PR_FMT,
602 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, KEY_PR_ARG
603 	)
604 );
605 
606 TRACE_EVENT(drv_update_tkip_key,
607 	TP_PROTO(struct ieee80211_local *local,
608 		 struct ieee80211_sub_if_data *sdata,
609 		 struct ieee80211_key_conf *conf,
610 		 struct ieee80211_sta *sta, u32 iv32),
611 
612 	TP_ARGS(local, sdata, conf, sta, iv32),
613 
614 	TP_STRUCT__entry(
615 		LOCAL_ENTRY
616 		VIF_ENTRY
617 		STA_ENTRY
618 		__field(u32, iv32)
619 	),
620 
621 	TP_fast_assign(
622 		LOCAL_ASSIGN;
623 		VIF_ASSIGN;
624 		STA_ASSIGN;
625 		__entry->iv32 = iv32;
626 	),
627 
628 	TP_printk(
629 		LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
630 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->iv32
631 	)
632 );
633 
634 DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
635 	TP_PROTO(struct ieee80211_local *local,
636 		 struct ieee80211_sub_if_data *sdata),
637 	TP_ARGS(local, sdata)
638 );
639 
640 DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
641 	TP_PROTO(struct ieee80211_local *local,
642 		 struct ieee80211_sub_if_data *sdata),
643 	TP_ARGS(local, sdata)
644 );
645 
646 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
647 	TP_PROTO(struct ieee80211_local *local,
648 		 struct ieee80211_sub_if_data *sdata),
649 	TP_ARGS(local, sdata)
650 );
651 
652 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
653 	TP_PROTO(struct ieee80211_local *local,
654 		 struct ieee80211_sub_if_data *sdata),
655 	TP_ARGS(local, sdata)
656 );
657 
658 TRACE_EVENT(drv_sw_scan_start,
659 	TP_PROTO(struct ieee80211_local *local,
660 		 struct ieee80211_sub_if_data *sdata,
661 		 const u8 *mac_addr),
662 
663 	TP_ARGS(local, sdata, mac_addr),
664 
665 	TP_STRUCT__entry(
666 		LOCAL_ENTRY
667 		VIF_ENTRY
668 		__array(char, mac_addr, ETH_ALEN)
669 	),
670 
671 	TP_fast_assign(
672 		LOCAL_ASSIGN;
673 		VIF_ASSIGN;
674 		memcpy(__entry->mac_addr, mac_addr, ETH_ALEN);
675 	),
676 
677 	TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", addr:%pM",
678 		  LOCAL_PR_ARG, VIF_PR_ARG, __entry->mac_addr)
679 );
680 
681 DEFINE_EVENT(local_sdata_evt, drv_sw_scan_complete,
682 	TP_PROTO(struct ieee80211_local *local,
683 		 struct ieee80211_sub_if_data *sdata),
684 	TP_ARGS(local, sdata)
685 );
686 
687 TRACE_EVENT(drv_get_stats,
688 	TP_PROTO(struct ieee80211_local *local,
689 		 struct ieee80211_low_level_stats *stats,
690 		 int ret),
691 
692 	TP_ARGS(local, stats, ret),
693 
694 	TP_STRUCT__entry(
695 		LOCAL_ENTRY
696 		__field(int, ret)
697 		__field(unsigned int, ackfail)
698 		__field(unsigned int, rtsfail)
699 		__field(unsigned int, fcserr)
700 		__field(unsigned int, rtssucc)
701 	),
702 
703 	TP_fast_assign(
704 		LOCAL_ASSIGN;
705 		__entry->ret = ret;
706 		__entry->ackfail = stats->dot11ACKFailureCount;
707 		__entry->rtsfail = stats->dot11RTSFailureCount;
708 		__entry->fcserr = stats->dot11FCSErrorCount;
709 		__entry->rtssucc = stats->dot11RTSSuccessCount;
710 	),
711 
712 	TP_printk(
713 		LOCAL_PR_FMT " ret:%d",
714 		LOCAL_PR_ARG, __entry->ret
715 	)
716 );
717 
718 TRACE_EVENT(drv_get_key_seq,
719 	TP_PROTO(struct ieee80211_local *local,
720 		 struct ieee80211_key_conf *key),
721 
722 	TP_ARGS(local, key),
723 
724 	TP_STRUCT__entry(
725 		LOCAL_ENTRY
726 		KEY_ENTRY
727 	),
728 
729 	TP_fast_assign(
730 		LOCAL_ASSIGN;
731 		KEY_ASSIGN(key);
732 	),
733 
734 	TP_printk(
735 		LOCAL_PR_FMT KEY_PR_FMT,
736 		LOCAL_PR_ARG, KEY_PR_ARG
737 	)
738 );
739 
740 DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
741 	TP_PROTO(struct ieee80211_local *local, u32 value),
742 	TP_ARGS(local, value)
743 );
744 
745 DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
746 	TP_PROTO(struct ieee80211_local *local, u32 value),
747 	TP_ARGS(local, value)
748 );
749 
750 TRACE_EVENT(drv_set_coverage_class,
751 	TP_PROTO(struct ieee80211_local *local, s16 value),
752 
753 	TP_ARGS(local, value),
754 
755 	TP_STRUCT__entry(
756 		LOCAL_ENTRY
757 		__field(s16, value)
758 	),
759 
760 	TP_fast_assign(
761 		LOCAL_ASSIGN;
762 		__entry->value = value;
763 	),
764 
765 	TP_printk(
766 		LOCAL_PR_FMT " value:%d",
767 		LOCAL_PR_ARG, __entry->value
768 	)
769 );
770 
771 TRACE_EVENT(drv_sta_notify,
772 	TP_PROTO(struct ieee80211_local *local,
773 		 struct ieee80211_sub_if_data *sdata,
774 		 enum sta_notify_cmd cmd,
775 		 struct ieee80211_sta *sta),
776 
777 	TP_ARGS(local, sdata, cmd, sta),
778 
779 	TP_STRUCT__entry(
780 		LOCAL_ENTRY
781 		VIF_ENTRY
782 		STA_ENTRY
783 		__field(u32, cmd)
784 	),
785 
786 	TP_fast_assign(
787 		LOCAL_ASSIGN;
788 		VIF_ASSIGN;
789 		STA_ASSIGN;
790 		__entry->cmd = cmd;
791 	),
792 
793 	TP_printk(
794 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " cmd:%d",
795 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
796 	)
797 );
798 
799 TRACE_EVENT(drv_sta_state,
800 	TP_PROTO(struct ieee80211_local *local,
801 		 struct ieee80211_sub_if_data *sdata,
802 		 struct ieee80211_sta *sta,
803 		 enum ieee80211_sta_state old_state,
804 		 enum ieee80211_sta_state new_state),
805 
806 	TP_ARGS(local, sdata, sta, old_state, new_state),
807 
808 	TP_STRUCT__entry(
809 		LOCAL_ENTRY
810 		VIF_ENTRY
811 		STA_ENTRY
812 		__field(u32, old_state)
813 		__field(u32, new_state)
814 	),
815 
816 	TP_fast_assign(
817 		LOCAL_ASSIGN;
818 		VIF_ASSIGN;
819 		STA_ASSIGN;
820 		__entry->old_state = old_state;
821 		__entry->new_state = new_state;
822 	),
823 
824 	TP_printk(
825 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " state: %d->%d",
826 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
827 		__entry->old_state, __entry->new_state
828 	)
829 );
830 
831 TRACE_EVENT(drv_sta_set_txpwr,
832 	TP_PROTO(struct ieee80211_local *local,
833 		 struct ieee80211_sub_if_data *sdata,
834 		 struct ieee80211_sta *sta),
835 
836 	TP_ARGS(local, sdata, sta),
837 
838 	TP_STRUCT__entry(
839 		LOCAL_ENTRY
840 		VIF_ENTRY
841 		STA_ENTRY
842 		__field(s16, txpwr)
843 		__field(u8, type)
844 	),
845 
846 	TP_fast_assign(
847 		LOCAL_ASSIGN;
848 		VIF_ASSIGN;
849 		STA_ASSIGN;
850 		__entry->txpwr = sta->txpwr.power;
851 		__entry->type = sta->txpwr.type;
852 	),
853 
854 	TP_printk(
855 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " txpwr: %d type %d",
856 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
857 		__entry->txpwr,  __entry->type
858 	)
859 );
860 
861 TRACE_EVENT(drv_sta_rc_update,
862 	TP_PROTO(struct ieee80211_local *local,
863 		 struct ieee80211_sub_if_data *sdata,
864 		 struct ieee80211_sta *sta,
865 		 u32 changed),
866 
867 	TP_ARGS(local, sdata, sta, changed),
868 
869 	TP_STRUCT__entry(
870 		LOCAL_ENTRY
871 		VIF_ENTRY
872 		STA_ENTRY
873 		__field(u32, changed)
874 	),
875 
876 	TP_fast_assign(
877 		LOCAL_ASSIGN;
878 		VIF_ASSIGN;
879 		STA_ASSIGN;
880 		__entry->changed = changed;
881 	),
882 
883 	TP_printk(
884 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " changed: 0x%x",
885 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
886 	)
887 );
888 
889 DECLARE_EVENT_CLASS(sta_event,
890 	TP_PROTO(struct ieee80211_local *local,
891 		 struct ieee80211_sub_if_data *sdata,
892 		 struct ieee80211_sta *sta),
893 
894 	TP_ARGS(local, sdata, sta),
895 
896 	TP_STRUCT__entry(
897 		LOCAL_ENTRY
898 		VIF_ENTRY
899 		STA_ENTRY
900 	),
901 
902 	TP_fast_assign(
903 		LOCAL_ASSIGN;
904 		VIF_ASSIGN;
905 		STA_ASSIGN;
906 	),
907 
908 	TP_printk(
909 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
910 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
911 	)
912 );
913 
914 DEFINE_EVENT(sta_event, drv_sta_statistics,
915 	TP_PROTO(struct ieee80211_local *local,
916 		 struct ieee80211_sub_if_data *sdata,
917 		 struct ieee80211_sta *sta),
918 	TP_ARGS(local, sdata, sta)
919 );
920 
921 DEFINE_EVENT(sta_event, drv_sta_add,
922 	TP_PROTO(struct ieee80211_local *local,
923 		 struct ieee80211_sub_if_data *sdata,
924 		 struct ieee80211_sta *sta),
925 	TP_ARGS(local, sdata, sta)
926 );
927 
928 DEFINE_EVENT(sta_event, drv_sta_remove,
929 	TP_PROTO(struct ieee80211_local *local,
930 		 struct ieee80211_sub_if_data *sdata,
931 		 struct ieee80211_sta *sta),
932 	TP_ARGS(local, sdata, sta)
933 );
934 
935 DEFINE_EVENT(sta_event, drv_sta_pre_rcu_remove,
936 	TP_PROTO(struct ieee80211_local *local,
937 		 struct ieee80211_sub_if_data *sdata,
938 		 struct ieee80211_sta *sta),
939 	TP_ARGS(local, sdata, sta)
940 );
941 
942 DEFINE_EVENT(sta_event, drv_sync_rx_queues,
943 	TP_PROTO(struct ieee80211_local *local,
944 		 struct ieee80211_sub_if_data *sdata,
945 		 struct ieee80211_sta *sta),
946 	TP_ARGS(local, sdata, sta)
947 );
948 
949 DEFINE_EVENT(sta_event, drv_sta_rate_tbl_update,
950 	TP_PROTO(struct ieee80211_local *local,
951 		 struct ieee80211_sub_if_data *sdata,
952 		 struct ieee80211_sta *sta),
953 	TP_ARGS(local, sdata, sta)
954 );
955 
956 TRACE_EVENT(drv_conf_tx,
957 	TP_PROTO(struct ieee80211_local *local,
958 		 struct ieee80211_sub_if_data *sdata,
959 		 u16 ac, const struct ieee80211_tx_queue_params *params),
960 
961 	TP_ARGS(local, sdata, ac, params),
962 
963 	TP_STRUCT__entry(
964 		LOCAL_ENTRY
965 		VIF_ENTRY
966 		__field(u16, ac)
967 		__field(u16, txop)
968 		__field(u16, cw_min)
969 		__field(u16, cw_max)
970 		__field(u8, aifs)
971 		__field(bool, uapsd)
972 	),
973 
974 	TP_fast_assign(
975 		LOCAL_ASSIGN;
976 		VIF_ASSIGN;
977 		__entry->ac = ac;
978 		__entry->txop = params->txop;
979 		__entry->cw_max = params->cw_max;
980 		__entry->cw_min = params->cw_min;
981 		__entry->aifs = params->aifs;
982 		__entry->uapsd = params->uapsd;
983 	),
984 
985 	TP_printk(
986 		LOCAL_PR_FMT  VIF_PR_FMT  " AC:%d",
987 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
988 	)
989 );
990 
991 DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
992 	TP_PROTO(struct ieee80211_local *local,
993 		 struct ieee80211_sub_if_data *sdata),
994 	TP_ARGS(local, sdata)
995 );
996 
997 TRACE_EVENT(drv_set_tsf,
998 	TP_PROTO(struct ieee80211_local *local,
999 		 struct ieee80211_sub_if_data *sdata,
1000 		 u64 tsf),
1001 
1002 	TP_ARGS(local, sdata, tsf),
1003 
1004 	TP_STRUCT__entry(
1005 		LOCAL_ENTRY
1006 		VIF_ENTRY
1007 		__field(u64, tsf)
1008 	),
1009 
1010 	TP_fast_assign(
1011 		LOCAL_ASSIGN;
1012 		VIF_ASSIGN;
1013 		__entry->tsf = tsf;
1014 	),
1015 
1016 	TP_printk(
1017 		LOCAL_PR_FMT  VIF_PR_FMT  " tsf:%llu",
1018 		LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
1019 	)
1020 );
1021 
1022 TRACE_EVENT(drv_offset_tsf,
1023 	TP_PROTO(struct ieee80211_local *local,
1024 		 struct ieee80211_sub_if_data *sdata,
1025 		 s64 offset),
1026 
1027 	TP_ARGS(local, sdata, offset),
1028 
1029 	TP_STRUCT__entry(
1030 		LOCAL_ENTRY
1031 		VIF_ENTRY
1032 		__field(s64, tsf_offset)
1033 	),
1034 
1035 	TP_fast_assign(
1036 		LOCAL_ASSIGN;
1037 		VIF_ASSIGN;
1038 		__entry->tsf_offset = offset;
1039 	),
1040 
1041 	TP_printk(
1042 		LOCAL_PR_FMT  VIF_PR_FMT  " tsf offset:%lld",
1043 		LOCAL_PR_ARG, VIF_PR_ARG,
1044 		(unsigned long long)__entry->tsf_offset
1045 	)
1046 );
1047 
1048 DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
1049 	TP_PROTO(struct ieee80211_local *local,
1050 		 struct ieee80211_sub_if_data *sdata),
1051 	TP_ARGS(local, sdata)
1052 );
1053 
1054 DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
1055 	TP_PROTO(struct ieee80211_local *local),
1056 	TP_ARGS(local)
1057 );
1058 
1059 TRACE_EVENT(drv_ampdu_action,
1060 	TP_PROTO(struct ieee80211_local *local,
1061 		 struct ieee80211_sub_if_data *sdata,
1062 		 struct ieee80211_ampdu_params *params),
1063 
1064 	TP_ARGS(local, sdata, params),
1065 
1066 	TP_STRUCT__entry(
1067 		LOCAL_ENTRY
1068 		VIF_ENTRY
1069 		AMPDU_ACTION_ENTRY
1070 	),
1071 
1072 	TP_fast_assign(
1073 		LOCAL_ASSIGN;
1074 		VIF_ASSIGN;
1075 		AMPDU_ACTION_ASSIGN;
1076 	),
1077 
1078 	TP_printk(
1079 		LOCAL_PR_FMT VIF_PR_FMT AMPDU_ACTION_PR_FMT,
1080 		LOCAL_PR_ARG, VIF_PR_ARG, AMPDU_ACTION_PR_ARG
1081 	)
1082 );
1083 
1084 TRACE_EVENT(drv_get_survey,
1085 	TP_PROTO(struct ieee80211_local *local, int _idx,
1086 		 struct survey_info *survey),
1087 
1088 	TP_ARGS(local, _idx, survey),
1089 
1090 	TP_STRUCT__entry(
1091 		LOCAL_ENTRY
1092 		__field(int, idx)
1093 	),
1094 
1095 	TP_fast_assign(
1096 		LOCAL_ASSIGN;
1097 		__entry->idx = _idx;
1098 	),
1099 
1100 	TP_printk(
1101 		LOCAL_PR_FMT " idx:%d",
1102 		LOCAL_PR_ARG, __entry->idx
1103 	)
1104 );
1105 
1106 TRACE_EVENT(drv_flush,
1107 	TP_PROTO(struct ieee80211_local *local,
1108 		 u32 queues, bool drop),
1109 
1110 	TP_ARGS(local, queues, drop),
1111 
1112 	TP_STRUCT__entry(
1113 		LOCAL_ENTRY
1114 		__field(bool, drop)
1115 		__field(u32, queues)
1116 	),
1117 
1118 	TP_fast_assign(
1119 		LOCAL_ASSIGN;
1120 		__entry->drop = drop;
1121 		__entry->queues = queues;
1122 	),
1123 
1124 	TP_printk(
1125 		LOCAL_PR_FMT " queues:0x%x drop:%d",
1126 		LOCAL_PR_ARG, __entry->queues, __entry->drop
1127 	)
1128 );
1129 
1130 TRACE_EVENT(drv_channel_switch,
1131 	TP_PROTO(struct ieee80211_local *local,
1132 		 struct ieee80211_sub_if_data *sdata,
1133 		 struct ieee80211_channel_switch *ch_switch),
1134 
1135 	TP_ARGS(local, sdata, ch_switch),
1136 
1137 	TP_STRUCT__entry(
1138 		LOCAL_ENTRY
1139 		VIF_ENTRY
1140 		CHANDEF_ENTRY
1141 		__field(u64, timestamp)
1142 		__field(u32, device_timestamp)
1143 		__field(bool, block_tx)
1144 		__field(u8, count)
1145 	),
1146 
1147 	TP_fast_assign(
1148 		LOCAL_ASSIGN;
1149 		VIF_ASSIGN;
1150 		CHANDEF_ASSIGN(&ch_switch->chandef)
1151 		__entry->timestamp = ch_switch->timestamp;
1152 		__entry->device_timestamp = ch_switch->device_timestamp;
1153 		__entry->block_tx = ch_switch->block_tx;
1154 		__entry->count = ch_switch->count;
1155 	),
1156 
1157 	TP_printk(
1158 		LOCAL_PR_FMT VIF_PR_FMT " new " CHANDEF_PR_FMT " count:%d",
1159 		LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count
1160 	)
1161 );
1162 
1163 TRACE_EVENT(drv_set_antenna,
1164 	TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
1165 
1166 	TP_ARGS(local, tx_ant, rx_ant, ret),
1167 
1168 	TP_STRUCT__entry(
1169 		LOCAL_ENTRY
1170 		__field(u32, tx_ant)
1171 		__field(u32, rx_ant)
1172 		__field(int, ret)
1173 	),
1174 
1175 	TP_fast_assign(
1176 		LOCAL_ASSIGN;
1177 		__entry->tx_ant = tx_ant;
1178 		__entry->rx_ant = rx_ant;
1179 		__entry->ret = ret;
1180 	),
1181 
1182 	TP_printk(
1183 		LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1184 		LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1185 	)
1186 );
1187 
1188 TRACE_EVENT(drv_get_antenna,
1189 	TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
1190 
1191 	TP_ARGS(local, tx_ant, rx_ant, ret),
1192 
1193 	TP_STRUCT__entry(
1194 		LOCAL_ENTRY
1195 		__field(u32, tx_ant)
1196 		__field(u32, rx_ant)
1197 		__field(int, ret)
1198 	),
1199 
1200 	TP_fast_assign(
1201 		LOCAL_ASSIGN;
1202 		__entry->tx_ant = tx_ant;
1203 		__entry->rx_ant = rx_ant;
1204 		__entry->ret = ret;
1205 	),
1206 
1207 	TP_printk(
1208 		LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1209 		LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1210 	)
1211 );
1212 
1213 TRACE_EVENT(drv_remain_on_channel,
1214 	TP_PROTO(struct ieee80211_local *local,
1215 		 struct ieee80211_sub_if_data *sdata,
1216 		 struct ieee80211_channel *chan,
1217 		 unsigned int duration,
1218 		 enum ieee80211_roc_type type),
1219 
1220 	TP_ARGS(local, sdata, chan, duration, type),
1221 
1222 	TP_STRUCT__entry(
1223 		LOCAL_ENTRY
1224 		VIF_ENTRY
1225 		__field(int, center_freq)
1226 		__field(unsigned int, duration)
1227 		__field(u32, type)
1228 	),
1229 
1230 	TP_fast_assign(
1231 		LOCAL_ASSIGN;
1232 		VIF_ASSIGN;
1233 		__entry->center_freq = chan->center_freq;
1234 		__entry->duration = duration;
1235 		__entry->type = type;
1236 	),
1237 
1238 	TP_printk(
1239 		LOCAL_PR_FMT  VIF_PR_FMT " freq:%dMHz duration:%dms type=%d",
1240 		LOCAL_PR_ARG, VIF_PR_ARG,
1241 		__entry->center_freq, __entry->duration, __entry->type
1242 	)
1243 );
1244 
1245 DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
1246 	TP_PROTO(struct ieee80211_local *local),
1247 	TP_ARGS(local)
1248 );
1249 
1250 TRACE_EVENT(drv_set_ringparam,
1251 	TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
1252 
1253 	TP_ARGS(local, tx, rx),
1254 
1255 	TP_STRUCT__entry(
1256 		LOCAL_ENTRY
1257 		__field(u32, tx)
1258 		__field(u32, rx)
1259 	),
1260 
1261 	TP_fast_assign(
1262 		LOCAL_ASSIGN;
1263 		__entry->tx = tx;
1264 		__entry->rx = rx;
1265 	),
1266 
1267 	TP_printk(
1268 		LOCAL_PR_FMT " tx:%d rx %d",
1269 		LOCAL_PR_ARG, __entry->tx, __entry->rx
1270 	)
1271 );
1272 
1273 TRACE_EVENT(drv_get_ringparam,
1274 	TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1275 		 u32 *rx, u32 *rx_max),
1276 
1277 	TP_ARGS(local, tx, tx_max, rx, rx_max),
1278 
1279 	TP_STRUCT__entry(
1280 		LOCAL_ENTRY
1281 		__field(u32, tx)
1282 		__field(u32, tx_max)
1283 		__field(u32, rx)
1284 		__field(u32, rx_max)
1285 	),
1286 
1287 	TP_fast_assign(
1288 		LOCAL_ASSIGN;
1289 		__entry->tx = *tx;
1290 		__entry->tx_max = *tx_max;
1291 		__entry->rx = *rx;
1292 		__entry->rx_max = *rx_max;
1293 	),
1294 
1295 	TP_printk(
1296 		LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1297 		LOCAL_PR_ARG,
1298 		__entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1299 	)
1300 );
1301 
1302 DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1303 	TP_PROTO(struct ieee80211_local *local),
1304 	TP_ARGS(local)
1305 );
1306 
1307 DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1308 	TP_PROTO(struct ieee80211_local *local),
1309 	TP_ARGS(local)
1310 );
1311 
1312 TRACE_EVENT(drv_set_bitrate_mask,
1313 	TP_PROTO(struct ieee80211_local *local,
1314 		 struct ieee80211_sub_if_data *sdata,
1315 		 const struct cfg80211_bitrate_mask *mask),
1316 
1317 	TP_ARGS(local, sdata, mask),
1318 
1319 	TP_STRUCT__entry(
1320 		LOCAL_ENTRY
1321 		VIF_ENTRY
1322 		__field(u32, legacy_2g)
1323 		__field(u32, legacy_5g)
1324 	),
1325 
1326 	TP_fast_assign(
1327 		LOCAL_ASSIGN;
1328 		VIF_ASSIGN;
1329 		__entry->legacy_2g = mask->control[NL80211_BAND_2GHZ].legacy;
1330 		__entry->legacy_5g = mask->control[NL80211_BAND_5GHZ].legacy;
1331 	),
1332 
1333 	TP_printk(
1334 		LOCAL_PR_FMT  VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1335 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1336 	)
1337 );
1338 
1339 TRACE_EVENT(drv_set_rekey_data,
1340 	TP_PROTO(struct ieee80211_local *local,
1341 		 struct ieee80211_sub_if_data *sdata,
1342 		 struct cfg80211_gtk_rekey_data *data),
1343 
1344 	TP_ARGS(local, sdata, data),
1345 
1346 	TP_STRUCT__entry(
1347 		LOCAL_ENTRY
1348 		VIF_ENTRY
1349 		__array(u8, kek, NL80211_KEK_LEN)
1350 		__array(u8, kck, NL80211_KCK_LEN)
1351 		__array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1352 	),
1353 
1354 	TP_fast_assign(
1355 		LOCAL_ASSIGN;
1356 		VIF_ASSIGN;
1357 		memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1358 		memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1359 		memcpy(__entry->replay_ctr, data->replay_ctr,
1360 		       NL80211_REPLAY_CTR_LEN);
1361 	),
1362 
1363 	TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1364 		  LOCAL_PR_ARG, VIF_PR_ARG)
1365 );
1366 
1367 TRACE_EVENT(drv_event_callback,
1368 	TP_PROTO(struct ieee80211_local *local,
1369 		 struct ieee80211_sub_if_data *sdata,
1370 		 const struct ieee80211_event *_event),
1371 
1372 	TP_ARGS(local, sdata, _event),
1373 
1374 	TP_STRUCT__entry(
1375 		LOCAL_ENTRY
1376 		VIF_ENTRY
1377 		__field(u32, type)
1378 	),
1379 
1380 	TP_fast_assign(
1381 		LOCAL_ASSIGN;
1382 		VIF_ASSIGN;
1383 		__entry->type = _event->type;
1384 	),
1385 
1386 	TP_printk(
1387 		LOCAL_PR_FMT VIF_PR_FMT " event:%d",
1388 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->type
1389 	)
1390 );
1391 
1392 DECLARE_EVENT_CLASS(release_evt,
1393 	TP_PROTO(struct ieee80211_local *local,
1394 		 struct ieee80211_sta *sta,
1395 		 u16 tids, int num_frames,
1396 		 enum ieee80211_frame_release_type reason,
1397 		 bool more_data),
1398 
1399 	TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1400 
1401 	TP_STRUCT__entry(
1402 		LOCAL_ENTRY
1403 		STA_ENTRY
1404 		__field(u16, tids)
1405 		__field(int, num_frames)
1406 		__field(int, reason)
1407 		__field(bool, more_data)
1408 	),
1409 
1410 	TP_fast_assign(
1411 		LOCAL_ASSIGN;
1412 		STA_ASSIGN;
1413 		__entry->tids = tids;
1414 		__entry->num_frames = num_frames;
1415 		__entry->reason = reason;
1416 		__entry->more_data = more_data;
1417 	),
1418 
1419 	TP_printk(
1420 		LOCAL_PR_FMT STA_PR_FMT
1421 		" TIDs:0x%.4x frames:%d reason:%d more:%d",
1422 		LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1423 		__entry->reason, __entry->more_data
1424 	)
1425 );
1426 
1427 DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1428 	TP_PROTO(struct ieee80211_local *local,
1429 		 struct ieee80211_sta *sta,
1430 		 u16 tids, int num_frames,
1431 		 enum ieee80211_frame_release_type reason,
1432 		 bool more_data),
1433 
1434 	TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1435 );
1436 
1437 DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1438 	TP_PROTO(struct ieee80211_local *local,
1439 		 struct ieee80211_sta *sta,
1440 		 u16 tids, int num_frames,
1441 		 enum ieee80211_frame_release_type reason,
1442 		 bool more_data),
1443 
1444 	TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1445 );
1446 
1447 TRACE_EVENT(drv_mgd_prepare_tx,
1448 	TP_PROTO(struct ieee80211_local *local,
1449 		 struct ieee80211_sub_if_data *sdata,
1450 		 u16 duration),
1451 
1452 	TP_ARGS(local, sdata, duration),
1453 
1454 	TP_STRUCT__entry(
1455 		LOCAL_ENTRY
1456 		VIF_ENTRY
1457 		__field(u32, duration)
1458 	),
1459 
1460 	TP_fast_assign(
1461 		LOCAL_ASSIGN;
1462 		VIF_ASSIGN;
1463 		__entry->duration = duration;
1464 	),
1465 
1466 	TP_printk(
1467 		LOCAL_PR_FMT VIF_PR_FMT " duration: %u",
1468 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->duration
1469 	)
1470 );
1471 
1472 DEFINE_EVENT(local_sdata_evt, drv_mgd_protect_tdls_discover,
1473 	TP_PROTO(struct ieee80211_local *local,
1474 		 struct ieee80211_sub_if_data *sdata),
1475 
1476 	TP_ARGS(local, sdata)
1477 );
1478 
1479 DECLARE_EVENT_CLASS(local_chanctx,
1480 	TP_PROTO(struct ieee80211_local *local,
1481 		 struct ieee80211_chanctx *ctx),
1482 
1483 	TP_ARGS(local, ctx),
1484 
1485 	TP_STRUCT__entry(
1486 		LOCAL_ENTRY
1487 		CHANCTX_ENTRY
1488 	),
1489 
1490 	TP_fast_assign(
1491 		LOCAL_ASSIGN;
1492 		CHANCTX_ASSIGN;
1493 	),
1494 
1495 	TP_printk(
1496 		LOCAL_PR_FMT CHANCTX_PR_FMT,
1497 		LOCAL_PR_ARG, CHANCTX_PR_ARG
1498 	)
1499 );
1500 
1501 DEFINE_EVENT(local_chanctx, drv_add_chanctx,
1502 	TP_PROTO(struct ieee80211_local *local,
1503 		 struct ieee80211_chanctx *ctx),
1504 	TP_ARGS(local, ctx)
1505 );
1506 
1507 DEFINE_EVENT(local_chanctx, drv_remove_chanctx,
1508 	TP_PROTO(struct ieee80211_local *local,
1509 		 struct ieee80211_chanctx *ctx),
1510 	TP_ARGS(local, ctx)
1511 );
1512 
1513 TRACE_EVENT(drv_change_chanctx,
1514 	TP_PROTO(struct ieee80211_local *local,
1515 		 struct ieee80211_chanctx *ctx,
1516 		 u32 changed),
1517 
1518 	TP_ARGS(local, ctx, changed),
1519 
1520 	TP_STRUCT__entry(
1521 		LOCAL_ENTRY
1522 		CHANCTX_ENTRY
1523 		__field(u32, changed)
1524 	),
1525 
1526 	TP_fast_assign(
1527 		LOCAL_ASSIGN;
1528 		CHANCTX_ASSIGN;
1529 		__entry->changed = changed;
1530 	),
1531 
1532 	TP_printk(
1533 		LOCAL_PR_FMT CHANCTX_PR_FMT " changed:%#x",
1534 		LOCAL_PR_ARG, CHANCTX_PR_ARG, __entry->changed
1535 	)
1536 );
1537 
1538 #if !defined(__TRACE_VIF_ENTRY)
1539 #define __TRACE_VIF_ENTRY
1540 struct trace_vif_entry {
1541 	enum nl80211_iftype vif_type;
1542 	bool p2p;
1543 	char vif_name[IFNAMSIZ];
1544 } __packed;
1545 
1546 struct trace_chandef_entry {
1547 	u32 control_freq;
1548 	u32 chan_width;
1549 	u32 center_freq1;
1550 	u32 center_freq2;
1551 } __packed;
1552 
1553 struct trace_switch_entry {
1554 	struct trace_vif_entry vif;
1555 	struct trace_chandef_entry old_chandef;
1556 	struct trace_chandef_entry new_chandef;
1557 } __packed;
1558 
1559 #define SWITCH_ENTRY_ASSIGN(to, from) local_vifs[i].to = vifs[i].from
1560 #endif
1561 
1562 TRACE_EVENT(drv_switch_vif_chanctx,
1563 	TP_PROTO(struct ieee80211_local *local,
1564 		 struct ieee80211_vif_chanctx_switch *vifs,
1565 		 int n_vifs, enum ieee80211_chanctx_switch_mode mode),
1566 	    TP_ARGS(local, vifs, n_vifs, mode),
1567 
1568 	TP_STRUCT__entry(
1569 		LOCAL_ENTRY
1570 		__field(int, n_vifs)
1571 		__field(u32, mode)
1572 		__dynamic_array(u8, vifs,
1573 				sizeof(struct trace_switch_entry) * n_vifs)
1574 	),
1575 
1576 	TP_fast_assign(
1577 		LOCAL_ASSIGN;
1578 		__entry->n_vifs = n_vifs;
1579 		__entry->mode = mode;
1580 		{
1581 			struct trace_switch_entry *local_vifs =
1582 				__get_dynamic_array(vifs);
1583 			int i;
1584 
1585 			for (i = 0; i < n_vifs; i++) {
1586 				struct ieee80211_sub_if_data *sdata;
1587 
1588 				sdata = container_of(vifs[i].vif,
1589 						struct ieee80211_sub_if_data,
1590 						vif);
1591 
1592 				SWITCH_ENTRY_ASSIGN(vif.vif_type, vif->type);
1593 				SWITCH_ENTRY_ASSIGN(vif.p2p, vif->p2p);
1594 				strncpy(local_vifs[i].vif.vif_name,
1595 					sdata->name,
1596 					sizeof(local_vifs[i].vif.vif_name));
1597 				SWITCH_ENTRY_ASSIGN(old_chandef.control_freq,
1598 						old_ctx->def.chan->center_freq);
1599 				SWITCH_ENTRY_ASSIGN(old_chandef.chan_width,
1600 						    old_ctx->def.width);
1601 				SWITCH_ENTRY_ASSIGN(old_chandef.center_freq1,
1602 						    old_ctx->def.center_freq1);
1603 				SWITCH_ENTRY_ASSIGN(old_chandef.center_freq2,
1604 						    old_ctx->def.center_freq2);
1605 				SWITCH_ENTRY_ASSIGN(new_chandef.control_freq,
1606 						new_ctx->def.chan->center_freq);
1607 				SWITCH_ENTRY_ASSIGN(new_chandef.chan_width,
1608 						    new_ctx->def.width);
1609 				SWITCH_ENTRY_ASSIGN(new_chandef.center_freq1,
1610 						    new_ctx->def.center_freq1);
1611 				SWITCH_ENTRY_ASSIGN(new_chandef.center_freq2,
1612 						    new_ctx->def.center_freq2);
1613 			}
1614 		}
1615 	),
1616 
1617 	TP_printk(
1618 		LOCAL_PR_FMT " n_vifs:%d mode:%d",
1619 		LOCAL_PR_ARG, __entry->n_vifs, __entry->mode
1620 	)
1621 );
1622 
1623 DECLARE_EVENT_CLASS(local_sdata_chanctx,
1624 	TP_PROTO(struct ieee80211_local *local,
1625 		 struct ieee80211_sub_if_data *sdata,
1626 		 struct ieee80211_chanctx *ctx),
1627 
1628 	TP_ARGS(local, sdata, ctx),
1629 
1630 	TP_STRUCT__entry(
1631 		LOCAL_ENTRY
1632 		VIF_ENTRY
1633 		CHANCTX_ENTRY
1634 	),
1635 
1636 	TP_fast_assign(
1637 		LOCAL_ASSIGN;
1638 		VIF_ASSIGN;
1639 		CHANCTX_ASSIGN;
1640 	),
1641 
1642 	TP_printk(
1643 		LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT,
1644 		LOCAL_PR_ARG, VIF_PR_ARG, CHANCTX_PR_ARG
1645 	)
1646 );
1647 
1648 DEFINE_EVENT(local_sdata_chanctx, drv_assign_vif_chanctx,
1649 	TP_PROTO(struct ieee80211_local *local,
1650 		 struct ieee80211_sub_if_data *sdata,
1651 		 struct ieee80211_chanctx *ctx),
1652 	TP_ARGS(local, sdata, ctx)
1653 );
1654 
1655 DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
1656 	TP_PROTO(struct ieee80211_local *local,
1657 		 struct ieee80211_sub_if_data *sdata,
1658 		 struct ieee80211_chanctx *ctx),
1659 	TP_ARGS(local, sdata, ctx)
1660 );
1661 
1662 TRACE_EVENT(drv_start_ap,
1663 	TP_PROTO(struct ieee80211_local *local,
1664 		 struct ieee80211_sub_if_data *sdata,
1665 		 struct ieee80211_bss_conf *info),
1666 
1667 	TP_ARGS(local, sdata, info),
1668 
1669 	TP_STRUCT__entry(
1670 		LOCAL_ENTRY
1671 		VIF_ENTRY
1672 		__field(u8, dtimper)
1673 		__field(u16, bcnint)
1674 		__dynamic_array(u8, ssid, info->ssid_len);
1675 		__field(bool, hidden_ssid);
1676 	),
1677 
1678 	TP_fast_assign(
1679 		LOCAL_ASSIGN;
1680 		VIF_ASSIGN;
1681 		__entry->dtimper = info->dtim_period;
1682 		__entry->bcnint = info->beacon_int;
1683 		memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
1684 		__entry->hidden_ssid = info->hidden_ssid;
1685 	),
1686 
1687 	TP_printk(
1688 		LOCAL_PR_FMT  VIF_PR_FMT,
1689 		LOCAL_PR_ARG, VIF_PR_ARG
1690 	)
1691 );
1692 
1693 DEFINE_EVENT(local_sdata_evt, drv_stop_ap,
1694 	TP_PROTO(struct ieee80211_local *local,
1695 		 struct ieee80211_sub_if_data *sdata),
1696 	TP_ARGS(local, sdata)
1697 );
1698 
1699 TRACE_EVENT(drv_reconfig_complete,
1700 	TP_PROTO(struct ieee80211_local *local,
1701 		 enum ieee80211_reconfig_type reconfig_type),
1702 	TP_ARGS(local, reconfig_type),
1703 
1704 	TP_STRUCT__entry(
1705 		LOCAL_ENTRY
1706 		__field(u8, reconfig_type)
1707 	),
1708 
1709 	TP_fast_assign(
1710 		LOCAL_ASSIGN;
1711 		__entry->reconfig_type = reconfig_type;
1712 	),
1713 
1714 	TP_printk(
1715 		LOCAL_PR_FMT  " reconfig_type:%d",
1716 		LOCAL_PR_ARG, __entry->reconfig_type
1717 	)
1718 
1719 );
1720 
1721 #if IS_ENABLED(CONFIG_IPV6)
1722 DEFINE_EVENT(local_sdata_evt, drv_ipv6_addr_change,
1723 	TP_PROTO(struct ieee80211_local *local,
1724 		 struct ieee80211_sub_if_data *sdata),
1725 	TP_ARGS(local, sdata)
1726 );
1727 #endif
1728 
1729 TRACE_EVENT(drv_join_ibss,
1730 	TP_PROTO(struct ieee80211_local *local,
1731 		 struct ieee80211_sub_if_data *sdata,
1732 		 struct ieee80211_bss_conf *info),
1733 
1734 	TP_ARGS(local, sdata, info),
1735 
1736 	TP_STRUCT__entry(
1737 		LOCAL_ENTRY
1738 		VIF_ENTRY
1739 		__field(u8, dtimper)
1740 		__field(u16, bcnint)
1741 		__dynamic_array(u8, ssid, info->ssid_len);
1742 	),
1743 
1744 	TP_fast_assign(
1745 		LOCAL_ASSIGN;
1746 		VIF_ASSIGN;
1747 		__entry->dtimper = info->dtim_period;
1748 		__entry->bcnint = info->beacon_int;
1749 		memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
1750 	),
1751 
1752 	TP_printk(
1753 		LOCAL_PR_FMT  VIF_PR_FMT,
1754 		LOCAL_PR_ARG, VIF_PR_ARG
1755 	)
1756 );
1757 
1758 DEFINE_EVENT(local_sdata_evt, drv_leave_ibss,
1759 	TP_PROTO(struct ieee80211_local *local,
1760 		 struct ieee80211_sub_if_data *sdata),
1761 	TP_ARGS(local, sdata)
1762 );
1763 
1764 TRACE_EVENT(drv_get_expected_throughput,
1765 	TP_PROTO(struct ieee80211_sta *sta),
1766 
1767 	TP_ARGS(sta),
1768 
1769 	TP_STRUCT__entry(
1770 		STA_ENTRY
1771 	),
1772 
1773 	TP_fast_assign(
1774 		STA_ASSIGN;
1775 	),
1776 
1777 	TP_printk(
1778 		STA_PR_FMT, STA_PR_ARG
1779 	)
1780 );
1781 
1782 TRACE_EVENT(drv_start_nan,
1783 	TP_PROTO(struct ieee80211_local *local,
1784 		 struct ieee80211_sub_if_data *sdata,
1785 		 struct cfg80211_nan_conf *conf),
1786 
1787 	TP_ARGS(local, sdata, conf),
1788 	TP_STRUCT__entry(
1789 		LOCAL_ENTRY
1790 		VIF_ENTRY
1791 		__field(u8, master_pref)
1792 		__field(u8, bands)
1793 	),
1794 
1795 	TP_fast_assign(
1796 		LOCAL_ASSIGN;
1797 		VIF_ASSIGN;
1798 		__entry->master_pref = conf->master_pref;
1799 		__entry->bands = conf->bands;
1800 	),
1801 
1802 	TP_printk(
1803 		LOCAL_PR_FMT  VIF_PR_FMT
1804 		", master preference: %u, bands: 0x%0x",
1805 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->master_pref,
1806 		__entry->bands
1807 	)
1808 );
1809 
1810 TRACE_EVENT(drv_stop_nan,
1811 	TP_PROTO(struct ieee80211_local *local,
1812 		 struct ieee80211_sub_if_data *sdata),
1813 
1814 	TP_ARGS(local, sdata),
1815 
1816 	TP_STRUCT__entry(
1817 		LOCAL_ENTRY
1818 		VIF_ENTRY
1819 	),
1820 
1821 	TP_fast_assign(
1822 		LOCAL_ASSIGN;
1823 		VIF_ASSIGN;
1824 	),
1825 
1826 	TP_printk(
1827 		LOCAL_PR_FMT  VIF_PR_FMT,
1828 		LOCAL_PR_ARG, VIF_PR_ARG
1829 	)
1830 );
1831 
1832 TRACE_EVENT(drv_nan_change_conf,
1833 	TP_PROTO(struct ieee80211_local *local,
1834 		 struct ieee80211_sub_if_data *sdata,
1835 		 struct cfg80211_nan_conf *conf,
1836 		 u32 changes),
1837 
1838 	TP_ARGS(local, sdata, conf, changes),
1839 	TP_STRUCT__entry(
1840 		LOCAL_ENTRY
1841 		VIF_ENTRY
1842 		__field(u8, master_pref)
1843 		__field(u8, bands)
1844 		__field(u32, changes)
1845 	),
1846 
1847 	TP_fast_assign(
1848 		LOCAL_ASSIGN;
1849 		VIF_ASSIGN;
1850 		__entry->master_pref = conf->master_pref;
1851 		__entry->bands = conf->bands;
1852 		__entry->changes = changes;
1853 	),
1854 
1855 	TP_printk(
1856 		LOCAL_PR_FMT  VIF_PR_FMT
1857 		", master preference: %u, bands: 0x%0x, changes: 0x%x",
1858 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->master_pref,
1859 		__entry->bands, __entry->changes
1860 	)
1861 );
1862 
1863 TRACE_EVENT(drv_add_nan_func,
1864 	TP_PROTO(struct ieee80211_local *local,
1865 		 struct ieee80211_sub_if_data *sdata,
1866 		 const struct cfg80211_nan_func *func),
1867 
1868 	TP_ARGS(local, sdata, func),
1869 	TP_STRUCT__entry(
1870 		LOCAL_ENTRY
1871 		VIF_ENTRY
1872 		__field(u8, type)
1873 		__field(u8, inst_id)
1874 	),
1875 
1876 	TP_fast_assign(
1877 		LOCAL_ASSIGN;
1878 		VIF_ASSIGN;
1879 		__entry->type = func->type;
1880 		__entry->inst_id = func->instance_id;
1881 	),
1882 
1883 	TP_printk(
1884 		LOCAL_PR_FMT  VIF_PR_FMT
1885 		", type: %u, inst_id: %u",
1886 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->type, __entry->inst_id
1887 	)
1888 );
1889 
1890 TRACE_EVENT(drv_del_nan_func,
1891 	TP_PROTO(struct ieee80211_local *local,
1892 		 struct ieee80211_sub_if_data *sdata,
1893 		 u8 instance_id),
1894 
1895 	TP_ARGS(local, sdata, instance_id),
1896 	TP_STRUCT__entry(
1897 		LOCAL_ENTRY
1898 		VIF_ENTRY
1899 		__field(u8, instance_id)
1900 	),
1901 
1902 	TP_fast_assign(
1903 		LOCAL_ASSIGN;
1904 		VIF_ASSIGN;
1905 		__entry->instance_id = instance_id;
1906 	),
1907 
1908 	TP_printk(
1909 		LOCAL_PR_FMT  VIF_PR_FMT
1910 		", instance_id: %u",
1911 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->instance_id
1912 	)
1913 );
1914 
1915 DEFINE_EVENT(local_sdata_evt, drv_start_pmsr,
1916 	TP_PROTO(struct ieee80211_local *local,
1917 		 struct ieee80211_sub_if_data *sdata),
1918 	TP_ARGS(local, sdata)
1919 );
1920 
1921 DEFINE_EVENT(local_sdata_evt, drv_abort_pmsr,
1922 	TP_PROTO(struct ieee80211_local *local,
1923 		 struct ieee80211_sub_if_data *sdata),
1924 	TP_ARGS(local, sdata)
1925 );
1926 
1927 /*
1928  * Tracing for API calls that drivers call.
1929  */
1930 
1931 TRACE_EVENT(api_start_tx_ba_session,
1932 	TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1933 
1934 	TP_ARGS(sta, tid),
1935 
1936 	TP_STRUCT__entry(
1937 		STA_ENTRY
1938 		__field(u16, tid)
1939 	),
1940 
1941 	TP_fast_assign(
1942 		STA_ASSIGN;
1943 		__entry->tid = tid;
1944 	),
1945 
1946 	TP_printk(
1947 		STA_PR_FMT " tid:%d",
1948 		STA_PR_ARG, __entry->tid
1949 	)
1950 );
1951 
1952 TRACE_EVENT(api_start_tx_ba_cb,
1953 	TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1954 
1955 	TP_ARGS(sdata, ra, tid),
1956 
1957 	TP_STRUCT__entry(
1958 		VIF_ENTRY
1959 		__array(u8, ra, ETH_ALEN)
1960 		__field(u16, tid)
1961 	),
1962 
1963 	TP_fast_assign(
1964 		VIF_ASSIGN;
1965 		memcpy(__entry->ra, ra, ETH_ALEN);
1966 		__entry->tid = tid;
1967 	),
1968 
1969 	TP_printk(
1970 		VIF_PR_FMT " ra:%pM tid:%d",
1971 		VIF_PR_ARG, __entry->ra, __entry->tid
1972 	)
1973 );
1974 
1975 TRACE_EVENT(api_stop_tx_ba_session,
1976 	TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1977 
1978 	TP_ARGS(sta, tid),
1979 
1980 	TP_STRUCT__entry(
1981 		STA_ENTRY
1982 		__field(u16, tid)
1983 	),
1984 
1985 	TP_fast_assign(
1986 		STA_ASSIGN;
1987 		__entry->tid = tid;
1988 	),
1989 
1990 	TP_printk(
1991 		STA_PR_FMT " tid:%d",
1992 		STA_PR_ARG, __entry->tid
1993 	)
1994 );
1995 
1996 TRACE_EVENT(api_stop_tx_ba_cb,
1997 	TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1998 
1999 	TP_ARGS(sdata, ra, tid),
2000 
2001 	TP_STRUCT__entry(
2002 		VIF_ENTRY
2003 		__array(u8, ra, ETH_ALEN)
2004 		__field(u16, tid)
2005 	),
2006 
2007 	TP_fast_assign(
2008 		VIF_ASSIGN;
2009 		memcpy(__entry->ra, ra, ETH_ALEN);
2010 		__entry->tid = tid;
2011 	),
2012 
2013 	TP_printk(
2014 		VIF_PR_FMT " ra:%pM tid:%d",
2015 		VIF_PR_ARG, __entry->ra, __entry->tid
2016 	)
2017 );
2018 
2019 DEFINE_EVENT(local_only_evt, api_restart_hw,
2020 	TP_PROTO(struct ieee80211_local *local),
2021 	TP_ARGS(local)
2022 );
2023 
2024 TRACE_EVENT(api_beacon_loss,
2025 	TP_PROTO(struct ieee80211_sub_if_data *sdata),
2026 
2027 	TP_ARGS(sdata),
2028 
2029 	TP_STRUCT__entry(
2030 		VIF_ENTRY
2031 	),
2032 
2033 	TP_fast_assign(
2034 		VIF_ASSIGN;
2035 	),
2036 
2037 	TP_printk(
2038 		VIF_PR_FMT,
2039 		VIF_PR_ARG
2040 	)
2041 );
2042 
2043 TRACE_EVENT(api_connection_loss,
2044 	TP_PROTO(struct ieee80211_sub_if_data *sdata),
2045 
2046 	TP_ARGS(sdata),
2047 
2048 	TP_STRUCT__entry(
2049 		VIF_ENTRY
2050 	),
2051 
2052 	TP_fast_assign(
2053 		VIF_ASSIGN;
2054 	),
2055 
2056 	TP_printk(
2057 		VIF_PR_FMT,
2058 		VIF_PR_ARG
2059 	)
2060 );
2061 
2062 TRACE_EVENT(api_cqm_rssi_notify,
2063 	TP_PROTO(struct ieee80211_sub_if_data *sdata,
2064 		 enum nl80211_cqm_rssi_threshold_event rssi_event,
2065 		 s32 rssi_level),
2066 
2067 	TP_ARGS(sdata, rssi_event, rssi_level),
2068 
2069 	TP_STRUCT__entry(
2070 		VIF_ENTRY
2071 		__field(u32, rssi_event)
2072 		__field(s32, rssi_level)
2073 	),
2074 
2075 	TP_fast_assign(
2076 		VIF_ASSIGN;
2077 		__entry->rssi_event = rssi_event;
2078 		__entry->rssi_level = rssi_level;
2079 	),
2080 
2081 	TP_printk(
2082 		VIF_PR_FMT " event:%d rssi:%d",
2083 		VIF_PR_ARG, __entry->rssi_event, __entry->rssi_level
2084 	)
2085 );
2086 
2087 DEFINE_EVENT(local_sdata_evt, api_cqm_beacon_loss_notify,
2088 	TP_PROTO(struct ieee80211_local *local,
2089 		 struct ieee80211_sub_if_data *sdata),
2090 	TP_ARGS(local, sdata)
2091 );
2092 
2093 TRACE_EVENT(api_scan_completed,
2094 	TP_PROTO(struct ieee80211_local *local, bool aborted),
2095 
2096 	TP_ARGS(local, aborted),
2097 
2098 	TP_STRUCT__entry(
2099 		LOCAL_ENTRY
2100 		__field(bool, aborted)
2101 	),
2102 
2103 	TP_fast_assign(
2104 		LOCAL_ASSIGN;
2105 		__entry->aborted = aborted;
2106 	),
2107 
2108 	TP_printk(
2109 		LOCAL_PR_FMT " aborted:%d",
2110 		LOCAL_PR_ARG, __entry->aborted
2111 	)
2112 );
2113 
2114 TRACE_EVENT(api_sched_scan_results,
2115 	TP_PROTO(struct ieee80211_local *local),
2116 
2117 	TP_ARGS(local),
2118 
2119 	TP_STRUCT__entry(
2120 		LOCAL_ENTRY
2121 	),
2122 
2123 	TP_fast_assign(
2124 		LOCAL_ASSIGN;
2125 	),
2126 
2127 	TP_printk(
2128 		LOCAL_PR_FMT, LOCAL_PR_ARG
2129 	)
2130 );
2131 
2132 TRACE_EVENT(api_sched_scan_stopped,
2133 	TP_PROTO(struct ieee80211_local *local),
2134 
2135 	TP_ARGS(local),
2136 
2137 	TP_STRUCT__entry(
2138 		LOCAL_ENTRY
2139 	),
2140 
2141 	TP_fast_assign(
2142 		LOCAL_ASSIGN;
2143 	),
2144 
2145 	TP_printk(
2146 		LOCAL_PR_FMT, LOCAL_PR_ARG
2147 	)
2148 );
2149 
2150 TRACE_EVENT(api_sta_block_awake,
2151 	TP_PROTO(struct ieee80211_local *local,
2152 		 struct ieee80211_sta *sta, bool block),
2153 
2154 	TP_ARGS(local, sta, block),
2155 
2156 	TP_STRUCT__entry(
2157 		LOCAL_ENTRY
2158 		STA_ENTRY
2159 		__field(bool, block)
2160 	),
2161 
2162 	TP_fast_assign(
2163 		LOCAL_ASSIGN;
2164 		STA_ASSIGN;
2165 		__entry->block = block;
2166 	),
2167 
2168 	TP_printk(
2169 		LOCAL_PR_FMT STA_PR_FMT " block:%d",
2170 		LOCAL_PR_ARG, STA_PR_ARG, __entry->block
2171 	)
2172 );
2173 
2174 TRACE_EVENT(api_chswitch_done,
2175 	TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
2176 
2177 	TP_ARGS(sdata, success),
2178 
2179 	TP_STRUCT__entry(
2180 		VIF_ENTRY
2181 		__field(bool, success)
2182 	),
2183 
2184 	TP_fast_assign(
2185 		VIF_ASSIGN;
2186 		__entry->success = success;
2187 	),
2188 
2189 	TP_printk(
2190 		VIF_PR_FMT " success=%d",
2191 		VIF_PR_ARG, __entry->success
2192 	)
2193 );
2194 
2195 DEFINE_EVENT(local_only_evt, api_ready_on_channel,
2196 	TP_PROTO(struct ieee80211_local *local),
2197 	TP_ARGS(local)
2198 );
2199 
2200 DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
2201 	TP_PROTO(struct ieee80211_local *local),
2202 	TP_ARGS(local)
2203 );
2204 
2205 TRACE_EVENT(api_gtk_rekey_notify,
2206 	TP_PROTO(struct ieee80211_sub_if_data *sdata,
2207 		 const u8 *bssid, const u8 *replay_ctr),
2208 
2209 	TP_ARGS(sdata, bssid, replay_ctr),
2210 
2211 	TP_STRUCT__entry(
2212 		VIF_ENTRY
2213 		__array(u8, bssid, ETH_ALEN)
2214 		__array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
2215 	),
2216 
2217 	TP_fast_assign(
2218 		VIF_ASSIGN;
2219 		memcpy(__entry->bssid, bssid, ETH_ALEN);
2220 		memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
2221 	),
2222 
2223 	TP_printk(VIF_PR_FMT, VIF_PR_ARG)
2224 );
2225 
2226 TRACE_EVENT(api_enable_rssi_reports,
2227 	TP_PROTO(struct ieee80211_sub_if_data *sdata,
2228 		 int rssi_min_thold, int rssi_max_thold),
2229 
2230 	TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
2231 
2232 	TP_STRUCT__entry(
2233 		VIF_ENTRY
2234 		__field(int, rssi_min_thold)
2235 		__field(int, rssi_max_thold)
2236 	),
2237 
2238 	TP_fast_assign(
2239 		VIF_ASSIGN;
2240 		__entry->rssi_min_thold = rssi_min_thold;
2241 		__entry->rssi_max_thold = rssi_max_thold;
2242 	),
2243 
2244 	TP_printk(
2245 		VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
2246 		VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
2247 	)
2248 );
2249 
2250 TRACE_EVENT(api_eosp,
2251 	TP_PROTO(struct ieee80211_local *local,
2252 		 struct ieee80211_sta *sta),
2253 
2254 	TP_ARGS(local, sta),
2255 
2256 	TP_STRUCT__entry(
2257 		LOCAL_ENTRY
2258 		STA_ENTRY
2259 	),
2260 
2261 	TP_fast_assign(
2262 		LOCAL_ASSIGN;
2263 		STA_ASSIGN;
2264 	),
2265 
2266 	TP_printk(
2267 		LOCAL_PR_FMT STA_PR_FMT,
2268 		LOCAL_PR_ARG, STA_PR_ARG
2269 	)
2270 );
2271 
2272 TRACE_EVENT(api_send_eosp_nullfunc,
2273 	TP_PROTO(struct ieee80211_local *local,
2274 		 struct ieee80211_sta *sta,
2275 		 u8 tid),
2276 
2277 	TP_ARGS(local, sta, tid),
2278 
2279 	TP_STRUCT__entry(
2280 		LOCAL_ENTRY
2281 		STA_ENTRY
2282 		__field(u8, tid)
2283 	),
2284 
2285 	TP_fast_assign(
2286 		LOCAL_ASSIGN;
2287 		STA_ASSIGN;
2288 		__entry->tid = tid;
2289 	),
2290 
2291 	TP_printk(
2292 		LOCAL_PR_FMT STA_PR_FMT " tid:%d",
2293 		LOCAL_PR_ARG, STA_PR_ARG, __entry->tid
2294 	)
2295 );
2296 
2297 TRACE_EVENT(api_sta_set_buffered,
2298 	TP_PROTO(struct ieee80211_local *local,
2299 		 struct ieee80211_sta *sta,
2300 		 u8 tid, bool buffered),
2301 
2302 	TP_ARGS(local, sta, tid, buffered),
2303 
2304 	TP_STRUCT__entry(
2305 		LOCAL_ENTRY
2306 		STA_ENTRY
2307 		__field(u8, tid)
2308 		__field(bool, buffered)
2309 	),
2310 
2311 	TP_fast_assign(
2312 		LOCAL_ASSIGN;
2313 		STA_ASSIGN;
2314 		__entry->tid = tid;
2315 		__entry->buffered = buffered;
2316 	),
2317 
2318 	TP_printk(
2319 		LOCAL_PR_FMT STA_PR_FMT " tid:%d buffered:%d",
2320 		LOCAL_PR_ARG, STA_PR_ARG, __entry->tid, __entry->buffered
2321 	)
2322 );
2323 
2324 /*
2325  * Tracing for internal functions
2326  * (which may also be called in response to driver calls)
2327  */
2328 
2329 TRACE_EVENT(wake_queue,
2330 	TP_PROTO(struct ieee80211_local *local, u16 queue,
2331 		 enum queue_stop_reason reason),
2332 
2333 	TP_ARGS(local, queue, reason),
2334 
2335 	TP_STRUCT__entry(
2336 		LOCAL_ENTRY
2337 		__field(u16, queue)
2338 		__field(u32, reason)
2339 	),
2340 
2341 	TP_fast_assign(
2342 		LOCAL_ASSIGN;
2343 		__entry->queue = queue;
2344 		__entry->reason = reason;
2345 	),
2346 
2347 	TP_printk(
2348 		LOCAL_PR_FMT " queue:%d, reason:%d",
2349 		LOCAL_PR_ARG, __entry->queue, __entry->reason
2350 	)
2351 );
2352 
2353 TRACE_EVENT(stop_queue,
2354 	TP_PROTO(struct ieee80211_local *local, u16 queue,
2355 		 enum queue_stop_reason reason),
2356 
2357 	TP_ARGS(local, queue, reason),
2358 
2359 	TP_STRUCT__entry(
2360 		LOCAL_ENTRY
2361 		__field(u16, queue)
2362 		__field(u32, reason)
2363 	),
2364 
2365 	TP_fast_assign(
2366 		LOCAL_ASSIGN;
2367 		__entry->queue = queue;
2368 		__entry->reason = reason;
2369 	),
2370 
2371 	TP_printk(
2372 		LOCAL_PR_FMT " queue:%d, reason:%d",
2373 		LOCAL_PR_ARG, __entry->queue, __entry->reason
2374 	)
2375 );
2376 
2377 TRACE_EVENT(drv_set_default_unicast_key,
2378 	TP_PROTO(struct ieee80211_local *local,
2379 		 struct ieee80211_sub_if_data *sdata,
2380 		 int key_idx),
2381 
2382 	TP_ARGS(local, sdata, key_idx),
2383 
2384 	TP_STRUCT__entry(
2385 		LOCAL_ENTRY
2386 		VIF_ENTRY
2387 		__field(int, key_idx)
2388 	),
2389 
2390 	TP_fast_assign(
2391 		LOCAL_ASSIGN;
2392 		VIF_ASSIGN;
2393 		__entry->key_idx = key_idx;
2394 	),
2395 
2396 	TP_printk(LOCAL_PR_FMT VIF_PR_FMT " key_idx:%d",
2397 		  LOCAL_PR_ARG, VIF_PR_ARG, __entry->key_idx)
2398 );
2399 
2400 TRACE_EVENT(api_radar_detected,
2401 	TP_PROTO(struct ieee80211_local *local),
2402 
2403 	TP_ARGS(local),
2404 
2405 	TP_STRUCT__entry(
2406 		LOCAL_ENTRY
2407 	),
2408 
2409 	TP_fast_assign(
2410 		LOCAL_ASSIGN;
2411 	),
2412 
2413 	TP_printk(
2414 		LOCAL_PR_FMT " radar detected",
2415 		LOCAL_PR_ARG
2416 	)
2417 );
2418 
2419 TRACE_EVENT(drv_channel_switch_beacon,
2420 	TP_PROTO(struct ieee80211_local *local,
2421 		 struct ieee80211_sub_if_data *sdata,
2422 		 struct cfg80211_chan_def *chandef),
2423 
2424 	TP_ARGS(local, sdata, chandef),
2425 
2426 	TP_STRUCT__entry(
2427 		LOCAL_ENTRY
2428 		VIF_ENTRY
2429 		CHANDEF_ENTRY
2430 	),
2431 
2432 	TP_fast_assign(
2433 		LOCAL_ASSIGN;
2434 		VIF_ASSIGN;
2435 		CHANDEF_ASSIGN(chandef);
2436 	),
2437 
2438 	TP_printk(
2439 		LOCAL_PR_FMT VIF_PR_FMT " channel switch to " CHANDEF_PR_FMT,
2440 		LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG
2441 	)
2442 );
2443 
2444 TRACE_EVENT(drv_pre_channel_switch,
2445 	TP_PROTO(struct ieee80211_local *local,
2446 		 struct ieee80211_sub_if_data *sdata,
2447 		 struct ieee80211_channel_switch *ch_switch),
2448 
2449 	TP_ARGS(local, sdata, ch_switch),
2450 
2451 	TP_STRUCT__entry(
2452 		LOCAL_ENTRY
2453 		VIF_ENTRY
2454 		CHANDEF_ENTRY
2455 		__field(u64, timestamp)
2456 		__field(u32, device_timestamp)
2457 		__field(bool, block_tx)
2458 		__field(u8, count)
2459 	),
2460 
2461 	TP_fast_assign(
2462 		LOCAL_ASSIGN;
2463 		VIF_ASSIGN;
2464 		CHANDEF_ASSIGN(&ch_switch->chandef)
2465 		__entry->timestamp = ch_switch->timestamp;
2466 		__entry->device_timestamp = ch_switch->device_timestamp;
2467 		__entry->block_tx = ch_switch->block_tx;
2468 		__entry->count = ch_switch->count;
2469 	),
2470 
2471 	TP_printk(
2472 		LOCAL_PR_FMT VIF_PR_FMT " prepare channel switch to "
2473 		CHANDEF_PR_FMT  " count:%d block_tx:%d timestamp:%llu",
2474 		LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count,
2475 		__entry->block_tx, __entry->timestamp
2476 	)
2477 );
2478 
2479 DEFINE_EVENT(local_sdata_evt, drv_post_channel_switch,
2480 	     TP_PROTO(struct ieee80211_local *local,
2481 		      struct ieee80211_sub_if_data *sdata),
2482 	     TP_ARGS(local, sdata)
2483 );
2484 
2485 DEFINE_EVENT(local_sdata_evt, drv_abort_channel_switch,
2486 	     TP_PROTO(struct ieee80211_local *local,
2487 		      struct ieee80211_sub_if_data *sdata),
2488 	     TP_ARGS(local, sdata)
2489 );
2490 
2491 TRACE_EVENT(drv_channel_switch_rx_beacon,
2492 	TP_PROTO(struct ieee80211_local *local,
2493 		 struct ieee80211_sub_if_data *sdata,
2494 		 struct ieee80211_channel_switch *ch_switch),
2495 
2496 	TP_ARGS(local, sdata, ch_switch),
2497 
2498 	TP_STRUCT__entry(
2499 		LOCAL_ENTRY
2500 		VIF_ENTRY
2501 		CHANDEF_ENTRY
2502 		__field(u64, timestamp)
2503 		__field(u32, device_timestamp)
2504 		__field(bool, block_tx)
2505 		__field(u8, count)
2506 	),
2507 
2508 	TP_fast_assign(
2509 		LOCAL_ASSIGN;
2510 		VIF_ASSIGN;
2511 		CHANDEF_ASSIGN(&ch_switch->chandef)
2512 		__entry->timestamp = ch_switch->timestamp;
2513 		__entry->device_timestamp = ch_switch->device_timestamp;
2514 		__entry->block_tx = ch_switch->block_tx;
2515 		__entry->count = ch_switch->count;
2516 	),
2517 
2518 	TP_printk(
2519 		LOCAL_PR_FMT VIF_PR_FMT
2520 		" received a channel switch beacon to "
2521 		CHANDEF_PR_FMT  " count:%d block_tx:%d timestamp:%llu",
2522 		LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count,
2523 		__entry->block_tx, __entry->timestamp
2524 	)
2525 );
2526 
2527 TRACE_EVENT(drv_get_txpower,
2528 	TP_PROTO(struct ieee80211_local *local,
2529 		 struct ieee80211_sub_if_data *sdata,
2530 		 int dbm, int ret),
2531 
2532 	TP_ARGS(local, sdata, dbm, ret),
2533 
2534 	TP_STRUCT__entry(
2535 		LOCAL_ENTRY
2536 		VIF_ENTRY
2537 		__field(int, dbm)
2538 		__field(int, ret)
2539 	),
2540 
2541 	TP_fast_assign(
2542 		LOCAL_ASSIGN;
2543 		VIF_ASSIGN;
2544 		__entry->dbm = dbm;
2545 		__entry->ret = ret;
2546 	),
2547 
2548 	TP_printk(
2549 		LOCAL_PR_FMT VIF_PR_FMT " dbm:%d ret:%d",
2550 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->dbm, __entry->ret
2551 	)
2552 );
2553 
2554 TRACE_EVENT(drv_tdls_channel_switch,
2555 	TP_PROTO(struct ieee80211_local *local,
2556 		 struct ieee80211_sub_if_data *sdata,
2557 		 struct ieee80211_sta *sta, u8 oper_class,
2558 		 struct cfg80211_chan_def *chandef),
2559 
2560 	TP_ARGS(local, sdata, sta, oper_class, chandef),
2561 
2562 	TP_STRUCT__entry(
2563 		LOCAL_ENTRY
2564 		VIF_ENTRY
2565 		STA_ENTRY
2566 		__field(u8, oper_class)
2567 		CHANDEF_ENTRY
2568 	),
2569 
2570 	TP_fast_assign(
2571 		LOCAL_ASSIGN;
2572 		VIF_ASSIGN;
2573 		STA_ASSIGN;
2574 		__entry->oper_class = oper_class;
2575 		CHANDEF_ASSIGN(chandef)
2576 	),
2577 
2578 	TP_printk(
2579 		LOCAL_PR_FMT VIF_PR_FMT " tdls channel switch to"
2580 		CHANDEF_PR_FMT  " oper_class:%d " STA_PR_FMT,
2581 		LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->oper_class,
2582 		STA_PR_ARG
2583 	)
2584 );
2585 
2586 TRACE_EVENT(drv_tdls_cancel_channel_switch,
2587 	TP_PROTO(struct ieee80211_local *local,
2588 		 struct ieee80211_sub_if_data *sdata,
2589 		 struct ieee80211_sta *sta),
2590 
2591 	TP_ARGS(local, sdata, sta),
2592 
2593 	TP_STRUCT__entry(
2594 		LOCAL_ENTRY
2595 		VIF_ENTRY
2596 		STA_ENTRY
2597 	),
2598 
2599 	TP_fast_assign(
2600 		LOCAL_ASSIGN;
2601 		VIF_ASSIGN;
2602 		STA_ASSIGN;
2603 	),
2604 
2605 	TP_printk(
2606 		LOCAL_PR_FMT VIF_PR_FMT
2607 		" tdls cancel channel switch with " STA_PR_FMT,
2608 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
2609 	)
2610 );
2611 
2612 TRACE_EVENT(drv_tdls_recv_channel_switch,
2613 	TP_PROTO(struct ieee80211_local *local,
2614 		 struct ieee80211_sub_if_data *sdata,
2615 		 struct ieee80211_tdls_ch_sw_params *params),
2616 
2617 	TP_ARGS(local, sdata, params),
2618 
2619 	TP_STRUCT__entry(
2620 		LOCAL_ENTRY
2621 		VIF_ENTRY
2622 		__field(u8, action_code)
2623 		STA_ENTRY
2624 		CHANDEF_ENTRY
2625 		__field(u32, status)
2626 		__field(bool, peer_initiator)
2627 		__field(u32, timestamp)
2628 		__field(u16, switch_time)
2629 		__field(u16, switch_timeout)
2630 	),
2631 
2632 	TP_fast_assign(
2633 		LOCAL_ASSIGN;
2634 		VIF_ASSIGN;
2635 		STA_NAMED_ASSIGN(params->sta);
2636 		CHANDEF_ASSIGN(params->chandef)
2637 		__entry->peer_initiator = params->sta->tdls_initiator;
2638 		__entry->action_code = params->action_code;
2639 		__entry->status = params->status;
2640 		__entry->timestamp = params->timestamp;
2641 		__entry->switch_time = params->switch_time;
2642 		__entry->switch_timeout = params->switch_timeout;
2643 	),
2644 
2645 	TP_printk(
2646 		LOCAL_PR_FMT VIF_PR_FMT " received tdls channel switch packet"
2647 		" action:%d status:%d time:%d switch time:%d switch"
2648 		" timeout:%d initiator: %d chan:" CHANDEF_PR_FMT STA_PR_FMT,
2649 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->action_code, __entry->status,
2650 		__entry->timestamp, __entry->switch_time,
2651 		__entry->switch_timeout, __entry->peer_initiator,
2652 		CHANDEF_PR_ARG, STA_PR_ARG
2653 	)
2654 );
2655 
2656 TRACE_EVENT(drv_wake_tx_queue,
2657 	TP_PROTO(struct ieee80211_local *local,
2658 		 struct ieee80211_sub_if_data *sdata,
2659 		 struct txq_info *txq),
2660 
2661 	TP_ARGS(local, sdata, txq),
2662 
2663 	TP_STRUCT__entry(
2664 		LOCAL_ENTRY
2665 		VIF_ENTRY
2666 		STA_ENTRY
2667 		__field(u8, ac)
2668 		__field(u8, tid)
2669 	),
2670 
2671 	TP_fast_assign(
2672 		struct ieee80211_sta *sta = txq->txq.sta;
2673 
2674 		LOCAL_ASSIGN;
2675 		VIF_ASSIGN;
2676 		STA_ASSIGN;
2677 		__entry->ac = txq->txq.ac;
2678 		__entry->tid = txq->txq.tid;
2679 	),
2680 
2681 	TP_printk(
2682 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " ac:%d tid:%d",
2683 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid
2684 	)
2685 );
2686 
2687 TRACE_EVENT(drv_get_ftm_responder_stats,
2688 	TP_PROTO(struct ieee80211_local *local,
2689 		 struct ieee80211_sub_if_data *sdata,
2690 		 struct cfg80211_ftm_responder_stats *ftm_stats),
2691 
2692 	TP_ARGS(local, sdata, ftm_stats),
2693 
2694 	TP_STRUCT__entry(
2695 		LOCAL_ENTRY
2696 		VIF_ENTRY
2697 	),
2698 
2699 	TP_fast_assign(
2700 		LOCAL_ASSIGN;
2701 		VIF_ASSIGN;
2702 	),
2703 
2704 	TP_printk(
2705 		LOCAL_PR_FMT VIF_PR_FMT,
2706 		LOCAL_PR_ARG, VIF_PR_ARG
2707 	)
2708 );
2709 
2710 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
2711 
2712 #undef TRACE_INCLUDE_PATH
2713 #define TRACE_INCLUDE_PATH .
2714 #undef TRACE_INCLUDE_FILE
2715 #define TRACE_INCLUDE_FILE trace
2716 #include <trace/define_trace.h>
2717