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