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