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