spi-topcliff-pch: Fix issue for transmitting over 4KByte
[zen-stable.git] / net / mac80211 / driver-trace.h
blob6e9df8fd8fb8c7d04e2d834232152a0377952823
1 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __MAC80211_DRIVER_TRACE
4 #include <linux/tracepoint.h>
5 #include <net/mac80211.h>
6 #include "ieee80211_i.h"
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM mac80211
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
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
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" : ""
32 * Tracing for driver callbacks.
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
41 TP_fast_assign(
42 LOCAL_ASSIGN;
44 TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
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),
52 TP_STRUCT__entry(
53 LOCAL_ENTRY
54 VIF_ENTRY
55 __array(char, addr, 6)
58 TP_fast_assign(
59 LOCAL_ASSIGN;
60 VIF_ASSIGN;
61 memcpy(__entry->addr, sdata->vif.addr, 6);
64 TP_printk(
65 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
66 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
70 DECLARE_EVENT_CLASS(local_u32_evt,
71 TP_PROTO(struct ieee80211_local *local, u32 value),
72 TP_ARGS(local, value),
74 TP_STRUCT__entry(
75 LOCAL_ENTRY
76 __field(u32, value)
79 TP_fast_assign(
80 LOCAL_ASSIGN;
81 __entry->value = value;
84 TP_printk(
85 LOCAL_PR_FMT " value:%d",
86 LOCAL_PR_ARG, __entry->value
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),
95 TP_STRUCT__entry(
96 LOCAL_ENTRY
97 VIF_ENTRY
100 TP_fast_assign(
101 LOCAL_ASSIGN;
102 VIF_ASSIGN;
105 TP_printk(
106 LOCAL_PR_FMT VIF_PR_FMT,
107 LOCAL_PR_ARG, VIF_PR_ARG
111 DEFINE_EVENT(local_only_evt, drv_return_void,
112 TP_PROTO(struct ieee80211_local *local),
113 TP_ARGS(local)
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)
123 TP_fast_assign(
124 LOCAL_ASSIGN;
125 __entry->ret = ret;
127 TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
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)
137 TP_fast_assign(
138 LOCAL_ASSIGN;
139 __entry->ret = ret;
141 TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
142 "true" : "false")
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)
152 TP_fast_assign(
153 LOCAL_ASSIGN;
154 __entry->ret = ret;
156 TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
159 DEFINE_EVENT(local_only_evt, drv_start,
160 TP_PROTO(struct ieee80211_local *local),
161 TP_ARGS(local)
164 DEFINE_EVENT(local_only_evt, drv_suspend,
165 TP_PROTO(struct ieee80211_local *local),
166 TP_ARGS(local)
169 DEFINE_EVENT(local_only_evt, drv_resume,
170 TP_PROTO(struct ieee80211_local *local),
171 TP_ARGS(local)
174 DEFINE_EVENT(local_only_evt, drv_stop,
175 TP_PROTO(struct ieee80211_local *local),
176 TP_ARGS(local)
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)
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),
190 TP_ARGS(local, sdata, type, p2p),
192 TP_STRUCT__entry(
193 LOCAL_ENTRY
194 VIF_ENTRY
195 __field(u32, new_type)
196 __field(bool, new_p2p)
199 TP_fast_assign(
200 LOCAL_ASSIGN;
201 VIF_ASSIGN;
202 __entry->new_type = type;
203 __entry->new_p2p = p2p;
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" : ""
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)
219 TRACE_EVENT(drv_config,
220 TP_PROTO(struct ieee80211_local *local,
221 u32 changed),
223 TP_ARGS(local, changed),
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)
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;
255 TP_printk(
256 LOCAL_PR_FMT " ch:%#x freq:%d",
257 LOCAL_PR_ARG, __entry->changed, __entry->center_freq
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),
267 TP_ARGS(local, sdata, info, changed),
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)
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->timestamp;
300 __entry->basic_rates = info->basic_rates;
301 __entry->enable_beacon = info->enable_beacon;
302 __entry->ht_operation_mode = info->ht_operation_mode;
305 TP_printk(
306 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
307 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
311 DECLARE_EVENT_CLASS(tx_sync_evt,
312 TP_PROTO(struct ieee80211_local *local,
313 struct ieee80211_sub_if_data *sdata,
314 const u8 *bssid,
315 enum ieee80211_tx_sync_type type),
316 TP_ARGS(local, sdata, bssid, type),
318 TP_STRUCT__entry(
319 LOCAL_ENTRY
320 VIF_ENTRY
321 __array(char, bssid, ETH_ALEN)
322 __field(u32, sync_type)
325 TP_fast_assign(
326 LOCAL_ASSIGN;
327 VIF_ASSIGN;
328 memcpy(__entry->bssid, bssid, ETH_ALEN);
329 __entry->sync_type = type;
332 TP_printk(
333 LOCAL_PR_FMT VIF_PR_FMT " bssid:%pM type:%d",
334 LOCAL_PR_ARG, VIF_PR_ARG, __entry->bssid, __entry->sync_type
338 DEFINE_EVENT(tx_sync_evt, drv_tx_sync,
339 TP_PROTO(struct ieee80211_local *local,
340 struct ieee80211_sub_if_data *sdata,
341 const u8 *bssid,
342 enum ieee80211_tx_sync_type type),
343 TP_ARGS(local, sdata, bssid, type)
346 DEFINE_EVENT(tx_sync_evt, drv_finish_tx_sync,
347 TP_PROTO(struct ieee80211_local *local,
348 struct ieee80211_sub_if_data *sdata,
349 const u8 *bssid,
350 enum ieee80211_tx_sync_type type),
351 TP_ARGS(local, sdata, bssid, type)
354 TRACE_EVENT(drv_prepare_multicast,
355 TP_PROTO(struct ieee80211_local *local, int mc_count),
357 TP_ARGS(local, mc_count),
359 TP_STRUCT__entry(
360 LOCAL_ENTRY
361 __field(int, mc_count)
364 TP_fast_assign(
365 LOCAL_ASSIGN;
366 __entry->mc_count = mc_count;
369 TP_printk(
370 LOCAL_PR_FMT " prepare mc (%d)",
371 LOCAL_PR_ARG, __entry->mc_count
375 TRACE_EVENT(drv_configure_filter,
376 TP_PROTO(struct ieee80211_local *local,
377 unsigned int changed_flags,
378 unsigned int *total_flags,
379 u64 multicast),
381 TP_ARGS(local, changed_flags, total_flags, multicast),
383 TP_STRUCT__entry(
384 LOCAL_ENTRY
385 __field(unsigned int, changed)
386 __field(unsigned int, total)
387 __field(u64, multicast)
390 TP_fast_assign(
391 LOCAL_ASSIGN;
392 __entry->changed = changed_flags;
393 __entry->total = *total_flags;
394 __entry->multicast = multicast;
397 TP_printk(
398 LOCAL_PR_FMT " changed:%#x total:%#x",
399 LOCAL_PR_ARG, __entry->changed, __entry->total
403 TRACE_EVENT(drv_set_tim,
404 TP_PROTO(struct ieee80211_local *local,
405 struct ieee80211_sta *sta, bool set),
407 TP_ARGS(local, sta, set),
409 TP_STRUCT__entry(
410 LOCAL_ENTRY
411 STA_ENTRY
412 __field(bool, set)
415 TP_fast_assign(
416 LOCAL_ASSIGN;
417 STA_ASSIGN;
418 __entry->set = set;
421 TP_printk(
422 LOCAL_PR_FMT STA_PR_FMT " set:%d",
423 LOCAL_PR_ARG, STA_PR_FMT, __entry->set
427 TRACE_EVENT(drv_set_key,
428 TP_PROTO(struct ieee80211_local *local,
429 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
430 struct ieee80211_sta *sta,
431 struct ieee80211_key_conf *key),
433 TP_ARGS(local, cmd, sdata, sta, key),
435 TP_STRUCT__entry(
436 LOCAL_ENTRY
437 VIF_ENTRY
438 STA_ENTRY
439 __field(u32, cipher)
440 __field(u8, hw_key_idx)
441 __field(u8, flags)
442 __field(s8, keyidx)
445 TP_fast_assign(
446 LOCAL_ASSIGN;
447 VIF_ASSIGN;
448 STA_ASSIGN;
449 __entry->cipher = key->cipher;
450 __entry->flags = key->flags;
451 __entry->keyidx = key->keyidx;
452 __entry->hw_key_idx = key->hw_key_idx;
455 TP_printk(
456 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
457 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
461 TRACE_EVENT(drv_update_tkip_key,
462 TP_PROTO(struct ieee80211_local *local,
463 struct ieee80211_sub_if_data *sdata,
464 struct ieee80211_key_conf *conf,
465 struct ieee80211_sta *sta, u32 iv32),
467 TP_ARGS(local, sdata, conf, sta, iv32),
469 TP_STRUCT__entry(
470 LOCAL_ENTRY
471 VIF_ENTRY
472 STA_ENTRY
473 __field(u32, iv32)
476 TP_fast_assign(
477 LOCAL_ASSIGN;
478 VIF_ASSIGN;
479 STA_ASSIGN;
480 __entry->iv32 = iv32;
483 TP_printk(
484 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
485 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
489 DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
490 TP_PROTO(struct ieee80211_local *local,
491 struct ieee80211_sub_if_data *sdata),
492 TP_ARGS(local, sdata)
495 DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
496 TP_PROTO(struct ieee80211_local *local,
497 struct ieee80211_sub_if_data *sdata),
498 TP_ARGS(local, sdata)
501 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
502 TP_PROTO(struct ieee80211_local *local,
503 struct ieee80211_sub_if_data *sdata),
504 TP_ARGS(local, sdata)
507 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
508 TP_PROTO(struct ieee80211_local *local,
509 struct ieee80211_sub_if_data *sdata),
510 TP_ARGS(local, sdata)
513 DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
514 TP_PROTO(struct ieee80211_local *local),
515 TP_ARGS(local)
518 DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
519 TP_PROTO(struct ieee80211_local *local),
520 TP_ARGS(local)
523 TRACE_EVENT(drv_get_stats,
524 TP_PROTO(struct ieee80211_local *local,
525 struct ieee80211_low_level_stats *stats,
526 int ret),
528 TP_ARGS(local, stats, ret),
530 TP_STRUCT__entry(
531 LOCAL_ENTRY
532 __field(int, ret)
533 __field(unsigned int, ackfail)
534 __field(unsigned int, rtsfail)
535 __field(unsigned int, fcserr)
536 __field(unsigned int, rtssucc)
539 TP_fast_assign(
540 LOCAL_ASSIGN;
541 __entry->ret = ret;
542 __entry->ackfail = stats->dot11ACKFailureCount;
543 __entry->rtsfail = stats->dot11RTSFailureCount;
544 __entry->fcserr = stats->dot11FCSErrorCount;
545 __entry->rtssucc = stats->dot11RTSSuccessCount;
548 TP_printk(
549 LOCAL_PR_FMT " ret:%d",
550 LOCAL_PR_ARG, __entry->ret
554 TRACE_EVENT(drv_get_tkip_seq,
555 TP_PROTO(struct ieee80211_local *local,
556 u8 hw_key_idx, u32 *iv32, u16 *iv16),
558 TP_ARGS(local, hw_key_idx, iv32, iv16),
560 TP_STRUCT__entry(
561 LOCAL_ENTRY
562 __field(u8, hw_key_idx)
563 __field(u32, iv32)
564 __field(u16, iv16)
567 TP_fast_assign(
568 LOCAL_ASSIGN;
569 __entry->hw_key_idx = hw_key_idx;
570 __entry->iv32 = *iv32;
571 __entry->iv16 = *iv16;
574 TP_printk(
575 LOCAL_PR_FMT, LOCAL_PR_ARG
579 DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
580 TP_PROTO(struct ieee80211_local *local, u32 value),
581 TP_ARGS(local, value)
584 DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
585 TP_PROTO(struct ieee80211_local *local, u32 value),
586 TP_ARGS(local, value)
589 TRACE_EVENT(drv_set_coverage_class,
590 TP_PROTO(struct ieee80211_local *local, u8 value),
592 TP_ARGS(local, value),
594 TP_STRUCT__entry(
595 LOCAL_ENTRY
596 __field(u8, value)
599 TP_fast_assign(
600 LOCAL_ASSIGN;
601 __entry->value = value;
604 TP_printk(
605 LOCAL_PR_FMT " value:%d",
606 LOCAL_PR_ARG, __entry->value
610 TRACE_EVENT(drv_sta_notify,
611 TP_PROTO(struct ieee80211_local *local,
612 struct ieee80211_sub_if_data *sdata,
613 enum sta_notify_cmd cmd,
614 struct ieee80211_sta *sta),
616 TP_ARGS(local, sdata, cmd, sta),
618 TP_STRUCT__entry(
619 LOCAL_ENTRY
620 VIF_ENTRY
621 STA_ENTRY
622 __field(u32, cmd)
625 TP_fast_assign(
626 LOCAL_ASSIGN;
627 VIF_ASSIGN;
628 STA_ASSIGN;
629 __entry->cmd = cmd;
632 TP_printk(
633 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
634 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
638 TRACE_EVENT(drv_sta_add,
639 TP_PROTO(struct ieee80211_local *local,
640 struct ieee80211_sub_if_data *sdata,
641 struct ieee80211_sta *sta),
643 TP_ARGS(local, sdata, sta),
645 TP_STRUCT__entry(
646 LOCAL_ENTRY
647 VIF_ENTRY
648 STA_ENTRY
651 TP_fast_assign(
652 LOCAL_ASSIGN;
653 VIF_ASSIGN;
654 STA_ASSIGN;
657 TP_printk(
658 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
659 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
663 TRACE_EVENT(drv_sta_remove,
664 TP_PROTO(struct ieee80211_local *local,
665 struct ieee80211_sub_if_data *sdata,
666 struct ieee80211_sta *sta),
668 TP_ARGS(local, sdata, sta),
670 TP_STRUCT__entry(
671 LOCAL_ENTRY
672 VIF_ENTRY
673 STA_ENTRY
676 TP_fast_assign(
677 LOCAL_ASSIGN;
678 VIF_ASSIGN;
679 STA_ASSIGN;
682 TP_printk(
683 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
684 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
688 TRACE_EVENT(drv_conf_tx,
689 TP_PROTO(struct ieee80211_local *local,
690 struct ieee80211_sub_if_data *sdata,
691 u16 queue,
692 const struct ieee80211_tx_queue_params *params),
694 TP_ARGS(local, sdata, queue, params),
696 TP_STRUCT__entry(
697 LOCAL_ENTRY
698 VIF_ENTRY
699 __field(u16, queue)
700 __field(u16, txop)
701 __field(u16, cw_min)
702 __field(u16, cw_max)
703 __field(u8, aifs)
704 __field(bool, uapsd)
707 TP_fast_assign(
708 LOCAL_ASSIGN;
709 VIF_ASSIGN;
710 __entry->queue = queue;
711 __entry->txop = params->txop;
712 __entry->cw_max = params->cw_max;
713 __entry->cw_min = params->cw_min;
714 __entry->aifs = params->aifs;
715 __entry->uapsd = params->uapsd;
718 TP_printk(
719 LOCAL_PR_FMT VIF_PR_FMT " queue:%d",
720 LOCAL_PR_ARG, VIF_PR_ARG, __entry->queue
724 DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
725 TP_PROTO(struct ieee80211_local *local,
726 struct ieee80211_sub_if_data *sdata),
727 TP_ARGS(local, sdata)
730 TRACE_EVENT(drv_set_tsf,
731 TP_PROTO(struct ieee80211_local *local,
732 struct ieee80211_sub_if_data *sdata,
733 u64 tsf),
735 TP_ARGS(local, sdata, tsf),
737 TP_STRUCT__entry(
738 LOCAL_ENTRY
739 VIF_ENTRY
740 __field(u64, tsf)
743 TP_fast_assign(
744 LOCAL_ASSIGN;
745 VIF_ASSIGN;
746 __entry->tsf = tsf;
749 TP_printk(
750 LOCAL_PR_FMT VIF_PR_FMT " tsf:%llu",
751 LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
755 DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
756 TP_PROTO(struct ieee80211_local *local,
757 struct ieee80211_sub_if_data *sdata),
758 TP_ARGS(local, sdata)
761 DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
762 TP_PROTO(struct ieee80211_local *local),
763 TP_ARGS(local)
766 TRACE_EVENT(drv_ampdu_action,
767 TP_PROTO(struct ieee80211_local *local,
768 struct ieee80211_sub_if_data *sdata,
769 enum ieee80211_ampdu_mlme_action action,
770 struct ieee80211_sta *sta, u16 tid,
771 u16 *ssn, u8 buf_size),
773 TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
775 TP_STRUCT__entry(
776 LOCAL_ENTRY
777 STA_ENTRY
778 __field(u32, action)
779 __field(u16, tid)
780 __field(u16, ssn)
781 __field(u8, buf_size)
782 VIF_ENTRY
785 TP_fast_assign(
786 LOCAL_ASSIGN;
787 VIF_ASSIGN;
788 STA_ASSIGN;
789 __entry->action = action;
790 __entry->tid = tid;
791 __entry->ssn = ssn ? *ssn : 0;
792 __entry->buf_size = buf_size;
795 TP_printk(
796 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
797 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
798 __entry->tid, __entry->buf_size
802 TRACE_EVENT(drv_get_survey,
803 TP_PROTO(struct ieee80211_local *local, int idx,
804 struct survey_info *survey),
806 TP_ARGS(local, idx, survey),
808 TP_STRUCT__entry(
809 LOCAL_ENTRY
810 __field(int, idx)
813 TP_fast_assign(
814 LOCAL_ASSIGN;
815 __entry->idx = idx;
818 TP_printk(
819 LOCAL_PR_FMT " idx:%d",
820 LOCAL_PR_ARG, __entry->idx
824 TRACE_EVENT(drv_flush,
825 TP_PROTO(struct ieee80211_local *local, bool drop),
827 TP_ARGS(local, drop),
829 TP_STRUCT__entry(
830 LOCAL_ENTRY
831 __field(bool, drop)
834 TP_fast_assign(
835 LOCAL_ASSIGN;
836 __entry->drop = drop;
839 TP_printk(
840 LOCAL_PR_FMT " drop:%d",
841 LOCAL_PR_ARG, __entry->drop
845 TRACE_EVENT(drv_channel_switch,
846 TP_PROTO(struct ieee80211_local *local,
847 struct ieee80211_channel_switch *ch_switch),
849 TP_ARGS(local, ch_switch),
851 TP_STRUCT__entry(
852 LOCAL_ENTRY
853 __field(u64, timestamp)
854 __field(bool, block_tx)
855 __field(u16, freq)
856 __field(u8, count)
859 TP_fast_assign(
860 LOCAL_ASSIGN;
861 __entry->timestamp = ch_switch->timestamp;
862 __entry->block_tx = ch_switch->block_tx;
863 __entry->freq = ch_switch->channel->center_freq;
864 __entry->count = ch_switch->count;
867 TP_printk(
868 LOCAL_PR_FMT " new freq:%u count:%d",
869 LOCAL_PR_ARG, __entry->freq, __entry->count
873 TRACE_EVENT(drv_set_antenna,
874 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
876 TP_ARGS(local, tx_ant, rx_ant, ret),
878 TP_STRUCT__entry(
879 LOCAL_ENTRY
880 __field(u32, tx_ant)
881 __field(u32, rx_ant)
882 __field(int, ret)
885 TP_fast_assign(
886 LOCAL_ASSIGN;
887 __entry->tx_ant = tx_ant;
888 __entry->rx_ant = rx_ant;
889 __entry->ret = ret;
892 TP_printk(
893 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
894 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
898 TRACE_EVENT(drv_get_antenna,
899 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
901 TP_ARGS(local, tx_ant, rx_ant, ret),
903 TP_STRUCT__entry(
904 LOCAL_ENTRY
905 __field(u32, tx_ant)
906 __field(u32, rx_ant)
907 __field(int, ret)
910 TP_fast_assign(
911 LOCAL_ASSIGN;
912 __entry->tx_ant = tx_ant;
913 __entry->rx_ant = rx_ant;
914 __entry->ret = ret;
917 TP_printk(
918 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
919 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
923 TRACE_EVENT(drv_remain_on_channel,
924 TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
925 enum nl80211_channel_type chantype, unsigned int duration),
927 TP_ARGS(local, chan, chantype, duration),
929 TP_STRUCT__entry(
930 LOCAL_ENTRY
931 __field(int, center_freq)
932 __field(int, channel_type)
933 __field(unsigned int, duration)
936 TP_fast_assign(
937 LOCAL_ASSIGN;
938 __entry->center_freq = chan->center_freq;
939 __entry->channel_type = chantype;
940 __entry->duration = duration;
943 TP_printk(
944 LOCAL_PR_FMT " freq:%dMHz duration:%dms",
945 LOCAL_PR_ARG, __entry->center_freq, __entry->duration
949 DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
950 TP_PROTO(struct ieee80211_local *local),
951 TP_ARGS(local)
954 TRACE_EVENT(drv_offchannel_tx,
955 TP_PROTO(struct ieee80211_local *local, struct sk_buff *skb,
956 struct ieee80211_channel *chan,
957 enum nl80211_channel_type channel_type,
958 unsigned int wait),
960 TP_ARGS(local, skb, chan, channel_type, wait),
962 TP_STRUCT__entry(
963 LOCAL_ENTRY
964 __field(int, center_freq)
965 __field(int, channel_type)
966 __field(unsigned int, wait)
969 TP_fast_assign(
970 LOCAL_ASSIGN;
971 __entry->center_freq = chan->center_freq;
972 __entry->channel_type = channel_type;
973 __entry->wait = wait;
976 TP_printk(
977 LOCAL_PR_FMT " freq:%dMHz, wait:%dms",
978 LOCAL_PR_ARG, __entry->center_freq, __entry->wait
982 TRACE_EVENT(drv_set_ringparam,
983 TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
985 TP_ARGS(local, tx, rx),
987 TP_STRUCT__entry(
988 LOCAL_ENTRY
989 __field(u32, tx)
990 __field(u32, rx)
993 TP_fast_assign(
994 LOCAL_ASSIGN;
995 __entry->tx = tx;
996 __entry->rx = rx;
999 TP_printk(
1000 LOCAL_PR_FMT " tx:%d rx %d",
1001 LOCAL_PR_ARG, __entry->tx, __entry->rx
1005 TRACE_EVENT(drv_get_ringparam,
1006 TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1007 u32 *rx, u32 *rx_max),
1009 TP_ARGS(local, tx, tx_max, rx, rx_max),
1011 TP_STRUCT__entry(
1012 LOCAL_ENTRY
1013 __field(u32, tx)
1014 __field(u32, tx_max)
1015 __field(u32, rx)
1016 __field(u32, rx_max)
1019 TP_fast_assign(
1020 LOCAL_ASSIGN;
1021 __entry->tx = *tx;
1022 __entry->tx_max = *tx_max;
1023 __entry->rx = *rx;
1024 __entry->rx_max = *rx_max;
1027 TP_printk(
1028 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1029 LOCAL_PR_ARG,
1030 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1034 DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1035 TP_PROTO(struct ieee80211_local *local),
1036 TP_ARGS(local)
1039 DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1040 TP_PROTO(struct ieee80211_local *local),
1041 TP_ARGS(local)
1044 TRACE_EVENT(drv_set_bitrate_mask,
1045 TP_PROTO(struct ieee80211_local *local,
1046 struct ieee80211_sub_if_data *sdata,
1047 const struct cfg80211_bitrate_mask *mask),
1049 TP_ARGS(local, sdata, mask),
1051 TP_STRUCT__entry(
1052 LOCAL_ENTRY
1053 VIF_ENTRY
1054 __field(u32, legacy_2g)
1055 __field(u32, legacy_5g)
1058 TP_fast_assign(
1059 LOCAL_ASSIGN;
1060 VIF_ASSIGN;
1061 __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
1062 __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
1065 TP_printk(
1066 LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1067 LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1071 TRACE_EVENT(drv_set_rekey_data,
1072 TP_PROTO(struct ieee80211_local *local,
1073 struct ieee80211_sub_if_data *sdata,
1074 struct cfg80211_gtk_rekey_data *data),
1076 TP_ARGS(local, sdata, data),
1078 TP_STRUCT__entry(
1079 LOCAL_ENTRY
1080 VIF_ENTRY
1081 __array(u8, kek, NL80211_KEK_LEN)
1082 __array(u8, kck, NL80211_KCK_LEN)
1083 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1086 TP_fast_assign(
1087 LOCAL_ASSIGN;
1088 VIF_ASSIGN;
1089 memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1090 memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1091 memcpy(__entry->replay_ctr, data->replay_ctr,
1092 NL80211_REPLAY_CTR_LEN);
1095 TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1096 LOCAL_PR_ARG, VIF_PR_ARG)
1099 TRACE_EVENT(drv_rssi_callback,
1100 TP_PROTO(struct ieee80211_local *local,
1101 enum ieee80211_rssi_event rssi_event),
1103 TP_ARGS(local, rssi_event),
1105 TP_STRUCT__entry(
1106 LOCAL_ENTRY
1107 __field(u32, rssi_event)
1110 TP_fast_assign(
1111 LOCAL_ASSIGN;
1112 __entry->rssi_event = rssi_event;
1115 TP_printk(
1116 LOCAL_PR_FMT " rssi_event:%d",
1117 LOCAL_PR_ARG, __entry->rssi_event
1121 DECLARE_EVENT_CLASS(release_evt,
1122 TP_PROTO(struct ieee80211_local *local,
1123 struct ieee80211_sta *sta,
1124 u16 tids, int num_frames,
1125 enum ieee80211_frame_release_type reason,
1126 bool more_data),
1128 TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1130 TP_STRUCT__entry(
1131 LOCAL_ENTRY
1132 STA_ENTRY
1133 __field(u16, tids)
1134 __field(int, num_frames)
1135 __field(int, reason)
1136 __field(bool, more_data)
1139 TP_fast_assign(
1140 LOCAL_ASSIGN;
1141 STA_ASSIGN;
1142 __entry->tids = tids;
1143 __entry->num_frames = num_frames;
1144 __entry->reason = reason;
1145 __entry->more_data = more_data;
1148 TP_printk(
1149 LOCAL_PR_FMT STA_PR_FMT
1150 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1151 LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1152 __entry->reason, __entry->more_data
1156 DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1157 TP_PROTO(struct ieee80211_local *local,
1158 struct ieee80211_sta *sta,
1159 u16 tids, int num_frames,
1160 enum ieee80211_frame_release_type reason,
1161 bool more_data),
1163 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1166 DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1167 TP_PROTO(struct ieee80211_local *local,
1168 struct ieee80211_sta *sta,
1169 u16 tids, int num_frames,
1170 enum ieee80211_frame_release_type reason,
1171 bool more_data),
1173 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1177 * Tracing for API calls that drivers call.
1180 TRACE_EVENT(api_start_tx_ba_session,
1181 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1183 TP_ARGS(sta, tid),
1185 TP_STRUCT__entry(
1186 STA_ENTRY
1187 __field(u16, tid)
1190 TP_fast_assign(
1191 STA_ASSIGN;
1192 __entry->tid = tid;
1195 TP_printk(
1196 STA_PR_FMT " tid:%d",
1197 STA_PR_ARG, __entry->tid
1201 TRACE_EVENT(api_start_tx_ba_cb,
1202 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1204 TP_ARGS(sdata, ra, tid),
1206 TP_STRUCT__entry(
1207 VIF_ENTRY
1208 __array(u8, ra, ETH_ALEN)
1209 __field(u16, tid)
1212 TP_fast_assign(
1213 VIF_ASSIGN;
1214 memcpy(__entry->ra, ra, ETH_ALEN);
1215 __entry->tid = tid;
1218 TP_printk(
1219 VIF_PR_FMT " ra:%pM tid:%d",
1220 VIF_PR_ARG, __entry->ra, __entry->tid
1224 TRACE_EVENT(api_stop_tx_ba_session,
1225 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1227 TP_ARGS(sta, tid),
1229 TP_STRUCT__entry(
1230 STA_ENTRY
1231 __field(u16, tid)
1234 TP_fast_assign(
1235 STA_ASSIGN;
1236 __entry->tid = tid;
1239 TP_printk(
1240 STA_PR_FMT " tid:%d",
1241 STA_PR_ARG, __entry->tid
1245 TRACE_EVENT(api_stop_tx_ba_cb,
1246 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1248 TP_ARGS(sdata, ra, tid),
1250 TP_STRUCT__entry(
1251 VIF_ENTRY
1252 __array(u8, ra, ETH_ALEN)
1253 __field(u16, tid)
1256 TP_fast_assign(
1257 VIF_ASSIGN;
1258 memcpy(__entry->ra, ra, ETH_ALEN);
1259 __entry->tid = tid;
1262 TP_printk(
1263 VIF_PR_FMT " ra:%pM tid:%d",
1264 VIF_PR_ARG, __entry->ra, __entry->tid
1268 DEFINE_EVENT(local_only_evt, api_restart_hw,
1269 TP_PROTO(struct ieee80211_local *local),
1270 TP_ARGS(local)
1273 TRACE_EVENT(api_beacon_loss,
1274 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1276 TP_ARGS(sdata),
1278 TP_STRUCT__entry(
1279 VIF_ENTRY
1282 TP_fast_assign(
1283 VIF_ASSIGN;
1286 TP_printk(
1287 VIF_PR_FMT,
1288 VIF_PR_ARG
1292 TRACE_EVENT(api_connection_loss,
1293 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1295 TP_ARGS(sdata),
1297 TP_STRUCT__entry(
1298 VIF_ENTRY
1301 TP_fast_assign(
1302 VIF_ASSIGN;
1305 TP_printk(
1306 VIF_PR_FMT,
1307 VIF_PR_ARG
1311 TRACE_EVENT(api_cqm_rssi_notify,
1312 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1313 enum nl80211_cqm_rssi_threshold_event rssi_event),
1315 TP_ARGS(sdata, rssi_event),
1317 TP_STRUCT__entry(
1318 VIF_ENTRY
1319 __field(u32, rssi_event)
1322 TP_fast_assign(
1323 VIF_ASSIGN;
1324 __entry->rssi_event = rssi_event;
1327 TP_printk(
1328 VIF_PR_FMT " event:%d",
1329 VIF_PR_ARG, __entry->rssi_event
1333 TRACE_EVENT(api_scan_completed,
1334 TP_PROTO(struct ieee80211_local *local, bool aborted),
1336 TP_ARGS(local, aborted),
1338 TP_STRUCT__entry(
1339 LOCAL_ENTRY
1340 __field(bool, aborted)
1343 TP_fast_assign(
1344 LOCAL_ASSIGN;
1345 __entry->aborted = aborted;
1348 TP_printk(
1349 LOCAL_PR_FMT " aborted:%d",
1350 LOCAL_PR_ARG, __entry->aborted
1354 TRACE_EVENT(api_sched_scan_results,
1355 TP_PROTO(struct ieee80211_local *local),
1357 TP_ARGS(local),
1359 TP_STRUCT__entry(
1360 LOCAL_ENTRY
1363 TP_fast_assign(
1364 LOCAL_ASSIGN;
1367 TP_printk(
1368 LOCAL_PR_FMT, LOCAL_PR_ARG
1372 TRACE_EVENT(api_sched_scan_stopped,
1373 TP_PROTO(struct ieee80211_local *local),
1375 TP_ARGS(local),
1377 TP_STRUCT__entry(
1378 LOCAL_ENTRY
1381 TP_fast_assign(
1382 LOCAL_ASSIGN;
1385 TP_printk(
1386 LOCAL_PR_FMT, LOCAL_PR_ARG
1390 TRACE_EVENT(api_sta_block_awake,
1391 TP_PROTO(struct ieee80211_local *local,
1392 struct ieee80211_sta *sta, bool block),
1394 TP_ARGS(local, sta, block),
1396 TP_STRUCT__entry(
1397 LOCAL_ENTRY
1398 STA_ENTRY
1399 __field(bool, block)
1402 TP_fast_assign(
1403 LOCAL_ASSIGN;
1404 STA_ASSIGN;
1405 __entry->block = block;
1408 TP_printk(
1409 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1410 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1414 TRACE_EVENT(api_chswitch_done,
1415 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1417 TP_ARGS(sdata, success),
1419 TP_STRUCT__entry(
1420 VIF_ENTRY
1421 __field(bool, success)
1424 TP_fast_assign(
1425 VIF_ASSIGN;
1426 __entry->success = success;
1429 TP_printk(
1430 VIF_PR_FMT " success=%d",
1431 VIF_PR_ARG, __entry->success
1435 DEFINE_EVENT(local_only_evt, api_ready_on_channel,
1436 TP_PROTO(struct ieee80211_local *local),
1437 TP_ARGS(local)
1440 DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
1441 TP_PROTO(struct ieee80211_local *local),
1442 TP_ARGS(local)
1445 TRACE_EVENT(api_gtk_rekey_notify,
1446 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1447 const u8 *bssid, const u8 *replay_ctr),
1449 TP_ARGS(sdata, bssid, replay_ctr),
1451 TP_STRUCT__entry(
1452 VIF_ENTRY
1453 __array(u8, bssid, ETH_ALEN)
1454 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1457 TP_fast_assign(
1458 VIF_ASSIGN;
1459 memcpy(__entry->bssid, bssid, ETH_ALEN);
1460 memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
1463 TP_printk(VIF_PR_FMT, VIF_PR_ARG)
1466 TRACE_EVENT(api_enable_rssi_reports,
1467 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1468 int rssi_min_thold, int rssi_max_thold),
1470 TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
1472 TP_STRUCT__entry(
1473 VIF_ENTRY
1474 __field(int, rssi_min_thold)
1475 __field(int, rssi_max_thold)
1478 TP_fast_assign(
1479 VIF_ASSIGN;
1480 __entry->rssi_min_thold = rssi_min_thold;
1481 __entry->rssi_max_thold = rssi_max_thold;
1484 TP_printk(
1485 VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
1486 VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
1490 TRACE_EVENT(api_eosp,
1491 TP_PROTO(struct ieee80211_local *local,
1492 struct ieee80211_sta *sta),
1494 TP_ARGS(local, sta),
1496 TP_STRUCT__entry(
1497 LOCAL_ENTRY
1498 STA_ENTRY
1501 TP_fast_assign(
1502 LOCAL_ASSIGN;
1503 STA_ASSIGN;
1506 TP_printk(
1507 LOCAL_PR_FMT STA_PR_FMT,
1508 LOCAL_PR_ARG, STA_PR_FMT
1513 * Tracing for internal functions
1514 * (which may also be called in response to driver calls)
1517 TRACE_EVENT(wake_queue,
1518 TP_PROTO(struct ieee80211_local *local, u16 queue,
1519 enum queue_stop_reason reason),
1521 TP_ARGS(local, queue, reason),
1523 TP_STRUCT__entry(
1524 LOCAL_ENTRY
1525 __field(u16, queue)
1526 __field(u32, reason)
1529 TP_fast_assign(
1530 LOCAL_ASSIGN;
1531 __entry->queue = queue;
1532 __entry->reason = reason;
1535 TP_printk(
1536 LOCAL_PR_FMT " queue:%d, reason:%d",
1537 LOCAL_PR_ARG, __entry->queue, __entry->reason
1541 TRACE_EVENT(stop_queue,
1542 TP_PROTO(struct ieee80211_local *local, u16 queue,
1543 enum queue_stop_reason reason),
1545 TP_ARGS(local, queue, reason),
1547 TP_STRUCT__entry(
1548 LOCAL_ENTRY
1549 __field(u16, queue)
1550 __field(u32, reason)
1553 TP_fast_assign(
1554 LOCAL_ASSIGN;
1555 __entry->queue = queue;
1556 __entry->reason = reason;
1559 TP_printk(
1560 LOCAL_PR_FMT " queue:%d, reason:%d",
1561 LOCAL_PR_ARG, __entry->queue, __entry->reason
1564 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
1566 #undef TRACE_INCLUDE_PATH
1567 #define TRACE_INCLUDE_PATH .
1568 #undef TRACE_INCLUDE_FILE
1569 #define TRACE_INCLUDE_FILE driver-trace
1570 #include <trace/define_trace.h>