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