1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Portions of this file
4 * Copyright(c) 2016 Intel Deutschland GmbH
7 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
8 #define __MAC80211_DRIVER_TRACE
10 #include <linux/tracepoint.h>
11 #include <net/mac80211.h>
12 #include "ieee80211_i.h"
15 #define TRACE_SYSTEM mac80211
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
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_NAMED_ASSIGN(s) memcpy(__entry->sta_addr, (s)->addr, ETH_ALEN)
26 #define STA_PR_FMT " sta:%pM"
27 #define STA_PR_ARG __entry->sta_addr
29 #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
31 __string(vif_name, sdata->name)
32 #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
33 __entry->p2p = sdata->vif.p2p; \
34 __assign_str(vif_name, sdata->name)
35 #define VIF_PR_FMT " vif:%s(%d%s)"
36 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
38 #define CHANDEF_ENTRY __field(u32, control_freq) \
39 __field(u32, chan_width) \
40 __field(u32, center_freq1) \
41 __field(u32, center_freq2)
42 #define CHANDEF_ASSIGN(c) \
43 __entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0; \
44 __entry->chan_width = (c) ? (c)->width : 0; \
45 __entry->center_freq1 = (c) ? (c)->center_freq1 : 0; \
46 __entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
47 #define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
48 #define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \
49 __entry->center_freq1, __entry->center_freq2
51 #define MIN_CHANDEF_ENTRY \
52 __field(u32, min_control_freq) \
53 __field(u32, min_chan_width) \
54 __field(u32, min_center_freq1) \
55 __field(u32, min_center_freq2)
57 #define MIN_CHANDEF_ASSIGN(c) \
58 __entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
59 __entry->min_chan_width = (c)->width; \
60 __entry->min_center_freq1 = (c)->center_freq1; \
61 __entry->min_center_freq2 = (c)->center_freq2;
62 #define MIN_CHANDEF_PR_FMT " min_control:%d MHz min_width:%d min_center: %d/%d MHz"
63 #define MIN_CHANDEF_PR_ARG __entry->min_control_freq, __entry->min_chan_width, \
64 __entry->min_center_freq1, __entry->min_center_freq2
66 #define CHANCTX_ENTRY CHANDEF_ENTRY \
68 __field(u8, rx_chains_static) \
69 __field(u8, rx_chains_dynamic)
70 #define CHANCTX_ASSIGN CHANDEF_ASSIGN(&ctx->conf.def) \
71 MIN_CHANDEF_ASSIGN(&ctx->conf.min_def) \
72 __entry->rx_chains_static = ctx->conf.rx_chains_static; \
73 __entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
74 #define CHANCTX_PR_FMT CHANDEF_PR_FMT MIN_CHANDEF_PR_FMT " chains:%d/%d"
75 #define CHANCTX_PR_ARG CHANDEF_PR_ARG, MIN_CHANDEF_PR_ARG, \
76 __entry->rx_chains_static, __entry->rx_chains_dynamic
78 #define KEY_ENTRY __field(u32, cipher) \
79 __field(u8, hw_key_idx) \
82 #define KEY_ASSIGN(k) __entry->cipher = (k)->cipher; \
83 __entry->flags = (k)->flags; \
84 __entry->keyidx = (k)->keyidx; \
85 __entry->hw_key_idx = (k)->hw_key_idx;
86 #define KEY_PR_FMT " cipher:0x%x, flags=%#x, keyidx=%d, hw_key_idx=%d"
87 #define KEY_PR_ARG __entry->cipher, __entry->flags, __entry->keyidx, __entry->hw_key_idx
89 #define AMPDU_ACTION_ENTRY __field(enum ieee80211_ampdu_mlme_action, \
90 ieee80211_ampdu_mlme_action) \
94 __field(u8, buf_size) \
95 __field(bool, amsdu) \
96 __field(u16, timeout) \
98 #define AMPDU_ACTION_ASSIGN STA_NAMED_ASSIGN(params->sta); \
99 __entry->tid = params->tid; \
100 __entry->ssn = params->ssn; \
101 __entry->buf_size = params->buf_size; \
102 __entry->amsdu = params->amsdu; \
103 __entry->timeout = params->timeout; \
104 __entry->action = params->action;
105 #define AMPDU_ACTION_PR_FMT STA_PR_FMT " tid %d, ssn %d, buf_size %u, amsdu %d, timeout %d action %d"
106 #define AMPDU_ACTION_PR_ARG STA_PR_ARG, __entry->tid, __entry->ssn, \
107 __entry->buf_size, __entry->amsdu, __entry->timeout, \
111 * Tracing for driver callbacks.
114 DECLARE_EVENT_CLASS(local_only_evt,
115 TP_PROTO(struct ieee80211_local *local),
123 TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
126 DECLARE_EVENT_CLASS(local_sdata_addr_evt,
127 TP_PROTO(struct ieee80211_local *local,
128 struct ieee80211_sub_if_data *sdata),
129 TP_ARGS(local, sdata),
134 __array(char, addr, ETH_ALEN)
140 memcpy(__entry->addr, sdata->vif.addr, ETH_ALEN);
144 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
145 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
149 DECLARE_EVENT_CLASS(local_u32_evt,
150 TP_PROTO(struct ieee80211_local *local, u32 value),
151 TP_ARGS(local, value),
160 __entry->value = value;
164 LOCAL_PR_FMT " value:%d",
165 LOCAL_PR_ARG, __entry->value
169 DECLARE_EVENT_CLASS(local_sdata_evt,
170 TP_PROTO(struct ieee80211_local *local,
171 struct ieee80211_sub_if_data *sdata),
172 TP_ARGS(local, sdata),
185 LOCAL_PR_FMT VIF_PR_FMT,
186 LOCAL_PR_ARG, VIF_PR_ARG
190 DEFINE_EVENT(local_only_evt, drv_return_void,
191 TP_PROTO(struct ieee80211_local *local),
195 TRACE_EVENT(drv_return_int,
196 TP_PROTO(struct ieee80211_local *local, int ret),
206 TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
209 TRACE_EVENT(drv_return_bool,
210 TP_PROTO(struct ieee80211_local *local, bool ret),
220 TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
224 TRACE_EVENT(drv_return_u32,
225 TP_PROTO(struct ieee80211_local *local, u32 ret),
235 TP_printk(LOCAL_PR_FMT " - %u", LOCAL_PR_ARG, __entry->ret)
238 TRACE_EVENT(drv_return_u64,
239 TP_PROTO(struct ieee80211_local *local, u64 ret),
249 TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
252 DEFINE_EVENT(local_only_evt, drv_start,
253 TP_PROTO(struct ieee80211_local *local),
257 DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
258 TP_PROTO(struct ieee80211_local *local, u32 sset),
262 DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
263 TP_PROTO(struct ieee80211_local *local, u32 sset),
267 DEFINE_EVENT(local_only_evt, drv_get_et_stats,
268 TP_PROTO(struct ieee80211_local *local),
272 DEFINE_EVENT(local_only_evt, drv_suspend,
273 TP_PROTO(struct ieee80211_local *local),
277 DEFINE_EVENT(local_only_evt, drv_resume,
278 TP_PROTO(struct ieee80211_local *local),
282 TRACE_EVENT(drv_set_wakeup,
283 TP_PROTO(struct ieee80211_local *local, bool enabled),
284 TP_ARGS(local, enabled),
287 __field(bool, enabled)
291 __entry->enabled = enabled;
293 TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
296 DEFINE_EVENT(local_only_evt, drv_stop,
297 TP_PROTO(struct ieee80211_local *local),
301 DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
302 TP_PROTO(struct ieee80211_local *local,
303 struct ieee80211_sub_if_data *sdata),
304 TP_ARGS(local, sdata)
307 TRACE_EVENT(drv_change_interface,
308 TP_PROTO(struct ieee80211_local *local,
309 struct ieee80211_sub_if_data *sdata,
310 enum nl80211_iftype type, bool p2p),
312 TP_ARGS(local, sdata, type, p2p),
317 __field(u32, new_type)
318 __field(bool, new_p2p)
324 __entry->new_type = type;
325 __entry->new_p2p = p2p;
329 LOCAL_PR_FMT VIF_PR_FMT " new type:%d%s",
330 LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
331 __entry->new_p2p ? "/p2p" : ""
335 DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
336 TP_PROTO(struct ieee80211_local *local,
337 struct ieee80211_sub_if_data *sdata),
338 TP_ARGS(local, sdata)
341 TRACE_EVENT(drv_config,
342 TP_PROTO(struct ieee80211_local *local,
345 TP_ARGS(local, changed),
349 __field(u32, changed)
351 __field(int, power_level)
352 __field(int, dynamic_ps_timeout)
353 __field(u16, listen_interval)
354 __field(u8, long_frame_max_tx_count)
355 __field(u8, short_frame_max_tx_count)
362 __entry->changed = changed;
363 __entry->flags = local->hw.conf.flags;
364 __entry->power_level = local->hw.conf.power_level;
365 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
366 __entry->listen_interval = local->hw.conf.listen_interval;
367 __entry->long_frame_max_tx_count =
368 local->hw.conf.long_frame_max_tx_count;
369 __entry->short_frame_max_tx_count =
370 local->hw.conf.short_frame_max_tx_count;
371 CHANDEF_ASSIGN(&local->hw.conf.chandef)
372 __entry->smps = local->hw.conf.smps_mode;
376 LOCAL_PR_FMT " ch:%#x" CHANDEF_PR_FMT,
377 LOCAL_PR_ARG, __entry->changed, CHANDEF_PR_ARG
381 TRACE_EVENT(drv_bss_info_changed,
382 TP_PROTO(struct ieee80211_local *local,
383 struct ieee80211_sub_if_data *sdata,
384 struct ieee80211_bss_conf *info,
387 TP_ARGS(local, sdata, info, changed),
392 __field(u32, changed)
394 __field(bool, ibss_joined)
395 __field(bool, ibss_creator)
398 __field(bool, shortpre)
399 __field(bool, shortslot)
400 __field(bool, enable_beacon)
403 __field(u16, assoc_cap)
404 __field(u64, sync_tsf)
405 __field(u32, sync_device_ts)
406 __field(u8, sync_dtim_count)
407 __field(u32, basic_rates)
408 __array(int, mcast_rate, NUM_NL80211_BANDS)
409 __field(u16, ht_operation_mode)
410 __field(s32, cqm_rssi_thold);
411 __field(s32, cqm_rssi_hyst);
412 __field(u32, channel_width);
413 __field(u32, channel_cfreq1);
414 __dynamic_array(u32, arp_addr_list,
415 info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
416 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
418 __field(int, arp_addr_cnt);
422 __dynamic_array(u8, ssid, info->ssid_len);
423 __field(bool, hidden_ssid);
424 __field(int, txpower)
425 __field(u8, p2p_oppps_ctwindow)
431 __entry->changed = changed;
432 __entry->aid = info->aid;
433 __entry->assoc = info->assoc;
434 __entry->ibss_joined = info->ibss_joined;
435 __entry->ibss_creator = info->ibss_creator;
436 __entry->shortpre = info->use_short_preamble;
437 __entry->cts = info->use_cts_prot;
438 __entry->shortslot = info->use_short_slot;
439 __entry->enable_beacon = info->enable_beacon;
440 __entry->dtimper = info->dtim_period;
441 __entry->bcnint = info->beacon_int;
442 __entry->assoc_cap = info->assoc_capability;
443 __entry->sync_tsf = info->sync_tsf;
444 __entry->sync_device_ts = info->sync_device_ts;
445 __entry->sync_dtim_count = info->sync_dtim_count;
446 __entry->basic_rates = info->basic_rates;
447 memcpy(__entry->mcast_rate, info->mcast_rate,
448 sizeof(__entry->mcast_rate));
449 __entry->ht_operation_mode = info->ht_operation_mode;
450 __entry->cqm_rssi_thold = info->cqm_rssi_thold;
451 __entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
452 __entry->channel_width = info->chandef.width;
453 __entry->channel_cfreq1 = info->chandef.center_freq1;
454 __entry->arp_addr_cnt = info->arp_addr_cnt;
455 memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
456 sizeof(u32) * (info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
457 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
458 info->arp_addr_cnt));
459 __entry->qos = info->qos;
460 __entry->idle = info->idle;
461 __entry->ps = info->ps;
462 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
463 __entry->hidden_ssid = info->hidden_ssid;
464 __entry->txpower = info->txpower;
465 __entry->p2p_oppps_ctwindow = info->p2p_noa_attr.oppps_ctwindow;
469 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
470 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
474 TRACE_EVENT(drv_prepare_multicast,
475 TP_PROTO(struct ieee80211_local *local, int mc_count),
477 TP_ARGS(local, mc_count),
481 __field(int, mc_count)
486 __entry->mc_count = mc_count;
490 LOCAL_PR_FMT " prepare mc (%d)",
491 LOCAL_PR_ARG, __entry->mc_count
495 TRACE_EVENT(drv_configure_filter,
496 TP_PROTO(struct ieee80211_local *local,
497 unsigned int changed_flags,
498 unsigned int *total_flags,
501 TP_ARGS(local, changed_flags, total_flags, multicast),
505 __field(unsigned int, changed)
506 __field(unsigned int, total)
507 __field(u64, multicast)
512 __entry->changed = changed_flags;
513 __entry->total = *total_flags;
514 __entry->multicast = multicast;
518 LOCAL_PR_FMT " changed:%#x total:%#x",
519 LOCAL_PR_ARG, __entry->changed, __entry->total
523 TRACE_EVENT(drv_config_iface_filter,
524 TP_PROTO(struct ieee80211_local *local,
525 struct ieee80211_sub_if_data *sdata,
526 unsigned int filter_flags,
527 unsigned int changed_flags),
529 TP_ARGS(local, sdata, filter_flags, changed_flags),
534 __field(unsigned int, filter_flags)
535 __field(unsigned int, changed_flags)
541 __entry->filter_flags = filter_flags;
542 __entry->changed_flags = changed_flags;
546 LOCAL_PR_FMT VIF_PR_FMT
547 " filter_flags: %#x changed_flags: %#x",
548 LOCAL_PR_ARG, VIF_PR_ARG, __entry->filter_flags,
549 __entry->changed_flags
553 TRACE_EVENT(drv_set_tim,
554 TP_PROTO(struct ieee80211_local *local,
555 struct ieee80211_sta *sta, bool set),
557 TP_ARGS(local, sta, set),
572 LOCAL_PR_FMT STA_PR_FMT " set:%d",
573 LOCAL_PR_ARG, STA_PR_ARG, __entry->set
577 TRACE_EVENT(drv_set_key,
578 TP_PROTO(struct ieee80211_local *local,
579 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
580 struct ieee80211_sta *sta,
581 struct ieee80211_key_conf *key),
583 TP_ARGS(local, cmd, sdata, sta, key),
600 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT KEY_PR_FMT,
601 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, KEY_PR_ARG
605 TRACE_EVENT(drv_update_tkip_key,
606 TP_PROTO(struct ieee80211_local *local,
607 struct ieee80211_sub_if_data *sdata,
608 struct ieee80211_key_conf *conf,
609 struct ieee80211_sta *sta, u32 iv32),
611 TP_ARGS(local, sdata, conf, sta, iv32),
624 __entry->iv32 = iv32;
628 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
629 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->iv32
633 DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
634 TP_PROTO(struct ieee80211_local *local,
635 struct ieee80211_sub_if_data *sdata),
636 TP_ARGS(local, sdata)
639 DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
640 TP_PROTO(struct ieee80211_local *local,
641 struct ieee80211_sub_if_data *sdata),
642 TP_ARGS(local, sdata)
645 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
646 TP_PROTO(struct ieee80211_local *local,
647 struct ieee80211_sub_if_data *sdata),
648 TP_ARGS(local, sdata)
651 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
652 TP_PROTO(struct ieee80211_local *local,
653 struct ieee80211_sub_if_data *sdata),
654 TP_ARGS(local, sdata)
657 TRACE_EVENT(drv_sw_scan_start,
658 TP_PROTO(struct ieee80211_local *local,
659 struct ieee80211_sub_if_data *sdata,
662 TP_ARGS(local, sdata, mac_addr),
667 __array(char, mac_addr, ETH_ALEN)
673 memcpy(__entry->mac_addr, mac_addr, ETH_ALEN);
676 TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", addr:%pM",
677 LOCAL_PR_ARG, VIF_PR_ARG, __entry->mac_addr)
680 DEFINE_EVENT(local_sdata_evt, drv_sw_scan_complete,
681 TP_PROTO(struct ieee80211_local *local,
682 struct ieee80211_sub_if_data *sdata),
683 TP_ARGS(local, sdata)
686 TRACE_EVENT(drv_get_stats,
687 TP_PROTO(struct ieee80211_local *local,
688 struct ieee80211_low_level_stats *stats,
691 TP_ARGS(local, stats, ret),
696 __field(unsigned int, ackfail)
697 __field(unsigned int, rtsfail)
698 __field(unsigned int, fcserr)
699 __field(unsigned int, rtssucc)
705 __entry->ackfail = stats->dot11ACKFailureCount;
706 __entry->rtsfail = stats->dot11RTSFailureCount;
707 __entry->fcserr = stats->dot11FCSErrorCount;
708 __entry->rtssucc = stats->dot11RTSSuccessCount;
712 LOCAL_PR_FMT " ret:%d",
713 LOCAL_PR_ARG, __entry->ret
717 TRACE_EVENT(drv_get_key_seq,
718 TP_PROTO(struct ieee80211_local *local,
719 struct ieee80211_key_conf *key),
734 LOCAL_PR_FMT KEY_PR_FMT,
735 LOCAL_PR_ARG, KEY_PR_ARG
739 DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
740 TP_PROTO(struct ieee80211_local *local, u32 value),
741 TP_ARGS(local, value)
744 DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
745 TP_PROTO(struct ieee80211_local *local, u32 value),
746 TP_ARGS(local, value)
749 TRACE_EVENT(drv_set_coverage_class,
750 TP_PROTO(struct ieee80211_local *local, s16 value),
752 TP_ARGS(local, value),
761 __entry->value = value;
765 LOCAL_PR_FMT " value:%d",
766 LOCAL_PR_ARG, __entry->value
770 TRACE_EVENT(drv_sta_notify,
771 TP_PROTO(struct ieee80211_local *local,
772 struct ieee80211_sub_if_data *sdata,
773 enum sta_notify_cmd cmd,
774 struct ieee80211_sta *sta),
776 TP_ARGS(local, sdata, cmd, sta),
793 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
794 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
798 TRACE_EVENT(drv_sta_state,
799 TP_PROTO(struct ieee80211_local *local,
800 struct ieee80211_sub_if_data *sdata,
801 struct ieee80211_sta *sta,
802 enum ieee80211_sta_state old_state,
803 enum ieee80211_sta_state new_state),
805 TP_ARGS(local, sdata, sta, old_state, new_state),
811 __field(u32, old_state)
812 __field(u32, new_state)
819 __entry->old_state = old_state;
820 __entry->new_state = new_state;
824 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " state: %d->%d",
825 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
826 __entry->old_state, __entry->new_state
830 TRACE_EVENT(drv_sta_rc_update,
831 TP_PROTO(struct ieee80211_local *local,
832 struct ieee80211_sub_if_data *sdata,
833 struct ieee80211_sta *sta,
836 TP_ARGS(local, sdata, sta, changed),
842 __field(u32, changed)
849 __entry->changed = changed;
853 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
854 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
858 DECLARE_EVENT_CLASS(sta_event,
859 TP_PROTO(struct ieee80211_local *local,
860 struct ieee80211_sub_if_data *sdata,
861 struct ieee80211_sta *sta),
863 TP_ARGS(local, sdata, sta),
878 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
879 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
883 DEFINE_EVENT(sta_event, drv_sta_statistics,
884 TP_PROTO(struct ieee80211_local *local,
885 struct ieee80211_sub_if_data *sdata,
886 struct ieee80211_sta *sta),
887 TP_ARGS(local, sdata, sta)
890 DEFINE_EVENT(sta_event, drv_sta_add,
891 TP_PROTO(struct ieee80211_local *local,
892 struct ieee80211_sub_if_data *sdata,
893 struct ieee80211_sta *sta),
894 TP_ARGS(local, sdata, sta)
897 DEFINE_EVENT(sta_event, drv_sta_remove,
898 TP_PROTO(struct ieee80211_local *local,
899 struct ieee80211_sub_if_data *sdata,
900 struct ieee80211_sta *sta),
901 TP_ARGS(local, sdata, sta)
904 DEFINE_EVENT(sta_event, drv_sta_pre_rcu_remove,
905 TP_PROTO(struct ieee80211_local *local,
906 struct ieee80211_sub_if_data *sdata,
907 struct ieee80211_sta *sta),
908 TP_ARGS(local, sdata, sta)
911 DEFINE_EVENT(sta_event, drv_sync_rx_queues,
912 TP_PROTO(struct ieee80211_local *local,
913 struct ieee80211_sub_if_data *sdata,
914 struct ieee80211_sta *sta),
915 TP_ARGS(local, sdata, sta)
918 DEFINE_EVENT(sta_event, drv_sta_rate_tbl_update,
919 TP_PROTO(struct ieee80211_local *local,
920 struct ieee80211_sub_if_data *sdata,
921 struct ieee80211_sta *sta),
922 TP_ARGS(local, sdata, sta)
925 TRACE_EVENT(drv_conf_tx,
926 TP_PROTO(struct ieee80211_local *local,
927 struct ieee80211_sub_if_data *sdata,
928 u16 ac, const struct ieee80211_tx_queue_params *params),
930 TP_ARGS(local, sdata, ac, params),
947 __entry->txop = params->txop;
948 __entry->cw_max = params->cw_max;
949 __entry->cw_min = params->cw_min;
950 __entry->aifs = params->aifs;
951 __entry->uapsd = params->uapsd;
955 LOCAL_PR_FMT VIF_PR_FMT " AC:%d",
956 LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
960 DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
961 TP_PROTO(struct ieee80211_local *local,
962 struct ieee80211_sub_if_data *sdata),
963 TP_ARGS(local, sdata)
966 TRACE_EVENT(drv_set_tsf,
967 TP_PROTO(struct ieee80211_local *local,
968 struct ieee80211_sub_if_data *sdata,
971 TP_ARGS(local, sdata, tsf),
986 LOCAL_PR_FMT VIF_PR_FMT " tsf:%llu",
987 LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
991 TRACE_EVENT(drv_offset_tsf,
992 TP_PROTO(struct ieee80211_local *local,
993 struct ieee80211_sub_if_data *sdata,
996 TP_ARGS(local, sdata, offset),
1001 __field(s64, tsf_offset)
1007 __entry->tsf_offset = offset;
1011 LOCAL_PR_FMT VIF_PR_FMT " tsf offset:%lld",
1012 LOCAL_PR_ARG, VIF_PR_ARG,
1013 (unsigned long long)__entry->tsf_offset
1017 DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
1018 TP_PROTO(struct ieee80211_local *local,
1019 struct ieee80211_sub_if_data *sdata),
1020 TP_ARGS(local, sdata)
1023 DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
1024 TP_PROTO(struct ieee80211_local *local),
1028 TRACE_EVENT(drv_ampdu_action,
1029 TP_PROTO(struct ieee80211_local *local,
1030 struct ieee80211_sub_if_data *sdata,
1031 struct ieee80211_ampdu_params *params),
1033 TP_ARGS(local, sdata, params),
1044 AMPDU_ACTION_ASSIGN;
1048 LOCAL_PR_FMT VIF_PR_FMT AMPDU_ACTION_PR_FMT,
1049 LOCAL_PR_ARG, VIF_PR_ARG, AMPDU_ACTION_PR_ARG
1053 TRACE_EVENT(drv_get_survey,
1054 TP_PROTO(struct ieee80211_local *local, int idx,
1055 struct survey_info *survey),
1057 TP_ARGS(local, idx, survey),
1070 LOCAL_PR_FMT " idx:%d",
1071 LOCAL_PR_ARG, __entry->idx
1075 TRACE_EVENT(drv_flush,
1076 TP_PROTO(struct ieee80211_local *local,
1077 u32 queues, bool drop),
1079 TP_ARGS(local, queues, drop),
1084 __field(u32, queues)
1089 __entry->drop = drop;
1090 __entry->queues = queues;
1094 LOCAL_PR_FMT " queues:0x%x drop:%d",
1095 LOCAL_PR_ARG, __entry->queues, __entry->drop
1099 TRACE_EVENT(drv_channel_switch,
1100 TP_PROTO(struct ieee80211_local *local,
1101 struct ieee80211_sub_if_data *sdata,
1102 struct ieee80211_channel_switch *ch_switch),
1104 TP_ARGS(local, sdata, ch_switch),
1110 __field(u64, timestamp)
1111 __field(u32, device_timestamp)
1112 __field(bool, block_tx)
1119 CHANDEF_ASSIGN(&ch_switch->chandef)
1120 __entry->timestamp = ch_switch->timestamp;
1121 __entry->device_timestamp = ch_switch->device_timestamp;
1122 __entry->block_tx = ch_switch->block_tx;
1123 __entry->count = ch_switch->count;
1127 LOCAL_PR_FMT VIF_PR_FMT " new " CHANDEF_PR_FMT " count:%d",
1128 LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count
1132 TRACE_EVENT(drv_set_antenna,
1133 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
1135 TP_ARGS(local, tx_ant, rx_ant, ret),
1139 __field(u32, tx_ant)
1140 __field(u32, rx_ant)
1146 __entry->tx_ant = tx_ant;
1147 __entry->rx_ant = rx_ant;
1152 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1153 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1157 TRACE_EVENT(drv_get_antenna,
1158 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
1160 TP_ARGS(local, tx_ant, rx_ant, ret),
1164 __field(u32, tx_ant)
1165 __field(u32, rx_ant)
1171 __entry->tx_ant = tx_ant;
1172 __entry->rx_ant = rx_ant;
1177 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1178 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1182 TRACE_EVENT(drv_remain_on_channel,
1183 TP_PROTO(struct ieee80211_local *local,
1184 struct ieee80211_sub_if_data *sdata,
1185 struct ieee80211_channel *chan,
1186 unsigned int duration,
1187 enum ieee80211_roc_type type),
1189 TP_ARGS(local, sdata, chan, duration, type),
1194 __field(int, center_freq)
1195 __field(unsigned int, duration)
1202 __entry->center_freq = chan->center_freq;
1203 __entry->duration = duration;
1204 __entry->type = type;
1208 LOCAL_PR_FMT VIF_PR_FMT " freq:%dMHz duration:%dms type=%d",
1209 LOCAL_PR_ARG, VIF_PR_ARG,
1210 __entry->center_freq, __entry->duration, __entry->type
1214 DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
1215 TP_PROTO(struct ieee80211_local *local),
1219 TRACE_EVENT(drv_set_ringparam,
1220 TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
1222 TP_ARGS(local, tx, rx),
1237 LOCAL_PR_FMT " tx:%d rx %d",
1238 LOCAL_PR_ARG, __entry->tx, __entry->rx
1242 TRACE_EVENT(drv_get_ringparam,
1243 TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1244 u32 *rx, u32 *rx_max),
1246 TP_ARGS(local, tx, tx_max, rx, rx_max),
1251 __field(u32, tx_max)
1253 __field(u32, rx_max)
1259 __entry->tx_max = *tx_max;
1261 __entry->rx_max = *rx_max;
1265 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1267 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1271 DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1272 TP_PROTO(struct ieee80211_local *local),
1276 DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1277 TP_PROTO(struct ieee80211_local *local),
1281 TRACE_EVENT(drv_set_bitrate_mask,
1282 TP_PROTO(struct ieee80211_local *local,
1283 struct ieee80211_sub_if_data *sdata,
1284 const struct cfg80211_bitrate_mask *mask),
1286 TP_ARGS(local, sdata, mask),
1291 __field(u32, legacy_2g)
1292 __field(u32, legacy_5g)
1298 __entry->legacy_2g = mask->control[NL80211_BAND_2GHZ].legacy;
1299 __entry->legacy_5g = mask->control[NL80211_BAND_5GHZ].legacy;
1303 LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1304 LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1308 TRACE_EVENT(drv_set_rekey_data,
1309 TP_PROTO(struct ieee80211_local *local,
1310 struct ieee80211_sub_if_data *sdata,
1311 struct cfg80211_gtk_rekey_data *data),
1313 TP_ARGS(local, sdata, data),
1318 __array(u8, kek, NL80211_KEK_LEN)
1319 __array(u8, kck, NL80211_KCK_LEN)
1320 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1326 memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1327 memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1328 memcpy(__entry->replay_ctr, data->replay_ctr,
1329 NL80211_REPLAY_CTR_LEN);
1332 TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1333 LOCAL_PR_ARG, VIF_PR_ARG)
1336 TRACE_EVENT(drv_event_callback,
1337 TP_PROTO(struct ieee80211_local *local,
1338 struct ieee80211_sub_if_data *sdata,
1339 const struct ieee80211_event *_event),
1341 TP_ARGS(local, sdata, _event),
1352 __entry->type = _event->type;
1356 LOCAL_PR_FMT VIF_PR_FMT " event:%d",
1357 LOCAL_PR_ARG, VIF_PR_ARG, __entry->type
1361 DECLARE_EVENT_CLASS(release_evt,
1362 TP_PROTO(struct ieee80211_local *local,
1363 struct ieee80211_sta *sta,
1364 u16 tids, int num_frames,
1365 enum ieee80211_frame_release_type reason,
1368 TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1374 __field(int, num_frames)
1375 __field(int, reason)
1376 __field(bool, more_data)
1382 __entry->tids = tids;
1383 __entry->num_frames = num_frames;
1384 __entry->reason = reason;
1385 __entry->more_data = more_data;
1389 LOCAL_PR_FMT STA_PR_FMT
1390 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1391 LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1392 __entry->reason, __entry->more_data
1396 DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1397 TP_PROTO(struct ieee80211_local *local,
1398 struct ieee80211_sta *sta,
1399 u16 tids, int num_frames,
1400 enum ieee80211_frame_release_type reason,
1403 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1406 DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1407 TP_PROTO(struct ieee80211_local *local,
1408 struct ieee80211_sta *sta,
1409 u16 tids, int num_frames,
1410 enum ieee80211_frame_release_type reason,
1413 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1416 DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
1417 TP_PROTO(struct ieee80211_local *local,
1418 struct ieee80211_sub_if_data *sdata),
1420 TP_ARGS(local, sdata)
1423 DEFINE_EVENT(local_sdata_evt, drv_mgd_protect_tdls_discover,
1424 TP_PROTO(struct ieee80211_local *local,
1425 struct ieee80211_sub_if_data *sdata),
1427 TP_ARGS(local, sdata)
1430 DECLARE_EVENT_CLASS(local_chanctx,
1431 TP_PROTO(struct ieee80211_local *local,
1432 struct ieee80211_chanctx *ctx),
1434 TP_ARGS(local, ctx),
1447 LOCAL_PR_FMT CHANCTX_PR_FMT,
1448 LOCAL_PR_ARG, CHANCTX_PR_ARG
1452 DEFINE_EVENT(local_chanctx, drv_add_chanctx,
1453 TP_PROTO(struct ieee80211_local *local,
1454 struct ieee80211_chanctx *ctx),
1458 DEFINE_EVENT(local_chanctx, drv_remove_chanctx,
1459 TP_PROTO(struct ieee80211_local *local,
1460 struct ieee80211_chanctx *ctx),
1464 TRACE_EVENT(drv_change_chanctx,
1465 TP_PROTO(struct ieee80211_local *local,
1466 struct ieee80211_chanctx *ctx,
1469 TP_ARGS(local, ctx, changed),
1474 __field(u32, changed)
1480 __entry->changed = changed;
1484 LOCAL_PR_FMT CHANCTX_PR_FMT " changed:%#x",
1485 LOCAL_PR_ARG, CHANCTX_PR_ARG, __entry->changed
1489 #if !defined(__TRACE_VIF_ENTRY)
1490 #define __TRACE_VIF_ENTRY
1491 struct trace_vif_entry {
1492 enum nl80211_iftype vif_type;
1494 char vif_name[IFNAMSIZ];
1497 struct trace_chandef_entry {
1504 struct trace_switch_entry {
1505 struct trace_vif_entry vif;
1506 struct trace_chandef_entry old_chandef;
1507 struct trace_chandef_entry new_chandef;
1510 #define SWITCH_ENTRY_ASSIGN(to, from) local_vifs[i].to = vifs[i].from
1513 TRACE_EVENT(drv_switch_vif_chanctx,
1514 TP_PROTO(struct ieee80211_local *local,
1515 struct ieee80211_vif_chanctx_switch *vifs,
1516 int n_vifs, enum ieee80211_chanctx_switch_mode mode),
1517 TP_ARGS(local, vifs, n_vifs, mode),
1521 __field(int, n_vifs)
1523 __dynamic_array(u8, vifs,
1524 sizeof(struct trace_switch_entry) * n_vifs)
1529 __entry->n_vifs = n_vifs;
1530 __entry->mode = mode;
1532 struct trace_switch_entry *local_vifs =
1533 __get_dynamic_array(vifs);
1536 for (i = 0; i < n_vifs; i++) {
1537 struct ieee80211_sub_if_data *sdata;
1539 sdata = container_of(vifs[i].vif,
1540 struct ieee80211_sub_if_data,
1543 SWITCH_ENTRY_ASSIGN(vif.vif_type, vif->type);
1544 SWITCH_ENTRY_ASSIGN(vif.p2p, vif->p2p);
1545 strncpy(local_vifs[i].vif.vif_name,
1547 sizeof(local_vifs[i].vif.vif_name));
1548 SWITCH_ENTRY_ASSIGN(old_chandef.control_freq,
1549 old_ctx->def.chan->center_freq);
1550 SWITCH_ENTRY_ASSIGN(old_chandef.chan_width,
1551 old_ctx->def.width);
1552 SWITCH_ENTRY_ASSIGN(old_chandef.center_freq1,
1553 old_ctx->def.center_freq1);
1554 SWITCH_ENTRY_ASSIGN(old_chandef.center_freq2,
1555 old_ctx->def.center_freq2);
1556 SWITCH_ENTRY_ASSIGN(new_chandef.control_freq,
1557 new_ctx->def.chan->center_freq);
1558 SWITCH_ENTRY_ASSIGN(new_chandef.chan_width,
1559 new_ctx->def.width);
1560 SWITCH_ENTRY_ASSIGN(new_chandef.center_freq1,
1561 new_ctx->def.center_freq1);
1562 SWITCH_ENTRY_ASSIGN(new_chandef.center_freq2,
1563 new_ctx->def.center_freq2);
1569 LOCAL_PR_FMT " n_vifs:%d mode:%d",
1570 LOCAL_PR_ARG, __entry->n_vifs, __entry->mode
1574 DECLARE_EVENT_CLASS(local_sdata_chanctx,
1575 TP_PROTO(struct ieee80211_local *local,
1576 struct ieee80211_sub_if_data *sdata,
1577 struct ieee80211_chanctx *ctx),
1579 TP_ARGS(local, sdata, ctx),
1594 LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT,
1595 LOCAL_PR_ARG, VIF_PR_ARG, CHANCTX_PR_ARG
1599 DEFINE_EVENT(local_sdata_chanctx, drv_assign_vif_chanctx,
1600 TP_PROTO(struct ieee80211_local *local,
1601 struct ieee80211_sub_if_data *sdata,
1602 struct ieee80211_chanctx *ctx),
1603 TP_ARGS(local, sdata, ctx)
1606 DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
1607 TP_PROTO(struct ieee80211_local *local,
1608 struct ieee80211_sub_if_data *sdata,
1609 struct ieee80211_chanctx *ctx),
1610 TP_ARGS(local, sdata, ctx)
1613 TRACE_EVENT(drv_start_ap,
1614 TP_PROTO(struct ieee80211_local *local,
1615 struct ieee80211_sub_if_data *sdata,
1616 struct ieee80211_bss_conf *info),
1618 TP_ARGS(local, sdata, info),
1623 __field(u8, dtimper)
1624 __field(u16, bcnint)
1625 __dynamic_array(u8, ssid, info->ssid_len);
1626 __field(bool, hidden_ssid);
1632 __entry->dtimper = info->dtim_period;
1633 __entry->bcnint = info->beacon_int;
1634 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
1635 __entry->hidden_ssid = info->hidden_ssid;
1639 LOCAL_PR_FMT VIF_PR_FMT,
1640 LOCAL_PR_ARG, VIF_PR_ARG
1644 DEFINE_EVENT(local_sdata_evt, drv_stop_ap,
1645 TP_PROTO(struct ieee80211_local *local,
1646 struct ieee80211_sub_if_data *sdata),
1647 TP_ARGS(local, sdata)
1650 TRACE_EVENT(drv_reconfig_complete,
1651 TP_PROTO(struct ieee80211_local *local,
1652 enum ieee80211_reconfig_type reconfig_type),
1653 TP_ARGS(local, reconfig_type),
1657 __field(u8, reconfig_type)
1662 __entry->reconfig_type = reconfig_type;
1666 LOCAL_PR_FMT " reconfig_type:%d",
1667 LOCAL_PR_ARG, __entry->reconfig_type
1672 #if IS_ENABLED(CONFIG_IPV6)
1673 DEFINE_EVENT(local_sdata_evt, drv_ipv6_addr_change,
1674 TP_PROTO(struct ieee80211_local *local,
1675 struct ieee80211_sub_if_data *sdata),
1676 TP_ARGS(local, sdata)
1680 TRACE_EVENT(drv_join_ibss,
1681 TP_PROTO(struct ieee80211_local *local,
1682 struct ieee80211_sub_if_data *sdata,
1683 struct ieee80211_bss_conf *info),
1685 TP_ARGS(local, sdata, info),
1690 __field(u8, dtimper)
1691 __field(u16, bcnint)
1692 __dynamic_array(u8, ssid, info->ssid_len);
1698 __entry->dtimper = info->dtim_period;
1699 __entry->bcnint = info->beacon_int;
1700 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
1704 LOCAL_PR_FMT VIF_PR_FMT,
1705 LOCAL_PR_ARG, VIF_PR_ARG
1709 DEFINE_EVENT(local_sdata_evt, drv_leave_ibss,
1710 TP_PROTO(struct ieee80211_local *local,
1711 struct ieee80211_sub_if_data *sdata),
1712 TP_ARGS(local, sdata)
1715 TRACE_EVENT(drv_get_expected_throughput,
1716 TP_PROTO(struct ieee80211_sta *sta),
1729 STA_PR_FMT, STA_PR_ARG
1733 TRACE_EVENT(drv_start_nan,
1734 TP_PROTO(struct ieee80211_local *local,
1735 struct ieee80211_sub_if_data *sdata,
1736 struct cfg80211_nan_conf *conf),
1738 TP_ARGS(local, sdata, conf),
1742 __field(u8, master_pref)
1749 __entry->master_pref = conf->master_pref;
1750 __entry->bands = conf->bands;
1754 LOCAL_PR_FMT VIF_PR_FMT
1755 ", master preference: %u, bands: 0x%0x",
1756 LOCAL_PR_ARG, VIF_PR_ARG, __entry->master_pref,
1761 TRACE_EVENT(drv_stop_nan,
1762 TP_PROTO(struct ieee80211_local *local,
1763 struct ieee80211_sub_if_data *sdata),
1765 TP_ARGS(local, sdata),
1778 LOCAL_PR_FMT VIF_PR_FMT,
1779 LOCAL_PR_ARG, VIF_PR_ARG
1783 TRACE_EVENT(drv_nan_change_conf,
1784 TP_PROTO(struct ieee80211_local *local,
1785 struct ieee80211_sub_if_data *sdata,
1786 struct cfg80211_nan_conf *conf,
1789 TP_ARGS(local, sdata, conf, changes),
1793 __field(u8, master_pref)
1795 __field(u32, changes)
1801 __entry->master_pref = conf->master_pref;
1802 __entry->bands = conf->bands;
1803 __entry->changes = changes;
1807 LOCAL_PR_FMT VIF_PR_FMT
1808 ", master preference: %u, bands: 0x%0x, changes: 0x%x",
1809 LOCAL_PR_ARG, VIF_PR_ARG, __entry->master_pref,
1810 __entry->bands, __entry->changes
1814 TRACE_EVENT(drv_add_nan_func,
1815 TP_PROTO(struct ieee80211_local *local,
1816 struct ieee80211_sub_if_data *sdata,
1817 const struct cfg80211_nan_func *func),
1819 TP_ARGS(local, sdata, func),
1824 __field(u8, inst_id)
1830 __entry->type = func->type;
1831 __entry->inst_id = func->instance_id;
1835 LOCAL_PR_FMT VIF_PR_FMT
1836 ", type: %u, inst_id: %u",
1837 LOCAL_PR_ARG, VIF_PR_ARG, __entry->type, __entry->inst_id
1841 TRACE_EVENT(drv_del_nan_func,
1842 TP_PROTO(struct ieee80211_local *local,
1843 struct ieee80211_sub_if_data *sdata,
1846 TP_ARGS(local, sdata, instance_id),
1850 __field(u8, instance_id)
1856 __entry->instance_id = instance_id;
1860 LOCAL_PR_FMT VIF_PR_FMT
1861 ", instance_id: %u",
1862 LOCAL_PR_ARG, VIF_PR_ARG, __entry->instance_id
1867 * Tracing for API calls that drivers call.
1870 TRACE_EVENT(api_start_tx_ba_session,
1871 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1886 STA_PR_FMT " tid:%d",
1887 STA_PR_ARG, __entry->tid
1891 TRACE_EVENT(api_start_tx_ba_cb,
1892 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1894 TP_ARGS(sdata, ra, tid),
1898 __array(u8, ra, ETH_ALEN)
1904 memcpy(__entry->ra, ra, ETH_ALEN);
1909 VIF_PR_FMT " ra:%pM tid:%d",
1910 VIF_PR_ARG, __entry->ra, __entry->tid
1914 TRACE_EVENT(api_stop_tx_ba_session,
1915 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1930 STA_PR_FMT " tid:%d",
1931 STA_PR_ARG, __entry->tid
1935 TRACE_EVENT(api_stop_tx_ba_cb,
1936 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1938 TP_ARGS(sdata, ra, tid),
1942 __array(u8, ra, ETH_ALEN)
1948 memcpy(__entry->ra, ra, ETH_ALEN);
1953 VIF_PR_FMT " ra:%pM tid:%d",
1954 VIF_PR_ARG, __entry->ra, __entry->tid
1958 DEFINE_EVENT(local_only_evt, api_restart_hw,
1959 TP_PROTO(struct ieee80211_local *local),
1963 TRACE_EVENT(api_beacon_loss,
1964 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1982 TRACE_EVENT(api_connection_loss,
1983 TP_PROTO(struct ieee80211_sub_if_data *sdata),
2001 TRACE_EVENT(api_cqm_rssi_notify,
2002 TP_PROTO(struct ieee80211_sub_if_data *sdata,
2003 enum nl80211_cqm_rssi_threshold_event rssi_event,
2006 TP_ARGS(sdata, rssi_event, rssi_level),
2010 __field(u32, rssi_event)
2011 __field(s32, rssi_level)
2016 __entry->rssi_event = rssi_event;
2017 __entry->rssi_level = rssi_level;
2021 VIF_PR_FMT " event:%d rssi:%d",
2022 VIF_PR_ARG, __entry->rssi_event, __entry->rssi_level
2026 DEFINE_EVENT(local_sdata_evt, api_cqm_beacon_loss_notify,
2027 TP_PROTO(struct ieee80211_local *local,
2028 struct ieee80211_sub_if_data *sdata),
2029 TP_ARGS(local, sdata)
2032 TRACE_EVENT(api_scan_completed,
2033 TP_PROTO(struct ieee80211_local *local, bool aborted),
2035 TP_ARGS(local, aborted),
2039 __field(bool, aborted)
2044 __entry->aborted = aborted;
2048 LOCAL_PR_FMT " aborted:%d",
2049 LOCAL_PR_ARG, __entry->aborted
2053 TRACE_EVENT(api_sched_scan_results,
2054 TP_PROTO(struct ieee80211_local *local),
2067 LOCAL_PR_FMT, LOCAL_PR_ARG
2071 TRACE_EVENT(api_sched_scan_stopped,
2072 TP_PROTO(struct ieee80211_local *local),
2085 LOCAL_PR_FMT, LOCAL_PR_ARG
2089 TRACE_EVENT(api_sta_block_awake,
2090 TP_PROTO(struct ieee80211_local *local,
2091 struct ieee80211_sta *sta, bool block),
2093 TP_ARGS(local, sta, block),
2098 __field(bool, block)
2104 __entry->block = block;
2108 LOCAL_PR_FMT STA_PR_FMT " block:%d",
2109 LOCAL_PR_ARG, STA_PR_ARG, __entry->block
2113 TRACE_EVENT(api_chswitch_done,
2114 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
2116 TP_ARGS(sdata, success),
2120 __field(bool, success)
2125 __entry->success = success;
2129 VIF_PR_FMT " success=%d",
2130 VIF_PR_ARG, __entry->success
2134 DEFINE_EVENT(local_only_evt, api_ready_on_channel,
2135 TP_PROTO(struct ieee80211_local *local),
2139 DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
2140 TP_PROTO(struct ieee80211_local *local),
2144 TRACE_EVENT(api_gtk_rekey_notify,
2145 TP_PROTO(struct ieee80211_sub_if_data *sdata,
2146 const u8 *bssid, const u8 *replay_ctr),
2148 TP_ARGS(sdata, bssid, replay_ctr),
2152 __array(u8, bssid, ETH_ALEN)
2153 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
2158 memcpy(__entry->bssid, bssid, ETH_ALEN);
2159 memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
2162 TP_printk(VIF_PR_FMT, VIF_PR_ARG)
2165 TRACE_EVENT(api_enable_rssi_reports,
2166 TP_PROTO(struct ieee80211_sub_if_data *sdata,
2167 int rssi_min_thold, int rssi_max_thold),
2169 TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
2173 __field(int, rssi_min_thold)
2174 __field(int, rssi_max_thold)
2179 __entry->rssi_min_thold = rssi_min_thold;
2180 __entry->rssi_max_thold = rssi_max_thold;
2184 VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
2185 VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
2189 TRACE_EVENT(api_eosp,
2190 TP_PROTO(struct ieee80211_local *local,
2191 struct ieee80211_sta *sta),
2193 TP_ARGS(local, sta),
2206 LOCAL_PR_FMT STA_PR_FMT,
2207 LOCAL_PR_ARG, STA_PR_ARG
2211 TRACE_EVENT(api_send_eosp_nullfunc,
2212 TP_PROTO(struct ieee80211_local *local,
2213 struct ieee80211_sta *sta,
2216 TP_ARGS(local, sta, tid),
2231 LOCAL_PR_FMT STA_PR_FMT " tid:%d",
2232 LOCAL_PR_ARG, STA_PR_ARG, __entry->tid
2236 TRACE_EVENT(api_sta_set_buffered,
2237 TP_PROTO(struct ieee80211_local *local,
2238 struct ieee80211_sta *sta,
2239 u8 tid, bool buffered),
2241 TP_ARGS(local, sta, tid, buffered),
2247 __field(bool, buffered)
2254 __entry->buffered = buffered;
2258 LOCAL_PR_FMT STA_PR_FMT " tid:%d buffered:%d",
2259 LOCAL_PR_ARG, STA_PR_ARG, __entry->tid, __entry->buffered
2264 * Tracing for internal functions
2265 * (which may also be called in response to driver calls)
2268 TRACE_EVENT(wake_queue,
2269 TP_PROTO(struct ieee80211_local *local, u16 queue,
2270 enum queue_stop_reason reason),
2272 TP_ARGS(local, queue, reason),
2277 __field(u32, reason)
2282 __entry->queue = queue;
2283 __entry->reason = reason;
2287 LOCAL_PR_FMT " queue:%d, reason:%d",
2288 LOCAL_PR_ARG, __entry->queue, __entry->reason
2292 TRACE_EVENT(stop_queue,
2293 TP_PROTO(struct ieee80211_local *local, u16 queue,
2294 enum queue_stop_reason reason),
2296 TP_ARGS(local, queue, reason),
2301 __field(u32, reason)
2306 __entry->queue = queue;
2307 __entry->reason = reason;
2311 LOCAL_PR_FMT " queue:%d, reason:%d",
2312 LOCAL_PR_ARG, __entry->queue, __entry->reason
2316 TRACE_EVENT(drv_set_default_unicast_key,
2317 TP_PROTO(struct ieee80211_local *local,
2318 struct ieee80211_sub_if_data *sdata,
2321 TP_ARGS(local, sdata, key_idx),
2326 __field(int, key_idx)
2332 __entry->key_idx = key_idx;
2335 TP_printk(LOCAL_PR_FMT VIF_PR_FMT " key_idx:%d",
2336 LOCAL_PR_ARG, VIF_PR_ARG, __entry->key_idx)
2339 TRACE_EVENT(api_radar_detected,
2340 TP_PROTO(struct ieee80211_local *local),
2353 LOCAL_PR_FMT " radar detected",
2358 TRACE_EVENT(drv_channel_switch_beacon,
2359 TP_PROTO(struct ieee80211_local *local,
2360 struct ieee80211_sub_if_data *sdata,
2361 struct cfg80211_chan_def *chandef),
2363 TP_ARGS(local, sdata, chandef),
2374 CHANDEF_ASSIGN(chandef);
2378 LOCAL_PR_FMT VIF_PR_FMT " channel switch to " CHANDEF_PR_FMT,
2379 LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG
2383 TRACE_EVENT(drv_pre_channel_switch,
2384 TP_PROTO(struct ieee80211_local *local,
2385 struct ieee80211_sub_if_data *sdata,
2386 struct ieee80211_channel_switch *ch_switch),
2388 TP_ARGS(local, sdata, ch_switch),
2394 __field(u64, timestamp)
2395 __field(u32, device_timestamp)
2396 __field(bool, block_tx)
2403 CHANDEF_ASSIGN(&ch_switch->chandef)
2404 __entry->timestamp = ch_switch->timestamp;
2405 __entry->device_timestamp = ch_switch->device_timestamp;
2406 __entry->block_tx = ch_switch->block_tx;
2407 __entry->count = ch_switch->count;
2411 LOCAL_PR_FMT VIF_PR_FMT " prepare channel switch to "
2412 CHANDEF_PR_FMT " count:%d block_tx:%d timestamp:%llu",
2413 LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count,
2414 __entry->block_tx, __entry->timestamp
2418 DEFINE_EVENT(local_sdata_evt, drv_post_channel_switch,
2419 TP_PROTO(struct ieee80211_local *local,
2420 struct ieee80211_sub_if_data *sdata),
2421 TP_ARGS(local, sdata)
2424 TRACE_EVENT(drv_get_txpower,
2425 TP_PROTO(struct ieee80211_local *local,
2426 struct ieee80211_sub_if_data *sdata,
2429 TP_ARGS(local, sdata, dbm, ret),
2446 LOCAL_PR_FMT VIF_PR_FMT " dbm:%d ret:%d",
2447 LOCAL_PR_ARG, VIF_PR_ARG, __entry->dbm, __entry->ret
2451 TRACE_EVENT(drv_tdls_channel_switch,
2452 TP_PROTO(struct ieee80211_local *local,
2453 struct ieee80211_sub_if_data *sdata,
2454 struct ieee80211_sta *sta, u8 oper_class,
2455 struct cfg80211_chan_def *chandef),
2457 TP_ARGS(local, sdata, sta, oper_class, chandef),
2463 __field(u8, oper_class)
2471 __entry->oper_class = oper_class;
2472 CHANDEF_ASSIGN(chandef)
2476 LOCAL_PR_FMT VIF_PR_FMT " tdls channel switch to"
2477 CHANDEF_PR_FMT " oper_class:%d " STA_PR_FMT,
2478 LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->oper_class,
2483 TRACE_EVENT(drv_tdls_cancel_channel_switch,
2484 TP_PROTO(struct ieee80211_local *local,
2485 struct ieee80211_sub_if_data *sdata,
2486 struct ieee80211_sta *sta),
2488 TP_ARGS(local, sdata, sta),
2503 LOCAL_PR_FMT VIF_PR_FMT
2504 " tdls cancel channel switch with " STA_PR_FMT,
2505 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
2509 TRACE_EVENT(drv_tdls_recv_channel_switch,
2510 TP_PROTO(struct ieee80211_local *local,
2511 struct ieee80211_sub_if_data *sdata,
2512 struct ieee80211_tdls_ch_sw_params *params),
2514 TP_ARGS(local, sdata, params),
2519 __field(u8, action_code)
2522 __field(u32, status)
2523 __field(bool, peer_initiator)
2524 __field(u32, timestamp)
2525 __field(u16, switch_time)
2526 __field(u16, switch_timeout)
2532 STA_NAMED_ASSIGN(params->sta);
2533 CHANDEF_ASSIGN(params->chandef)
2534 __entry->peer_initiator = params->sta->tdls_initiator;
2535 __entry->action_code = params->action_code;
2536 __entry->status = params->status;
2537 __entry->timestamp = params->timestamp;
2538 __entry->switch_time = params->switch_time;
2539 __entry->switch_timeout = params->switch_timeout;
2543 LOCAL_PR_FMT VIF_PR_FMT " received tdls channel switch packet"
2544 " action:%d status:%d time:%d switch time:%d switch"
2545 " timeout:%d initiator: %d chan:" CHANDEF_PR_FMT STA_PR_FMT,
2546 LOCAL_PR_ARG, VIF_PR_ARG, __entry->action_code, __entry->status,
2547 __entry->timestamp, __entry->switch_time,
2548 __entry->switch_timeout, __entry->peer_initiator,
2549 CHANDEF_PR_ARG, STA_PR_ARG
2553 TRACE_EVENT(drv_wake_tx_queue,
2554 TP_PROTO(struct ieee80211_local *local,
2555 struct ieee80211_sub_if_data *sdata,
2556 struct txq_info *txq),
2558 TP_ARGS(local, sdata, txq),
2569 struct ieee80211_sta *sta = txq->txq.sta;
2574 __entry->ac = txq->txq.ac;
2575 __entry->tid = txq->txq.tid;
2579 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d",
2580 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid
2584 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
2586 #undef TRACE_INCLUDE_PATH
2587 #define TRACE_INCLUDE_PATH .
2588 #undef TRACE_INCLUDE_FILE
2589 #define TRACE_INCLUDE_FILE trace
2590 #include <trace/define_trace.h>