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