f6f3d89e43faa206a56888b200030e8f3ed151e8
[linux-2.6.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 #if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
9 #undef TRACE_EVENT
10 #define TRACE_EVENT(name, proto, ...) \
11 static inline void trace_ ## name(proto) {}
12 #endif
13
14 #undef TRACE_SYSTEM
15 #define TRACE_SYSTEM mac80211
16
17 #define MAXNAME         32
18 #define LOCAL_ENTRY     __array(char, wiphy_name, 32)
19 #define LOCAL_ASSIGN    strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
20 #define LOCAL_PR_FMT    "%s"
21 #define LOCAL_PR_ARG    __entry->wiphy_name
22
23 #define STA_ENTRY       __array(char, sta_addr, ETH_ALEN)
24 #define STA_ASSIGN      (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
25 #define STA_PR_FMT      " sta:%pM"
26 #define STA_PR_ARG      __entry->sta_addr
27
28 #define VIF_ENTRY       __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
29                         __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
30 #define VIF_ASSIGN      __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
31                         __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
32 #define VIF_PR_FMT      " vif:%s(%d)"
33 #define VIF_PR_ARG      __get_str(vif_name), __entry->vif_type
34
35 /*
36  * Tracing for driver callbacks.
37  */
38
39 TRACE_EVENT(drv_return_void,
40         TP_PROTO(struct ieee80211_local *local),
41         TP_ARGS(local),
42         TP_STRUCT__entry(
43                 LOCAL_ENTRY
44         ),
45         TP_fast_assign(
46                 LOCAL_ASSIGN;
47         ),
48         TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
49 );
50
51 TRACE_EVENT(drv_return_int,
52         TP_PROTO(struct ieee80211_local *local, int ret),
53         TP_ARGS(local, ret),
54         TP_STRUCT__entry(
55                 LOCAL_ENTRY
56                 __field(int, ret)
57         ),
58         TP_fast_assign(
59                 LOCAL_ASSIGN;
60                 __entry->ret = ret;
61         ),
62         TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
63 );
64
65 TRACE_EVENT(drv_return_u64,
66         TP_PROTO(struct ieee80211_local *local, u64 ret),
67         TP_ARGS(local, ret),
68         TP_STRUCT__entry(
69                 LOCAL_ENTRY
70                 __field(u64, ret)
71         ),
72         TP_fast_assign(
73                 LOCAL_ASSIGN;
74                 __entry->ret = ret;
75         ),
76         TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
77 );
78
79 TRACE_EVENT(drv_start,
80         TP_PROTO(struct ieee80211_local *local),
81
82         TP_ARGS(local),
83
84         TP_STRUCT__entry(
85                 LOCAL_ENTRY
86         ),
87
88         TP_fast_assign(
89                 LOCAL_ASSIGN;
90         ),
91
92         TP_printk(
93                 LOCAL_PR_FMT, LOCAL_PR_ARG
94         )
95 );
96
97 TRACE_EVENT(drv_stop,
98         TP_PROTO(struct ieee80211_local *local),
99
100         TP_ARGS(local),
101
102         TP_STRUCT__entry(
103                 LOCAL_ENTRY
104         ),
105
106         TP_fast_assign(
107                 LOCAL_ASSIGN;
108         ),
109
110         TP_printk(
111                 LOCAL_PR_FMT, LOCAL_PR_ARG
112         )
113 );
114
115 TRACE_EVENT(drv_add_interface,
116         TP_PROTO(struct ieee80211_local *local,
117                  struct ieee80211_sub_if_data *sdata),
118
119         TP_ARGS(local, sdata),
120
121         TP_STRUCT__entry(
122                 LOCAL_ENTRY
123                 VIF_ENTRY
124                 __array(char, addr, 6)
125         ),
126
127         TP_fast_assign(
128                 LOCAL_ASSIGN;
129                 VIF_ASSIGN;
130                 memcpy(__entry->addr, sdata->vif.addr, 6);
131         ),
132
133         TP_printk(
134                 LOCAL_PR_FMT  VIF_PR_FMT " addr:%pM",
135                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
136         )
137 );
138
139 TRACE_EVENT(drv_change_interface,
140         TP_PROTO(struct ieee80211_local *local,
141                  struct ieee80211_sub_if_data *sdata,
142                  enum nl80211_iftype type),
143
144         TP_ARGS(local, sdata, type),
145
146         TP_STRUCT__entry(
147                 LOCAL_ENTRY
148                 VIF_ENTRY
149                 __field(u32, new_type)
150         ),
151
152         TP_fast_assign(
153                 LOCAL_ASSIGN;
154                 VIF_ASSIGN;
155                 __entry->new_type = type;
156         ),
157
158         TP_printk(
159                 LOCAL_PR_FMT  VIF_PR_FMT " new type:%d",
160                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type
161         )
162 );
163
164 TRACE_EVENT(drv_remove_interface,
165         TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),
166
167         TP_ARGS(local, sdata),
168
169         TP_STRUCT__entry(
170                 LOCAL_ENTRY
171                 VIF_ENTRY
172                 __array(char, addr, 6)
173         ),
174
175         TP_fast_assign(
176                 LOCAL_ASSIGN;
177                 VIF_ASSIGN;
178                 memcpy(__entry->addr, sdata->vif.addr, 6);
179         ),
180
181         TP_printk(
182                 LOCAL_PR_FMT  VIF_PR_FMT " addr:%pM",
183                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
184         )
185 );
186
187 TRACE_EVENT(drv_config,
188         TP_PROTO(struct ieee80211_local *local,
189                  u32 changed),
190
191         TP_ARGS(local, changed),
192
193         TP_STRUCT__entry(
194                 LOCAL_ENTRY
195                 __field(u32, changed)
196                 __field(u32, flags)
197                 __field(int, power_level)
198                 __field(int, dynamic_ps_timeout)
199                 __field(int, max_sleep_period)
200                 __field(u16, listen_interval)
201                 __field(u8, long_frame_max_tx_count)
202                 __field(u8, short_frame_max_tx_count)
203                 __field(int, center_freq)
204                 __field(int, channel_type)
205                 __field(int, smps)
206         ),
207
208         TP_fast_assign(
209                 LOCAL_ASSIGN;
210                 __entry->changed = changed;
211                 __entry->flags = local->hw.conf.flags;
212                 __entry->power_level = local->hw.conf.power_level;
213                 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
214                 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
215                 __entry->listen_interval = local->hw.conf.listen_interval;
216                 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
217                 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
218                 __entry->center_freq = local->hw.conf.channel->center_freq;
219                 __entry->channel_type = local->hw.conf.channel_type;
220                 __entry->smps = local->hw.conf.smps_mode;
221         ),
222
223         TP_printk(
224                 LOCAL_PR_FMT " ch:%#x freq:%d",
225                 LOCAL_PR_ARG, __entry->changed, __entry->center_freq
226         )
227 );
228
229 TRACE_EVENT(drv_bss_info_changed,
230         TP_PROTO(struct ieee80211_local *local,
231                  struct ieee80211_sub_if_data *sdata,
232                  struct ieee80211_bss_conf *info,
233                  u32 changed),
234
235         TP_ARGS(local, sdata, info, changed),
236
237         TP_STRUCT__entry(
238                 LOCAL_ENTRY
239                 VIF_ENTRY
240                 __field(bool, assoc)
241                 __field(u16, aid)
242                 __field(bool, cts)
243                 __field(bool, shortpre)
244                 __field(bool, shortslot)
245                 __field(u8, dtimper)
246                 __field(u16, bcnint)
247                 __field(u16, assoc_cap)
248                 __field(u64, timestamp)
249                 __field(u32, basic_rates)
250                 __field(u32, changed)
251                 __field(bool, enable_beacon)
252                 __field(u16, ht_operation_mode)
253         ),
254
255         TP_fast_assign(
256                 LOCAL_ASSIGN;
257                 VIF_ASSIGN;
258                 __entry->changed = changed;
259                 __entry->aid = info->aid;
260                 __entry->assoc = info->assoc;
261                 __entry->shortpre = info->use_short_preamble;
262                 __entry->cts = info->use_cts_prot;
263                 __entry->shortslot = info->use_short_slot;
264                 __entry->dtimper = info->dtim_period;
265                 __entry->bcnint = info->beacon_int;
266                 __entry->assoc_cap = info->assoc_capability;
267                 __entry->timestamp = info->timestamp;
268                 __entry->basic_rates = info->basic_rates;
269                 __entry->enable_beacon = info->enable_beacon;
270                 __entry->ht_operation_mode = info->ht_operation_mode;
271         ),
272
273         TP_printk(
274                 LOCAL_PR_FMT  VIF_PR_FMT " changed:%#x",
275                 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
276         )
277 );
278
279 TRACE_EVENT(drv_prepare_multicast,
280         TP_PROTO(struct ieee80211_local *local, int mc_count),
281
282         TP_ARGS(local, mc_count),
283
284         TP_STRUCT__entry(
285                 LOCAL_ENTRY
286                 __field(int, mc_count)
287         ),
288
289         TP_fast_assign(
290                 LOCAL_ASSIGN;
291                 __entry->mc_count = mc_count;
292         ),
293
294         TP_printk(
295                 LOCAL_PR_FMT " prepare mc (%d)",
296                 LOCAL_PR_ARG, __entry->mc_count
297         )
298 );
299
300 TRACE_EVENT(drv_configure_filter,
301         TP_PROTO(struct ieee80211_local *local,
302                  unsigned int changed_flags,
303                  unsigned int *total_flags,
304                  u64 multicast),
305
306         TP_ARGS(local, changed_flags, total_flags, multicast),
307
308         TP_STRUCT__entry(
309                 LOCAL_ENTRY
310                 __field(unsigned int, changed)
311                 __field(unsigned int, total)
312                 __field(u64, multicast)
313         ),
314
315         TP_fast_assign(
316                 LOCAL_ASSIGN;
317                 __entry->changed = changed_flags;
318                 __entry->total = *total_flags;
319                 __entry->multicast = multicast;
320         ),
321
322         TP_printk(
323                 LOCAL_PR_FMT " changed:%#x total:%#x",
324                 LOCAL_PR_ARG, __entry->changed, __entry->total
325         )
326 );
327
328 TRACE_EVENT(drv_set_tim,
329         TP_PROTO(struct ieee80211_local *local,
330                  struct ieee80211_sta *sta, bool set),
331
332         TP_ARGS(local, sta, set),
333
334         TP_STRUCT__entry(
335                 LOCAL_ENTRY
336                 STA_ENTRY
337                 __field(bool, set)
338         ),
339
340         TP_fast_assign(
341                 LOCAL_ASSIGN;
342                 STA_ASSIGN;
343                 __entry->set = set;
344         ),
345
346         TP_printk(
347                 LOCAL_PR_FMT STA_PR_FMT " set:%d",
348                 LOCAL_PR_ARG, STA_PR_FMT, __entry->set
349         )
350 );
351
352 TRACE_EVENT(drv_set_key,
353         TP_PROTO(struct ieee80211_local *local,
354                  enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
355                  struct ieee80211_sta *sta,
356                  struct ieee80211_key_conf *key),
357
358         TP_ARGS(local, cmd, sdata, sta, key),
359
360         TP_STRUCT__entry(
361                 LOCAL_ENTRY
362                 VIF_ENTRY
363                 STA_ENTRY
364                 __field(u32, cipher)
365                 __field(u8, hw_key_idx)
366                 __field(u8, flags)
367                 __field(s8, keyidx)
368         ),
369
370         TP_fast_assign(
371                 LOCAL_ASSIGN;
372                 VIF_ASSIGN;
373                 STA_ASSIGN;
374                 __entry->cipher = key->cipher;
375                 __entry->flags = key->flags;
376                 __entry->keyidx = key->keyidx;
377                 __entry->hw_key_idx = key->hw_key_idx;
378         ),
379
380         TP_printk(
381                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
382                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
383         )
384 );
385
386 TRACE_EVENT(drv_update_tkip_key,
387         TP_PROTO(struct ieee80211_local *local,
388                  struct ieee80211_sub_if_data *sdata,
389                  struct ieee80211_key_conf *conf,
390                  struct ieee80211_sta *sta, u32 iv32),
391
392         TP_ARGS(local, sdata, conf, sta, iv32),
393
394         TP_STRUCT__entry(
395                 LOCAL_ENTRY
396                 VIF_ENTRY
397                 STA_ENTRY
398                 __field(u32, iv32)
399         ),
400
401         TP_fast_assign(
402                 LOCAL_ASSIGN;
403                 VIF_ASSIGN;
404                 STA_ASSIGN;
405                 __entry->iv32 = iv32;
406         ),
407
408         TP_printk(
409                 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
410                 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
411         )
412 );
413
414 TRACE_EVENT(drv_hw_scan,
415         TP_PROTO(struct ieee80211_local *local,
416                  struct ieee80211_sub_if_data *sdata,
417                  struct cfg80211_scan_request *req),
418
419         TP_ARGS(local, sdata, req),
420
421         TP_STRUCT__entry(
422                 LOCAL_ENTRY
423                 VIF_ENTRY
424         ),
425
426         TP_fast_assign(
427                 LOCAL_ASSIGN;
428                 VIF_ASSIGN;
429         ),
430
431         TP_printk(
432                 LOCAL_PR_FMT VIF_PR_FMT,
433                 LOCAL_PR_ARG,VIF_PR_ARG
434         )
435 );
436
437 TRACE_EVENT(drv_sw_scan_start,
438         TP_PROTO(struct ieee80211_local *local),
439
440         TP_ARGS(local),
441
442         TP_STRUCT__entry(
443                 LOCAL_ENTRY
444         ),
445
446         TP_fast_assign(
447                 LOCAL_ASSIGN;
448         ),
449
450         TP_printk(
451                 LOCAL_PR_FMT, LOCAL_PR_ARG
452         )
453 );
454
455 TRACE_EVENT(drv_sw_scan_complete,
456         TP_PROTO(struct ieee80211_local *local),
457
458         TP_ARGS(local),
459
460         TP_STRUCT__entry(
461                 LOCAL_ENTRY
462         ),
463
464         TP_fast_assign(
465                 LOCAL_ASSIGN;
466         ),
467
468         TP_printk(
469                 LOCAL_PR_FMT, LOCAL_PR_ARG
470         )
471 );
472
473 TRACE_EVENT(drv_get_stats,
474         TP_PROTO(struct ieee80211_local *local,
475                  struct ieee80211_low_level_stats *stats,
476                  int ret),
477
478         TP_ARGS(local, stats, ret),
479
480         TP_STRUCT__entry(
481                 LOCAL_ENTRY
482                 __field(int, ret)
483                 __field(unsigned int, ackfail)
484                 __field(unsigned int, rtsfail)
485                 __field(unsigned int, fcserr)
486                 __field(unsigned int, rtssucc)
487         ),
488
489         TP_fast_assign(
490                 LOCAL_ASSIGN;
491                 __entry->ret = ret;
492                 __entry->ackfail = stats->dot11ACKFailureCount;
493                 __entry->rtsfail = stats->dot11RTSFailureCount;
494                 __entry->fcserr = stats->dot11FCSErrorCount;
495                 __entry->rtssucc = stats->dot11RTSSuccessCount;
496         ),
497
498         TP_printk(
499                 LOCAL_PR_FMT " ret:%d",
500                 LOCAL_PR_ARG, __entry->ret
501         )
502 );
503
504 TRACE_EVENT(drv_get_tkip_seq,
505         TP_PROTO(struct ieee80211_local *local,
506                  u8 hw_key_idx, u32 *iv32, u16 *iv16),
507
508         TP_ARGS(local, hw_key_idx, iv32, iv16),
509
510         TP_STRUCT__entry(
511                 LOCAL_ENTRY
512                 __field(u8, hw_key_idx)
513                 __field(u32, iv32)
514                 __field(u16, iv16)
515         ),
516
517         TP_fast_assign(
518                 LOCAL_ASSIGN;
519                 __entry->hw_key_idx = hw_key_idx;
520                 __entry->iv32 = *iv32;
521                 __entry->iv16 = *iv16;
522         ),
523
524         TP_printk(
525                 LOCAL_PR_FMT, LOCAL_PR_ARG
526         )
527 );
528
529 TRACE_EVENT(drv_set_rts_threshold,
530         TP_PROTO(struct ieee80211_local *local, u32 value),
531
532         TP_ARGS(local, value),
533
534         TP_STRUCT__entry(
535                 LOCAL_ENTRY
536                 __field(u32, value)
537         ),
538
539         TP_fast_assign(
540                 LOCAL_ASSIGN;
541                 __entry->value = value;
542         ),
543
544         TP_printk(
545                 LOCAL_PR_FMT " value:%d",
546                 LOCAL_PR_ARG, __entry->value
547         )
548 );
549
550 TRACE_EVENT(drv_set_coverage_class,
551         TP_PROTO(struct ieee80211_local *local, u8 value),
552
553         TP_ARGS(local, value),
554
555         TP_STRUCT__entry(
556                 LOCAL_ENTRY
557                 __field(u8, value)
558         ),
559
560         TP_fast_assign(
561                 LOCAL_ASSIGN;
562                 __entry->value = value;
563         ),
564
565         TP_printk(
566                 LOCAL_PR_FMT " value:%d",
567                 LOCAL_PR_ARG, __entry->value
568         )
569 );
570
571 TRACE_EVENT(drv_sta_notify,
572         TP_PROTO(struct ieee80211_local *local,
573                  struct ieee80211_sub_if_data *sdata,
574                  enum sta_notify_cmd cmd,
575                  struct ieee80211_sta *sta),
576
577         TP_ARGS(local, sdata, cmd, sta),
578
579         TP_STRUCT__entry(
580                 LOCAL_ENTRY
581                 VIF_ENTRY
582                 STA_ENTRY
583                 __field(u32, cmd)
584         ),
585
586         TP_fast_assign(
587                 LOCAL_ASSIGN;
588                 VIF_ASSIGN;
589                 STA_ASSIGN;
590                 __entry->cmd = cmd;
591         ),
592
593         TP_printk(
594                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " cmd:%d",
595                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
596         )
597 );
598
599 TRACE_EVENT(drv_sta_add,
600         TP_PROTO(struct ieee80211_local *local,
601                  struct ieee80211_sub_if_data *sdata,
602                  struct ieee80211_sta *sta),
603
604         TP_ARGS(local, sdata, sta),
605
606         TP_STRUCT__entry(
607                 LOCAL_ENTRY
608                 VIF_ENTRY
609                 STA_ENTRY
610         ),
611
612         TP_fast_assign(
613                 LOCAL_ASSIGN;
614                 VIF_ASSIGN;
615                 STA_ASSIGN;
616         ),
617
618         TP_printk(
619                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
620                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
621         )
622 );
623
624 TRACE_EVENT(drv_sta_remove,
625         TP_PROTO(struct ieee80211_local *local,
626                  struct ieee80211_sub_if_data *sdata,
627                  struct ieee80211_sta *sta),
628
629         TP_ARGS(local, sdata, sta),
630
631         TP_STRUCT__entry(
632                 LOCAL_ENTRY
633                 VIF_ENTRY
634                 STA_ENTRY
635         ),
636
637         TP_fast_assign(
638                 LOCAL_ASSIGN;
639                 VIF_ASSIGN;
640                 STA_ASSIGN;
641         ),
642
643         TP_printk(
644                 LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
645                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
646         )
647 );
648
649 TRACE_EVENT(drv_conf_tx,
650         TP_PROTO(struct ieee80211_local *local, u16 queue,
651                  const struct ieee80211_tx_queue_params *params),
652
653         TP_ARGS(local, queue, params),
654
655         TP_STRUCT__entry(
656                 LOCAL_ENTRY
657                 __field(u16, queue)
658                 __field(u16, txop)
659                 __field(u16, cw_min)
660                 __field(u16, cw_max)
661                 __field(u8, aifs)
662         ),
663
664         TP_fast_assign(
665                 LOCAL_ASSIGN;
666                 __entry->queue = queue;
667                 __entry->txop = params->txop;
668                 __entry->cw_max = params->cw_max;
669                 __entry->cw_min = params->cw_min;
670                 __entry->aifs = params->aifs;
671         ),
672
673         TP_printk(
674                 LOCAL_PR_FMT " queue:%d",
675                 LOCAL_PR_ARG, __entry->queue
676         )
677 );
678
679 TRACE_EVENT(drv_get_tsf,
680         TP_PROTO(struct ieee80211_local *local),
681
682         TP_ARGS(local),
683
684         TP_STRUCT__entry(
685                 LOCAL_ENTRY
686         ),
687
688         TP_fast_assign(
689                 LOCAL_ASSIGN;
690         ),
691
692         TP_printk(
693                 LOCAL_PR_FMT,
694                 LOCAL_PR_ARG
695         )
696 );
697
698 TRACE_EVENT(drv_set_tsf,
699         TP_PROTO(struct ieee80211_local *local, u64 tsf),
700
701         TP_ARGS(local, tsf),
702
703         TP_STRUCT__entry(
704                 LOCAL_ENTRY
705                 __field(u64, tsf)
706         ),
707
708         TP_fast_assign(
709                 LOCAL_ASSIGN;
710                 __entry->tsf = tsf;
711         ),
712
713         TP_printk(
714                 LOCAL_PR_FMT " tsf:%llu",
715                 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
716         )
717 );
718
719 TRACE_EVENT(drv_reset_tsf,
720         TP_PROTO(struct ieee80211_local *local),
721
722         TP_ARGS(local),
723
724         TP_STRUCT__entry(
725                 LOCAL_ENTRY
726         ),
727
728         TP_fast_assign(
729                 LOCAL_ASSIGN;
730         ),
731
732         TP_printk(
733                 LOCAL_PR_FMT, LOCAL_PR_ARG
734         )
735 );
736
737 TRACE_EVENT(drv_tx_last_beacon,
738         TP_PROTO(struct ieee80211_local *local),
739
740         TP_ARGS(local),
741
742         TP_STRUCT__entry(
743                 LOCAL_ENTRY
744         ),
745
746         TP_fast_assign(
747                 LOCAL_ASSIGN;
748         ),
749
750         TP_printk(
751                 LOCAL_PR_FMT,
752                 LOCAL_PR_ARG
753         )
754 );
755
756 TRACE_EVENT(drv_ampdu_action,
757         TP_PROTO(struct ieee80211_local *local,
758                  struct ieee80211_sub_if_data *sdata,
759                  enum ieee80211_ampdu_mlme_action action,
760                  struct ieee80211_sta *sta, u16 tid,
761                  u16 *ssn),
762
763         TP_ARGS(local, sdata, action, sta, tid, ssn),
764
765         TP_STRUCT__entry(
766                 LOCAL_ENTRY
767                 STA_ENTRY
768                 __field(u32, action)
769                 __field(u16, tid)
770                 __field(u16, ssn)
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         ),
782
783         TP_printk(
784                 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d",
785                 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid
786         )
787 );
788
789 TRACE_EVENT(drv_get_survey,
790         TP_PROTO(struct ieee80211_local *local, int idx,
791                  struct survey_info *survey),
792
793         TP_ARGS(local, idx, survey),
794
795         TP_STRUCT__entry(
796                 LOCAL_ENTRY
797                 __field(int, idx)
798         ),
799
800         TP_fast_assign(
801                 LOCAL_ASSIGN;
802                 __entry->idx = idx;
803         ),
804
805         TP_printk(
806                 LOCAL_PR_FMT " idx:%d",
807                 LOCAL_PR_ARG, __entry->idx
808         )
809 );
810
811 TRACE_EVENT(drv_flush,
812         TP_PROTO(struct ieee80211_local *local, bool drop),
813
814         TP_ARGS(local, drop),
815
816         TP_STRUCT__entry(
817                 LOCAL_ENTRY
818                 __field(bool, drop)
819         ),
820
821         TP_fast_assign(
822                 LOCAL_ASSIGN;
823                 __entry->drop = drop;
824         ),
825
826         TP_printk(
827                 LOCAL_PR_FMT " drop:%d",
828                 LOCAL_PR_ARG, __entry->drop
829         )
830 );
831
832 TRACE_EVENT(drv_channel_switch,
833         TP_PROTO(struct ieee80211_local *local,
834                  struct ieee80211_channel_switch *ch_switch),
835
836         TP_ARGS(local, ch_switch),
837
838         TP_STRUCT__entry(
839                 LOCAL_ENTRY
840                 __field(u64, timestamp)
841                 __field(bool, block_tx)
842                 __field(u16, freq)
843                 __field(u8, count)
844         ),
845
846         TP_fast_assign(
847                 LOCAL_ASSIGN;
848                 __entry->timestamp = ch_switch->timestamp;
849                 __entry->block_tx = ch_switch->block_tx;
850                 __entry->freq = ch_switch->channel->center_freq;
851                 __entry->count = ch_switch->count;
852         ),
853
854         TP_printk(
855                 LOCAL_PR_FMT " new freq:%u count:%d",
856                 LOCAL_PR_ARG, __entry->freq, __entry->count
857         )
858 );
859
860 /*
861  * Tracing for API calls that drivers call.
862  */
863
864 TRACE_EVENT(api_start_tx_ba_session,
865         TP_PROTO(struct ieee80211_sta *sta, u16 tid),
866
867         TP_ARGS(sta, tid),
868
869         TP_STRUCT__entry(
870                 STA_ENTRY
871                 __field(u16, tid)
872         ),
873
874         TP_fast_assign(
875                 STA_ASSIGN;
876                 __entry->tid = tid;
877         ),
878
879         TP_printk(
880                 STA_PR_FMT " tid:%d",
881                 STA_PR_ARG, __entry->tid
882         )
883 );
884
885 TRACE_EVENT(api_start_tx_ba_cb,
886         TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
887
888         TP_ARGS(sdata, ra, tid),
889
890         TP_STRUCT__entry(
891                 VIF_ENTRY
892                 __array(u8, ra, ETH_ALEN)
893                 __field(u16, tid)
894         ),
895
896         TP_fast_assign(
897                 VIF_ASSIGN;
898                 memcpy(__entry->ra, ra, ETH_ALEN);
899                 __entry->tid = tid;
900         ),
901
902         TP_printk(
903                 VIF_PR_FMT " ra:%pM tid:%d",
904                 VIF_PR_ARG, __entry->ra, __entry->tid
905         )
906 );
907
908 TRACE_EVENT(api_stop_tx_ba_session,
909         TP_PROTO(struct ieee80211_sta *sta, u16 tid),
910
911         TP_ARGS(sta, tid),
912
913         TP_STRUCT__entry(
914                 STA_ENTRY
915                 __field(u16, tid)
916         ),
917
918         TP_fast_assign(
919                 STA_ASSIGN;
920                 __entry->tid = tid;
921         ),
922
923         TP_printk(
924                 STA_PR_FMT " tid:%d",
925                 STA_PR_ARG, __entry->tid
926         )
927 );
928
929 TRACE_EVENT(api_stop_tx_ba_cb,
930         TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
931
932         TP_ARGS(sdata, ra, tid),
933
934         TP_STRUCT__entry(
935                 VIF_ENTRY
936                 __array(u8, ra, ETH_ALEN)
937                 __field(u16, tid)
938         ),
939
940         TP_fast_assign(
941                 VIF_ASSIGN;
942                 memcpy(__entry->ra, ra, ETH_ALEN);
943                 __entry->tid = tid;
944         ),
945
946         TP_printk(
947                 VIF_PR_FMT " ra:%pM tid:%d",
948                 VIF_PR_ARG, __entry->ra, __entry->tid
949         )
950 );
951
952 TRACE_EVENT(api_restart_hw,
953         TP_PROTO(struct ieee80211_local *local),
954
955         TP_ARGS(local),
956
957         TP_STRUCT__entry(
958                 LOCAL_ENTRY
959         ),
960
961         TP_fast_assign(
962                 LOCAL_ASSIGN;
963         ),
964
965         TP_printk(
966                 LOCAL_PR_FMT,
967                 LOCAL_PR_ARG
968         )
969 );
970
971 TRACE_EVENT(api_beacon_loss,
972         TP_PROTO(struct ieee80211_sub_if_data *sdata),
973
974         TP_ARGS(sdata),
975
976         TP_STRUCT__entry(
977                 VIF_ENTRY
978         ),
979
980         TP_fast_assign(
981                 VIF_ASSIGN;
982         ),
983
984         TP_printk(
985                 VIF_PR_FMT,
986                 VIF_PR_ARG
987         )
988 );
989
990 TRACE_EVENT(api_connection_loss,
991         TP_PROTO(struct ieee80211_sub_if_data *sdata),
992
993         TP_ARGS(sdata),
994
995         TP_STRUCT__entry(
996                 VIF_ENTRY
997         ),
998
999         TP_fast_assign(
1000                 VIF_ASSIGN;
1001         ),
1002
1003         TP_printk(
1004                 VIF_PR_FMT,
1005                 VIF_PR_ARG
1006         )
1007 );
1008
1009 TRACE_EVENT(api_cqm_rssi_notify,
1010         TP_PROTO(struct ieee80211_sub_if_data *sdata,
1011                  enum nl80211_cqm_rssi_threshold_event rssi_event),
1012
1013         TP_ARGS(sdata, rssi_event),
1014
1015         TP_STRUCT__entry(
1016                 VIF_ENTRY
1017                 __field(u32, rssi_event)
1018         ),
1019
1020         TP_fast_assign(
1021                 VIF_ASSIGN;
1022                 __entry->rssi_event = rssi_event;
1023         ),
1024
1025         TP_printk(
1026                 VIF_PR_FMT " event:%d",
1027                 VIF_PR_ARG, __entry->rssi_event
1028         )
1029 );
1030
1031 TRACE_EVENT(api_scan_completed,
1032         TP_PROTO(struct ieee80211_local *local, bool aborted),
1033
1034         TP_ARGS(local, aborted),
1035
1036         TP_STRUCT__entry(
1037                 LOCAL_ENTRY
1038                 __field(bool, aborted)
1039         ),
1040
1041         TP_fast_assign(
1042                 LOCAL_ASSIGN;
1043                 __entry->aborted = aborted;
1044         ),
1045
1046         TP_printk(
1047                 LOCAL_PR_FMT " aborted:%d",
1048                 LOCAL_PR_ARG, __entry->aborted
1049         )
1050 );
1051
1052 TRACE_EVENT(api_sta_block_awake,
1053         TP_PROTO(struct ieee80211_local *local,
1054                  struct ieee80211_sta *sta, bool block),
1055
1056         TP_ARGS(local, sta, block),
1057
1058         TP_STRUCT__entry(
1059                 LOCAL_ENTRY
1060                 STA_ENTRY
1061                 __field(bool, block)
1062         ),
1063
1064         TP_fast_assign(
1065                 LOCAL_ASSIGN;
1066                 STA_ASSIGN;
1067                 __entry->block = block;
1068         ),
1069
1070         TP_printk(
1071                 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1072                 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1073         )
1074 );
1075
1076 TRACE_EVENT(api_chswitch_done,
1077         TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1078
1079         TP_ARGS(sdata, success),
1080
1081         TP_STRUCT__entry(
1082                 VIF_ENTRY
1083                 __field(bool, success)
1084         ),
1085
1086         TP_fast_assign(
1087                 VIF_ASSIGN;
1088                 __entry->success = success;
1089         ),
1090
1091         TP_printk(
1092                 VIF_PR_FMT " success=%d",
1093                 VIF_PR_ARG, __entry->success
1094         )
1095 );
1096
1097 /*
1098  * Tracing for internal functions
1099  * (which may also be called in response to driver calls)
1100  */
1101
1102 TRACE_EVENT(wake_queue,
1103         TP_PROTO(struct ieee80211_local *local, u16 queue,
1104                  enum queue_stop_reason reason),
1105
1106         TP_ARGS(local, queue, reason),
1107
1108         TP_STRUCT__entry(
1109                 LOCAL_ENTRY
1110                 __field(u16, queue)
1111                 __field(u32, reason)
1112         ),
1113
1114         TP_fast_assign(
1115                 LOCAL_ASSIGN;
1116                 __entry->queue = queue;
1117                 __entry->reason = reason;
1118         ),
1119
1120         TP_printk(
1121                 LOCAL_PR_FMT " queue:%d, reason:%d",
1122                 LOCAL_PR_ARG, __entry->queue, __entry->reason
1123         )
1124 );
1125
1126 TRACE_EVENT(stop_queue,
1127         TP_PROTO(struct ieee80211_local *local, u16 queue,
1128                  enum queue_stop_reason reason),
1129
1130         TP_ARGS(local, queue, reason),
1131
1132         TP_STRUCT__entry(
1133                 LOCAL_ENTRY
1134                 __field(u16, queue)
1135                 __field(u32, reason)
1136         ),
1137
1138         TP_fast_assign(
1139                 LOCAL_ASSIGN;
1140                 __entry->queue = queue;
1141                 __entry->reason = reason;
1142         ),
1143
1144         TP_printk(
1145                 LOCAL_PR_FMT " queue:%d, reason:%d",
1146                 LOCAL_PR_ARG, __entry->queue, __entry->reason
1147         )
1148 );
1149 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
1150
1151 #undef TRACE_INCLUDE_PATH
1152 #define TRACE_INCLUDE_PATH .
1153 #undef TRACE_INCLUDE_FILE
1154 #define TRACE_INCLUDE_FILE driver-trace
1155 #include <trace/define_trace.h>