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"
9 #define TRACE_SYSTEM mac80211
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) \
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 : sdata->name)
28 #define VIF_PR_FMT " vif:%s(%d%s)"
29 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
31 #define CHANCTX_ENTRY __field(int, freq) \
32 __field(int, chantype) \
33 __field(u8, rx_chains_static) \
34 __field(u8, rx_chains_dynamic)
35 #define CHANCTX_ASSIGN __entry->freq = ctx->conf.channel->center_freq; \
36 __entry->chantype = ctx->conf.channel_type; \
37 __entry->rx_chains_static = ctx->conf.rx_chains_static; \
38 __entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
39 #define CHANCTX_PR_FMT " freq:%d MHz chantype:%d chains:%d/%d"
40 #define CHANCTX_PR_ARG __entry->freq, __entry->chantype, \
41 __entry->rx_chains_static, __entry->rx_chains_dynamic
46 * Tracing for driver callbacks.
49 DECLARE_EVENT_CLASS(local_only_evt,
50 TP_PROTO(struct ieee80211_local *local),
58 TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
61 DECLARE_EVENT_CLASS(local_sdata_addr_evt,
62 TP_PROTO(struct ieee80211_local *local,
63 struct ieee80211_sub_if_data *sdata),
64 TP_ARGS(local, sdata),
69 __array(char, addr, 6)
75 memcpy(__entry->addr, sdata->vif.addr, 6);
79 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
80 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
84 DECLARE_EVENT_CLASS(local_u32_evt,
85 TP_PROTO(struct ieee80211_local *local, u32 value),
86 TP_ARGS(local, value),
95 __entry->value = value;
99 LOCAL_PR_FMT " value:%d",
100 LOCAL_PR_ARG, __entry->value
104 DECLARE_EVENT_CLASS(local_sdata_evt,
105 TP_PROTO(struct ieee80211_local *local,
106 struct ieee80211_sub_if_data *sdata),
107 TP_ARGS(local, sdata),
120 LOCAL_PR_FMT VIF_PR_FMT,
121 LOCAL_PR_ARG, VIF_PR_ARG
125 DEFINE_EVENT(local_only_evt, drv_return_void,
126 TP_PROTO(struct ieee80211_local *local),
130 TRACE_EVENT(drv_return_int,
131 TP_PROTO(struct ieee80211_local *local, int ret),
141 TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
144 TRACE_EVENT(drv_return_bool,
145 TP_PROTO(struct ieee80211_local *local, bool ret),
155 TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
159 TRACE_EVENT(drv_return_u64,
160 TP_PROTO(struct ieee80211_local *local, u64 ret),
170 TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
173 DEFINE_EVENT(local_only_evt, drv_start,
174 TP_PROTO(struct ieee80211_local *local),
178 DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
179 TP_PROTO(struct ieee80211_local *local, u32 sset),
183 DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
184 TP_PROTO(struct ieee80211_local *local, u32 sset),
188 DEFINE_EVENT(local_only_evt, drv_get_et_stats,
189 TP_PROTO(struct ieee80211_local *local),
193 DEFINE_EVENT(local_only_evt, drv_suspend,
194 TP_PROTO(struct ieee80211_local *local),
198 DEFINE_EVENT(local_only_evt, drv_resume,
199 TP_PROTO(struct ieee80211_local *local),
203 TRACE_EVENT(drv_set_wakeup,
204 TP_PROTO(struct ieee80211_local *local, bool enabled),
205 TP_ARGS(local, enabled),
208 __field(bool, enabled)
212 __entry->enabled = enabled;
214 TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
217 DEFINE_EVENT(local_only_evt, drv_stop,
218 TP_PROTO(struct ieee80211_local *local),
222 DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
223 TP_PROTO(struct ieee80211_local *local,
224 struct ieee80211_sub_if_data *sdata),
225 TP_ARGS(local, sdata)
228 TRACE_EVENT(drv_change_interface,
229 TP_PROTO(struct ieee80211_local *local,
230 struct ieee80211_sub_if_data *sdata,
231 enum nl80211_iftype type, bool p2p),
233 TP_ARGS(local, sdata, type, p2p),
238 __field(u32, new_type)
239 __field(bool, new_p2p)
245 __entry->new_type = type;
246 __entry->new_p2p = p2p;
250 LOCAL_PR_FMT VIF_PR_FMT " new type:%d%s",
251 LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
252 __entry->new_p2p ? "/p2p" : ""
256 DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
257 TP_PROTO(struct ieee80211_local *local,
258 struct ieee80211_sub_if_data *sdata),
259 TP_ARGS(local, sdata)
262 TRACE_EVENT(drv_config,
263 TP_PROTO(struct ieee80211_local *local,
266 TP_ARGS(local, changed),
270 __field(u32, changed)
272 __field(int, power_level)
273 __field(int, dynamic_ps_timeout)
274 __field(int, max_sleep_period)
275 __field(u16, listen_interval)
276 __field(u8, long_frame_max_tx_count)
277 __field(u8, short_frame_max_tx_count)
278 __field(int, center_freq)
279 __field(int, channel_type)
285 __entry->changed = changed;
286 __entry->flags = local->hw.conf.flags;
287 __entry->power_level = local->hw.conf.power_level;
288 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
289 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
290 __entry->listen_interval = local->hw.conf.listen_interval;
291 __entry->long_frame_max_tx_count =
292 local->hw.conf.long_frame_max_tx_count;
293 __entry->short_frame_max_tx_count =
294 local->hw.conf.short_frame_max_tx_count;
295 __entry->center_freq = local->hw.conf.channel ?
296 local->hw.conf.channel->center_freq : 0;
297 __entry->channel_type = local->hw.conf.channel_type;
298 __entry->smps = local->hw.conf.smps_mode;
302 LOCAL_PR_FMT " ch:%#x freq:%d",
303 LOCAL_PR_ARG, __entry->changed, __entry->center_freq
307 TRACE_EVENT(drv_bss_info_changed,
308 TP_PROTO(struct ieee80211_local *local,
309 struct ieee80211_sub_if_data *sdata,
310 struct ieee80211_bss_conf *info,
313 TP_ARGS(local, sdata, info, changed),
318 __field(u32, changed)
320 __field(bool, ibss_joined)
321 __field(bool, ibss_creator)
324 __field(bool, shortpre)
325 __field(bool, shortslot)
326 __field(bool, enable_beacon)
329 __field(u16, assoc_cap)
330 __field(u64, sync_tsf)
331 __field(u32, sync_device_ts)
332 __field(u32, basic_rates)
333 __array(int, mcast_rate, IEEE80211_NUM_BANDS)
334 __field(u16, ht_operation_mode)
335 __field(s32, cqm_rssi_thold);
336 __field(s32, cqm_rssi_hyst);
337 __field(u32, channel_type);
338 __dynamic_array(u32, arp_addr_list, info->arp_addr_cnt);
339 __field(bool, arp_filter_enabled);
343 __dynamic_array(u8, ssid, info->ssid_len);
344 __field(bool, hidden_ssid);
350 __entry->changed = changed;
351 __entry->aid = info->aid;
352 __entry->assoc = info->assoc;
353 __entry->ibss_joined = info->ibss_joined;
354 __entry->ibss_creator = info->ibss_creator;
355 __entry->shortpre = info->use_short_preamble;
356 __entry->cts = info->use_cts_prot;
357 __entry->shortslot = info->use_short_slot;
358 __entry->enable_beacon = info->enable_beacon;
359 __entry->dtimper = info->dtim_period;
360 __entry->bcnint = info->beacon_int;
361 __entry->assoc_cap = info->assoc_capability;
362 __entry->sync_tsf = info->sync_tsf;
363 __entry->sync_device_ts = info->sync_device_ts;
364 __entry->basic_rates = info->basic_rates;
365 memcpy(__entry->mcast_rate, info->mcast_rate,
366 sizeof(__entry->mcast_rate));
367 __entry->ht_operation_mode = info->ht_operation_mode;
368 __entry->cqm_rssi_thold = info->cqm_rssi_thold;
369 __entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
370 __entry->channel_type = info->channel_type;
371 memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
372 sizeof(u32) * info->arp_addr_cnt);
373 __entry->arp_filter_enabled = info->arp_filter_enabled;
374 __entry->qos = info->qos;
375 __entry->idle = info->idle;
376 __entry->ps = info->ps;
377 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
378 __entry->hidden_ssid = info->hidden_ssid;
382 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
383 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
387 TRACE_EVENT(drv_prepare_multicast,
388 TP_PROTO(struct ieee80211_local *local, int mc_count),
390 TP_ARGS(local, mc_count),
394 __field(int, mc_count)
399 __entry->mc_count = mc_count;
403 LOCAL_PR_FMT " prepare mc (%d)",
404 LOCAL_PR_ARG, __entry->mc_count
408 TRACE_EVENT(drv_configure_filter,
409 TP_PROTO(struct ieee80211_local *local,
410 unsigned int changed_flags,
411 unsigned int *total_flags,
414 TP_ARGS(local, changed_flags, total_flags, multicast),
418 __field(unsigned int, changed)
419 __field(unsigned int, total)
420 __field(u64, multicast)
425 __entry->changed = changed_flags;
426 __entry->total = *total_flags;
427 __entry->multicast = multicast;
431 LOCAL_PR_FMT " changed:%#x total:%#x",
432 LOCAL_PR_ARG, __entry->changed, __entry->total
436 TRACE_EVENT(drv_set_tim,
437 TP_PROTO(struct ieee80211_local *local,
438 struct ieee80211_sta *sta, bool set),
440 TP_ARGS(local, sta, set),
455 LOCAL_PR_FMT STA_PR_FMT " set:%d",
456 LOCAL_PR_ARG, STA_PR_FMT, __entry->set
460 TRACE_EVENT(drv_set_key,
461 TP_PROTO(struct ieee80211_local *local,
462 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
463 struct ieee80211_sta *sta,
464 struct ieee80211_key_conf *key),
466 TP_ARGS(local, cmd, sdata, sta, key),
473 __field(u8, hw_key_idx)
482 __entry->cipher = key->cipher;
483 __entry->flags = key->flags;
484 __entry->keyidx = key->keyidx;
485 __entry->hw_key_idx = key->hw_key_idx;
489 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
490 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
494 TRACE_EVENT(drv_update_tkip_key,
495 TP_PROTO(struct ieee80211_local *local,
496 struct ieee80211_sub_if_data *sdata,
497 struct ieee80211_key_conf *conf,
498 struct ieee80211_sta *sta, u32 iv32),
500 TP_ARGS(local, sdata, conf, sta, iv32),
513 __entry->iv32 = iv32;
517 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
518 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
522 DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
523 TP_PROTO(struct ieee80211_local *local,
524 struct ieee80211_sub_if_data *sdata),
525 TP_ARGS(local, sdata)
528 DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
529 TP_PROTO(struct ieee80211_local *local,
530 struct ieee80211_sub_if_data *sdata),
531 TP_ARGS(local, sdata)
534 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
535 TP_PROTO(struct ieee80211_local *local,
536 struct ieee80211_sub_if_data *sdata),
537 TP_ARGS(local, sdata)
540 DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
541 TP_PROTO(struct ieee80211_local *local,
542 struct ieee80211_sub_if_data *sdata),
543 TP_ARGS(local, sdata)
546 DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
547 TP_PROTO(struct ieee80211_local *local),
551 DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
552 TP_PROTO(struct ieee80211_local *local),
556 TRACE_EVENT(drv_get_stats,
557 TP_PROTO(struct ieee80211_local *local,
558 struct ieee80211_low_level_stats *stats,
561 TP_ARGS(local, stats, ret),
566 __field(unsigned int, ackfail)
567 __field(unsigned int, rtsfail)
568 __field(unsigned int, fcserr)
569 __field(unsigned int, rtssucc)
575 __entry->ackfail = stats->dot11ACKFailureCount;
576 __entry->rtsfail = stats->dot11RTSFailureCount;
577 __entry->fcserr = stats->dot11FCSErrorCount;
578 __entry->rtssucc = stats->dot11RTSSuccessCount;
582 LOCAL_PR_FMT " ret:%d",
583 LOCAL_PR_ARG, __entry->ret
587 TRACE_EVENT(drv_get_tkip_seq,
588 TP_PROTO(struct ieee80211_local *local,
589 u8 hw_key_idx, u32 *iv32, u16 *iv16),
591 TP_ARGS(local, hw_key_idx, iv32, iv16),
595 __field(u8, hw_key_idx)
602 __entry->hw_key_idx = hw_key_idx;
603 __entry->iv32 = *iv32;
604 __entry->iv16 = *iv16;
608 LOCAL_PR_FMT, LOCAL_PR_ARG
612 DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
613 TP_PROTO(struct ieee80211_local *local, u32 value),
614 TP_ARGS(local, value)
617 DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
618 TP_PROTO(struct ieee80211_local *local, u32 value),
619 TP_ARGS(local, value)
622 TRACE_EVENT(drv_set_coverage_class,
623 TP_PROTO(struct ieee80211_local *local, u8 value),
625 TP_ARGS(local, value),
634 __entry->value = value;
638 LOCAL_PR_FMT " value:%d",
639 LOCAL_PR_ARG, __entry->value
643 TRACE_EVENT(drv_sta_notify,
644 TP_PROTO(struct ieee80211_local *local,
645 struct ieee80211_sub_if_data *sdata,
646 enum sta_notify_cmd cmd,
647 struct ieee80211_sta *sta),
649 TP_ARGS(local, sdata, cmd, sta),
666 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
667 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
671 TRACE_EVENT(drv_sta_state,
672 TP_PROTO(struct ieee80211_local *local,
673 struct ieee80211_sub_if_data *sdata,
674 struct ieee80211_sta *sta,
675 enum ieee80211_sta_state old_state,
676 enum ieee80211_sta_state new_state),
678 TP_ARGS(local, sdata, sta, old_state, new_state),
684 __field(u32, old_state)
685 __field(u32, new_state)
692 __entry->old_state = old_state;
693 __entry->new_state = new_state;
697 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " state: %d->%d",
698 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
699 __entry->old_state, __entry->new_state
703 TRACE_EVENT(drv_sta_rc_update,
704 TP_PROTO(struct ieee80211_local *local,
705 struct ieee80211_sub_if_data *sdata,
706 struct ieee80211_sta *sta,
709 TP_ARGS(local, sdata, sta, changed),
715 __field(u32, changed)
722 __entry->changed = changed;
726 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
727 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
731 TRACE_EVENT(drv_sta_add,
732 TP_PROTO(struct ieee80211_local *local,
733 struct ieee80211_sub_if_data *sdata,
734 struct ieee80211_sta *sta),
736 TP_ARGS(local, sdata, sta),
751 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
752 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
756 TRACE_EVENT(drv_sta_remove,
757 TP_PROTO(struct ieee80211_local *local,
758 struct ieee80211_sub_if_data *sdata,
759 struct ieee80211_sta *sta),
761 TP_ARGS(local, sdata, sta),
776 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
777 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
781 TRACE_EVENT(drv_conf_tx,
782 TP_PROTO(struct ieee80211_local *local,
783 struct ieee80211_sub_if_data *sdata,
784 u16 ac, const struct ieee80211_tx_queue_params *params),
786 TP_ARGS(local, sdata, ac, params),
803 __entry->txop = params->txop;
804 __entry->cw_max = params->cw_max;
805 __entry->cw_min = params->cw_min;
806 __entry->aifs = params->aifs;
807 __entry->uapsd = params->uapsd;
811 LOCAL_PR_FMT VIF_PR_FMT " AC:%d",
812 LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
816 DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
817 TP_PROTO(struct ieee80211_local *local,
818 struct ieee80211_sub_if_data *sdata),
819 TP_ARGS(local, sdata)
822 TRACE_EVENT(drv_set_tsf,
823 TP_PROTO(struct ieee80211_local *local,
824 struct ieee80211_sub_if_data *sdata,
827 TP_ARGS(local, sdata, tsf),
842 LOCAL_PR_FMT VIF_PR_FMT " tsf:%llu",
843 LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
847 DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
848 TP_PROTO(struct ieee80211_local *local,
849 struct ieee80211_sub_if_data *sdata),
850 TP_ARGS(local, sdata)
853 DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
854 TP_PROTO(struct ieee80211_local *local),
858 TRACE_EVENT(drv_ampdu_action,
859 TP_PROTO(struct ieee80211_local *local,
860 struct ieee80211_sub_if_data *sdata,
861 enum ieee80211_ampdu_mlme_action action,
862 struct ieee80211_sta *sta, u16 tid,
863 u16 *ssn, u8 buf_size),
865 TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
873 __field(u8, buf_size)
881 __entry->action = action;
883 __entry->ssn = ssn ? *ssn : 0;
884 __entry->buf_size = buf_size;
888 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
889 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
890 __entry->tid, __entry->buf_size
894 TRACE_EVENT(drv_get_survey,
895 TP_PROTO(struct ieee80211_local *local, int idx,
896 struct survey_info *survey),
898 TP_ARGS(local, idx, survey),
911 LOCAL_PR_FMT " idx:%d",
912 LOCAL_PR_ARG, __entry->idx
916 TRACE_EVENT(drv_flush,
917 TP_PROTO(struct ieee80211_local *local, bool drop),
919 TP_ARGS(local, drop),
928 __entry->drop = drop;
932 LOCAL_PR_FMT " drop:%d",
933 LOCAL_PR_ARG, __entry->drop
937 TRACE_EVENT(drv_channel_switch,
938 TP_PROTO(struct ieee80211_local *local,
939 struct ieee80211_channel_switch *ch_switch),
941 TP_ARGS(local, ch_switch),
945 __field(u64, timestamp)
946 __field(bool, block_tx)
953 __entry->timestamp = ch_switch->timestamp;
954 __entry->block_tx = ch_switch->block_tx;
955 __entry->freq = ch_switch->channel->center_freq;
956 __entry->count = ch_switch->count;
960 LOCAL_PR_FMT " new freq:%u count:%d",
961 LOCAL_PR_ARG, __entry->freq, __entry->count
965 TRACE_EVENT(drv_set_antenna,
966 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
968 TP_ARGS(local, tx_ant, rx_ant, ret),
979 __entry->tx_ant = tx_ant;
980 __entry->rx_ant = rx_ant;
985 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
986 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
990 TRACE_EVENT(drv_get_antenna,
991 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
993 TP_ARGS(local, tx_ant, rx_ant, ret),
1004 __entry->tx_ant = tx_ant;
1005 __entry->rx_ant = rx_ant;
1010 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1011 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1015 TRACE_EVENT(drv_remain_on_channel,
1016 TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
1017 enum nl80211_channel_type chantype, unsigned int duration),
1019 TP_ARGS(local, chan, chantype, duration),
1023 __field(int, center_freq)
1024 __field(int, channel_type)
1025 __field(unsigned int, duration)
1030 __entry->center_freq = chan->center_freq;
1031 __entry->channel_type = chantype;
1032 __entry->duration = duration;
1036 LOCAL_PR_FMT " freq:%dMHz duration:%dms",
1037 LOCAL_PR_ARG, __entry->center_freq, __entry->duration
1041 DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
1042 TP_PROTO(struct ieee80211_local *local),
1046 TRACE_EVENT(drv_offchannel_tx,
1047 TP_PROTO(struct ieee80211_local *local, struct sk_buff *skb,
1048 struct ieee80211_channel *chan,
1049 enum nl80211_channel_type channel_type,
1052 TP_ARGS(local, skb, chan, channel_type, wait),
1056 __field(int, center_freq)
1057 __field(int, channel_type)
1058 __field(unsigned int, wait)
1063 __entry->center_freq = chan->center_freq;
1064 __entry->channel_type = channel_type;
1065 __entry->wait = wait;
1069 LOCAL_PR_FMT " freq:%dMHz, wait:%dms",
1070 LOCAL_PR_ARG, __entry->center_freq, __entry->wait
1074 TRACE_EVENT(drv_set_ringparam,
1075 TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
1077 TP_ARGS(local, tx, rx),
1092 LOCAL_PR_FMT " tx:%d rx %d",
1093 LOCAL_PR_ARG, __entry->tx, __entry->rx
1097 TRACE_EVENT(drv_get_ringparam,
1098 TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1099 u32 *rx, u32 *rx_max),
1101 TP_ARGS(local, tx, tx_max, rx, rx_max),
1106 __field(u32, tx_max)
1108 __field(u32, rx_max)
1114 __entry->tx_max = *tx_max;
1116 __entry->rx_max = *rx_max;
1120 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1122 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1126 DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1127 TP_PROTO(struct ieee80211_local *local),
1131 DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1132 TP_PROTO(struct ieee80211_local *local),
1136 TRACE_EVENT(drv_set_bitrate_mask,
1137 TP_PROTO(struct ieee80211_local *local,
1138 struct ieee80211_sub_if_data *sdata,
1139 const struct cfg80211_bitrate_mask *mask),
1141 TP_ARGS(local, sdata, mask),
1146 __field(u32, legacy_2g)
1147 __field(u32, legacy_5g)
1153 __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
1154 __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
1158 LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1159 LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1163 TRACE_EVENT(drv_set_rekey_data,
1164 TP_PROTO(struct ieee80211_local *local,
1165 struct ieee80211_sub_if_data *sdata,
1166 struct cfg80211_gtk_rekey_data *data),
1168 TP_ARGS(local, sdata, data),
1173 __array(u8, kek, NL80211_KEK_LEN)
1174 __array(u8, kck, NL80211_KCK_LEN)
1175 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1181 memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1182 memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1183 memcpy(__entry->replay_ctr, data->replay_ctr,
1184 NL80211_REPLAY_CTR_LEN);
1187 TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1188 LOCAL_PR_ARG, VIF_PR_ARG)
1191 TRACE_EVENT(drv_rssi_callback,
1192 TP_PROTO(struct ieee80211_local *local,
1193 enum ieee80211_rssi_event rssi_event),
1195 TP_ARGS(local, rssi_event),
1199 __field(u32, rssi_event)
1204 __entry->rssi_event = rssi_event;
1208 LOCAL_PR_FMT " rssi_event:%d",
1209 LOCAL_PR_ARG, __entry->rssi_event
1213 DECLARE_EVENT_CLASS(release_evt,
1214 TP_PROTO(struct ieee80211_local *local,
1215 struct ieee80211_sta *sta,
1216 u16 tids, int num_frames,
1217 enum ieee80211_frame_release_type reason,
1220 TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1226 __field(int, num_frames)
1227 __field(int, reason)
1228 __field(bool, more_data)
1234 __entry->tids = tids;
1235 __entry->num_frames = num_frames;
1236 __entry->reason = reason;
1237 __entry->more_data = more_data;
1241 LOCAL_PR_FMT STA_PR_FMT
1242 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1243 LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1244 __entry->reason, __entry->more_data
1248 DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1249 TP_PROTO(struct ieee80211_local *local,
1250 struct ieee80211_sta *sta,
1251 u16 tids, int num_frames,
1252 enum ieee80211_frame_release_type reason,
1255 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1258 DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1259 TP_PROTO(struct ieee80211_local *local,
1260 struct ieee80211_sta *sta,
1261 u16 tids, int num_frames,
1262 enum ieee80211_frame_release_type reason,
1265 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1268 TRACE_EVENT(drv_get_rssi,
1269 TP_PROTO(struct ieee80211_local *local, struct ieee80211_sta *sta,
1272 TP_ARGS(local, sta, rssi, ret),
1284 __entry->rssi = rssi;
1289 LOCAL_PR_FMT STA_PR_FMT " rssi:%d ret:%d",
1290 LOCAL_PR_ARG, STA_PR_ARG, __entry->rssi, __entry->ret
1294 DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
1295 TP_PROTO(struct ieee80211_local *local,
1296 struct ieee80211_sub_if_data *sdata),
1298 TP_ARGS(local, sdata)
1301 DECLARE_EVENT_CLASS(local_chanctx,
1302 TP_PROTO(struct ieee80211_local *local,
1303 struct ieee80211_chanctx *ctx),
1305 TP_ARGS(local, ctx),
1318 LOCAL_PR_FMT CHANCTX_PR_FMT,
1319 LOCAL_PR_ARG, CHANCTX_PR_ARG
1323 DEFINE_EVENT(local_chanctx, drv_add_chanctx,
1324 TP_PROTO(struct ieee80211_local *local,
1325 struct ieee80211_chanctx *ctx),
1329 DEFINE_EVENT(local_chanctx, drv_remove_chanctx,
1330 TP_PROTO(struct ieee80211_local *local,
1331 struct ieee80211_chanctx *ctx),
1335 TRACE_EVENT(drv_change_chanctx,
1336 TP_PROTO(struct ieee80211_local *local,
1337 struct ieee80211_chanctx *ctx,
1340 TP_ARGS(local, ctx, changed),
1345 __field(u32, changed)
1351 __entry->changed = changed;
1355 LOCAL_PR_FMT CHANCTX_PR_FMT " changed:%#x",
1356 LOCAL_PR_ARG, CHANCTX_PR_ARG, __entry->changed
1360 DECLARE_EVENT_CLASS(local_sdata_chanctx,
1361 TP_PROTO(struct ieee80211_local *local,
1362 struct ieee80211_sub_if_data *sdata,
1363 struct ieee80211_chanctx *ctx),
1365 TP_ARGS(local, sdata, ctx),
1380 LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT,
1381 LOCAL_PR_ARG, VIF_PR_ARG, CHANCTX_PR_ARG
1385 DEFINE_EVENT(local_sdata_chanctx, drv_assign_vif_chanctx,
1386 TP_PROTO(struct ieee80211_local *local,
1387 struct ieee80211_sub_if_data *sdata,
1388 struct ieee80211_chanctx *ctx),
1389 TP_ARGS(local, sdata, ctx)
1392 DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
1393 TP_PROTO(struct ieee80211_local *local,
1394 struct ieee80211_sub_if_data *sdata,
1395 struct ieee80211_chanctx *ctx),
1396 TP_ARGS(local, sdata, ctx)
1400 * Tracing for API calls that drivers call.
1403 TRACE_EVENT(api_start_tx_ba_session,
1404 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1419 STA_PR_FMT " tid:%d",
1420 STA_PR_ARG, __entry->tid
1424 TRACE_EVENT(api_start_tx_ba_cb,
1425 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1427 TP_ARGS(sdata, ra, tid),
1431 __array(u8, ra, ETH_ALEN)
1437 memcpy(__entry->ra, ra, ETH_ALEN);
1442 VIF_PR_FMT " ra:%pM tid:%d",
1443 VIF_PR_ARG, __entry->ra, __entry->tid
1447 TRACE_EVENT(api_stop_tx_ba_session,
1448 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1463 STA_PR_FMT " tid:%d",
1464 STA_PR_ARG, __entry->tid
1468 TRACE_EVENT(api_stop_tx_ba_cb,
1469 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1471 TP_ARGS(sdata, ra, tid),
1475 __array(u8, ra, ETH_ALEN)
1481 memcpy(__entry->ra, ra, ETH_ALEN);
1486 VIF_PR_FMT " ra:%pM tid:%d",
1487 VIF_PR_ARG, __entry->ra, __entry->tid
1491 DEFINE_EVENT(local_only_evt, api_restart_hw,
1492 TP_PROTO(struct ieee80211_local *local),
1496 TRACE_EVENT(api_beacon_loss,
1497 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1515 TRACE_EVENT(api_connection_loss,
1516 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1534 TRACE_EVENT(api_cqm_rssi_notify,
1535 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1536 enum nl80211_cqm_rssi_threshold_event rssi_event),
1538 TP_ARGS(sdata, rssi_event),
1542 __field(u32, rssi_event)
1547 __entry->rssi_event = rssi_event;
1551 VIF_PR_FMT " event:%d",
1552 VIF_PR_ARG, __entry->rssi_event
1556 TRACE_EVENT(api_scan_completed,
1557 TP_PROTO(struct ieee80211_local *local, bool aborted),
1559 TP_ARGS(local, aborted),
1563 __field(bool, aborted)
1568 __entry->aborted = aborted;
1572 LOCAL_PR_FMT " aborted:%d",
1573 LOCAL_PR_ARG, __entry->aborted
1577 TRACE_EVENT(api_sched_scan_results,
1578 TP_PROTO(struct ieee80211_local *local),
1591 LOCAL_PR_FMT, LOCAL_PR_ARG
1595 TRACE_EVENT(api_sched_scan_stopped,
1596 TP_PROTO(struct ieee80211_local *local),
1609 LOCAL_PR_FMT, LOCAL_PR_ARG
1613 TRACE_EVENT(api_sta_block_awake,
1614 TP_PROTO(struct ieee80211_local *local,
1615 struct ieee80211_sta *sta, bool block),
1617 TP_ARGS(local, sta, block),
1622 __field(bool, block)
1628 __entry->block = block;
1632 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1633 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1637 TRACE_EVENT(api_chswitch_done,
1638 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1640 TP_ARGS(sdata, success),
1644 __field(bool, success)
1649 __entry->success = success;
1653 VIF_PR_FMT " success=%d",
1654 VIF_PR_ARG, __entry->success
1658 DEFINE_EVENT(local_only_evt, api_ready_on_channel,
1659 TP_PROTO(struct ieee80211_local *local),
1663 DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
1664 TP_PROTO(struct ieee80211_local *local),
1668 TRACE_EVENT(api_gtk_rekey_notify,
1669 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1670 const u8 *bssid, const u8 *replay_ctr),
1672 TP_ARGS(sdata, bssid, replay_ctr),
1676 __array(u8, bssid, ETH_ALEN)
1677 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1682 memcpy(__entry->bssid, bssid, ETH_ALEN);
1683 memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
1686 TP_printk(VIF_PR_FMT, VIF_PR_ARG)
1689 TRACE_EVENT(api_enable_rssi_reports,
1690 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1691 int rssi_min_thold, int rssi_max_thold),
1693 TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
1697 __field(int, rssi_min_thold)
1698 __field(int, rssi_max_thold)
1703 __entry->rssi_min_thold = rssi_min_thold;
1704 __entry->rssi_max_thold = rssi_max_thold;
1708 VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
1709 VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
1713 TRACE_EVENT(api_eosp,
1714 TP_PROTO(struct ieee80211_local *local,
1715 struct ieee80211_sta *sta),
1717 TP_ARGS(local, sta),
1730 LOCAL_PR_FMT STA_PR_FMT,
1731 LOCAL_PR_ARG, STA_PR_FMT
1736 * Tracing for internal functions
1737 * (which may also be called in response to driver calls)
1740 TRACE_EVENT(wake_queue,
1741 TP_PROTO(struct ieee80211_local *local, u16 queue,
1742 enum queue_stop_reason reason),
1744 TP_ARGS(local, queue, reason),
1749 __field(u32, reason)
1754 __entry->queue = queue;
1755 __entry->reason = reason;
1759 LOCAL_PR_FMT " queue:%d, reason:%d",
1760 LOCAL_PR_ARG, __entry->queue, __entry->reason
1764 TRACE_EVENT(stop_queue,
1765 TP_PROTO(struct ieee80211_local *local, u16 queue,
1766 enum queue_stop_reason reason),
1768 TP_ARGS(local, queue, reason),
1773 __field(u32, reason)
1778 __entry->queue = queue;
1779 __entry->reason = reason;
1783 LOCAL_PR_FMT " queue:%d, reason:%d",
1784 LOCAL_PR_ARG, __entry->queue, __entry->reason
1788 #ifdef CONFIG_MAC80211_MESSAGE_TRACING
1790 #define TRACE_SYSTEM mac80211_msg
1792 #define MAX_MSG_LEN 100
1794 DECLARE_EVENT_CLASS(mac80211_msg_event,
1795 TP_PROTO(struct va_format *vaf),
1800 __dynamic_array(char, msg, MAX_MSG_LEN)
1804 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
1805 MAX_MSG_LEN, vaf->fmt,
1806 *vaf->va) >= MAX_MSG_LEN);
1809 TP_printk("%s", __get_str(msg))
1812 DEFINE_EVENT(mac80211_msg_event, mac80211_info,
1813 TP_PROTO(struct va_format *vaf),
1816 DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
1817 TP_PROTO(struct va_format *vaf),
1820 DEFINE_EVENT(mac80211_msg_event, mac80211_err,
1821 TP_PROTO(struct va_format *vaf),
1826 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
1828 #undef TRACE_INCLUDE_PATH
1829 #define TRACE_INCLUDE_PATH .
1830 #undef TRACE_INCLUDE_FILE
1831 #define TRACE_INCLUDE_FILE trace
1832 #include <trace/define_trace.h>