xref: /openbmc/linux/net/mac80211/trace.h (revision 95e9fd10)
1 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __MAC80211_DRIVER_TRACE
3 
4 #include <linux/tracepoint.h>
5 #include <net/mac80211.h>
6 #include "ieee80211_i.h"
7 
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM mac80211
10 
11 #define MAXNAME		32
12 #define LOCAL_ENTRY	__array(char, wiphy_name, 32)
13 #define LOCAL_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
14 #define LOCAL_PR_FMT	"%s"
15 #define LOCAL_PR_ARG	__entry->wiphy_name
16 
17 #define STA_ENTRY	__array(char, sta_addr, ETH_ALEN)
18 #define STA_ASSIGN	(sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
19 #define STA_PR_FMT	" sta:%pM"
20 #define STA_PR_ARG	__entry->sta_addr
21 
22 #define VIF_ENTRY	__field(enum nl80211_iftype, vif_type) __field(void *, sdata)	\
23 			__field(bool, p2p)						\
24 			__string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
25 #define VIF_ASSIGN	__entry->vif_type = sdata->vif.type; __entry->sdata = sdata;	\
26 			__entry->p2p = sdata->vif.p2p;					\
27 			__assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
28 #define VIF_PR_FMT	" vif:%s(%d%s)"
29 #define VIF_PR_ARG	__get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
30 
31 /*
32  * Tracing for driver callbacks.
33  */
34 
35 DECLARE_EVENT_CLASS(local_only_evt,
36 	TP_PROTO(struct ieee80211_local *local),
37 	TP_ARGS(local),
38 	TP_STRUCT__entry(
39 		LOCAL_ENTRY
40 	),
41 	TP_fast_assign(
42 		LOCAL_ASSIGN;
43 	),
44 	TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
45 );
46 
47 DECLARE_EVENT_CLASS(local_sdata_addr_evt,
48 	TP_PROTO(struct ieee80211_local *local,
49 		 struct ieee80211_sub_if_data *sdata),
50 	TP_ARGS(local, sdata),
51 
52 	TP_STRUCT__entry(
53 		LOCAL_ENTRY
54 		VIF_ENTRY
55 		__array(char, addr, 6)
56 	),
57 
58 	TP_fast_assign(
59 		LOCAL_ASSIGN;
60 		VIF_ASSIGN;
61 		memcpy(__entry->addr, sdata->vif.addr, 6);
62 	),
63 
64 	TP_printk(
65 		LOCAL_PR_FMT  VIF_PR_FMT " addr:%pM",
66 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
67 	)
68 );
69 
70 DECLARE_EVENT_CLASS(local_u32_evt,
71 	TP_PROTO(struct ieee80211_local *local, u32 value),
72 	TP_ARGS(local, value),
73 
74 	TP_STRUCT__entry(
75 		LOCAL_ENTRY
76 		__field(u32, value)
77 	),
78 
79 	TP_fast_assign(
80 		LOCAL_ASSIGN;
81 		__entry->value = value;
82 	),
83 
84 	TP_printk(
85 		LOCAL_PR_FMT " value:%d",
86 		LOCAL_PR_ARG, __entry->value
87 	)
88 );
89 
90 DECLARE_EVENT_CLASS(local_sdata_evt,
91 	TP_PROTO(struct ieee80211_local *local,
92 		 struct ieee80211_sub_if_data *sdata),
93 	TP_ARGS(local, sdata),
94 
95 	TP_STRUCT__entry(
96 		LOCAL_ENTRY
97 		VIF_ENTRY
98 	),
99 
100 	TP_fast_assign(
101 		LOCAL_ASSIGN;
102 		VIF_ASSIGN;
103 	),
104 
105 	TP_printk(
106 		LOCAL_PR_FMT VIF_PR_FMT,
107 		LOCAL_PR_ARG, VIF_PR_ARG
108 	)
109 );
110 
111 DEFINE_EVENT(local_only_evt, drv_return_void,
112 	TP_PROTO(struct ieee80211_local *local),
113 	TP_ARGS(local)
114 );
115 
116 TRACE_EVENT(drv_return_int,
117 	TP_PROTO(struct ieee80211_local *local, int ret),
118 	TP_ARGS(local, ret),
119 	TP_STRUCT__entry(
120 		LOCAL_ENTRY
121 		__field(int, ret)
122 	),
123 	TP_fast_assign(
124 		LOCAL_ASSIGN;
125 		__entry->ret = ret;
126 	),
127 	TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
128 );
129 
130 TRACE_EVENT(drv_return_bool,
131 	TP_PROTO(struct ieee80211_local *local, bool ret),
132 	TP_ARGS(local, ret),
133 	TP_STRUCT__entry(
134 		LOCAL_ENTRY
135 		__field(bool, ret)
136 	),
137 	TP_fast_assign(
138 		LOCAL_ASSIGN;
139 		__entry->ret = ret;
140 	),
141 	TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
142 		  "true" : "false")
143 );
144 
145 TRACE_EVENT(drv_return_u64,
146 	TP_PROTO(struct ieee80211_local *local, u64 ret),
147 	TP_ARGS(local, ret),
148 	TP_STRUCT__entry(
149 		LOCAL_ENTRY
150 		__field(u64, ret)
151 	),
152 	TP_fast_assign(
153 		LOCAL_ASSIGN;
154 		__entry->ret = ret;
155 	),
156 	TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
157 );
158 
159 DEFINE_EVENT(local_only_evt, drv_start,
160 	TP_PROTO(struct ieee80211_local *local),
161 	TP_ARGS(local)
162 );
163 
164 DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
165 	     TP_PROTO(struct ieee80211_local *local, u32 sset),
166 	     TP_ARGS(local, sset)
167 );
168 
169 DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
170 	     TP_PROTO(struct ieee80211_local *local, u32 sset),
171 	     TP_ARGS(local, sset)
172 );
173 
174 DEFINE_EVENT(local_only_evt, drv_get_et_stats,
175 	     TP_PROTO(struct ieee80211_local *local),
176 	     TP_ARGS(local)
177 );
178 
179 DEFINE_EVENT(local_only_evt, drv_suspend,
180 	TP_PROTO(struct ieee80211_local *local),
181 	TP_ARGS(local)
182 );
183 
184 DEFINE_EVENT(local_only_evt, drv_resume,
185 	TP_PROTO(struct ieee80211_local *local),
186 	TP_ARGS(local)
187 );
188 
189 TRACE_EVENT(drv_set_wakeup,
190 	TP_PROTO(struct ieee80211_local *local, bool enabled),
191 	TP_ARGS(local, enabled),
192 	TP_STRUCT__entry(
193 		LOCAL_ENTRY
194 		__field(bool, enabled)
195 	),
196 	TP_fast_assign(
197 		LOCAL_ASSIGN;
198 		__entry->enabled = enabled;
199 	),
200 	TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
201 );
202 
203 DEFINE_EVENT(local_only_evt, drv_stop,
204 	TP_PROTO(struct ieee80211_local *local),
205 	TP_ARGS(local)
206 );
207 
208 DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
209 	TP_PROTO(struct ieee80211_local *local,
210 		 struct ieee80211_sub_if_data *sdata),
211 	TP_ARGS(local, sdata)
212 );
213 
214 TRACE_EVENT(drv_change_interface,
215 	TP_PROTO(struct ieee80211_local *local,
216 		 struct ieee80211_sub_if_data *sdata,
217 		 enum nl80211_iftype type, bool p2p),
218 
219 	TP_ARGS(local, sdata, type, p2p),
220 
221 	TP_STRUCT__entry(
222 		LOCAL_ENTRY
223 		VIF_ENTRY
224 		__field(u32, new_type)
225 		__field(bool, new_p2p)
226 	),
227 
228 	TP_fast_assign(
229 		LOCAL_ASSIGN;
230 		VIF_ASSIGN;
231 		__entry->new_type = type;
232 		__entry->new_p2p = p2p;
233 	),
234 
235 	TP_printk(
236 		LOCAL_PR_FMT  VIF_PR_FMT " new type:%d%s",
237 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
238 		__entry->new_p2p ? "/p2p" : ""
239 	)
240 );
241 
242 DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
243 	TP_PROTO(struct ieee80211_local *local,
244 		 struct ieee80211_sub_if_data *sdata),
245 	TP_ARGS(local, sdata)
246 );
247 
248 TRACE_EVENT(drv_config,
249 	TP_PROTO(struct ieee80211_local *local,
250 		 u32 changed),
251 
252 	TP_ARGS(local, changed),
253 
254 	TP_STRUCT__entry(
255 		LOCAL_ENTRY
256 		__field(u32, changed)
257 		__field(u32, flags)
258 		__field(int, power_level)
259 		__field(int, dynamic_ps_timeout)
260 		__field(int, max_sleep_period)
261 		__field(u16, listen_interval)
262 		__field(u8, long_frame_max_tx_count)
263 		__field(u8, short_frame_max_tx_count)
264 		__field(int, center_freq)
265 		__field(int, channel_type)
266 		__field(int, smps)
267 	),
268 
269 	TP_fast_assign(
270 		LOCAL_ASSIGN;
271 		__entry->changed = changed;
272 		__entry->flags = local->hw.conf.flags;
273 		__entry->power_level = local->hw.conf.power_level;
274 		__entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
275 		__entry->max_sleep_period = local->hw.conf.max_sleep_period;
276 		__entry->listen_interval = local->hw.conf.listen_interval;
277 		__entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
278 		__entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
279 		__entry->center_freq = local->hw.conf.channel->center_freq;
280 		__entry->channel_type = local->hw.conf.channel_type;
281 		__entry->smps = local->hw.conf.smps_mode;
282 	),
283 
284 	TP_printk(
285 		LOCAL_PR_FMT " ch:%#x freq:%d",
286 		LOCAL_PR_ARG, __entry->changed, __entry->center_freq
287 	)
288 );
289 
290 TRACE_EVENT(drv_bss_info_changed,
291 	TP_PROTO(struct ieee80211_local *local,
292 		 struct ieee80211_sub_if_data *sdata,
293 		 struct ieee80211_bss_conf *info,
294 		 u32 changed),
295 
296 	TP_ARGS(local, sdata, info, changed),
297 
298 	TP_STRUCT__entry(
299 		LOCAL_ENTRY
300 		VIF_ENTRY
301 		__field(bool, assoc)
302 		__field(u16, aid)
303 		__field(bool, cts)
304 		__field(bool, shortpre)
305 		__field(bool, shortslot)
306 		__field(u8, dtimper)
307 		__field(u16, bcnint)
308 		__field(u16, assoc_cap)
309 		__field(u64, sync_tsf)
310 		__field(u32, sync_device_ts)
311 		__field(u32, basic_rates)
312 		__field(u32, changed)
313 		__field(bool, enable_beacon)
314 		__field(u16, ht_operation_mode)
315 	),
316 
317 	TP_fast_assign(
318 		LOCAL_ASSIGN;
319 		VIF_ASSIGN;
320 		__entry->changed = changed;
321 		__entry->aid = info->aid;
322 		__entry->assoc = info->assoc;
323 		__entry->shortpre = info->use_short_preamble;
324 		__entry->cts = info->use_cts_prot;
325 		__entry->shortslot = info->use_short_slot;
326 		__entry->dtimper = info->dtim_period;
327 		__entry->bcnint = info->beacon_int;
328 		__entry->assoc_cap = info->assoc_capability;
329 		__entry->sync_tsf = info->sync_tsf;
330 		__entry->sync_device_ts = info->sync_device_ts;
331 		__entry->basic_rates = info->basic_rates;
332 		__entry->enable_beacon = info->enable_beacon;
333 		__entry->ht_operation_mode = info->ht_operation_mode;
334 	),
335 
336 	TP_printk(
337 		LOCAL_PR_FMT  VIF_PR_FMT " changed:%#x",
338 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
339 	)
340 );
341 
342 TRACE_EVENT(drv_prepare_multicast,
343 	TP_PROTO(struct ieee80211_local *local, int mc_count),
344 
345 	TP_ARGS(local, mc_count),
346 
347 	TP_STRUCT__entry(
348 		LOCAL_ENTRY
349 		__field(int, mc_count)
350 	),
351 
352 	TP_fast_assign(
353 		LOCAL_ASSIGN;
354 		__entry->mc_count = mc_count;
355 	),
356 
357 	TP_printk(
358 		LOCAL_PR_FMT " prepare mc (%d)",
359 		LOCAL_PR_ARG, __entry->mc_count
360 	)
361 );
362 
363 TRACE_EVENT(drv_configure_filter,
364 	TP_PROTO(struct ieee80211_local *local,
365 		 unsigned int changed_flags,
366 		 unsigned int *total_flags,
367 		 u64 multicast),
368 
369 	TP_ARGS(local, changed_flags, total_flags, multicast),
370 
371 	TP_STRUCT__entry(
372 		LOCAL_ENTRY
373 		__field(unsigned int, changed)
374 		__field(unsigned int, total)
375 		__field(u64, multicast)
376 	),
377 
378 	TP_fast_assign(
379 		LOCAL_ASSIGN;
380 		__entry->changed = changed_flags;
381 		__entry->total = *total_flags;
382 		__entry->multicast = multicast;
383 	),
384 
385 	TP_printk(
386 		LOCAL_PR_FMT " changed:%#x total:%#x",
387 		LOCAL_PR_ARG, __entry->changed, __entry->total
388 	)
389 );
390 
391 TRACE_EVENT(drv_set_tim,
392 	TP_PROTO(struct ieee80211_local *local,
393 		 struct ieee80211_sta *sta, bool set),
394 
395 	TP_ARGS(local, sta, set),
396 
397 	TP_STRUCT__entry(
398 		LOCAL_ENTRY
399 		STA_ENTRY
400 		__field(bool, set)
401 	),
402 
403 	TP_fast_assign(
404 		LOCAL_ASSIGN;
405 		STA_ASSIGN;
406 		__entry->set = set;
407 	),
408 
409 	TP_printk(
410 		LOCAL_PR_FMT STA_PR_FMT " set:%d",
411 		LOCAL_PR_ARG, STA_PR_FMT, __entry->set
412 	)
413 );
414 
415 TRACE_EVENT(drv_set_key,
416 	TP_PROTO(struct ieee80211_local *local,
417 		 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
418 		 struct ieee80211_sta *sta,
419 		 struct ieee80211_key_conf *key),
420 
421 	TP_ARGS(local, cmd, sdata, sta, key),
422 
423 	TP_STRUCT__entry(
424 		LOCAL_ENTRY
425 		VIF_ENTRY
426 		STA_ENTRY
427 		__field(u32, cipher)
428 		__field(u8, hw_key_idx)
429 		__field(u8, flags)
430 		__field(s8, keyidx)
431 	),
432 
433 	TP_fast_assign(
434 		LOCAL_ASSIGN;
435 		VIF_ASSIGN;
436 		STA_ASSIGN;
437 		__entry->cipher = key->cipher;
438 		__entry->flags = key->flags;
439 		__entry->keyidx = key->keyidx;
440 		__entry->hw_key_idx = key->hw_key_idx;
441 	),
442 
443 	TP_printk(
444 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
445 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
446 	)
447 );
448 
449 TRACE_EVENT(drv_update_tkip_key,
450 	TP_PROTO(struct ieee80211_local *local,
451 		 struct ieee80211_sub_if_data *sdata,
452 		 struct ieee80211_key_conf *conf,
453 		 struct ieee80211_sta *sta, u32 iv32),
454 
455 	TP_ARGS(local, sdata, conf, sta, iv32),
456 
457 	TP_STRUCT__entry(
458 		LOCAL_ENTRY
459 		VIF_ENTRY
460 		STA_ENTRY
461 		__field(u32, iv32)
462 	),
463 
464 	TP_fast_assign(
465 		LOCAL_ASSIGN;
466 		VIF_ASSIGN;
467 		STA_ASSIGN;
468 		__entry->iv32 = iv32;
469 	),
470 
471 	TP_printk(
472 		LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
473 		LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
474 	)
475 );
476 
477 DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
478 	TP_PROTO(struct ieee80211_local *local,
479 		 struct ieee80211_sub_if_data *sdata),
480 	TP_ARGS(local, sdata)
481 );
482 
483 DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
484 	TP_PROTO(struct ieee80211_local *local,
485 		 struct ieee80211_sub_if_data *sdata),
486 	TP_ARGS(local, sdata)
487 );
488 
489 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
490 	TP_PROTO(struct ieee80211_local *local,
491 		 struct ieee80211_sub_if_data *sdata),
492 	TP_ARGS(local, sdata)
493 );
494 
495 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
496 	TP_PROTO(struct ieee80211_local *local,
497 		 struct ieee80211_sub_if_data *sdata),
498 	TP_ARGS(local, sdata)
499 );
500 
501 DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
502 	TP_PROTO(struct ieee80211_local *local),
503 	TP_ARGS(local)
504 );
505 
506 DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
507 	TP_PROTO(struct ieee80211_local *local),
508 	TP_ARGS(local)
509 );
510 
511 TRACE_EVENT(drv_get_stats,
512 	TP_PROTO(struct ieee80211_local *local,
513 		 struct ieee80211_low_level_stats *stats,
514 		 int ret),
515 
516 	TP_ARGS(local, stats, ret),
517 
518 	TP_STRUCT__entry(
519 		LOCAL_ENTRY
520 		__field(int, ret)
521 		__field(unsigned int, ackfail)
522 		__field(unsigned int, rtsfail)
523 		__field(unsigned int, fcserr)
524 		__field(unsigned int, rtssucc)
525 	),
526 
527 	TP_fast_assign(
528 		LOCAL_ASSIGN;
529 		__entry->ret = ret;
530 		__entry->ackfail = stats->dot11ACKFailureCount;
531 		__entry->rtsfail = stats->dot11RTSFailureCount;
532 		__entry->fcserr = stats->dot11FCSErrorCount;
533 		__entry->rtssucc = stats->dot11RTSSuccessCount;
534 	),
535 
536 	TP_printk(
537 		LOCAL_PR_FMT " ret:%d",
538 		LOCAL_PR_ARG, __entry->ret
539 	)
540 );
541 
542 TRACE_EVENT(drv_get_tkip_seq,
543 	TP_PROTO(struct ieee80211_local *local,
544 		 u8 hw_key_idx, u32 *iv32, u16 *iv16),
545 
546 	TP_ARGS(local, hw_key_idx, iv32, iv16),
547 
548 	TP_STRUCT__entry(
549 		LOCAL_ENTRY
550 		__field(u8, hw_key_idx)
551 		__field(u32, iv32)
552 		__field(u16, iv16)
553 	),
554 
555 	TP_fast_assign(
556 		LOCAL_ASSIGN;
557 		__entry->hw_key_idx = hw_key_idx;
558 		__entry->iv32 = *iv32;
559 		__entry->iv16 = *iv16;
560 	),
561 
562 	TP_printk(
563 		LOCAL_PR_FMT, LOCAL_PR_ARG
564 	)
565 );
566 
567 DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
568 	TP_PROTO(struct ieee80211_local *local, u32 value),
569 	TP_ARGS(local, value)
570 );
571 
572 DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
573 	TP_PROTO(struct ieee80211_local *local, u32 value),
574 	TP_ARGS(local, value)
575 );
576 
577 TRACE_EVENT(drv_set_coverage_class,
578 	TP_PROTO(struct ieee80211_local *local, u8 value),
579 
580 	TP_ARGS(local, value),
581 
582 	TP_STRUCT__entry(
583 		LOCAL_ENTRY
584 		__field(u8, value)
585 	),
586 
587 	TP_fast_assign(
588 		LOCAL_ASSIGN;
589 		__entry->value = value;
590 	),
591 
592 	TP_printk(
593 		LOCAL_PR_FMT " value:%d",
594 		LOCAL_PR_ARG, __entry->value
595 	)
596 );
597 
598 TRACE_EVENT(drv_sta_notify,
599 	TP_PROTO(struct ieee80211_local *local,
600 		 struct ieee80211_sub_if_data *sdata,
601 		 enum sta_notify_cmd cmd,
602 		 struct ieee80211_sta *sta),
603 
604 	TP_ARGS(local, sdata, cmd, sta),
605 
606 	TP_STRUCT__entry(
607 		LOCAL_ENTRY
608 		VIF_ENTRY
609 		STA_ENTRY
610 		__field(u32, cmd)
611 	),
612 
613 	TP_fast_assign(
614 		LOCAL_ASSIGN;
615 		VIF_ASSIGN;
616 		STA_ASSIGN;
617 		__entry->cmd = cmd;
618 	),
619 
620 	TP_printk(
621 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " cmd:%d",
622 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
623 	)
624 );
625 
626 TRACE_EVENT(drv_sta_state,
627 	TP_PROTO(struct ieee80211_local *local,
628 		 struct ieee80211_sub_if_data *sdata,
629 		 struct ieee80211_sta *sta,
630 		 enum ieee80211_sta_state old_state,
631 		 enum ieee80211_sta_state new_state),
632 
633 	TP_ARGS(local, sdata, sta, old_state, new_state),
634 
635 	TP_STRUCT__entry(
636 		LOCAL_ENTRY
637 		VIF_ENTRY
638 		STA_ENTRY
639 		__field(u32, old_state)
640 		__field(u32, new_state)
641 	),
642 
643 	TP_fast_assign(
644 		LOCAL_ASSIGN;
645 		VIF_ASSIGN;
646 		STA_ASSIGN;
647 		__entry->old_state = old_state;
648 		__entry->new_state = new_state;
649 	),
650 
651 	TP_printk(
652 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " state: %d->%d",
653 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
654 		__entry->old_state, __entry->new_state
655 	)
656 );
657 
658 TRACE_EVENT(drv_sta_rc_update,
659 	TP_PROTO(struct ieee80211_local *local,
660 		 struct ieee80211_sub_if_data *sdata,
661 		 struct ieee80211_sta *sta,
662 		 u32 changed),
663 
664 	TP_ARGS(local, sdata, sta, changed),
665 
666 	TP_STRUCT__entry(
667 		LOCAL_ENTRY
668 		VIF_ENTRY
669 		STA_ENTRY
670 		__field(u32, changed)
671 	),
672 
673 	TP_fast_assign(
674 		LOCAL_ASSIGN;
675 		VIF_ASSIGN;
676 		STA_ASSIGN;
677 		__entry->changed = changed;
678 	),
679 
680 	TP_printk(
681 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " changed: 0x%x",
682 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
683 	)
684 );
685 
686 TRACE_EVENT(drv_sta_add,
687 	TP_PROTO(struct ieee80211_local *local,
688 		 struct ieee80211_sub_if_data *sdata,
689 		 struct ieee80211_sta *sta),
690 
691 	TP_ARGS(local, sdata, sta),
692 
693 	TP_STRUCT__entry(
694 		LOCAL_ENTRY
695 		VIF_ENTRY
696 		STA_ENTRY
697 	),
698 
699 	TP_fast_assign(
700 		LOCAL_ASSIGN;
701 		VIF_ASSIGN;
702 		STA_ASSIGN;
703 	),
704 
705 	TP_printk(
706 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
707 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
708 	)
709 );
710 
711 TRACE_EVENT(drv_sta_remove,
712 	TP_PROTO(struct ieee80211_local *local,
713 		 struct ieee80211_sub_if_data *sdata,
714 		 struct ieee80211_sta *sta),
715 
716 	TP_ARGS(local, sdata, sta),
717 
718 	TP_STRUCT__entry(
719 		LOCAL_ENTRY
720 		VIF_ENTRY
721 		STA_ENTRY
722 	),
723 
724 	TP_fast_assign(
725 		LOCAL_ASSIGN;
726 		VIF_ASSIGN;
727 		STA_ASSIGN;
728 	),
729 
730 	TP_printk(
731 		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
732 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
733 	)
734 );
735 
736 TRACE_EVENT(drv_conf_tx,
737 	TP_PROTO(struct ieee80211_local *local,
738 		 struct ieee80211_sub_if_data *sdata,
739 		 u16 ac, const struct ieee80211_tx_queue_params *params),
740 
741 	TP_ARGS(local, sdata, ac, params),
742 
743 	TP_STRUCT__entry(
744 		LOCAL_ENTRY
745 		VIF_ENTRY
746 		__field(u16, ac)
747 		__field(u16, txop)
748 		__field(u16, cw_min)
749 		__field(u16, cw_max)
750 		__field(u8, aifs)
751 		__field(bool, uapsd)
752 	),
753 
754 	TP_fast_assign(
755 		LOCAL_ASSIGN;
756 		VIF_ASSIGN;
757 		__entry->ac = ac;
758 		__entry->txop = params->txop;
759 		__entry->cw_max = params->cw_max;
760 		__entry->cw_min = params->cw_min;
761 		__entry->aifs = params->aifs;
762 		__entry->uapsd = params->uapsd;
763 	),
764 
765 	TP_printk(
766 		LOCAL_PR_FMT  VIF_PR_FMT  " AC:%d",
767 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
768 	)
769 );
770 
771 DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
772 	TP_PROTO(struct ieee80211_local *local,
773 		 struct ieee80211_sub_if_data *sdata),
774 	TP_ARGS(local, sdata)
775 );
776 
777 TRACE_EVENT(drv_set_tsf,
778 	TP_PROTO(struct ieee80211_local *local,
779 		 struct ieee80211_sub_if_data *sdata,
780 		 u64 tsf),
781 
782 	TP_ARGS(local, sdata, tsf),
783 
784 	TP_STRUCT__entry(
785 		LOCAL_ENTRY
786 		VIF_ENTRY
787 		__field(u64, tsf)
788 	),
789 
790 	TP_fast_assign(
791 		LOCAL_ASSIGN;
792 		VIF_ASSIGN;
793 		__entry->tsf = tsf;
794 	),
795 
796 	TP_printk(
797 		LOCAL_PR_FMT  VIF_PR_FMT  " tsf:%llu",
798 		LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
799 	)
800 );
801 
802 DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
803 	TP_PROTO(struct ieee80211_local *local,
804 		 struct ieee80211_sub_if_data *sdata),
805 	TP_ARGS(local, sdata)
806 );
807 
808 DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
809 	TP_PROTO(struct ieee80211_local *local),
810 	TP_ARGS(local)
811 );
812 
813 TRACE_EVENT(drv_ampdu_action,
814 	TP_PROTO(struct ieee80211_local *local,
815 		 struct ieee80211_sub_if_data *sdata,
816 		 enum ieee80211_ampdu_mlme_action action,
817 		 struct ieee80211_sta *sta, u16 tid,
818 		 u16 *ssn, u8 buf_size),
819 
820 	TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
821 
822 	TP_STRUCT__entry(
823 		LOCAL_ENTRY
824 		STA_ENTRY
825 		__field(u32, action)
826 		__field(u16, tid)
827 		__field(u16, ssn)
828 		__field(u8, buf_size)
829 		VIF_ENTRY
830 	),
831 
832 	TP_fast_assign(
833 		LOCAL_ASSIGN;
834 		VIF_ASSIGN;
835 		STA_ASSIGN;
836 		__entry->action = action;
837 		__entry->tid = tid;
838 		__entry->ssn = ssn ? *ssn : 0;
839 		__entry->buf_size = buf_size;
840 	),
841 
842 	TP_printk(
843 		LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
844 		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
845 		__entry->tid, __entry->buf_size
846 	)
847 );
848 
849 TRACE_EVENT(drv_get_survey,
850 	TP_PROTO(struct ieee80211_local *local, int idx,
851 		 struct survey_info *survey),
852 
853 	TP_ARGS(local, idx, survey),
854 
855 	TP_STRUCT__entry(
856 		LOCAL_ENTRY
857 		__field(int, idx)
858 	),
859 
860 	TP_fast_assign(
861 		LOCAL_ASSIGN;
862 		__entry->idx = idx;
863 	),
864 
865 	TP_printk(
866 		LOCAL_PR_FMT " idx:%d",
867 		LOCAL_PR_ARG, __entry->idx
868 	)
869 );
870 
871 TRACE_EVENT(drv_flush,
872 	TP_PROTO(struct ieee80211_local *local, bool drop),
873 
874 	TP_ARGS(local, drop),
875 
876 	TP_STRUCT__entry(
877 		LOCAL_ENTRY
878 		__field(bool, drop)
879 	),
880 
881 	TP_fast_assign(
882 		LOCAL_ASSIGN;
883 		__entry->drop = drop;
884 	),
885 
886 	TP_printk(
887 		LOCAL_PR_FMT " drop:%d",
888 		LOCAL_PR_ARG, __entry->drop
889 	)
890 );
891 
892 TRACE_EVENT(drv_channel_switch,
893 	TP_PROTO(struct ieee80211_local *local,
894 		 struct ieee80211_channel_switch *ch_switch),
895 
896 	TP_ARGS(local, ch_switch),
897 
898 	TP_STRUCT__entry(
899 		LOCAL_ENTRY
900 		__field(u64, timestamp)
901 		__field(bool, block_tx)
902 		__field(u16, freq)
903 		__field(u8, count)
904 	),
905 
906 	TP_fast_assign(
907 		LOCAL_ASSIGN;
908 		__entry->timestamp = ch_switch->timestamp;
909 		__entry->block_tx = ch_switch->block_tx;
910 		__entry->freq = ch_switch->channel->center_freq;
911 		__entry->count = ch_switch->count;
912 	),
913 
914 	TP_printk(
915 		LOCAL_PR_FMT " new freq:%u count:%d",
916 		LOCAL_PR_ARG, __entry->freq, __entry->count
917 	)
918 );
919 
920 TRACE_EVENT(drv_set_antenna,
921 	TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
922 
923 	TP_ARGS(local, tx_ant, rx_ant, ret),
924 
925 	TP_STRUCT__entry(
926 		LOCAL_ENTRY
927 		__field(u32, tx_ant)
928 		__field(u32, rx_ant)
929 		__field(int, ret)
930 	),
931 
932 	TP_fast_assign(
933 		LOCAL_ASSIGN;
934 		__entry->tx_ant = tx_ant;
935 		__entry->rx_ant = rx_ant;
936 		__entry->ret = ret;
937 	),
938 
939 	TP_printk(
940 		LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
941 		LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
942 	)
943 );
944 
945 TRACE_EVENT(drv_get_antenna,
946 	TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
947 
948 	TP_ARGS(local, tx_ant, rx_ant, ret),
949 
950 	TP_STRUCT__entry(
951 		LOCAL_ENTRY
952 		__field(u32, tx_ant)
953 		__field(u32, rx_ant)
954 		__field(int, ret)
955 	),
956 
957 	TP_fast_assign(
958 		LOCAL_ASSIGN;
959 		__entry->tx_ant = tx_ant;
960 		__entry->rx_ant = rx_ant;
961 		__entry->ret = ret;
962 	),
963 
964 	TP_printk(
965 		LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
966 		LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
967 	)
968 );
969 
970 TRACE_EVENT(drv_remain_on_channel,
971 	TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
972 		 enum nl80211_channel_type chantype, unsigned int duration),
973 
974 	TP_ARGS(local, chan, chantype, duration),
975 
976 	TP_STRUCT__entry(
977 		LOCAL_ENTRY
978 		__field(int, center_freq)
979 		__field(int, channel_type)
980 		__field(unsigned int, duration)
981 	),
982 
983 	TP_fast_assign(
984 		LOCAL_ASSIGN;
985 		__entry->center_freq = chan->center_freq;
986 		__entry->channel_type = chantype;
987 		__entry->duration = duration;
988 	),
989 
990 	TP_printk(
991 		LOCAL_PR_FMT " freq:%dMHz duration:%dms",
992 		LOCAL_PR_ARG, __entry->center_freq, __entry->duration
993 	)
994 );
995 
996 DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
997 	TP_PROTO(struct ieee80211_local *local),
998 	TP_ARGS(local)
999 );
1000 
1001 TRACE_EVENT(drv_offchannel_tx,
1002 	TP_PROTO(struct ieee80211_local *local, struct sk_buff *skb,
1003 		 struct ieee80211_channel *chan,
1004 		 enum nl80211_channel_type channel_type,
1005 		 unsigned int wait),
1006 
1007 	TP_ARGS(local, skb, chan, channel_type, wait),
1008 
1009 	TP_STRUCT__entry(
1010 		LOCAL_ENTRY
1011 		__field(int, center_freq)
1012 		__field(int, channel_type)
1013 		__field(unsigned int, wait)
1014 	),
1015 
1016 	TP_fast_assign(
1017 		LOCAL_ASSIGN;
1018 		__entry->center_freq = chan->center_freq;
1019 		__entry->channel_type = channel_type;
1020 		__entry->wait = wait;
1021 	),
1022 
1023 	TP_printk(
1024 		LOCAL_PR_FMT " freq:%dMHz, wait:%dms",
1025 		LOCAL_PR_ARG, __entry->center_freq, __entry->wait
1026 	)
1027 );
1028 
1029 TRACE_EVENT(drv_set_ringparam,
1030 	TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
1031 
1032 	TP_ARGS(local, tx, rx),
1033 
1034 	TP_STRUCT__entry(
1035 		LOCAL_ENTRY
1036 		__field(u32, tx)
1037 		__field(u32, rx)
1038 	),
1039 
1040 	TP_fast_assign(
1041 		LOCAL_ASSIGN;
1042 		__entry->tx = tx;
1043 		__entry->rx = rx;
1044 	),
1045 
1046 	TP_printk(
1047 		LOCAL_PR_FMT " tx:%d rx %d",
1048 		LOCAL_PR_ARG, __entry->tx, __entry->rx
1049 	)
1050 );
1051 
1052 TRACE_EVENT(drv_get_ringparam,
1053 	TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1054 		 u32 *rx, u32 *rx_max),
1055 
1056 	TP_ARGS(local, tx, tx_max, rx, rx_max),
1057 
1058 	TP_STRUCT__entry(
1059 		LOCAL_ENTRY
1060 		__field(u32, tx)
1061 		__field(u32, tx_max)
1062 		__field(u32, rx)
1063 		__field(u32, rx_max)
1064 	),
1065 
1066 	TP_fast_assign(
1067 		LOCAL_ASSIGN;
1068 		__entry->tx = *tx;
1069 		__entry->tx_max = *tx_max;
1070 		__entry->rx = *rx;
1071 		__entry->rx_max = *rx_max;
1072 	),
1073 
1074 	TP_printk(
1075 		LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1076 		LOCAL_PR_ARG,
1077 		__entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1078 	)
1079 );
1080 
1081 DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1082 	TP_PROTO(struct ieee80211_local *local),
1083 	TP_ARGS(local)
1084 );
1085 
1086 DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1087 	TP_PROTO(struct ieee80211_local *local),
1088 	TP_ARGS(local)
1089 );
1090 
1091 TRACE_EVENT(drv_set_bitrate_mask,
1092 	TP_PROTO(struct ieee80211_local *local,
1093 		 struct ieee80211_sub_if_data *sdata,
1094 		 const struct cfg80211_bitrate_mask *mask),
1095 
1096 	TP_ARGS(local, sdata, mask),
1097 
1098 	TP_STRUCT__entry(
1099 		LOCAL_ENTRY
1100 		VIF_ENTRY
1101 		__field(u32, legacy_2g)
1102 		__field(u32, legacy_5g)
1103 	),
1104 
1105 	TP_fast_assign(
1106 		LOCAL_ASSIGN;
1107 		VIF_ASSIGN;
1108 		__entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
1109 		__entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
1110 	),
1111 
1112 	TP_printk(
1113 		LOCAL_PR_FMT  VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1114 		LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1115 	)
1116 );
1117 
1118 TRACE_EVENT(drv_set_rekey_data,
1119 	TP_PROTO(struct ieee80211_local *local,
1120 		 struct ieee80211_sub_if_data *sdata,
1121 		 struct cfg80211_gtk_rekey_data *data),
1122 
1123 	TP_ARGS(local, sdata, data),
1124 
1125 	TP_STRUCT__entry(
1126 		LOCAL_ENTRY
1127 		VIF_ENTRY
1128 		__array(u8, kek, NL80211_KEK_LEN)
1129 		__array(u8, kck, NL80211_KCK_LEN)
1130 		__array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1131 	),
1132 
1133 	TP_fast_assign(
1134 		LOCAL_ASSIGN;
1135 		VIF_ASSIGN;
1136 		memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1137 		memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1138 		memcpy(__entry->replay_ctr, data->replay_ctr,
1139 		       NL80211_REPLAY_CTR_LEN);
1140 	),
1141 
1142 	TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1143 		  LOCAL_PR_ARG, VIF_PR_ARG)
1144 );
1145 
1146 TRACE_EVENT(drv_rssi_callback,
1147 	TP_PROTO(struct ieee80211_local *local,
1148 		 enum ieee80211_rssi_event rssi_event),
1149 
1150 	TP_ARGS(local, rssi_event),
1151 
1152 	TP_STRUCT__entry(
1153 		LOCAL_ENTRY
1154 		__field(u32, rssi_event)
1155 	),
1156 
1157 	TP_fast_assign(
1158 		LOCAL_ASSIGN;
1159 		__entry->rssi_event = rssi_event;
1160 	),
1161 
1162 	TP_printk(
1163 		LOCAL_PR_FMT " rssi_event:%d",
1164 		LOCAL_PR_ARG, __entry->rssi_event
1165 	)
1166 );
1167 
1168 DECLARE_EVENT_CLASS(release_evt,
1169 	TP_PROTO(struct ieee80211_local *local,
1170 		 struct ieee80211_sta *sta,
1171 		 u16 tids, int num_frames,
1172 		 enum ieee80211_frame_release_type reason,
1173 		 bool more_data),
1174 
1175 	TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1176 
1177 	TP_STRUCT__entry(
1178 		LOCAL_ENTRY
1179 		STA_ENTRY
1180 		__field(u16, tids)
1181 		__field(int, num_frames)
1182 		__field(int, reason)
1183 		__field(bool, more_data)
1184 	),
1185 
1186 	TP_fast_assign(
1187 		LOCAL_ASSIGN;
1188 		STA_ASSIGN;
1189 		__entry->tids = tids;
1190 		__entry->num_frames = num_frames;
1191 		__entry->reason = reason;
1192 		__entry->more_data = more_data;
1193 	),
1194 
1195 	TP_printk(
1196 		LOCAL_PR_FMT STA_PR_FMT
1197 		" TIDs:0x%.4x frames:%d reason:%d more:%d",
1198 		LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1199 		__entry->reason, __entry->more_data
1200 	)
1201 );
1202 
1203 DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1204 	TP_PROTO(struct ieee80211_local *local,
1205 		 struct ieee80211_sta *sta,
1206 		 u16 tids, int num_frames,
1207 		 enum ieee80211_frame_release_type reason,
1208 		 bool more_data),
1209 
1210 	TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1211 );
1212 
1213 DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1214 	TP_PROTO(struct ieee80211_local *local,
1215 		 struct ieee80211_sta *sta,
1216 		 u16 tids, int num_frames,
1217 		 enum ieee80211_frame_release_type reason,
1218 		 bool more_data),
1219 
1220 	TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1221 );
1222 
1223 TRACE_EVENT(drv_get_rssi,
1224 	TP_PROTO(struct ieee80211_local *local, struct ieee80211_sta *sta,
1225 		 s8 rssi, int ret),
1226 
1227 	TP_ARGS(local, sta, rssi, ret),
1228 
1229 	TP_STRUCT__entry(
1230 		LOCAL_ENTRY
1231 		STA_ENTRY
1232 		__field(s8, rssi)
1233 		__field(int, ret)
1234 	),
1235 
1236 	TP_fast_assign(
1237 		LOCAL_ASSIGN;
1238 		STA_ASSIGN;
1239 		__entry->rssi = rssi;
1240 		__entry->ret = ret;
1241 	),
1242 
1243 	TP_printk(
1244 		LOCAL_PR_FMT STA_PR_FMT " rssi:%d ret:%d",
1245 		LOCAL_PR_ARG, STA_PR_ARG, __entry->rssi, __entry->ret
1246 	)
1247 );
1248 
1249 DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
1250 	TP_PROTO(struct ieee80211_local *local,
1251 		 struct ieee80211_sub_if_data *sdata),
1252 
1253 	TP_ARGS(local, sdata)
1254 );
1255 
1256 /*
1257  * Tracing for API calls that drivers call.
1258  */
1259 
1260 TRACE_EVENT(api_start_tx_ba_session,
1261 	TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1262 
1263 	TP_ARGS(sta, tid),
1264 
1265 	TP_STRUCT__entry(
1266 		STA_ENTRY
1267 		__field(u16, tid)
1268 	),
1269 
1270 	TP_fast_assign(
1271 		STA_ASSIGN;
1272 		__entry->tid = tid;
1273 	),
1274 
1275 	TP_printk(
1276 		STA_PR_FMT " tid:%d",
1277 		STA_PR_ARG, __entry->tid
1278 	)
1279 );
1280 
1281 TRACE_EVENT(api_start_tx_ba_cb,
1282 	TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1283 
1284 	TP_ARGS(sdata, ra, tid),
1285 
1286 	TP_STRUCT__entry(
1287 		VIF_ENTRY
1288 		__array(u8, ra, ETH_ALEN)
1289 		__field(u16, tid)
1290 	),
1291 
1292 	TP_fast_assign(
1293 		VIF_ASSIGN;
1294 		memcpy(__entry->ra, ra, ETH_ALEN);
1295 		__entry->tid = tid;
1296 	),
1297 
1298 	TP_printk(
1299 		VIF_PR_FMT " ra:%pM tid:%d",
1300 		VIF_PR_ARG, __entry->ra, __entry->tid
1301 	)
1302 );
1303 
1304 TRACE_EVENT(api_stop_tx_ba_session,
1305 	TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1306 
1307 	TP_ARGS(sta, tid),
1308 
1309 	TP_STRUCT__entry(
1310 		STA_ENTRY
1311 		__field(u16, tid)
1312 	),
1313 
1314 	TP_fast_assign(
1315 		STA_ASSIGN;
1316 		__entry->tid = tid;
1317 	),
1318 
1319 	TP_printk(
1320 		STA_PR_FMT " tid:%d",
1321 		STA_PR_ARG, __entry->tid
1322 	)
1323 );
1324 
1325 TRACE_EVENT(api_stop_tx_ba_cb,
1326 	TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1327 
1328 	TP_ARGS(sdata, ra, tid),
1329 
1330 	TP_STRUCT__entry(
1331 		VIF_ENTRY
1332 		__array(u8, ra, ETH_ALEN)
1333 		__field(u16, tid)
1334 	),
1335 
1336 	TP_fast_assign(
1337 		VIF_ASSIGN;
1338 		memcpy(__entry->ra, ra, ETH_ALEN);
1339 		__entry->tid = tid;
1340 	),
1341 
1342 	TP_printk(
1343 		VIF_PR_FMT " ra:%pM tid:%d",
1344 		VIF_PR_ARG, __entry->ra, __entry->tid
1345 	)
1346 );
1347 
1348 DEFINE_EVENT(local_only_evt, api_restart_hw,
1349 	TP_PROTO(struct ieee80211_local *local),
1350 	TP_ARGS(local)
1351 );
1352 
1353 TRACE_EVENT(api_beacon_loss,
1354 	TP_PROTO(struct ieee80211_sub_if_data *sdata),
1355 
1356 	TP_ARGS(sdata),
1357 
1358 	TP_STRUCT__entry(
1359 		VIF_ENTRY
1360 	),
1361 
1362 	TP_fast_assign(
1363 		VIF_ASSIGN;
1364 	),
1365 
1366 	TP_printk(
1367 		VIF_PR_FMT,
1368 		VIF_PR_ARG
1369 	)
1370 );
1371 
1372 TRACE_EVENT(api_connection_loss,
1373 	TP_PROTO(struct ieee80211_sub_if_data *sdata),
1374 
1375 	TP_ARGS(sdata),
1376 
1377 	TP_STRUCT__entry(
1378 		VIF_ENTRY
1379 	),
1380 
1381 	TP_fast_assign(
1382 		VIF_ASSIGN;
1383 	),
1384 
1385 	TP_printk(
1386 		VIF_PR_FMT,
1387 		VIF_PR_ARG
1388 	)
1389 );
1390 
1391 TRACE_EVENT(api_cqm_rssi_notify,
1392 	TP_PROTO(struct ieee80211_sub_if_data *sdata,
1393 		 enum nl80211_cqm_rssi_threshold_event rssi_event),
1394 
1395 	TP_ARGS(sdata, rssi_event),
1396 
1397 	TP_STRUCT__entry(
1398 		VIF_ENTRY
1399 		__field(u32, rssi_event)
1400 	),
1401 
1402 	TP_fast_assign(
1403 		VIF_ASSIGN;
1404 		__entry->rssi_event = rssi_event;
1405 	),
1406 
1407 	TP_printk(
1408 		VIF_PR_FMT " event:%d",
1409 		VIF_PR_ARG, __entry->rssi_event
1410 	)
1411 );
1412 
1413 TRACE_EVENT(api_scan_completed,
1414 	TP_PROTO(struct ieee80211_local *local, bool aborted),
1415 
1416 	TP_ARGS(local, aborted),
1417 
1418 	TP_STRUCT__entry(
1419 		LOCAL_ENTRY
1420 		__field(bool, aborted)
1421 	),
1422 
1423 	TP_fast_assign(
1424 		LOCAL_ASSIGN;
1425 		__entry->aborted = aborted;
1426 	),
1427 
1428 	TP_printk(
1429 		LOCAL_PR_FMT " aborted:%d",
1430 		LOCAL_PR_ARG, __entry->aborted
1431 	)
1432 );
1433 
1434 TRACE_EVENT(api_sched_scan_results,
1435 	TP_PROTO(struct ieee80211_local *local),
1436 
1437 	TP_ARGS(local),
1438 
1439 	TP_STRUCT__entry(
1440 		LOCAL_ENTRY
1441 	),
1442 
1443 	TP_fast_assign(
1444 		LOCAL_ASSIGN;
1445 	),
1446 
1447 	TP_printk(
1448 		LOCAL_PR_FMT, LOCAL_PR_ARG
1449 	)
1450 );
1451 
1452 TRACE_EVENT(api_sched_scan_stopped,
1453 	TP_PROTO(struct ieee80211_local *local),
1454 
1455 	TP_ARGS(local),
1456 
1457 	TP_STRUCT__entry(
1458 		LOCAL_ENTRY
1459 	),
1460 
1461 	TP_fast_assign(
1462 		LOCAL_ASSIGN;
1463 	),
1464 
1465 	TP_printk(
1466 		LOCAL_PR_FMT, LOCAL_PR_ARG
1467 	)
1468 );
1469 
1470 TRACE_EVENT(api_sta_block_awake,
1471 	TP_PROTO(struct ieee80211_local *local,
1472 		 struct ieee80211_sta *sta, bool block),
1473 
1474 	TP_ARGS(local, sta, block),
1475 
1476 	TP_STRUCT__entry(
1477 		LOCAL_ENTRY
1478 		STA_ENTRY
1479 		__field(bool, block)
1480 	),
1481 
1482 	TP_fast_assign(
1483 		LOCAL_ASSIGN;
1484 		STA_ASSIGN;
1485 		__entry->block = block;
1486 	),
1487 
1488 	TP_printk(
1489 		LOCAL_PR_FMT STA_PR_FMT " block:%d",
1490 		LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1491 	)
1492 );
1493 
1494 TRACE_EVENT(api_chswitch_done,
1495 	TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1496 
1497 	TP_ARGS(sdata, success),
1498 
1499 	TP_STRUCT__entry(
1500 		VIF_ENTRY
1501 		__field(bool, success)
1502 	),
1503 
1504 	TP_fast_assign(
1505 		VIF_ASSIGN;
1506 		__entry->success = success;
1507 	),
1508 
1509 	TP_printk(
1510 		VIF_PR_FMT " success=%d",
1511 		VIF_PR_ARG, __entry->success
1512 	)
1513 );
1514 
1515 DEFINE_EVENT(local_only_evt, api_ready_on_channel,
1516 	TP_PROTO(struct ieee80211_local *local),
1517 	TP_ARGS(local)
1518 );
1519 
1520 DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
1521 	TP_PROTO(struct ieee80211_local *local),
1522 	TP_ARGS(local)
1523 );
1524 
1525 TRACE_EVENT(api_gtk_rekey_notify,
1526 	TP_PROTO(struct ieee80211_sub_if_data *sdata,
1527 		 const u8 *bssid, const u8 *replay_ctr),
1528 
1529 	TP_ARGS(sdata, bssid, replay_ctr),
1530 
1531 	TP_STRUCT__entry(
1532 		VIF_ENTRY
1533 		__array(u8, bssid, ETH_ALEN)
1534 		__array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1535 	),
1536 
1537 	TP_fast_assign(
1538 		VIF_ASSIGN;
1539 		memcpy(__entry->bssid, bssid, ETH_ALEN);
1540 		memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
1541 	),
1542 
1543 	TP_printk(VIF_PR_FMT, VIF_PR_ARG)
1544 );
1545 
1546 TRACE_EVENT(api_enable_rssi_reports,
1547 	TP_PROTO(struct ieee80211_sub_if_data *sdata,
1548 		 int rssi_min_thold, int rssi_max_thold),
1549 
1550 	TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
1551 
1552 	TP_STRUCT__entry(
1553 		VIF_ENTRY
1554 		__field(int, rssi_min_thold)
1555 		__field(int, rssi_max_thold)
1556 	),
1557 
1558 	TP_fast_assign(
1559 		VIF_ASSIGN;
1560 		__entry->rssi_min_thold = rssi_min_thold;
1561 		__entry->rssi_max_thold = rssi_max_thold;
1562 	),
1563 
1564 	TP_printk(
1565 		VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
1566 		VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
1567 	)
1568 );
1569 
1570 TRACE_EVENT(api_eosp,
1571 	TP_PROTO(struct ieee80211_local *local,
1572 		 struct ieee80211_sta *sta),
1573 
1574 	TP_ARGS(local, sta),
1575 
1576 	TP_STRUCT__entry(
1577 		LOCAL_ENTRY
1578 		STA_ENTRY
1579 	),
1580 
1581 	TP_fast_assign(
1582 		LOCAL_ASSIGN;
1583 		STA_ASSIGN;
1584 	),
1585 
1586 	TP_printk(
1587 		LOCAL_PR_FMT STA_PR_FMT,
1588 		LOCAL_PR_ARG, STA_PR_FMT
1589 	)
1590 );
1591 
1592 /*
1593  * Tracing for internal functions
1594  * (which may also be called in response to driver calls)
1595  */
1596 
1597 TRACE_EVENT(wake_queue,
1598 	TP_PROTO(struct ieee80211_local *local, u16 queue,
1599 		 enum queue_stop_reason reason),
1600 
1601 	TP_ARGS(local, queue, reason),
1602 
1603 	TP_STRUCT__entry(
1604 		LOCAL_ENTRY
1605 		__field(u16, queue)
1606 		__field(u32, reason)
1607 	),
1608 
1609 	TP_fast_assign(
1610 		LOCAL_ASSIGN;
1611 		__entry->queue = queue;
1612 		__entry->reason = reason;
1613 	),
1614 
1615 	TP_printk(
1616 		LOCAL_PR_FMT " queue:%d, reason:%d",
1617 		LOCAL_PR_ARG, __entry->queue, __entry->reason
1618 	)
1619 );
1620 
1621 TRACE_EVENT(stop_queue,
1622 	TP_PROTO(struct ieee80211_local *local, u16 queue,
1623 		 enum queue_stop_reason reason),
1624 
1625 	TP_ARGS(local, queue, reason),
1626 
1627 	TP_STRUCT__entry(
1628 		LOCAL_ENTRY
1629 		__field(u16, queue)
1630 		__field(u32, reason)
1631 	),
1632 
1633 	TP_fast_assign(
1634 		LOCAL_ASSIGN;
1635 		__entry->queue = queue;
1636 		__entry->reason = reason;
1637 	),
1638 
1639 	TP_printk(
1640 		LOCAL_PR_FMT " queue:%d, reason:%d",
1641 		LOCAL_PR_ARG, __entry->queue, __entry->reason
1642 	)
1643 );
1644 
1645 #ifdef CONFIG_MAC80211_MESSAGE_TRACING
1646 #undef TRACE_SYSTEM
1647 #define TRACE_SYSTEM mac80211_msg
1648 
1649 #define MAX_MSG_LEN	100
1650 
1651 DECLARE_EVENT_CLASS(mac80211_msg_event,
1652 	TP_PROTO(struct va_format *vaf),
1653 
1654 	TP_ARGS(vaf),
1655 
1656 	TP_STRUCT__entry(
1657 		__dynamic_array(char, msg, MAX_MSG_LEN)
1658 	),
1659 
1660 	TP_fast_assign(
1661 		WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
1662 				       MAX_MSG_LEN, vaf->fmt,
1663 				       *vaf->va) >= MAX_MSG_LEN);
1664 	),
1665 
1666 	TP_printk("%s", __get_str(msg))
1667 );
1668 
1669 DEFINE_EVENT(mac80211_msg_event, mac80211_info,
1670 	TP_PROTO(struct va_format *vaf),
1671 	TP_ARGS(vaf)
1672 );
1673 DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
1674 	TP_PROTO(struct va_format *vaf),
1675 	TP_ARGS(vaf)
1676 );
1677 DEFINE_EVENT(mac80211_msg_event, mac80211_err,
1678 	TP_PROTO(struct va_format *vaf),
1679 	TP_ARGS(vaf)
1680 );
1681 #endif
1682 
1683 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
1684 
1685 #undef TRACE_INCLUDE_PATH
1686 #define TRACE_INCLUDE_PATH .
1687 #undef TRACE_INCLUDE_FILE
1688 #define TRACE_INCLUDE_FILE trace
1689 #include <trace/define_trace.h>
1690