1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Portions of this file
4 * Copyright(c) 2016 Intel Deutschland GmbH
5 * Copyright (C) 2018 Intel Corporation
8 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
9 #define __MAC80211_DRIVER_TRACE
11 #include <linux/tracepoint.h>
12 #include <net/mac80211.h>
13 #include "ieee80211_i.h"
16 #define TRACE_SYSTEM mac80211
19 #define LOCAL_ENTRY __array(char, wiphy_name, 32)
20 #define LOCAL_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
21 #define LOCAL_PR_FMT "%s"
22 #define LOCAL_PR_ARG __entry->wiphy_name
24 #define STA_ENTRY __array(char, sta_addr, ETH_ALEN)
25 #define STA_ASSIGN (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
26 #define STA_NAMED_ASSIGN(s) memcpy(__entry->sta_addr, (s)->addr, ETH_ALEN)
27 #define STA_PR_FMT " sta:%pM"
28 #define STA_PR_ARG __entry->sta_addr
30 #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
32 __string(vif_name, sdata->name)
33 #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
34 __entry->p2p = sdata->vif.p2p; \
35 __assign_str(vif_name, sdata->name)
36 #define VIF_PR_FMT " vif:%s(%d%s)"
37 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
39 #define CHANDEF_ENTRY __field(u32, control_freq) \
40 __field(u32, chan_width) \
41 __field(u32, center_freq1) \
42 __field(u32, center_freq2)
43 #define CHANDEF_ASSIGN(c) \
44 __entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0; \
45 __entry->chan_width = (c) ? (c)->width : 0; \
46 __entry->center_freq1 = (c) ? (c)->center_freq1 : 0; \
47 __entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
48 #define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
49 #define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \
50 __entry->center_freq1, __entry->center_freq2
52 #define MIN_CHANDEF_ENTRY \
53 __field(u32, min_control_freq) \
54 __field(u32, min_chan_width) \
55 __field(u32, min_center_freq1) \
56 __field(u32, min_center_freq2)
58 #define MIN_CHANDEF_ASSIGN(c) \
59 __entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
60 __entry->min_chan_width = (c)->width; \
61 __entry->min_center_freq1 = (c)->center_freq1; \
62 __entry->min_center_freq2 = (c)->center_freq2;
63 #define MIN_CHANDEF_PR_FMT " min_control:%d MHz min_width:%d min_center: %d/%d MHz"
64 #define MIN_CHANDEF_PR_ARG __entry->min_control_freq, __entry->min_chan_width, \
65 __entry->min_center_freq1, __entry->min_center_freq2
67 #define CHANCTX_ENTRY CHANDEF_ENTRY \
69 __field(u8, rx_chains_static) \
70 __field(u8, rx_chains_dynamic)
71 #define CHANCTX_ASSIGN CHANDEF_ASSIGN(&ctx->conf.def) \
72 MIN_CHANDEF_ASSIGN(&ctx->conf.min_def) \
73 __entry->rx_chains_static = ctx->conf.rx_chains_static; \
74 __entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
75 #define CHANCTX_PR_FMT CHANDEF_PR_FMT MIN_CHANDEF_PR_FMT " chains:%d/%d"
76 #define CHANCTX_PR_ARG CHANDEF_PR_ARG, MIN_CHANDEF_PR_ARG, \
77 __entry->rx_chains_static, __entry->rx_chains_dynamic
79 #define KEY_ENTRY __field(u32, cipher) \
80 __field(u8, hw_key_idx) \
83 #define KEY_ASSIGN(k) __entry->cipher = (k)->cipher; \
84 __entry->flags = (k)->flags; \
85 __entry->keyidx = (k)->keyidx; \
86 __entry->hw_key_idx = (k)->hw_key_idx;
87 #define KEY_PR_FMT " cipher:0x%x, flags=%#x, keyidx=%d, hw_key_idx=%d"
88 #define KEY_PR_ARG __entry->cipher, __entry->flags, __entry->keyidx, __entry->hw_key_idx
90 #define AMPDU_ACTION_ENTRY __field(enum ieee80211_ampdu_mlme_action, \
91 ieee80211_ampdu_mlme_action) \
95 __field(u16, buf_size) \
96 __field(bool, amsdu) \
97 __field(u16, timeout) \
99 #define AMPDU_ACTION_ASSIGN STA_NAMED_ASSIGN(params->sta); \
100 __entry->tid = params->tid; \
101 __entry->ssn = params->ssn; \
102 __entry->buf_size = params->buf_size; \
103 __entry->amsdu = params->amsdu; \
104 __entry->timeout = params->timeout; \
105 __entry->action = params->action;
106 #define AMPDU_ACTION_PR_FMT STA_PR_FMT " tid %d, ssn %d, buf_size %u, amsdu %d, timeout %d action %d"
107 #define AMPDU_ACTION_PR_ARG STA_PR_ARG, __entry->tid, __entry->ssn, \
108 __entry->buf_size, __entry->amsdu, __entry->timeout, \
112 * Tracing for driver callbacks.
115 DECLARE_EVENT_CLASS(local_only_evt
,
116 TP_PROTO(struct ieee80211_local
*local
),
124 TP_printk(LOCAL_PR_FMT
, LOCAL_PR_ARG
)
127 DECLARE_EVENT_CLASS(local_sdata_addr_evt
,
128 TP_PROTO(struct ieee80211_local
*local
,
129 struct ieee80211_sub_if_data
*sdata
),
130 TP_ARGS(local
, sdata
),
135 __array(char, addr
, ETH_ALEN
)
141 memcpy(__entry
->addr
, sdata
->vif
.addr
, ETH_ALEN
);
145 LOCAL_PR_FMT VIF_PR_FMT
" addr:%pM",
146 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->addr
150 DECLARE_EVENT_CLASS(local_u32_evt
,
151 TP_PROTO(struct ieee80211_local
*local
, u32 value
),
152 TP_ARGS(local
, value
),
161 __entry
->value
= value
;
165 LOCAL_PR_FMT
" value:%d",
166 LOCAL_PR_ARG
, __entry
->value
170 DECLARE_EVENT_CLASS(local_sdata_evt
,
171 TP_PROTO(struct ieee80211_local
*local
,
172 struct ieee80211_sub_if_data
*sdata
),
173 TP_ARGS(local
, sdata
),
186 LOCAL_PR_FMT VIF_PR_FMT
,
187 LOCAL_PR_ARG
, VIF_PR_ARG
191 DEFINE_EVENT(local_only_evt
, drv_return_void
,
192 TP_PROTO(struct ieee80211_local
*local
),
196 TRACE_EVENT(drv_return_int
,
197 TP_PROTO(struct ieee80211_local
*local
, int ret
),
207 TP_printk(LOCAL_PR_FMT
" - %d", LOCAL_PR_ARG
, __entry
->ret
)
210 TRACE_EVENT(drv_return_bool
,
211 TP_PROTO(struct ieee80211_local
*local
, bool ret
),
221 TP_printk(LOCAL_PR_FMT
" - %s", LOCAL_PR_ARG
, (__entry
->ret
) ?
225 TRACE_EVENT(drv_return_u32
,
226 TP_PROTO(struct ieee80211_local
*local
, u32 ret
),
236 TP_printk(LOCAL_PR_FMT
" - %u", LOCAL_PR_ARG
, __entry
->ret
)
239 TRACE_EVENT(drv_return_u64
,
240 TP_PROTO(struct ieee80211_local
*local
, u64 ret
),
250 TP_printk(LOCAL_PR_FMT
" - %llu", LOCAL_PR_ARG
, __entry
->ret
)
253 DEFINE_EVENT(local_only_evt
, drv_start
,
254 TP_PROTO(struct ieee80211_local
*local
),
258 DEFINE_EVENT(local_u32_evt
, drv_get_et_strings
,
259 TP_PROTO(struct ieee80211_local
*local
, u32 sset
),
263 DEFINE_EVENT(local_u32_evt
, drv_get_et_sset_count
,
264 TP_PROTO(struct ieee80211_local
*local
, u32 sset
),
268 DEFINE_EVENT(local_only_evt
, drv_get_et_stats
,
269 TP_PROTO(struct ieee80211_local
*local
),
273 DEFINE_EVENT(local_only_evt
, drv_suspend
,
274 TP_PROTO(struct ieee80211_local
*local
),
278 DEFINE_EVENT(local_only_evt
, drv_resume
,
279 TP_PROTO(struct ieee80211_local
*local
),
283 TRACE_EVENT(drv_set_wakeup
,
284 TP_PROTO(struct ieee80211_local
*local
, bool enabled
),
285 TP_ARGS(local
, enabled
),
288 __field(bool, enabled
)
292 __entry
->enabled
= enabled
;
294 TP_printk(LOCAL_PR_FMT
" enabled:%d", LOCAL_PR_ARG
, __entry
->enabled
)
297 DEFINE_EVENT(local_only_evt
, drv_stop
,
298 TP_PROTO(struct ieee80211_local
*local
),
302 DEFINE_EVENT(local_sdata_addr_evt
, drv_add_interface
,
303 TP_PROTO(struct ieee80211_local
*local
,
304 struct ieee80211_sub_if_data
*sdata
),
305 TP_ARGS(local
, sdata
)
308 TRACE_EVENT(drv_change_interface
,
309 TP_PROTO(struct ieee80211_local
*local
,
310 struct ieee80211_sub_if_data
*sdata
,
311 enum nl80211_iftype type
, bool p2p
),
313 TP_ARGS(local
, sdata
, type
, p2p
),
318 __field(u32
, new_type
)
319 __field(bool, new_p2p
)
325 __entry
->new_type
= type
;
326 __entry
->new_p2p
= p2p
;
330 LOCAL_PR_FMT VIF_PR_FMT
" new type:%d%s",
331 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->new_type
,
332 __entry
->new_p2p
? "/p2p" : ""
336 DEFINE_EVENT(local_sdata_addr_evt
, drv_remove_interface
,
337 TP_PROTO(struct ieee80211_local
*local
,
338 struct ieee80211_sub_if_data
*sdata
),
339 TP_ARGS(local
, sdata
)
342 TRACE_EVENT(drv_config
,
343 TP_PROTO(struct ieee80211_local
*local
,
346 TP_ARGS(local
, changed
),
350 __field(u32
, changed
)
352 __field(int, power_level
)
353 __field(int, dynamic_ps_timeout
)
354 __field(u16
, listen_interval
)
355 __field(u8
, long_frame_max_tx_count
)
356 __field(u8
, short_frame_max_tx_count
)
363 __entry
->changed
= changed
;
364 __entry
->flags
= local
->hw
.conf
.flags
;
365 __entry
->power_level
= local
->hw
.conf
.power_level
;
366 __entry
->dynamic_ps_timeout
= local
->hw
.conf
.dynamic_ps_timeout
;
367 __entry
->listen_interval
= local
->hw
.conf
.listen_interval
;
368 __entry
->long_frame_max_tx_count
=
369 local
->hw
.conf
.long_frame_max_tx_count
;
370 __entry
->short_frame_max_tx_count
=
371 local
->hw
.conf
.short_frame_max_tx_count
;
372 CHANDEF_ASSIGN(&local
->hw
.conf
.chandef
)
373 __entry
->smps
= local
->hw
.conf
.smps_mode
;
377 LOCAL_PR_FMT
" ch:%#x" CHANDEF_PR_FMT
,
378 LOCAL_PR_ARG
, __entry
->changed
, CHANDEF_PR_ARG
382 TRACE_EVENT(drv_bss_info_changed
,
383 TP_PROTO(struct ieee80211_local
*local
,
384 struct ieee80211_sub_if_data
*sdata
,
385 struct ieee80211_bss_conf
*info
,
388 TP_ARGS(local
, sdata
, info
, changed
),
393 __field(u32
, changed
)
395 __field(bool, ibss_joined
)
396 __field(bool, ibss_creator
)
399 __field(bool, shortpre
)
400 __field(bool, shortslot
)
401 __field(bool, enable_beacon
)
404 __field(u16
, assoc_cap
)
405 __field(u64
, sync_tsf
)
406 __field(u32
, sync_device_ts
)
407 __field(u8
, sync_dtim_count
)
408 __field(u32
, basic_rates
)
409 __array(int, mcast_rate
, NUM_NL80211_BANDS
)
410 __field(u16
, ht_operation_mode
)
411 __field(s32
, cqm_rssi_thold
);
412 __field(s32
, cqm_rssi_hyst
);
413 __field(u32
, channel_width
);
414 __field(u32
, channel_cfreq1
);
415 __dynamic_array(u32
, arp_addr_list
,
416 info
->arp_addr_cnt
> IEEE80211_BSS_ARP_ADDR_LIST_LEN
?
417 IEEE80211_BSS_ARP_ADDR_LIST_LEN
:
419 __field(int, arp_addr_cnt
);
423 __dynamic_array(u8
, ssid
, info
->ssid_len
);
424 __field(bool, hidden_ssid
);
425 __field(int, txpower
)
426 __field(u8
, p2p_oppps_ctwindow
)
432 __entry
->changed
= changed
;
433 __entry
->aid
= info
->aid
;
434 __entry
->assoc
= info
->assoc
;
435 __entry
->ibss_joined
= info
->ibss_joined
;
436 __entry
->ibss_creator
= info
->ibss_creator
;
437 __entry
->shortpre
= info
->use_short_preamble
;
438 __entry
->cts
= info
->use_cts_prot
;
439 __entry
->shortslot
= info
->use_short_slot
;
440 __entry
->enable_beacon
= info
->enable_beacon
;
441 __entry
->dtimper
= info
->dtim_period
;
442 __entry
->bcnint
= info
->beacon_int
;
443 __entry
->assoc_cap
= info
->assoc_capability
;
444 __entry
->sync_tsf
= info
->sync_tsf
;
445 __entry
->sync_device_ts
= info
->sync_device_ts
;
446 __entry
->sync_dtim_count
= info
->sync_dtim_count
;
447 __entry
->basic_rates
= info
->basic_rates
;
448 memcpy(__entry
->mcast_rate
, info
->mcast_rate
,
449 sizeof(__entry
->mcast_rate
));
450 __entry
->ht_operation_mode
= info
->ht_operation_mode
;
451 __entry
->cqm_rssi_thold
= info
->cqm_rssi_thold
;
452 __entry
->cqm_rssi_hyst
= info
->cqm_rssi_hyst
;
453 __entry
->channel_width
= info
->chandef
.width
;
454 __entry
->channel_cfreq1
= info
->chandef
.center_freq1
;
455 __entry
->arp_addr_cnt
= info
->arp_addr_cnt
;
456 memcpy(__get_dynamic_array(arp_addr_list
), info
->arp_addr_list
,
457 sizeof(u32
) * (info
->arp_addr_cnt
> IEEE80211_BSS_ARP_ADDR_LIST_LEN
?
458 IEEE80211_BSS_ARP_ADDR_LIST_LEN
:
459 info
->arp_addr_cnt
));
460 __entry
->qos
= info
->qos
;
461 __entry
->idle
= info
->idle
;
462 __entry
->ps
= info
->ps
;
463 memcpy(__get_dynamic_array(ssid
), info
->ssid
, info
->ssid_len
);
464 __entry
->hidden_ssid
= info
->hidden_ssid
;
465 __entry
->txpower
= info
->txpower
;
466 __entry
->p2p_oppps_ctwindow
= info
->p2p_noa_attr
.oppps_ctwindow
;
470 LOCAL_PR_FMT VIF_PR_FMT
" changed:%#x",
471 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->changed
475 TRACE_EVENT(drv_prepare_multicast
,
476 TP_PROTO(struct ieee80211_local
*local
, int mc_count
),
478 TP_ARGS(local
, mc_count
),
482 __field(int, mc_count
)
487 __entry
->mc_count
= mc_count
;
491 LOCAL_PR_FMT
" prepare mc (%d)",
492 LOCAL_PR_ARG
, __entry
->mc_count
496 TRACE_EVENT(drv_configure_filter
,
497 TP_PROTO(struct ieee80211_local
*local
,
498 unsigned int changed_flags
,
499 unsigned int *total_flags
,
502 TP_ARGS(local
, changed_flags
, total_flags
, multicast
),
506 __field(unsigned int, changed
)
507 __field(unsigned int, total
)
508 __field(u64
, multicast
)
513 __entry
->changed
= changed_flags
;
514 __entry
->total
= *total_flags
;
515 __entry
->multicast
= multicast
;
519 LOCAL_PR_FMT
" changed:%#x total:%#x",
520 LOCAL_PR_ARG
, __entry
->changed
, __entry
->total
524 TRACE_EVENT(drv_config_iface_filter
,
525 TP_PROTO(struct ieee80211_local
*local
,
526 struct ieee80211_sub_if_data
*sdata
,
527 unsigned int filter_flags
,
528 unsigned int changed_flags
),
530 TP_ARGS(local
, sdata
, filter_flags
, changed_flags
),
535 __field(unsigned int, filter_flags
)
536 __field(unsigned int, changed_flags
)
542 __entry
->filter_flags
= filter_flags
;
543 __entry
->changed_flags
= changed_flags
;
547 LOCAL_PR_FMT VIF_PR_FMT
548 " filter_flags: %#x changed_flags: %#x",
549 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->filter_flags
,
550 __entry
->changed_flags
554 TRACE_EVENT(drv_set_tim
,
555 TP_PROTO(struct ieee80211_local
*local
,
556 struct ieee80211_sta
*sta
, bool set
),
558 TP_ARGS(local
, sta
, set
),
573 LOCAL_PR_FMT STA_PR_FMT
" set:%d",
574 LOCAL_PR_ARG
, STA_PR_ARG
, __entry
->set
578 TRACE_EVENT(drv_set_key
,
579 TP_PROTO(struct ieee80211_local
*local
,
580 enum set_key_cmd cmd
, struct ieee80211_sub_if_data
*sdata
,
581 struct ieee80211_sta
*sta
,
582 struct ieee80211_key_conf
*key
),
584 TP_ARGS(local
, cmd
, sdata
, sta
, key
),
601 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT KEY_PR_FMT
,
602 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, KEY_PR_ARG
606 TRACE_EVENT(drv_update_tkip_key
,
607 TP_PROTO(struct ieee80211_local
*local
,
608 struct ieee80211_sub_if_data
*sdata
,
609 struct ieee80211_key_conf
*conf
,
610 struct ieee80211_sta
*sta
, u32 iv32
),
612 TP_ARGS(local
, sdata
, conf
, sta
, iv32
),
625 __entry
->iv32
= iv32
;
629 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" iv32:%#x",
630 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->iv32
634 DEFINE_EVENT(local_sdata_evt
, drv_hw_scan
,
635 TP_PROTO(struct ieee80211_local
*local
,
636 struct ieee80211_sub_if_data
*sdata
),
637 TP_ARGS(local
, sdata
)
640 DEFINE_EVENT(local_sdata_evt
, drv_cancel_hw_scan
,
641 TP_PROTO(struct ieee80211_local
*local
,
642 struct ieee80211_sub_if_data
*sdata
),
643 TP_ARGS(local
, sdata
)
646 DEFINE_EVENT(local_sdata_evt
, drv_sched_scan_start
,
647 TP_PROTO(struct ieee80211_local
*local
,
648 struct ieee80211_sub_if_data
*sdata
),
649 TP_ARGS(local
, sdata
)
652 DEFINE_EVENT(local_sdata_evt
, drv_sched_scan_stop
,
653 TP_PROTO(struct ieee80211_local
*local
,
654 struct ieee80211_sub_if_data
*sdata
),
655 TP_ARGS(local
, sdata
)
658 TRACE_EVENT(drv_sw_scan_start
,
659 TP_PROTO(struct ieee80211_local
*local
,
660 struct ieee80211_sub_if_data
*sdata
,
663 TP_ARGS(local
, sdata
, mac_addr
),
668 __array(char, mac_addr
, ETH_ALEN
)
674 memcpy(__entry
->mac_addr
, mac_addr
, ETH_ALEN
);
677 TP_printk(LOCAL_PR_FMT
", " VIF_PR_FMT
", addr:%pM",
678 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->mac_addr
)
681 DEFINE_EVENT(local_sdata_evt
, drv_sw_scan_complete
,
682 TP_PROTO(struct ieee80211_local
*local
,
683 struct ieee80211_sub_if_data
*sdata
),
684 TP_ARGS(local
, sdata
)
687 TRACE_EVENT(drv_get_stats
,
688 TP_PROTO(struct ieee80211_local
*local
,
689 struct ieee80211_low_level_stats
*stats
,
692 TP_ARGS(local
, stats
, ret
),
697 __field(unsigned int, ackfail
)
698 __field(unsigned int, rtsfail
)
699 __field(unsigned int, fcserr
)
700 __field(unsigned int, rtssucc
)
706 __entry
->ackfail
= stats
->dot11ACKFailureCount
;
707 __entry
->rtsfail
= stats
->dot11RTSFailureCount
;
708 __entry
->fcserr
= stats
->dot11FCSErrorCount
;
709 __entry
->rtssucc
= stats
->dot11RTSSuccessCount
;
713 LOCAL_PR_FMT
" ret:%d",
714 LOCAL_PR_ARG
, __entry
->ret
718 TRACE_EVENT(drv_get_key_seq
,
719 TP_PROTO(struct ieee80211_local
*local
,
720 struct ieee80211_key_conf
*key
),
735 LOCAL_PR_FMT KEY_PR_FMT
,
736 LOCAL_PR_ARG
, KEY_PR_ARG
740 DEFINE_EVENT(local_u32_evt
, drv_set_frag_threshold
,
741 TP_PROTO(struct ieee80211_local
*local
, u32 value
),
742 TP_ARGS(local
, value
)
745 DEFINE_EVENT(local_u32_evt
, drv_set_rts_threshold
,
746 TP_PROTO(struct ieee80211_local
*local
, u32 value
),
747 TP_ARGS(local
, value
)
750 TRACE_EVENT(drv_set_coverage_class
,
751 TP_PROTO(struct ieee80211_local
*local
, s16 value
),
753 TP_ARGS(local
, value
),
762 __entry
->value
= value
;
766 LOCAL_PR_FMT
" value:%d",
767 LOCAL_PR_ARG
, __entry
->value
771 TRACE_EVENT(drv_sta_notify
,
772 TP_PROTO(struct ieee80211_local
*local
,
773 struct ieee80211_sub_if_data
*sdata
,
774 enum sta_notify_cmd cmd
,
775 struct ieee80211_sta
*sta
),
777 TP_ARGS(local
, sdata
, cmd
, sta
),
794 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" cmd:%d",
795 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->cmd
799 TRACE_EVENT(drv_sta_state
,
800 TP_PROTO(struct ieee80211_local
*local
,
801 struct ieee80211_sub_if_data
*sdata
,
802 struct ieee80211_sta
*sta
,
803 enum ieee80211_sta_state old_state
,
804 enum ieee80211_sta_state new_state
),
806 TP_ARGS(local
, sdata
, sta
, old_state
, new_state
),
812 __field(u32
, old_state
)
813 __field(u32
, new_state
)
820 __entry
->old_state
= old_state
;
821 __entry
->new_state
= new_state
;
825 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" state: %d->%d",
826 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
,
827 __entry
->old_state
, __entry
->new_state
831 TRACE_EVENT(drv_sta_rc_update
,
832 TP_PROTO(struct ieee80211_local
*local
,
833 struct ieee80211_sub_if_data
*sdata
,
834 struct ieee80211_sta
*sta
,
837 TP_ARGS(local
, sdata
, sta
, changed
),
843 __field(u32
, changed
)
850 __entry
->changed
= changed
;
854 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" changed: 0x%x",
855 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->changed
859 DECLARE_EVENT_CLASS(sta_event
,
860 TP_PROTO(struct ieee80211_local
*local
,
861 struct ieee80211_sub_if_data
*sdata
,
862 struct ieee80211_sta
*sta
),
864 TP_ARGS(local
, sdata
, sta
),
879 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
,
880 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
884 DEFINE_EVENT(sta_event
, drv_sta_statistics
,
885 TP_PROTO(struct ieee80211_local
*local
,
886 struct ieee80211_sub_if_data
*sdata
,
887 struct ieee80211_sta
*sta
),
888 TP_ARGS(local
, sdata
, sta
)
891 DEFINE_EVENT(sta_event
, drv_sta_add
,
892 TP_PROTO(struct ieee80211_local
*local
,
893 struct ieee80211_sub_if_data
*sdata
,
894 struct ieee80211_sta
*sta
),
895 TP_ARGS(local
, sdata
, sta
)
898 DEFINE_EVENT(sta_event
, drv_sta_remove
,
899 TP_PROTO(struct ieee80211_local
*local
,
900 struct ieee80211_sub_if_data
*sdata
,
901 struct ieee80211_sta
*sta
),
902 TP_ARGS(local
, sdata
, sta
)
905 DEFINE_EVENT(sta_event
, drv_sta_pre_rcu_remove
,
906 TP_PROTO(struct ieee80211_local
*local
,
907 struct ieee80211_sub_if_data
*sdata
,
908 struct ieee80211_sta
*sta
),
909 TP_ARGS(local
, sdata
, sta
)
912 DEFINE_EVENT(sta_event
, drv_sync_rx_queues
,
913 TP_PROTO(struct ieee80211_local
*local
,
914 struct ieee80211_sub_if_data
*sdata
,
915 struct ieee80211_sta
*sta
),
916 TP_ARGS(local
, sdata
, sta
)
919 DEFINE_EVENT(sta_event
, drv_sta_rate_tbl_update
,
920 TP_PROTO(struct ieee80211_local
*local
,
921 struct ieee80211_sub_if_data
*sdata
,
922 struct ieee80211_sta
*sta
),
923 TP_ARGS(local
, sdata
, sta
)
926 TRACE_EVENT(drv_conf_tx
,
927 TP_PROTO(struct ieee80211_local
*local
,
928 struct ieee80211_sub_if_data
*sdata
,
929 u16 ac
, const struct ieee80211_tx_queue_params
*params
),
931 TP_ARGS(local
, sdata
, ac
, params
),
948 __entry
->txop
= params
->txop
;
949 __entry
->cw_max
= params
->cw_max
;
950 __entry
->cw_min
= params
->cw_min
;
951 __entry
->aifs
= params
->aifs
;
952 __entry
->uapsd
= params
->uapsd
;
956 LOCAL_PR_FMT VIF_PR_FMT
" AC:%d",
957 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->ac
961 DEFINE_EVENT(local_sdata_evt
, drv_get_tsf
,
962 TP_PROTO(struct ieee80211_local
*local
,
963 struct ieee80211_sub_if_data
*sdata
),
964 TP_ARGS(local
, sdata
)
967 TRACE_EVENT(drv_set_tsf
,
968 TP_PROTO(struct ieee80211_local
*local
,
969 struct ieee80211_sub_if_data
*sdata
,
972 TP_ARGS(local
, sdata
, tsf
),
987 LOCAL_PR_FMT VIF_PR_FMT
" tsf:%llu",
988 LOCAL_PR_ARG
, VIF_PR_ARG
, (unsigned long long)__entry
->tsf
992 TRACE_EVENT(drv_offset_tsf
,
993 TP_PROTO(struct ieee80211_local
*local
,
994 struct ieee80211_sub_if_data
*sdata
,
997 TP_ARGS(local
, sdata
, offset
),
1002 __field(s64
, tsf_offset
)
1008 __entry
->tsf_offset
= offset
;
1012 LOCAL_PR_FMT VIF_PR_FMT
" tsf offset:%lld",
1013 LOCAL_PR_ARG
, VIF_PR_ARG
,
1014 (unsigned long long)__entry
->tsf_offset
1018 DEFINE_EVENT(local_sdata_evt
, drv_reset_tsf
,
1019 TP_PROTO(struct ieee80211_local
*local
,
1020 struct ieee80211_sub_if_data
*sdata
),
1021 TP_ARGS(local
, sdata
)
1024 DEFINE_EVENT(local_only_evt
, drv_tx_last_beacon
,
1025 TP_PROTO(struct ieee80211_local
*local
),
1029 TRACE_EVENT(drv_ampdu_action
,
1030 TP_PROTO(struct ieee80211_local
*local
,
1031 struct ieee80211_sub_if_data
*sdata
,
1032 struct ieee80211_ampdu_params
*params
),
1034 TP_ARGS(local
, sdata
, params
),
1045 AMPDU_ACTION_ASSIGN
;
1049 LOCAL_PR_FMT VIF_PR_FMT AMPDU_ACTION_PR_FMT
,
1050 LOCAL_PR_ARG
, VIF_PR_ARG
, AMPDU_ACTION_PR_ARG
1054 TRACE_EVENT(drv_get_survey
,
1055 TP_PROTO(struct ieee80211_local
*local
, int idx
,
1056 struct survey_info
*survey
),
1058 TP_ARGS(local
, idx
, survey
),
1071 LOCAL_PR_FMT
" idx:%d",
1072 LOCAL_PR_ARG
, __entry
->idx
1076 TRACE_EVENT(drv_flush
,
1077 TP_PROTO(struct ieee80211_local
*local
,
1078 u32 queues
, bool drop
),
1080 TP_ARGS(local
, queues
, drop
),
1085 __field(u32
, queues
)
1090 __entry
->drop
= drop
;
1091 __entry
->queues
= queues
;
1095 LOCAL_PR_FMT
" queues:0x%x drop:%d",
1096 LOCAL_PR_ARG
, __entry
->queues
, __entry
->drop
1100 TRACE_EVENT(drv_channel_switch
,
1101 TP_PROTO(struct ieee80211_local
*local
,
1102 struct ieee80211_sub_if_data
*sdata
,
1103 struct ieee80211_channel_switch
*ch_switch
),
1105 TP_ARGS(local
, sdata
, ch_switch
),
1111 __field(u64
, timestamp
)
1112 __field(u32
, device_timestamp
)
1113 __field(bool, block_tx
)
1120 CHANDEF_ASSIGN(&ch_switch
->chandef
)
1121 __entry
->timestamp
= ch_switch
->timestamp
;
1122 __entry
->device_timestamp
= ch_switch
->device_timestamp
;
1123 __entry
->block_tx
= ch_switch
->block_tx
;
1124 __entry
->count
= ch_switch
->count
;
1128 LOCAL_PR_FMT VIF_PR_FMT
" new " CHANDEF_PR_FMT
" count:%d",
1129 LOCAL_PR_ARG
, VIF_PR_ARG
, CHANDEF_PR_ARG
, __entry
->count
1133 TRACE_EVENT(drv_set_antenna
,
1134 TP_PROTO(struct ieee80211_local
*local
, u32 tx_ant
, u32 rx_ant
, int ret
),
1136 TP_ARGS(local
, tx_ant
, rx_ant
, ret
),
1140 __field(u32
, tx_ant
)
1141 __field(u32
, rx_ant
)
1147 __entry
->tx_ant
= tx_ant
;
1148 __entry
->rx_ant
= rx_ant
;
1153 LOCAL_PR_FMT
" tx_ant:%d rx_ant:%d ret:%d",
1154 LOCAL_PR_ARG
, __entry
->tx_ant
, __entry
->rx_ant
, __entry
->ret
1158 TRACE_EVENT(drv_get_antenna
,
1159 TP_PROTO(struct ieee80211_local
*local
, u32 tx_ant
, u32 rx_ant
, int ret
),
1161 TP_ARGS(local
, tx_ant
, rx_ant
, ret
),
1165 __field(u32
, tx_ant
)
1166 __field(u32
, rx_ant
)
1172 __entry
->tx_ant
= tx_ant
;
1173 __entry
->rx_ant
= rx_ant
;
1178 LOCAL_PR_FMT
" tx_ant:%d rx_ant:%d ret:%d",
1179 LOCAL_PR_ARG
, __entry
->tx_ant
, __entry
->rx_ant
, __entry
->ret
1183 TRACE_EVENT(drv_remain_on_channel
,
1184 TP_PROTO(struct ieee80211_local
*local
,
1185 struct ieee80211_sub_if_data
*sdata
,
1186 struct ieee80211_channel
*chan
,
1187 unsigned int duration
,
1188 enum ieee80211_roc_type type
),
1190 TP_ARGS(local
, sdata
, chan
, duration
, type
),
1195 __field(int, center_freq
)
1196 __field(unsigned int, duration
)
1203 __entry
->center_freq
= chan
->center_freq
;
1204 __entry
->duration
= duration
;
1205 __entry
->type
= type
;
1209 LOCAL_PR_FMT VIF_PR_FMT
" freq:%dMHz duration:%dms type=%d",
1210 LOCAL_PR_ARG
, VIF_PR_ARG
,
1211 __entry
->center_freq
, __entry
->duration
, __entry
->type
1215 DEFINE_EVENT(local_only_evt
, drv_cancel_remain_on_channel
,
1216 TP_PROTO(struct ieee80211_local
*local
),
1220 TRACE_EVENT(drv_set_ringparam
,
1221 TP_PROTO(struct ieee80211_local
*local
, u32 tx
, u32 rx
),
1223 TP_ARGS(local
, tx
, rx
),
1238 LOCAL_PR_FMT
" tx:%d rx %d",
1239 LOCAL_PR_ARG
, __entry
->tx
, __entry
->rx
1243 TRACE_EVENT(drv_get_ringparam
,
1244 TP_PROTO(struct ieee80211_local
*local
, u32
*tx
, u32
*tx_max
,
1245 u32
*rx
, u32
*rx_max
),
1247 TP_ARGS(local
, tx
, tx_max
, rx
, rx_max
),
1252 __field(u32
, tx_max
)
1254 __field(u32
, rx_max
)
1260 __entry
->tx_max
= *tx_max
;
1262 __entry
->rx_max
= *rx_max
;
1266 LOCAL_PR_FMT
" tx:%d tx_max %d rx %d rx_max %d",
1268 __entry
->tx
, __entry
->tx_max
, __entry
->rx
, __entry
->rx_max
1272 DEFINE_EVENT(local_only_evt
, drv_tx_frames_pending
,
1273 TP_PROTO(struct ieee80211_local
*local
),
1277 DEFINE_EVENT(local_only_evt
, drv_offchannel_tx_cancel_wait
,
1278 TP_PROTO(struct ieee80211_local
*local
),
1282 TRACE_EVENT(drv_set_bitrate_mask
,
1283 TP_PROTO(struct ieee80211_local
*local
,
1284 struct ieee80211_sub_if_data
*sdata
,
1285 const struct cfg80211_bitrate_mask
*mask
),
1287 TP_ARGS(local
, sdata
, mask
),
1292 __field(u32
, legacy_2g
)
1293 __field(u32
, legacy_5g
)
1299 __entry
->legacy_2g
= mask
->control
[NL80211_BAND_2GHZ
].legacy
;
1300 __entry
->legacy_5g
= mask
->control
[NL80211_BAND_5GHZ
].legacy
;
1304 LOCAL_PR_FMT VIF_PR_FMT
" 2G Mask:0x%x 5G Mask:0x%x",
1305 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->legacy_2g
, __entry
->legacy_5g
1309 TRACE_EVENT(drv_set_rekey_data
,
1310 TP_PROTO(struct ieee80211_local
*local
,
1311 struct ieee80211_sub_if_data
*sdata
,
1312 struct cfg80211_gtk_rekey_data
*data
),
1314 TP_ARGS(local
, sdata
, data
),
1319 __array(u8
, kek
, NL80211_KEK_LEN
)
1320 __array(u8
, kck
, NL80211_KCK_LEN
)
1321 __array(u8
, replay_ctr
, NL80211_REPLAY_CTR_LEN
)
1327 memcpy(__entry
->kek
, data
->kek
, NL80211_KEK_LEN
);
1328 memcpy(__entry
->kck
, data
->kck
, NL80211_KCK_LEN
);
1329 memcpy(__entry
->replay_ctr
, data
->replay_ctr
,
1330 NL80211_REPLAY_CTR_LEN
);
1333 TP_printk(LOCAL_PR_FMT VIF_PR_FMT
,
1334 LOCAL_PR_ARG
, VIF_PR_ARG
)
1337 TRACE_EVENT(drv_event_callback
,
1338 TP_PROTO(struct ieee80211_local
*local
,
1339 struct ieee80211_sub_if_data
*sdata
,
1340 const struct ieee80211_event
*_event
),
1342 TP_ARGS(local
, sdata
, _event
),
1353 __entry
->type
= _event
->type
;
1357 LOCAL_PR_FMT VIF_PR_FMT
" event:%d",
1358 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->type
1362 DECLARE_EVENT_CLASS(release_evt
,
1363 TP_PROTO(struct ieee80211_local
*local
,
1364 struct ieee80211_sta
*sta
,
1365 u16 tids
, int num_frames
,
1366 enum ieee80211_frame_release_type reason
,
1369 TP_ARGS(local
, sta
, tids
, num_frames
, reason
, more_data
),
1375 __field(int, num_frames
)
1376 __field(int, reason
)
1377 __field(bool, more_data
)
1383 __entry
->tids
= tids
;
1384 __entry
->num_frames
= num_frames
;
1385 __entry
->reason
= reason
;
1386 __entry
->more_data
= more_data
;
1390 LOCAL_PR_FMT STA_PR_FMT
1391 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1392 LOCAL_PR_ARG
, STA_PR_ARG
, __entry
->tids
, __entry
->num_frames
,
1393 __entry
->reason
, __entry
->more_data
1397 DEFINE_EVENT(release_evt
, drv_release_buffered_frames
,
1398 TP_PROTO(struct ieee80211_local
*local
,
1399 struct ieee80211_sta
*sta
,
1400 u16 tids
, int num_frames
,
1401 enum ieee80211_frame_release_type reason
,
1404 TP_ARGS(local
, sta
, tids
, num_frames
, reason
, more_data
)
1407 DEFINE_EVENT(release_evt
, drv_allow_buffered_frames
,
1408 TP_PROTO(struct ieee80211_local
*local
,
1409 struct ieee80211_sta
*sta
,
1410 u16 tids
, int num_frames
,
1411 enum ieee80211_frame_release_type reason
,
1414 TP_ARGS(local
, sta
, tids
, num_frames
, reason
, more_data
)
1417 TRACE_EVENT(drv_mgd_prepare_tx
,
1418 TP_PROTO(struct ieee80211_local
*local
,
1419 struct ieee80211_sub_if_data
*sdata
,
1422 TP_ARGS(local
, sdata
, duration
),
1427 __field(u32
, duration
)
1433 __entry
->duration
= duration
;
1437 LOCAL_PR_FMT VIF_PR_FMT
" duration: %u",
1438 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->duration
1442 DEFINE_EVENT(local_sdata_evt
, drv_mgd_protect_tdls_discover
,
1443 TP_PROTO(struct ieee80211_local
*local
,
1444 struct ieee80211_sub_if_data
*sdata
),
1446 TP_ARGS(local
, sdata
)
1449 DECLARE_EVENT_CLASS(local_chanctx
,
1450 TP_PROTO(struct ieee80211_local
*local
,
1451 struct ieee80211_chanctx
*ctx
),
1453 TP_ARGS(local
, ctx
),
1466 LOCAL_PR_FMT CHANCTX_PR_FMT
,
1467 LOCAL_PR_ARG
, CHANCTX_PR_ARG
1471 DEFINE_EVENT(local_chanctx
, drv_add_chanctx
,
1472 TP_PROTO(struct ieee80211_local
*local
,
1473 struct ieee80211_chanctx
*ctx
),
1477 DEFINE_EVENT(local_chanctx
, drv_remove_chanctx
,
1478 TP_PROTO(struct ieee80211_local
*local
,
1479 struct ieee80211_chanctx
*ctx
),
1483 TRACE_EVENT(drv_change_chanctx
,
1484 TP_PROTO(struct ieee80211_local
*local
,
1485 struct ieee80211_chanctx
*ctx
,
1488 TP_ARGS(local
, ctx
, changed
),
1493 __field(u32
, changed
)
1499 __entry
->changed
= changed
;
1503 LOCAL_PR_FMT CHANCTX_PR_FMT
" changed:%#x",
1504 LOCAL_PR_ARG
, CHANCTX_PR_ARG
, __entry
->changed
1508 #if !defined(__TRACE_VIF_ENTRY)
1509 #define __TRACE_VIF_ENTRY
1510 struct trace_vif_entry
{
1511 enum nl80211_iftype vif_type
;
1513 char vif_name
[IFNAMSIZ
];
1516 struct trace_chandef_entry
{
1523 struct trace_switch_entry
{
1524 struct trace_vif_entry vif
;
1525 struct trace_chandef_entry old_chandef
;
1526 struct trace_chandef_entry new_chandef
;
1529 #define SWITCH_ENTRY_ASSIGN(to, from) local_vifs[i].to = vifs[i].from
1532 TRACE_EVENT(drv_switch_vif_chanctx
,
1533 TP_PROTO(struct ieee80211_local
*local
,
1534 struct ieee80211_vif_chanctx_switch
*vifs
,
1535 int n_vifs
, enum ieee80211_chanctx_switch_mode mode
),
1536 TP_ARGS(local
, vifs
, n_vifs
, mode
),
1540 __field(int, n_vifs
)
1542 __dynamic_array(u8
, vifs
,
1543 sizeof(struct trace_switch_entry
) * n_vifs
)
1548 __entry
->n_vifs
= n_vifs
;
1549 __entry
->mode
= mode
;
1551 struct trace_switch_entry
*local_vifs
=
1552 __get_dynamic_array(vifs
);
1555 for (i
= 0; i
< n_vifs
; i
++) {
1556 struct ieee80211_sub_if_data
*sdata
;
1558 sdata
= container_of(vifs
[i
].vif
,
1559 struct ieee80211_sub_if_data
,
1562 SWITCH_ENTRY_ASSIGN(vif
.vif_type
, vif
->type
);
1563 SWITCH_ENTRY_ASSIGN(vif
.p2p
, vif
->p2p
);
1564 strncpy(local_vifs
[i
].vif
.vif_name
,
1566 sizeof(local_vifs
[i
].vif
.vif_name
));
1567 SWITCH_ENTRY_ASSIGN(old_chandef
.control_freq
,
1568 old_ctx
->def
.chan
->center_freq
);
1569 SWITCH_ENTRY_ASSIGN(old_chandef
.chan_width
,
1570 old_ctx
->def
.width
);
1571 SWITCH_ENTRY_ASSIGN(old_chandef
.center_freq1
,
1572 old_ctx
->def
.center_freq1
);
1573 SWITCH_ENTRY_ASSIGN(old_chandef
.center_freq2
,
1574 old_ctx
->def
.center_freq2
);
1575 SWITCH_ENTRY_ASSIGN(new_chandef
.control_freq
,
1576 new_ctx
->def
.chan
->center_freq
);
1577 SWITCH_ENTRY_ASSIGN(new_chandef
.chan_width
,
1578 new_ctx
->def
.width
);
1579 SWITCH_ENTRY_ASSIGN(new_chandef
.center_freq1
,
1580 new_ctx
->def
.center_freq1
);
1581 SWITCH_ENTRY_ASSIGN(new_chandef
.center_freq2
,
1582 new_ctx
->def
.center_freq2
);
1588 LOCAL_PR_FMT
" n_vifs:%d mode:%d",
1589 LOCAL_PR_ARG
, __entry
->n_vifs
, __entry
->mode
1593 DECLARE_EVENT_CLASS(local_sdata_chanctx
,
1594 TP_PROTO(struct ieee80211_local
*local
,
1595 struct ieee80211_sub_if_data
*sdata
,
1596 struct ieee80211_chanctx
*ctx
),
1598 TP_ARGS(local
, sdata
, ctx
),
1613 LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT
,
1614 LOCAL_PR_ARG
, VIF_PR_ARG
, CHANCTX_PR_ARG
1618 DEFINE_EVENT(local_sdata_chanctx
, drv_assign_vif_chanctx
,
1619 TP_PROTO(struct ieee80211_local
*local
,
1620 struct ieee80211_sub_if_data
*sdata
,
1621 struct ieee80211_chanctx
*ctx
),
1622 TP_ARGS(local
, sdata
, ctx
)
1625 DEFINE_EVENT(local_sdata_chanctx
, drv_unassign_vif_chanctx
,
1626 TP_PROTO(struct ieee80211_local
*local
,
1627 struct ieee80211_sub_if_data
*sdata
,
1628 struct ieee80211_chanctx
*ctx
),
1629 TP_ARGS(local
, sdata
, ctx
)
1632 TRACE_EVENT(drv_start_ap
,
1633 TP_PROTO(struct ieee80211_local
*local
,
1634 struct ieee80211_sub_if_data
*sdata
,
1635 struct ieee80211_bss_conf
*info
),
1637 TP_ARGS(local
, sdata
, info
),
1642 __field(u8
, dtimper
)
1643 __field(u16
, bcnint
)
1644 __dynamic_array(u8
, ssid
, info
->ssid_len
);
1645 __field(bool, hidden_ssid
);
1651 __entry
->dtimper
= info
->dtim_period
;
1652 __entry
->bcnint
= info
->beacon_int
;
1653 memcpy(__get_dynamic_array(ssid
), info
->ssid
, info
->ssid_len
);
1654 __entry
->hidden_ssid
= info
->hidden_ssid
;
1658 LOCAL_PR_FMT VIF_PR_FMT
,
1659 LOCAL_PR_ARG
, VIF_PR_ARG
1663 DEFINE_EVENT(local_sdata_evt
, drv_stop_ap
,
1664 TP_PROTO(struct ieee80211_local
*local
,
1665 struct ieee80211_sub_if_data
*sdata
),
1666 TP_ARGS(local
, sdata
)
1669 TRACE_EVENT(drv_reconfig_complete
,
1670 TP_PROTO(struct ieee80211_local
*local
,
1671 enum ieee80211_reconfig_type reconfig_type
),
1672 TP_ARGS(local
, reconfig_type
),
1676 __field(u8
, reconfig_type
)
1681 __entry
->reconfig_type
= reconfig_type
;
1685 LOCAL_PR_FMT
" reconfig_type:%d",
1686 LOCAL_PR_ARG
, __entry
->reconfig_type
1691 #if IS_ENABLED(CONFIG_IPV6)
1692 DEFINE_EVENT(local_sdata_evt
, drv_ipv6_addr_change
,
1693 TP_PROTO(struct ieee80211_local
*local
,
1694 struct ieee80211_sub_if_data
*sdata
),
1695 TP_ARGS(local
, sdata
)
1699 TRACE_EVENT(drv_join_ibss
,
1700 TP_PROTO(struct ieee80211_local
*local
,
1701 struct ieee80211_sub_if_data
*sdata
,
1702 struct ieee80211_bss_conf
*info
),
1704 TP_ARGS(local
, sdata
, info
),
1709 __field(u8
, dtimper
)
1710 __field(u16
, bcnint
)
1711 __dynamic_array(u8
, ssid
, info
->ssid_len
);
1717 __entry
->dtimper
= info
->dtim_period
;
1718 __entry
->bcnint
= info
->beacon_int
;
1719 memcpy(__get_dynamic_array(ssid
), info
->ssid
, info
->ssid_len
);
1723 LOCAL_PR_FMT VIF_PR_FMT
,
1724 LOCAL_PR_ARG
, VIF_PR_ARG
1728 DEFINE_EVENT(local_sdata_evt
, drv_leave_ibss
,
1729 TP_PROTO(struct ieee80211_local
*local
,
1730 struct ieee80211_sub_if_data
*sdata
),
1731 TP_ARGS(local
, sdata
)
1734 TRACE_EVENT(drv_get_expected_throughput
,
1735 TP_PROTO(struct ieee80211_sta
*sta
),
1748 STA_PR_FMT
, STA_PR_ARG
1752 TRACE_EVENT(drv_start_nan
,
1753 TP_PROTO(struct ieee80211_local
*local
,
1754 struct ieee80211_sub_if_data
*sdata
,
1755 struct cfg80211_nan_conf
*conf
),
1757 TP_ARGS(local
, sdata
, conf
),
1761 __field(u8
, master_pref
)
1768 __entry
->master_pref
= conf
->master_pref
;
1769 __entry
->bands
= conf
->bands
;
1773 LOCAL_PR_FMT VIF_PR_FMT
1774 ", master preference: %u, bands: 0x%0x",
1775 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->master_pref
,
1780 TRACE_EVENT(drv_stop_nan
,
1781 TP_PROTO(struct ieee80211_local
*local
,
1782 struct ieee80211_sub_if_data
*sdata
),
1784 TP_ARGS(local
, sdata
),
1797 LOCAL_PR_FMT VIF_PR_FMT
,
1798 LOCAL_PR_ARG
, VIF_PR_ARG
1802 TRACE_EVENT(drv_nan_change_conf
,
1803 TP_PROTO(struct ieee80211_local
*local
,
1804 struct ieee80211_sub_if_data
*sdata
,
1805 struct cfg80211_nan_conf
*conf
,
1808 TP_ARGS(local
, sdata
, conf
, changes
),
1812 __field(u8
, master_pref
)
1814 __field(u32
, changes
)
1820 __entry
->master_pref
= conf
->master_pref
;
1821 __entry
->bands
= conf
->bands
;
1822 __entry
->changes
= changes
;
1826 LOCAL_PR_FMT VIF_PR_FMT
1827 ", master preference: %u, bands: 0x%0x, changes: 0x%x",
1828 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->master_pref
,
1829 __entry
->bands
, __entry
->changes
1833 TRACE_EVENT(drv_add_nan_func
,
1834 TP_PROTO(struct ieee80211_local
*local
,
1835 struct ieee80211_sub_if_data
*sdata
,
1836 const struct cfg80211_nan_func
*func
),
1838 TP_ARGS(local
, sdata
, func
),
1843 __field(u8
, inst_id
)
1849 __entry
->type
= func
->type
;
1850 __entry
->inst_id
= func
->instance_id
;
1854 LOCAL_PR_FMT VIF_PR_FMT
1855 ", type: %u, inst_id: %u",
1856 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->type
, __entry
->inst_id
1860 TRACE_EVENT(drv_del_nan_func
,
1861 TP_PROTO(struct ieee80211_local
*local
,
1862 struct ieee80211_sub_if_data
*sdata
,
1865 TP_ARGS(local
, sdata
, instance_id
),
1869 __field(u8
, instance_id
)
1875 __entry
->instance_id
= instance_id
;
1879 LOCAL_PR_FMT VIF_PR_FMT
1880 ", instance_id: %u",
1881 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->instance_id
1886 * Tracing for API calls that drivers call.
1889 TRACE_EVENT(api_start_tx_ba_session
,
1890 TP_PROTO(struct ieee80211_sta
*sta
, u16 tid
),
1905 STA_PR_FMT
" tid:%d",
1906 STA_PR_ARG
, __entry
->tid
1910 TRACE_EVENT(api_start_tx_ba_cb
,
1911 TP_PROTO(struct ieee80211_sub_if_data
*sdata
, const u8
*ra
, u16 tid
),
1913 TP_ARGS(sdata
, ra
, tid
),
1917 __array(u8
, ra
, ETH_ALEN
)
1923 memcpy(__entry
->ra
, ra
, ETH_ALEN
);
1928 VIF_PR_FMT
" ra:%pM tid:%d",
1929 VIF_PR_ARG
, __entry
->ra
, __entry
->tid
1933 TRACE_EVENT(api_stop_tx_ba_session
,
1934 TP_PROTO(struct ieee80211_sta
*sta
, u16 tid
),
1949 STA_PR_FMT
" tid:%d",
1950 STA_PR_ARG
, __entry
->tid
1954 TRACE_EVENT(api_stop_tx_ba_cb
,
1955 TP_PROTO(struct ieee80211_sub_if_data
*sdata
, const u8
*ra
, u16 tid
),
1957 TP_ARGS(sdata
, ra
, tid
),
1961 __array(u8
, ra
, ETH_ALEN
)
1967 memcpy(__entry
->ra
, ra
, ETH_ALEN
);
1972 VIF_PR_FMT
" ra:%pM tid:%d",
1973 VIF_PR_ARG
, __entry
->ra
, __entry
->tid
1977 DEFINE_EVENT(local_only_evt
, api_restart_hw
,
1978 TP_PROTO(struct ieee80211_local
*local
),
1982 TRACE_EVENT(api_beacon_loss
,
1983 TP_PROTO(struct ieee80211_sub_if_data
*sdata
),
2001 TRACE_EVENT(api_connection_loss
,
2002 TP_PROTO(struct ieee80211_sub_if_data
*sdata
),
2020 TRACE_EVENT(api_cqm_rssi_notify
,
2021 TP_PROTO(struct ieee80211_sub_if_data
*sdata
,
2022 enum nl80211_cqm_rssi_threshold_event rssi_event
,
2025 TP_ARGS(sdata
, rssi_event
, rssi_level
),
2029 __field(u32
, rssi_event
)
2030 __field(s32
, rssi_level
)
2035 __entry
->rssi_event
= rssi_event
;
2036 __entry
->rssi_level
= rssi_level
;
2040 VIF_PR_FMT
" event:%d rssi:%d",
2041 VIF_PR_ARG
, __entry
->rssi_event
, __entry
->rssi_level
2045 DEFINE_EVENT(local_sdata_evt
, api_cqm_beacon_loss_notify
,
2046 TP_PROTO(struct ieee80211_local
*local
,
2047 struct ieee80211_sub_if_data
*sdata
),
2048 TP_ARGS(local
, sdata
)
2051 TRACE_EVENT(api_scan_completed
,
2052 TP_PROTO(struct ieee80211_local
*local
, bool aborted
),
2054 TP_ARGS(local
, aborted
),
2058 __field(bool, aborted
)
2063 __entry
->aborted
= aborted
;
2067 LOCAL_PR_FMT
" aborted:%d",
2068 LOCAL_PR_ARG
, __entry
->aborted
2072 TRACE_EVENT(api_sched_scan_results
,
2073 TP_PROTO(struct ieee80211_local
*local
),
2086 LOCAL_PR_FMT
, LOCAL_PR_ARG
2090 TRACE_EVENT(api_sched_scan_stopped
,
2091 TP_PROTO(struct ieee80211_local
*local
),
2104 LOCAL_PR_FMT
, LOCAL_PR_ARG
2108 TRACE_EVENT(api_sta_block_awake
,
2109 TP_PROTO(struct ieee80211_local
*local
,
2110 struct ieee80211_sta
*sta
, bool block
),
2112 TP_ARGS(local
, sta
, block
),
2117 __field(bool, block
)
2123 __entry
->block
= block
;
2127 LOCAL_PR_FMT STA_PR_FMT
" block:%d",
2128 LOCAL_PR_ARG
, STA_PR_ARG
, __entry
->block
2132 TRACE_EVENT(api_chswitch_done
,
2133 TP_PROTO(struct ieee80211_sub_if_data
*sdata
, bool success
),
2135 TP_ARGS(sdata
, success
),
2139 __field(bool, success
)
2144 __entry
->success
= success
;
2148 VIF_PR_FMT
" success=%d",
2149 VIF_PR_ARG
, __entry
->success
2153 DEFINE_EVENT(local_only_evt
, api_ready_on_channel
,
2154 TP_PROTO(struct ieee80211_local
*local
),
2158 DEFINE_EVENT(local_only_evt
, api_remain_on_channel_expired
,
2159 TP_PROTO(struct ieee80211_local
*local
),
2163 TRACE_EVENT(api_gtk_rekey_notify
,
2164 TP_PROTO(struct ieee80211_sub_if_data
*sdata
,
2165 const u8
*bssid
, const u8
*replay_ctr
),
2167 TP_ARGS(sdata
, bssid
, replay_ctr
),
2171 __array(u8
, bssid
, ETH_ALEN
)
2172 __array(u8
, replay_ctr
, NL80211_REPLAY_CTR_LEN
)
2177 memcpy(__entry
->bssid
, bssid
, ETH_ALEN
);
2178 memcpy(__entry
->replay_ctr
, replay_ctr
, NL80211_REPLAY_CTR_LEN
);
2181 TP_printk(VIF_PR_FMT
, VIF_PR_ARG
)
2184 TRACE_EVENT(api_enable_rssi_reports
,
2185 TP_PROTO(struct ieee80211_sub_if_data
*sdata
,
2186 int rssi_min_thold
, int rssi_max_thold
),
2188 TP_ARGS(sdata
, rssi_min_thold
, rssi_max_thold
),
2192 __field(int, rssi_min_thold
)
2193 __field(int, rssi_max_thold
)
2198 __entry
->rssi_min_thold
= rssi_min_thold
;
2199 __entry
->rssi_max_thold
= rssi_max_thold
;
2203 VIF_PR_FMT
" rssi_min_thold =%d, rssi_max_thold = %d",
2204 VIF_PR_ARG
, __entry
->rssi_min_thold
, __entry
->rssi_max_thold
2208 TRACE_EVENT(api_eosp
,
2209 TP_PROTO(struct ieee80211_local
*local
,
2210 struct ieee80211_sta
*sta
),
2212 TP_ARGS(local
, sta
),
2225 LOCAL_PR_FMT STA_PR_FMT
,
2226 LOCAL_PR_ARG
, STA_PR_ARG
2230 TRACE_EVENT(api_send_eosp_nullfunc
,
2231 TP_PROTO(struct ieee80211_local
*local
,
2232 struct ieee80211_sta
*sta
,
2235 TP_ARGS(local
, sta
, tid
),
2250 LOCAL_PR_FMT STA_PR_FMT
" tid:%d",
2251 LOCAL_PR_ARG
, STA_PR_ARG
, __entry
->tid
2255 TRACE_EVENT(api_sta_set_buffered
,
2256 TP_PROTO(struct ieee80211_local
*local
,
2257 struct ieee80211_sta
*sta
,
2258 u8 tid
, bool buffered
),
2260 TP_ARGS(local
, sta
, tid
, buffered
),
2266 __field(bool, buffered
)
2273 __entry
->buffered
= buffered
;
2277 LOCAL_PR_FMT STA_PR_FMT
" tid:%d buffered:%d",
2278 LOCAL_PR_ARG
, STA_PR_ARG
, __entry
->tid
, __entry
->buffered
2283 * Tracing for internal functions
2284 * (which may also be called in response to driver calls)
2287 TRACE_EVENT(wake_queue
,
2288 TP_PROTO(struct ieee80211_local
*local
, u16 queue
,
2289 enum queue_stop_reason reason
),
2291 TP_ARGS(local
, queue
, reason
),
2296 __field(u32
, reason
)
2301 __entry
->queue
= queue
;
2302 __entry
->reason
= reason
;
2306 LOCAL_PR_FMT
" queue:%d, reason:%d",
2307 LOCAL_PR_ARG
, __entry
->queue
, __entry
->reason
2311 TRACE_EVENT(stop_queue
,
2312 TP_PROTO(struct ieee80211_local
*local
, u16 queue
,
2313 enum queue_stop_reason reason
),
2315 TP_ARGS(local
, queue
, reason
),
2320 __field(u32
, reason
)
2325 __entry
->queue
= queue
;
2326 __entry
->reason
= reason
;
2330 LOCAL_PR_FMT
" queue:%d, reason:%d",
2331 LOCAL_PR_ARG
, __entry
->queue
, __entry
->reason
2335 TRACE_EVENT(drv_set_default_unicast_key
,
2336 TP_PROTO(struct ieee80211_local
*local
,
2337 struct ieee80211_sub_if_data
*sdata
,
2340 TP_ARGS(local
, sdata
, key_idx
),
2345 __field(int, key_idx
)
2351 __entry
->key_idx
= key_idx
;
2354 TP_printk(LOCAL_PR_FMT VIF_PR_FMT
" key_idx:%d",
2355 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->key_idx
)
2358 TRACE_EVENT(api_radar_detected
,
2359 TP_PROTO(struct ieee80211_local
*local
),
2372 LOCAL_PR_FMT
" radar detected",
2377 TRACE_EVENT(drv_channel_switch_beacon
,
2378 TP_PROTO(struct ieee80211_local
*local
,
2379 struct ieee80211_sub_if_data
*sdata
,
2380 struct cfg80211_chan_def
*chandef
),
2382 TP_ARGS(local
, sdata
, chandef
),
2393 CHANDEF_ASSIGN(chandef
);
2397 LOCAL_PR_FMT VIF_PR_FMT
" channel switch to " CHANDEF_PR_FMT
,
2398 LOCAL_PR_ARG
, VIF_PR_ARG
, CHANDEF_PR_ARG
2402 TRACE_EVENT(drv_pre_channel_switch
,
2403 TP_PROTO(struct ieee80211_local
*local
,
2404 struct ieee80211_sub_if_data
*sdata
,
2405 struct ieee80211_channel_switch
*ch_switch
),
2407 TP_ARGS(local
, sdata
, ch_switch
),
2413 __field(u64
, timestamp
)
2414 __field(u32
, device_timestamp
)
2415 __field(bool, block_tx
)
2422 CHANDEF_ASSIGN(&ch_switch
->chandef
)
2423 __entry
->timestamp
= ch_switch
->timestamp
;
2424 __entry
->device_timestamp
= ch_switch
->device_timestamp
;
2425 __entry
->block_tx
= ch_switch
->block_tx
;
2426 __entry
->count
= ch_switch
->count
;
2430 LOCAL_PR_FMT VIF_PR_FMT
" prepare channel switch to "
2431 CHANDEF_PR_FMT
" count:%d block_tx:%d timestamp:%llu",
2432 LOCAL_PR_ARG
, VIF_PR_ARG
, CHANDEF_PR_ARG
, __entry
->count
,
2433 __entry
->block_tx
, __entry
->timestamp
2437 DEFINE_EVENT(local_sdata_evt
, drv_post_channel_switch
,
2438 TP_PROTO(struct ieee80211_local
*local
,
2439 struct ieee80211_sub_if_data
*sdata
),
2440 TP_ARGS(local
, sdata
)
2443 TRACE_EVENT(drv_get_txpower
,
2444 TP_PROTO(struct ieee80211_local
*local
,
2445 struct ieee80211_sub_if_data
*sdata
,
2448 TP_ARGS(local
, sdata
, dbm
, ret
),
2465 LOCAL_PR_FMT VIF_PR_FMT
" dbm:%d ret:%d",
2466 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->dbm
, __entry
->ret
2470 TRACE_EVENT(drv_tdls_channel_switch
,
2471 TP_PROTO(struct ieee80211_local
*local
,
2472 struct ieee80211_sub_if_data
*sdata
,
2473 struct ieee80211_sta
*sta
, u8 oper_class
,
2474 struct cfg80211_chan_def
*chandef
),
2476 TP_ARGS(local
, sdata
, sta
, oper_class
, chandef
),
2482 __field(u8
, oper_class
)
2490 __entry
->oper_class
= oper_class
;
2491 CHANDEF_ASSIGN(chandef
)
2495 LOCAL_PR_FMT VIF_PR_FMT
" tdls channel switch to"
2496 CHANDEF_PR_FMT
" oper_class:%d " STA_PR_FMT
,
2497 LOCAL_PR_ARG
, VIF_PR_ARG
, CHANDEF_PR_ARG
, __entry
->oper_class
,
2502 TRACE_EVENT(drv_tdls_cancel_channel_switch
,
2503 TP_PROTO(struct ieee80211_local
*local
,
2504 struct ieee80211_sub_if_data
*sdata
,
2505 struct ieee80211_sta
*sta
),
2507 TP_ARGS(local
, sdata
, sta
),
2522 LOCAL_PR_FMT VIF_PR_FMT
2523 " tdls cancel channel switch with " STA_PR_FMT
,
2524 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
2528 TRACE_EVENT(drv_tdls_recv_channel_switch
,
2529 TP_PROTO(struct ieee80211_local
*local
,
2530 struct ieee80211_sub_if_data
*sdata
,
2531 struct ieee80211_tdls_ch_sw_params
*params
),
2533 TP_ARGS(local
, sdata
, params
),
2538 __field(u8
, action_code
)
2541 __field(u32
, status
)
2542 __field(bool, peer_initiator
)
2543 __field(u32
, timestamp
)
2544 __field(u16
, switch_time
)
2545 __field(u16
, switch_timeout
)
2551 STA_NAMED_ASSIGN(params
->sta
);
2552 CHANDEF_ASSIGN(params
->chandef
)
2553 __entry
->peer_initiator
= params
->sta
->tdls_initiator
;
2554 __entry
->action_code
= params
->action_code
;
2555 __entry
->status
= params
->status
;
2556 __entry
->timestamp
= params
->timestamp
;
2557 __entry
->switch_time
= params
->switch_time
;
2558 __entry
->switch_timeout
= params
->switch_timeout
;
2562 LOCAL_PR_FMT VIF_PR_FMT
" received tdls channel switch packet"
2563 " action:%d status:%d time:%d switch time:%d switch"
2564 " timeout:%d initiator: %d chan:" CHANDEF_PR_FMT STA_PR_FMT
,
2565 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->action_code
, __entry
->status
,
2566 __entry
->timestamp
, __entry
->switch_time
,
2567 __entry
->switch_timeout
, __entry
->peer_initiator
,
2568 CHANDEF_PR_ARG
, STA_PR_ARG
2572 TRACE_EVENT(drv_wake_tx_queue
,
2573 TP_PROTO(struct ieee80211_local
*local
,
2574 struct ieee80211_sub_if_data
*sdata
,
2575 struct txq_info
*txq
),
2577 TP_ARGS(local
, sdata
, txq
),
2588 struct ieee80211_sta
*sta
= txq
->txq
.sta
;
2593 __entry
->ac
= txq
->txq
.ac
;
2594 __entry
->tid
= txq
->txq
.tid
;
2598 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" ac:%d tid:%d",
2599 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->ac
, __entry
->tid
2603 TRACE_EVENT(drv_get_ftm_responder_stats
,
2604 TP_PROTO(struct ieee80211_local
*local
,
2605 struct ieee80211_sub_if_data
*sdata
,
2606 struct cfg80211_ftm_responder_stats
*ftm_stats
),
2608 TP_ARGS(local
, sdata
, ftm_stats
),
2621 LOCAL_PR_FMT VIF_PR_FMT
,
2622 LOCAL_PR_ARG
, VIF_PR_ARG
2626 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
2628 #undef TRACE_INCLUDE_PATH
2629 #define TRACE_INCLUDE_PATH .
2630 #undef TRACE_INCLUDE_FILE
2631 #define TRACE_INCLUDE_FILE trace
2632 #include <trace/define_trace.h>