Merge tag 'maintainers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[platform/adaptation/renesas_rcar/renesas_kernel.git] / net / mac80211 / driver-trace.h
1 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __MAC80211_DRIVER_TRACE
3
4 #include <linux/tracepoint.h>
5 #include <net/mac80211.h>
6 #include "ieee80211_i.h"
7
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM mac80211
10
11 #define MAXNAME         32
12 #define LOCAL_ENTRY     __array(char, wiphy_name, 32)
13 #define LOCAL_ASSIGN    strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
14 #define LOCAL_PR_FMT    "%s"
15 #define LOCAL_PR_ARG    __entry->wiphy_name
16
17 #define STA_ENTRY       __array(char, sta_addr, ETH_ALEN)
18 #define STA_ASSIGN      (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
19 #define STA_PR_FMT      " sta:%pM"
20 #define STA_PR_ARG      __entry->sta_addr
21
22 #define VIF_ENTRY       __field(enum nl80211_iftype, vif_type) __field(void *, sdata)   \
23                         __field(bool, p2p)                                              \
24                         __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
25 #define VIF_ASSIGN      __entry->vif_type = sdata->vif.type; __entry->sdata = sdata;    \
26                         __entry->p2p = sdata->vif.p2p;                                  \
27                         __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
28 #define VIF_PR_FMT      " vif:%s(%d%s)"
29 #define VIF_PR_ARG      __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
30
31 /*
32  * Tracing for driver callbacks.
33  */
34
35 DECLARE_EVENT_CLASS(local_only_evt,
36         TP_PROTO(struct ieee80211_local *local),
37         TP_ARGS(local),
38         TP_STRUCT__entry(
39                 LOCAL_ENTRY
40         ),
41         TP_fast_assign(
42                 LOCAL_ASSIGN;
43         ),
44         TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
45 );
46
47 DECLARE_EVENT_CLASS(local_sdata_addr_evt,
48         TP_PROTO(struct ieee80211_local *local,
49                  struct ieee80211_sub_if_data *sdata),
50         TP_ARGS(local, sdata),
51
52         TP_STRUCT__entry(
53                 LOCAL_ENTRY
54                 VIF_ENTRY
55                 __array(char, addr, 6)
56         ),
57
58         TP_fast_assign(
59                 LOCAL_ASSIGN;
60                 VIF_ASSIGN;
61                 memcpy(__entry->addr, sdata->vif.addr, 6);
62         ),
63
64         TP_printk(
65                 LOCAL_PR_FMT  VIF_PR_FMT " addr:%pM",
66                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
67         )
68 );
69
70 DECLARE_EVENT_CLASS(local_u32_evt,
71         TP_PROTO(struct ieee80211_local *local, u32 value),
72         TP_ARGS(local, value),
73
74         TP_STRUCT__entry(
75                 LOCAL_ENTRY
76                 __field(u32, value)
77         ),
78
79         TP_fast_assign(
80                 LOCAL_ASSIGN;
81                 __entry->value = value;
82         ),
83
84         TP_printk(
85                 LOCAL_PR_FMT " value:%d",
86                 LOCAL_PR_ARG, __entry->value
87         )
88 );
89
90 DECLARE_EVENT_CLASS(local_sdata_evt,
91         TP_PROTO(struct ieee80211_local *local,
92                  struct ieee80211_sub_if_data *sdata),
93         TP_ARGS(local, sdata),
94
95         TP_STRUCT__entry(
96                 LOCAL_ENTRY
97                 VIF_ENTRY
98         ),
99
100         TP_fast_assign(
101                 LOCAL_ASSIGN;
102                 VIF_ASSIGN;
103         ),
104
105         TP_printk(
106                 LOCAL_PR_FMT VIF_PR_FMT,
107                 LOCAL_PR_ARG, VIF_PR_ARG
108         )
109 );
110
111 DEFINE_EVENT(local_only_evt, drv_return_void,
112         TP_PROTO(struct ieee80211_local *local),
113         TP_ARGS(local)
114 );
115
116 TRACE_EVENT(drv_return_int,
117         TP_PROTO(struct ieee80211_local *local, int ret),
118         TP_ARGS(local, ret),
119         TP_STRUCT__entry(
120                 LOCAL_ENTRY
121                 __field(int, ret)
122         ),
123         TP_fast_assign(
124                 LOCAL_ASSIGN;
125                 __entry->ret = ret;
126         ),
127         TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
128 );
129
130 TRACE_EVENT(drv_return_bool,
131         TP_PROTO(struct ieee80211_local *local, bool ret),
132         TP_ARGS(local, ret),
133         TP_STRUCT__entry(
134                 LOCAL_ENTRY
135                 __field(bool, ret)
136         ),
137         TP_fast_assign(
138                 LOCAL_ASSIGN;
139                 __entry->ret = ret;
140         ),
141         TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
142                   "true" : "false")
143 );
144
145 TRACE_EVENT(drv_return_u64,
146         TP_PROTO(struct ieee80211_local *local, u64 ret),
147         TP_ARGS(local, ret),
148         TP_STRUCT__entry(
149                 LOCAL_ENTRY
150                 __field(u64, ret)
151         ),
152         TP_fast_assign(
153                 LOCAL_ASSIGN;
154                 __entry->ret = ret;
155         ),
156         TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
157 );
158
159 DEFINE_EVENT(local_only_evt, drv_start,
160         TP_PROTO(struct ieee80211_local *local),
161         TP_ARGS(local)
162 );
163
164 DEFINE_EVENT(local_only_evt, drv_suspend,
165         TP_PROTO(struct ieee80211_local *local),
166         TP_ARGS(local)
167 );
168
169 DEFINE_EVENT(local_only_evt, drv_resume,
170         TP_PROTO(struct ieee80211_local *local),
171         TP_ARGS(local)
172 );
173
174 DEFINE_EVENT(local_only_evt, drv_stop,
175         TP_PROTO(struct ieee80211_local *local),
176         TP_ARGS(local)
177 );
178
179 DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
180         TP_PROTO(struct ieee80211_local *local,
181                  struct ieee80211_sub_if_data *sdata),
182         TP_ARGS(local, sdata)
183 );
184
185 TRACE_EVENT(drv_change_interface,
186         TP_PROTO(struct ieee80211_local *local,
187                  struct ieee80211_sub_if_data *sdata,
188                  enum nl80211_iftype type, bool p2p),
189
190         TP_ARGS(local, sdata, type, p2p),
191
192         TP_STRUCT__entry(
193                 LOCAL_ENTRY
194                 VIF_ENTRY
195                 __field(u32, new_type)
196                 __field(bool, new_p2p)
197         ),
198
199         TP_fast_assign(
200                 LOCAL_ASSIGN;
201                 VIF_ASSIGN;
202                 __entry->new_type = type;
203                 __entry->new_p2p = p2p;
204         ),
205
206         TP_printk(
207                 LOCAL_PR_FMT  VIF_PR_FMT " new type:%d%s",
208                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
209                 __entry->new_p2p ? "/p2p" : ""
210         )
211 );
212
213 DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
214         TP_PROTO(struct ieee80211_local *local,
215                  struct ieee80211_sub_if_data *sdata),
216         TP_ARGS(local, sdata)
217 );
218
219 TRACE_EVENT(drv_config,
220         TP_PROTO(struct ieee80211_local *local,
221                  u32 changed),
222
223         TP_ARGS(local, changed),
224
225         TP_STRUCT__entry(
226                 LOCAL_ENTRY
227                 __field(u32, changed)
228                 __field(u32, flags)
229                 __field(int, power_level)
230                 __field(int, dynamic_ps_timeout)
231                 __field(int, max_sleep_period)
232                 __field(u16, listen_interval)
233                 __field(u8, long_frame_max_tx_count)
234                 __field(u8, short_frame_max_tx_count)
235                 __field(int, center_freq)
236                 __field(int, channel_type)
237                 __field(int, smps)
238         ),
239
240         TP_fast_assign(
241                 LOCAL_ASSIGN;
242                 __entry->changed = changed;
243                 __entry->flags = local->hw.conf.flags;
244                 __entry->power_level = local->hw.conf.power_level;
245                 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
246                 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
247                 __entry->listen_interval = local->hw.conf.listen_interval;
248                 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
249                 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
250                 __entry->center_freq = local->hw.conf.channel->center_freq;
251                 __entry->channel_type = local->hw.conf.channel_type;
252                 __entry->smps = local->hw.conf.smps_mode;
253         ),
254
255         TP_printk(
256                 LOCAL_PR_FMT " ch:%#x freq:%d",
257                 LOCAL_PR_ARG, __entry->changed, __entry->center_freq
258         )
259 );
260
261 TRACE_EVENT(drv_bss_info_changed,
262         TP_PROTO(struct ieee80211_local *local,
263                  struct ieee80211_sub_if_data *sdata,
264                  struct ieee80211_bss_conf *info,
265                  u32 changed),
266
267         TP_ARGS(local, sdata, info, changed),
268
269         TP_STRUCT__entry(
270                 LOCAL_ENTRY
271                 VIF_ENTRY
272                 __field(bool, assoc)
273                 __field(u16, aid)
274                 __field(bool, cts)
275                 __field(bool, shortpre)
276                 __field(bool, shortslot)
277                 __field(u8, dtimper)
278                 __field(u16, bcnint)
279                 __field(u16, assoc_cap)
280                 __field(u64, timestamp)
281                 __field(u32, basic_rates)
282                 __field(u32, changed)
283                 __field(bool, enable_beacon)
284                 __field(u16, ht_operation_mode)
285         ),
286
287         TP_fast_assign(
288                 LOCAL_ASSIGN;
289                 VIF_ASSIGN;
290                 __entry->changed = changed;
291                 __entry->aid = info->aid;
292                 __entry->assoc = info->assoc;
293                 __entry->shortpre = info->use_short_preamble;
294                 __entry->cts = info->use_cts_prot;
295                 __entry->shortslot = info->use_short_slot;
296                 __entry->dtimper = info->dtim_period;
297                 __entry->bcnint = info->beacon_int;
298                 __entry->assoc_cap = info->assoc_capability;
299                 __entry->timestamp = info->last_tsf;
300                 __entry->basic_rates = info->basic_rates;
301                 __entry->enable_beacon = info->enable_beacon;
302                 __entry->ht_operation_mode = info->ht_operation_mode;
303         ),
304
305         TP_printk(
306                 LOCAL_PR_FMT  VIF_PR_FMT " changed:%#x",
307                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
308         )
309 );
310
311 TRACE_EVENT(drv_prepare_multicast,
312         TP_PROTO(struct ieee80211_local *local, int mc_count),
313
314         TP_ARGS(local, mc_count),
315
316         TP_STRUCT__entry(
317                 LOCAL_ENTRY
318                 __field(int, mc_count)
319         ),
320
321         TP_fast_assign(
322                 LOCAL_ASSIGN;
323                 __entry->mc_count = mc_count;
324         ),
325
326         TP_printk(
327                 LOCAL_PR_FMT " prepare mc (%d)",
328                 LOCAL_PR_ARG, __entry->mc_count
329         )
330 );
331
332 TRACE_EVENT(drv_configure_filter,
333         TP_PROTO(struct ieee80211_local *local,
334                  unsigned int changed_flags,
335                  unsigned int *total_flags,
336                  u64 multicast),
337
338         TP_ARGS(local, changed_flags, total_flags, multicast),
339
340         TP_STRUCT__entry(
341                 LOCAL_ENTRY
342                 __field(unsigned int, changed)
343                 __field(unsigned int, total)
344                 __field(u64, multicast)
345         ),
346
347         TP_fast_assign(
348                 LOCAL_ASSIGN;
349                 __entry->changed = changed_flags;
350                 __entry->total = *total_flags;
351                 __entry->multicast = multicast;
352         ),
353
354         TP_printk(
355                 LOCAL_PR_FMT " changed:%#x total:%#x",
356                 LOCAL_PR_ARG, __entry->changed, __entry->total
357         )
358 );
359
360 TRACE_EVENT(drv_set_tim,
361         TP_PROTO(struct ieee80211_local *local,
362                  struct ieee80211_sta *sta, bool set),
363
364         TP_ARGS(local, sta, set),
365
366         TP_STRUCT__entry(
367                 LOCAL_ENTRY
368                 STA_ENTRY
369                 __field(bool, set)
370         ),
371
372         TP_fast_assign(
373                 LOCAL_ASSIGN;
374                 STA_ASSIGN;
375                 __entry->set = set;
376         ),
377
378         TP_printk(
379                 LOCAL_PR_FMT STA_PR_FMT " set:%d",
380                 LOCAL_PR_ARG, STA_PR_FMT, __entry->set
381         )
382 );
383
384 TRACE_EVENT(drv_set_key,
385         TP_PROTO(struct ieee80211_local *local,
386                  enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
387                  struct ieee80211_sta *sta,
388                  struct ieee80211_key_conf *key),
389
390         TP_ARGS(local, cmd, sdata, sta, key),
391
392         TP_STRUCT__entry(
393                 LOCAL_ENTRY
394                 VIF_ENTRY
395                 STA_ENTRY
396                 __field(u32, cipher)
397                 __field(u8, hw_key_idx)
398                 __field(u8, flags)
399                 __field(s8, keyidx)
400         ),
401
402         TP_fast_assign(
403                 LOCAL_ASSIGN;
404                 VIF_ASSIGN;
405                 STA_ASSIGN;
406                 __entry->cipher = key->cipher;
407                 __entry->flags = key->flags;
408                 __entry->keyidx = key->keyidx;
409                 __entry->hw_key_idx = key->hw_key_idx;
410         ),
411
412         TP_printk(
413                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
414                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
415         )
416 );
417
418 TRACE_EVENT(drv_update_tkip_key,
419         TP_PROTO(struct ieee80211_local *local,
420                  struct ieee80211_sub_if_data *sdata,
421                  struct ieee80211_key_conf *conf,
422                  struct ieee80211_sta *sta, u32 iv32),
423
424         TP_ARGS(local, sdata, conf, sta, iv32),
425
426         TP_STRUCT__entry(
427                 LOCAL_ENTRY
428                 VIF_ENTRY
429                 STA_ENTRY
430                 __field(u32, iv32)
431         ),
432
433         TP_fast_assign(
434                 LOCAL_ASSIGN;
435                 VIF_ASSIGN;
436                 STA_ASSIGN;
437                 __entry->iv32 = iv32;
438         ),
439
440         TP_printk(
441                 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
442                 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
443         )
444 );
445
446 DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
447         TP_PROTO(struct ieee80211_local *local,
448                  struct ieee80211_sub_if_data *sdata),
449         TP_ARGS(local, sdata)
450 );
451
452 DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
453         TP_PROTO(struct ieee80211_local *local,
454                  struct ieee80211_sub_if_data *sdata),
455         TP_ARGS(local, sdata)
456 );
457
458 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
459         TP_PROTO(struct ieee80211_local *local,
460                  struct ieee80211_sub_if_data *sdata),
461         TP_ARGS(local, sdata)
462 );
463
464 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
465         TP_PROTO(struct ieee80211_local *local,
466                  struct ieee80211_sub_if_data *sdata),
467         TP_ARGS(local, sdata)
468 );
469
470 DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
471         TP_PROTO(struct ieee80211_local *local),
472         TP_ARGS(local)
473 );
474
475 DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
476         TP_PROTO(struct ieee80211_local *local),
477         TP_ARGS(local)
478 );
479
480 TRACE_EVENT(drv_get_stats,
481         TP_PROTO(struct ieee80211_local *local,
482                  struct ieee80211_low_level_stats *stats,
483                  int ret),
484
485         TP_ARGS(local, stats, ret),
486
487         TP_STRUCT__entry(
488                 LOCAL_ENTRY
489                 __field(int, ret)
490                 __field(unsigned int, ackfail)
491                 __field(unsigned int, rtsfail)
492                 __field(unsigned int, fcserr)
493                 __field(unsigned int, rtssucc)
494         ),
495
496         TP_fast_assign(
497                 LOCAL_ASSIGN;
498                 __entry->ret = ret;
499                 __entry->ackfail = stats->dot11ACKFailureCount;
500                 __entry->rtsfail = stats->dot11RTSFailureCount;
501                 __entry->fcserr = stats->dot11FCSErrorCount;
502                 __entry->rtssucc = stats->dot11RTSSuccessCount;
503         ),
504
505         TP_printk(
506                 LOCAL_PR_FMT " ret:%d",
507                 LOCAL_PR_ARG, __entry->ret
508         )
509 );
510
511 TRACE_EVENT(drv_get_tkip_seq,
512         TP_PROTO(struct ieee80211_local *local,
513                  u8 hw_key_idx, u32 *iv32, u16 *iv16),
514
515         TP_ARGS(local, hw_key_idx, iv32, iv16),
516
517         TP_STRUCT__entry(
518                 LOCAL_ENTRY
519                 __field(u8, hw_key_idx)
520                 __field(u32, iv32)
521                 __field(u16, iv16)
522         ),
523
524         TP_fast_assign(
525                 LOCAL_ASSIGN;
526                 __entry->hw_key_idx = hw_key_idx;
527                 __entry->iv32 = *iv32;
528                 __entry->iv16 = *iv16;
529         ),
530
531         TP_printk(
532                 LOCAL_PR_FMT, LOCAL_PR_ARG
533         )
534 );
535
536 DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
537         TP_PROTO(struct ieee80211_local *local, u32 value),
538         TP_ARGS(local, value)
539 );
540
541 DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
542         TP_PROTO(struct ieee80211_local *local, u32 value),
543         TP_ARGS(local, value)
544 );
545
546 TRACE_EVENT(drv_set_coverage_class,
547         TP_PROTO(struct ieee80211_local *local, u8 value),
548
549         TP_ARGS(local, value),
550
551         TP_STRUCT__entry(
552                 LOCAL_ENTRY
553                 __field(u8, value)
554         ),
555
556         TP_fast_assign(
557                 LOCAL_ASSIGN;
558                 __entry->value = value;
559         ),
560
561         TP_printk(
562                 LOCAL_PR_FMT " value:%d",
563                 LOCAL_PR_ARG, __entry->value
564         )
565 );
566
567 TRACE_EVENT(drv_sta_notify,
568         TP_PROTO(struct ieee80211_local *local,
569                  struct ieee80211_sub_if_data *sdata,
570                  enum sta_notify_cmd cmd,
571                  struct ieee80211_sta *sta),
572
573         TP_ARGS(local, sdata, cmd, sta),
574
575         TP_STRUCT__entry(
576                 LOCAL_ENTRY
577                 VIF_ENTRY
578                 STA_ENTRY
579                 __field(u32, cmd)
580         ),
581
582         TP_fast_assign(
583                 LOCAL_ASSIGN;
584                 VIF_ASSIGN;
585                 STA_ASSIGN;
586                 __entry->cmd = cmd;
587         ),
588
589         TP_printk(
590                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " cmd:%d",
591                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
592         )
593 );
594
595 TRACE_EVENT(drv_sta_state,
596         TP_PROTO(struct ieee80211_local *local,
597                  struct ieee80211_sub_if_data *sdata,
598                  struct ieee80211_sta *sta,
599                  enum ieee80211_sta_state old_state,
600                  enum ieee80211_sta_state new_state),
601
602         TP_ARGS(local, sdata, sta, old_state, new_state),
603
604         TP_STRUCT__entry(
605                 LOCAL_ENTRY
606                 VIF_ENTRY
607                 STA_ENTRY
608                 __field(u32, old_state)
609                 __field(u32, new_state)
610         ),
611
612         TP_fast_assign(
613                 LOCAL_ASSIGN;
614                 VIF_ASSIGN;
615                 STA_ASSIGN;
616                 __entry->old_state = old_state;
617                 __entry->new_state = new_state;
618         ),
619
620         TP_printk(
621                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " state: %d->%d",
622                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
623                 __entry->old_state, __entry->new_state
624         )
625 );
626
627 TRACE_EVENT(drv_sta_add,
628         TP_PROTO(struct ieee80211_local *local,
629                  struct ieee80211_sub_if_data *sdata,
630                  struct ieee80211_sta *sta),
631
632         TP_ARGS(local, sdata, sta),
633
634         TP_STRUCT__entry(
635                 LOCAL_ENTRY
636                 VIF_ENTRY
637                 STA_ENTRY
638         ),
639
640         TP_fast_assign(
641                 LOCAL_ASSIGN;
642                 VIF_ASSIGN;
643                 STA_ASSIGN;
644         ),
645
646         TP_printk(
647                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
648                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
649         )
650 );
651
652 TRACE_EVENT(drv_sta_remove,
653         TP_PROTO(struct ieee80211_local *local,
654                  struct ieee80211_sub_if_data *sdata,
655                  struct ieee80211_sta *sta),
656
657         TP_ARGS(local, sdata, sta),
658
659         TP_STRUCT__entry(
660                 LOCAL_ENTRY
661                 VIF_ENTRY
662                 STA_ENTRY
663         ),
664
665         TP_fast_assign(
666                 LOCAL_ASSIGN;
667                 VIF_ASSIGN;
668                 STA_ASSIGN;
669         ),
670
671         TP_printk(
672                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
673                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
674         )
675 );
676
677 TRACE_EVENT(drv_conf_tx,
678         TP_PROTO(struct ieee80211_local *local,
679                  struct ieee80211_sub_if_data *sdata,
680                  u16 queue,
681                  const struct ieee80211_tx_queue_params *params),
682
683         TP_ARGS(local, sdata, queue, params),
684
685         TP_STRUCT__entry(
686                 LOCAL_ENTRY
687                 VIF_ENTRY
688                 __field(u16, queue)
689                 __field(u16, txop)
690                 __field(u16, cw_min)
691                 __field(u16, cw_max)
692                 __field(u8, aifs)
693                 __field(bool, uapsd)
694         ),
695
696         TP_fast_assign(
697                 LOCAL_ASSIGN;
698                 VIF_ASSIGN;
699                 __entry->queue = queue;
700                 __entry->txop = params->txop;
701                 __entry->cw_max = params->cw_max;
702                 __entry->cw_min = params->cw_min;
703                 __entry->aifs = params->aifs;
704                 __entry->uapsd = params->uapsd;
705         ),
706
707         TP_printk(
708                 LOCAL_PR_FMT  VIF_PR_FMT  " queue:%d",
709                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->queue
710         )
711 );
712
713 DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
714         TP_PROTO(struct ieee80211_local *local,
715                  struct ieee80211_sub_if_data *sdata),
716         TP_ARGS(local, sdata)
717 );
718
719 TRACE_EVENT(drv_set_tsf,
720         TP_PROTO(struct ieee80211_local *local,
721                  struct ieee80211_sub_if_data *sdata,
722                  u64 tsf),
723
724         TP_ARGS(local, sdata, tsf),
725
726         TP_STRUCT__entry(
727                 LOCAL_ENTRY
728                 VIF_ENTRY
729                 __field(u64, tsf)
730         ),
731
732         TP_fast_assign(
733                 LOCAL_ASSIGN;
734                 VIF_ASSIGN;
735                 __entry->tsf = tsf;
736         ),
737
738         TP_printk(
739                 LOCAL_PR_FMT  VIF_PR_FMT  " tsf:%llu",
740                 LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
741         )
742 );
743
744 DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
745         TP_PROTO(struct ieee80211_local *local,
746                  struct ieee80211_sub_if_data *sdata),
747         TP_ARGS(local, sdata)
748 );
749
750 DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
751         TP_PROTO(struct ieee80211_local *local),
752         TP_ARGS(local)
753 );
754
755 TRACE_EVENT(drv_ampdu_action,
756         TP_PROTO(struct ieee80211_local *local,
757                  struct ieee80211_sub_if_data *sdata,
758                  enum ieee80211_ampdu_mlme_action action,
759                  struct ieee80211_sta *sta, u16 tid,
760                  u16 *ssn, u8 buf_size),
761
762         TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
763
764         TP_STRUCT__entry(
765                 LOCAL_ENTRY
766                 STA_ENTRY
767                 __field(u32, action)
768                 __field(u16, tid)
769                 __field(u16, ssn)
770                 __field(u8, buf_size)
771                 VIF_ENTRY
772         ),
773
774         TP_fast_assign(
775                 LOCAL_ASSIGN;
776                 VIF_ASSIGN;
777                 STA_ASSIGN;
778                 __entry->action = action;
779                 __entry->tid = tid;
780                 __entry->ssn = ssn ? *ssn : 0;
781                 __entry->buf_size = buf_size;
782         ),
783
784         TP_printk(
785                 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
786                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
787                 __entry->tid, __entry->buf_size
788         )
789 );
790
791 TRACE_EVENT(drv_get_survey,
792         TP_PROTO(struct ieee80211_local *local, int idx,
793                  struct survey_info *survey),
794
795         TP_ARGS(local, idx, survey),
796
797         TP_STRUCT__entry(
798                 LOCAL_ENTRY
799                 __field(int, idx)
800         ),
801
802         TP_fast_assign(
803                 LOCAL_ASSIGN;
804                 __entry->idx = idx;
805         ),
806
807         TP_printk(
808                 LOCAL_PR_FMT " idx:%d",
809                 LOCAL_PR_ARG, __entry->idx
810         )
811 );
812
813 TRACE_EVENT(drv_flush,
814         TP_PROTO(struct ieee80211_local *local, bool drop),
815
816         TP_ARGS(local, drop),
817
818         TP_STRUCT__entry(
819                 LOCAL_ENTRY
820                 __field(bool, drop)
821         ),
822
823         TP_fast_assign(
824                 LOCAL_ASSIGN;
825                 __entry->drop = drop;
826         ),
827
828         TP_printk(
829                 LOCAL_PR_FMT " drop:%d",
830                 LOCAL_PR_ARG, __entry->drop
831         )
832 );
833
834 TRACE_EVENT(drv_channel_switch,
835         TP_PROTO(struct ieee80211_local *local,
836                  struct ieee80211_channel_switch *ch_switch),
837
838         TP_ARGS(local, ch_switch),
839
840         TP_STRUCT__entry(
841                 LOCAL_ENTRY
842                 __field(u64, timestamp)
843                 __field(bool, block_tx)
844                 __field(u16, freq)
845                 __field(u8, count)
846         ),
847
848         TP_fast_assign(
849                 LOCAL_ASSIGN;
850                 __entry->timestamp = ch_switch->timestamp;
851                 __entry->block_tx = ch_switch->block_tx;
852                 __entry->freq = ch_switch->channel->center_freq;
853                 __entry->count = ch_switch->count;
854         ),
855
856         TP_printk(
857                 LOCAL_PR_FMT " new freq:%u count:%d",
858                 LOCAL_PR_ARG, __entry->freq, __entry->count
859         )
860 );
861
862 TRACE_EVENT(drv_set_antenna,
863         TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
864
865         TP_ARGS(local, tx_ant, rx_ant, ret),
866
867         TP_STRUCT__entry(
868                 LOCAL_ENTRY
869                 __field(u32, tx_ant)
870                 __field(u32, rx_ant)
871                 __field(int, ret)
872         ),
873
874         TP_fast_assign(
875                 LOCAL_ASSIGN;
876                 __entry->tx_ant = tx_ant;
877                 __entry->rx_ant = rx_ant;
878                 __entry->ret = ret;
879         ),
880
881         TP_printk(
882                 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
883                 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
884         )
885 );
886
887 TRACE_EVENT(drv_get_antenna,
888         TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
889
890         TP_ARGS(local, tx_ant, rx_ant, ret),
891
892         TP_STRUCT__entry(
893                 LOCAL_ENTRY
894                 __field(u32, tx_ant)
895                 __field(u32, rx_ant)
896                 __field(int, ret)
897         ),
898
899         TP_fast_assign(
900                 LOCAL_ASSIGN;
901                 __entry->tx_ant = tx_ant;
902                 __entry->rx_ant = rx_ant;
903                 __entry->ret = ret;
904         ),
905
906         TP_printk(
907                 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
908                 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
909         )
910 );
911
912 TRACE_EVENT(drv_remain_on_channel,
913         TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
914                  enum nl80211_channel_type chantype, unsigned int duration),
915
916         TP_ARGS(local, chan, chantype, duration),
917
918         TP_STRUCT__entry(
919                 LOCAL_ENTRY
920                 __field(int, center_freq)
921                 __field(int, channel_type)
922                 __field(unsigned int, duration)
923         ),
924
925         TP_fast_assign(
926                 LOCAL_ASSIGN;
927                 __entry->center_freq = chan->center_freq;
928                 __entry->channel_type = chantype;
929                 __entry->duration = duration;
930         ),
931
932         TP_printk(
933                 LOCAL_PR_FMT " freq:%dMHz duration:%dms",
934                 LOCAL_PR_ARG, __entry->center_freq, __entry->duration
935         )
936 );
937
938 DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
939         TP_PROTO(struct ieee80211_local *local),
940         TP_ARGS(local)
941 );
942
943 TRACE_EVENT(drv_offchannel_tx,
944         TP_PROTO(struct ieee80211_local *local, struct sk_buff *skb,
945                  struct ieee80211_channel *chan,
946                  enum nl80211_channel_type channel_type,
947                  unsigned int wait),
948
949         TP_ARGS(local, skb, chan, channel_type, wait),
950
951         TP_STRUCT__entry(
952                 LOCAL_ENTRY
953                 __field(int, center_freq)
954                 __field(int, channel_type)
955                 __field(unsigned int, wait)
956         ),
957
958         TP_fast_assign(
959                 LOCAL_ASSIGN;
960                 __entry->center_freq = chan->center_freq;
961                 __entry->channel_type = channel_type;
962                 __entry->wait = wait;
963         ),
964
965         TP_printk(
966                 LOCAL_PR_FMT " freq:%dMHz, wait:%dms",
967                 LOCAL_PR_ARG, __entry->center_freq, __entry->wait
968         )
969 );
970
971 TRACE_EVENT(drv_set_ringparam,
972         TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
973
974         TP_ARGS(local, tx, rx),
975
976         TP_STRUCT__entry(
977                 LOCAL_ENTRY
978                 __field(u32, tx)
979                 __field(u32, rx)
980         ),
981
982         TP_fast_assign(
983                 LOCAL_ASSIGN;
984                 __entry->tx = tx;
985                 __entry->rx = rx;
986         ),
987
988         TP_printk(
989                 LOCAL_PR_FMT " tx:%d rx %d",
990                 LOCAL_PR_ARG, __entry->tx, __entry->rx
991         )
992 );
993
994 TRACE_EVENT(drv_get_ringparam,
995         TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
996                  u32 *rx, u32 *rx_max),
997
998         TP_ARGS(local, tx, tx_max, rx, rx_max),
999
1000         TP_STRUCT__entry(
1001                 LOCAL_ENTRY
1002                 __field(u32, tx)
1003                 __field(u32, tx_max)
1004                 __field(u32, rx)
1005                 __field(u32, rx_max)
1006         ),
1007
1008         TP_fast_assign(
1009                 LOCAL_ASSIGN;
1010                 __entry->tx = *tx;
1011                 __entry->tx_max = *tx_max;
1012                 __entry->rx = *rx;
1013                 __entry->rx_max = *rx_max;
1014         ),
1015
1016         TP_printk(
1017                 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1018                 LOCAL_PR_ARG,
1019                 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1020         )
1021 );
1022
1023 DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1024         TP_PROTO(struct ieee80211_local *local),
1025         TP_ARGS(local)
1026 );
1027
1028 DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1029         TP_PROTO(struct ieee80211_local *local),
1030         TP_ARGS(local)
1031 );
1032
1033 TRACE_EVENT(drv_set_bitrate_mask,
1034         TP_PROTO(struct ieee80211_local *local,
1035                  struct ieee80211_sub_if_data *sdata,
1036                  const struct cfg80211_bitrate_mask *mask),
1037
1038         TP_ARGS(local, sdata, mask),
1039
1040         TP_STRUCT__entry(
1041                 LOCAL_ENTRY
1042                 VIF_ENTRY
1043                 __field(u32, legacy_2g)
1044                 __field(u32, legacy_5g)
1045         ),
1046
1047         TP_fast_assign(
1048                 LOCAL_ASSIGN;
1049                 VIF_ASSIGN;
1050                 __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
1051                 __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
1052         ),
1053
1054         TP_printk(
1055                 LOCAL_PR_FMT  VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1056                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1057         )
1058 );
1059
1060 TRACE_EVENT(drv_set_rekey_data,
1061         TP_PROTO(struct ieee80211_local *local,
1062                  struct ieee80211_sub_if_data *sdata,
1063                  struct cfg80211_gtk_rekey_data *data),
1064
1065         TP_ARGS(local, sdata, data),
1066
1067         TP_STRUCT__entry(
1068                 LOCAL_ENTRY
1069                 VIF_ENTRY
1070                 __array(u8, kek, NL80211_KEK_LEN)
1071                 __array(u8, kck, NL80211_KCK_LEN)
1072                 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1073         ),
1074
1075         TP_fast_assign(
1076                 LOCAL_ASSIGN;
1077                 VIF_ASSIGN;
1078                 memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1079                 memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1080                 memcpy(__entry->replay_ctr, data->replay_ctr,
1081                        NL80211_REPLAY_CTR_LEN);
1082         ),
1083
1084         TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1085                   LOCAL_PR_ARG, VIF_PR_ARG)
1086 );
1087
1088 TRACE_EVENT(drv_rssi_callback,
1089         TP_PROTO(struct ieee80211_local *local,
1090                  enum ieee80211_rssi_event rssi_event),
1091
1092         TP_ARGS(local, rssi_event),
1093
1094         TP_STRUCT__entry(
1095                 LOCAL_ENTRY
1096                 __field(u32, rssi_event)
1097         ),
1098
1099         TP_fast_assign(
1100                 LOCAL_ASSIGN;
1101                 __entry->rssi_event = rssi_event;
1102         ),
1103
1104         TP_printk(
1105                 LOCAL_PR_FMT " rssi_event:%d",
1106                 LOCAL_PR_ARG, __entry->rssi_event
1107         )
1108 );
1109
1110 DECLARE_EVENT_CLASS(release_evt,
1111         TP_PROTO(struct ieee80211_local *local,
1112                  struct ieee80211_sta *sta,
1113                  u16 tids, int num_frames,
1114                  enum ieee80211_frame_release_type reason,
1115                  bool more_data),
1116
1117         TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1118
1119         TP_STRUCT__entry(
1120                 LOCAL_ENTRY
1121                 STA_ENTRY
1122                 __field(u16, tids)
1123                 __field(int, num_frames)
1124                 __field(int, reason)
1125                 __field(bool, more_data)
1126         ),
1127
1128         TP_fast_assign(
1129                 LOCAL_ASSIGN;
1130                 STA_ASSIGN;
1131                 __entry->tids = tids;
1132                 __entry->num_frames = num_frames;
1133                 __entry->reason = reason;
1134                 __entry->more_data = more_data;
1135         ),
1136
1137         TP_printk(
1138                 LOCAL_PR_FMT STA_PR_FMT
1139                 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1140                 LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1141                 __entry->reason, __entry->more_data
1142         )
1143 );
1144
1145 DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1146         TP_PROTO(struct ieee80211_local *local,
1147                  struct ieee80211_sta *sta,
1148                  u16 tids, int num_frames,
1149                  enum ieee80211_frame_release_type reason,
1150                  bool more_data),
1151
1152         TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1153 );
1154
1155 DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1156         TP_PROTO(struct ieee80211_local *local,
1157                  struct ieee80211_sta *sta,
1158                  u16 tids, int num_frames,
1159                  enum ieee80211_frame_release_type reason,
1160                  bool more_data),
1161
1162         TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1163 );
1164
1165 /*
1166  * Tracing for API calls that drivers call.
1167  */
1168
1169 TRACE_EVENT(api_start_tx_ba_session,
1170         TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1171
1172         TP_ARGS(sta, tid),
1173
1174         TP_STRUCT__entry(
1175                 STA_ENTRY
1176                 __field(u16, tid)
1177         ),
1178
1179         TP_fast_assign(
1180                 STA_ASSIGN;
1181                 __entry->tid = tid;
1182         ),
1183
1184         TP_printk(
1185                 STA_PR_FMT " tid:%d",
1186                 STA_PR_ARG, __entry->tid
1187         )
1188 );
1189
1190 TRACE_EVENT(api_start_tx_ba_cb,
1191         TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1192
1193         TP_ARGS(sdata, ra, tid),
1194
1195         TP_STRUCT__entry(
1196                 VIF_ENTRY
1197                 __array(u8, ra, ETH_ALEN)
1198                 __field(u16, tid)
1199         ),
1200
1201         TP_fast_assign(
1202                 VIF_ASSIGN;
1203                 memcpy(__entry->ra, ra, ETH_ALEN);
1204                 __entry->tid = tid;
1205         ),
1206
1207         TP_printk(
1208                 VIF_PR_FMT " ra:%pM tid:%d",
1209                 VIF_PR_ARG, __entry->ra, __entry->tid
1210         )
1211 );
1212
1213 TRACE_EVENT(api_stop_tx_ba_session,
1214         TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1215
1216         TP_ARGS(sta, tid),
1217
1218         TP_STRUCT__entry(
1219                 STA_ENTRY
1220                 __field(u16, tid)
1221         ),
1222
1223         TP_fast_assign(
1224                 STA_ASSIGN;
1225                 __entry->tid = tid;
1226         ),
1227
1228         TP_printk(
1229                 STA_PR_FMT " tid:%d",
1230                 STA_PR_ARG, __entry->tid
1231         )
1232 );
1233
1234 TRACE_EVENT(api_stop_tx_ba_cb,
1235         TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1236
1237         TP_ARGS(sdata, ra, tid),
1238
1239         TP_STRUCT__entry(
1240                 VIF_ENTRY
1241                 __array(u8, ra, ETH_ALEN)
1242                 __field(u16, tid)
1243         ),
1244
1245         TP_fast_assign(
1246                 VIF_ASSIGN;
1247                 memcpy(__entry->ra, ra, ETH_ALEN);
1248                 __entry->tid = tid;
1249         ),
1250
1251         TP_printk(
1252                 VIF_PR_FMT " ra:%pM tid:%d",
1253                 VIF_PR_ARG, __entry->ra, __entry->tid
1254         )
1255 );
1256
1257 DEFINE_EVENT(local_only_evt, api_restart_hw,
1258         TP_PROTO(struct ieee80211_local *local),
1259         TP_ARGS(local)
1260 );
1261
1262 TRACE_EVENT(api_beacon_loss,
1263         TP_PROTO(struct ieee80211_sub_if_data *sdata),
1264
1265         TP_ARGS(sdata),
1266
1267         TP_STRUCT__entry(
1268                 VIF_ENTRY
1269         ),
1270
1271         TP_fast_assign(
1272                 VIF_ASSIGN;
1273         ),
1274
1275         TP_printk(
1276                 VIF_PR_FMT,
1277                 VIF_PR_ARG
1278         )
1279 );
1280
1281 TRACE_EVENT(api_connection_loss,
1282         TP_PROTO(struct ieee80211_sub_if_data *sdata),
1283
1284         TP_ARGS(sdata),
1285
1286         TP_STRUCT__entry(
1287                 VIF_ENTRY
1288         ),
1289
1290         TP_fast_assign(
1291                 VIF_ASSIGN;
1292         ),
1293
1294         TP_printk(
1295                 VIF_PR_FMT,
1296                 VIF_PR_ARG
1297         )
1298 );
1299
1300 TRACE_EVENT(api_cqm_rssi_notify,
1301         TP_PROTO(struct ieee80211_sub_if_data *sdata,
1302                  enum nl80211_cqm_rssi_threshold_event rssi_event),
1303
1304         TP_ARGS(sdata, rssi_event),
1305
1306         TP_STRUCT__entry(
1307                 VIF_ENTRY
1308                 __field(u32, rssi_event)
1309         ),
1310
1311         TP_fast_assign(
1312                 VIF_ASSIGN;
1313                 __entry->rssi_event = rssi_event;
1314         ),
1315
1316         TP_printk(
1317                 VIF_PR_FMT " event:%d",
1318                 VIF_PR_ARG, __entry->rssi_event
1319         )
1320 );
1321
1322 TRACE_EVENT(api_scan_completed,
1323         TP_PROTO(struct ieee80211_local *local, bool aborted),
1324
1325         TP_ARGS(local, aborted),
1326
1327         TP_STRUCT__entry(
1328                 LOCAL_ENTRY
1329                 __field(bool, aborted)
1330         ),
1331
1332         TP_fast_assign(
1333                 LOCAL_ASSIGN;
1334                 __entry->aborted = aborted;
1335         ),
1336
1337         TP_printk(
1338                 LOCAL_PR_FMT " aborted:%d",
1339                 LOCAL_PR_ARG, __entry->aborted
1340         )
1341 );
1342
1343 TRACE_EVENT(api_sched_scan_results,
1344         TP_PROTO(struct ieee80211_local *local),
1345
1346         TP_ARGS(local),
1347
1348         TP_STRUCT__entry(
1349                 LOCAL_ENTRY
1350         ),
1351
1352         TP_fast_assign(
1353                 LOCAL_ASSIGN;
1354         ),
1355
1356         TP_printk(
1357                 LOCAL_PR_FMT, LOCAL_PR_ARG
1358         )
1359 );
1360
1361 TRACE_EVENT(api_sched_scan_stopped,
1362         TP_PROTO(struct ieee80211_local *local),
1363
1364         TP_ARGS(local),
1365
1366         TP_STRUCT__entry(
1367                 LOCAL_ENTRY
1368         ),
1369
1370         TP_fast_assign(
1371                 LOCAL_ASSIGN;
1372         ),
1373
1374         TP_printk(
1375                 LOCAL_PR_FMT, LOCAL_PR_ARG
1376         )
1377 );
1378
1379 TRACE_EVENT(api_sta_block_awake,
1380         TP_PROTO(struct ieee80211_local *local,
1381                  struct ieee80211_sta *sta, bool block),
1382
1383         TP_ARGS(local, sta, block),
1384
1385         TP_STRUCT__entry(
1386                 LOCAL_ENTRY
1387                 STA_ENTRY
1388                 __field(bool, block)
1389         ),
1390
1391         TP_fast_assign(
1392                 LOCAL_ASSIGN;
1393                 STA_ASSIGN;
1394                 __entry->block = block;
1395         ),
1396
1397         TP_printk(
1398                 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1399                 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1400         )
1401 );
1402
1403 TRACE_EVENT(api_chswitch_done,
1404         TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1405
1406         TP_ARGS(sdata, success),
1407
1408         TP_STRUCT__entry(
1409                 VIF_ENTRY
1410                 __field(bool, success)
1411         ),
1412
1413         TP_fast_assign(
1414                 VIF_ASSIGN;
1415                 __entry->success = success;
1416         ),
1417
1418         TP_printk(
1419                 VIF_PR_FMT " success=%d",
1420                 VIF_PR_ARG, __entry->success
1421         )
1422 );
1423
1424 DEFINE_EVENT(local_only_evt, api_ready_on_channel,
1425         TP_PROTO(struct ieee80211_local *local),
1426         TP_ARGS(local)
1427 );
1428
1429 DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
1430         TP_PROTO(struct ieee80211_local *local),
1431         TP_ARGS(local)
1432 );
1433
1434 TRACE_EVENT(api_gtk_rekey_notify,
1435         TP_PROTO(struct ieee80211_sub_if_data *sdata,
1436                  const u8 *bssid, const u8 *replay_ctr),
1437
1438         TP_ARGS(sdata, bssid, replay_ctr),
1439
1440         TP_STRUCT__entry(
1441                 VIF_ENTRY
1442                 __array(u8, bssid, ETH_ALEN)
1443                 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1444         ),
1445
1446         TP_fast_assign(
1447                 VIF_ASSIGN;
1448                 memcpy(__entry->bssid, bssid, ETH_ALEN);
1449                 memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
1450         ),
1451
1452         TP_printk(VIF_PR_FMT, VIF_PR_ARG)
1453 );
1454
1455 TRACE_EVENT(api_enable_rssi_reports,
1456         TP_PROTO(struct ieee80211_sub_if_data *sdata,
1457                  int rssi_min_thold, int rssi_max_thold),
1458
1459         TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
1460
1461         TP_STRUCT__entry(
1462                 VIF_ENTRY
1463                 __field(int, rssi_min_thold)
1464                 __field(int, rssi_max_thold)
1465         ),
1466
1467         TP_fast_assign(
1468                 VIF_ASSIGN;
1469                 __entry->rssi_min_thold = rssi_min_thold;
1470                 __entry->rssi_max_thold = rssi_max_thold;
1471         ),
1472
1473         TP_printk(
1474                 VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
1475                 VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
1476         )
1477 );
1478
1479 TRACE_EVENT(api_eosp,
1480         TP_PROTO(struct ieee80211_local *local,
1481                  struct ieee80211_sta *sta),
1482
1483         TP_ARGS(local, sta),
1484
1485         TP_STRUCT__entry(
1486                 LOCAL_ENTRY
1487                 STA_ENTRY
1488         ),
1489
1490         TP_fast_assign(
1491                 LOCAL_ASSIGN;
1492                 STA_ASSIGN;
1493         ),
1494
1495         TP_printk(
1496                 LOCAL_PR_FMT STA_PR_FMT,
1497                 LOCAL_PR_ARG, STA_PR_FMT
1498         )
1499 );
1500
1501 /*
1502  * Tracing for internal functions
1503  * (which may also be called in response to driver calls)
1504  */
1505
1506 TRACE_EVENT(wake_queue,
1507         TP_PROTO(struct ieee80211_local *local, u16 queue,
1508                  enum queue_stop_reason reason),
1509
1510         TP_ARGS(local, queue, reason),
1511
1512         TP_STRUCT__entry(
1513                 LOCAL_ENTRY
1514                 __field(u16, queue)
1515                 __field(u32, reason)
1516         ),
1517
1518         TP_fast_assign(
1519                 LOCAL_ASSIGN;
1520                 __entry->queue = queue;
1521                 __entry->reason = reason;
1522         ),
1523
1524         TP_printk(
1525                 LOCAL_PR_FMT " queue:%d, reason:%d",
1526                 LOCAL_PR_ARG, __entry->queue, __entry->reason
1527         )
1528 );
1529
1530 TRACE_EVENT(stop_queue,
1531         TP_PROTO(struct ieee80211_local *local, u16 queue,
1532                  enum queue_stop_reason reason),
1533
1534         TP_ARGS(local, queue, reason),
1535
1536         TP_STRUCT__entry(
1537                 LOCAL_ENTRY
1538                 __field(u16, queue)
1539                 __field(u32, reason)
1540         ),
1541
1542         TP_fast_assign(
1543                 LOCAL_ASSIGN;
1544                 __entry->queue = queue;
1545                 __entry->reason = reason;
1546         ),
1547
1548         TP_printk(
1549                 LOCAL_PR_FMT " queue:%d, reason:%d",
1550                 LOCAL_PR_ARG, __entry->queue, __entry->reason
1551         )
1552 );
1553 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
1554
1555 #undef TRACE_INCLUDE_PATH
1556 #define TRACE_INCLUDE_PATH .
1557 #undef TRACE_INCLUDE_FILE
1558 #define TRACE_INCLUDE_FILE driver-trace
1559 #include <trace/define_trace.h>