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