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