1 #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2 #define __MAC80211_DRIVER_TRACE
4 #include <linux/tracepoint.h>
5 #include <net/mac80211.h>
6 #include "ieee80211_i.h"
8 #if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
10 #define TRACE_EVENT(name, proto, ...) \
11 static inline void trace_ ## name(proto) {}
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_PR_FMT " sta:%pM"
26 #define STA_PR_ARG __entry->sta_addr
28 #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, vif)
29 #define VIF_ASSIGN __entry->vif_type = vif ? vif->type : 0; __entry->vif = vif
30 #define VIF_PR_FMT " vif:%p(%d)"
31 #define VIF_PR_ARG __entry->vif, __entry->vif_type
33 TRACE_EVENT(drv_start
,
34 TP_PROTO(struct ieee80211_local
*local
, int ret
),
49 LOCAL_PR_FMT
, LOCAL_PR_ARG
54 TP_PROTO(struct ieee80211_local
*local
),
67 LOCAL_PR_FMT
, LOCAL_PR_ARG
71 TRACE_EVENT(drv_add_interface
,
72 TP_PROTO(struct ieee80211_local
*local
,
74 struct ieee80211_vif
*vif
,
77 TP_ARGS(local
, addr
, vif
, ret
),
82 __array(char, addr
, 6)
89 memcpy(__entry
->addr
, addr
, 6);
94 LOCAL_PR_FMT VIF_PR_FMT
" addr:%pM ret:%d",
95 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->addr
, __entry
->ret
99 TRACE_EVENT(drv_remove_interface
,
100 TP_PROTO(struct ieee80211_local
*local
,
101 const u8
*addr
, struct ieee80211_vif
*vif
),
103 TP_ARGS(local
, addr
, vif
),
108 __array(char, addr
, 6)
114 memcpy(__entry
->addr
, addr
, 6);
118 LOCAL_PR_FMT VIF_PR_FMT
" addr:%pM",
119 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->addr
123 TRACE_EVENT(drv_config
,
124 TP_PROTO(struct ieee80211_local
*local
,
128 TP_ARGS(local
, changed
, ret
),
132 __field(u32
, changed
)
138 __entry
->changed
= changed
;
143 LOCAL_PR_FMT
" ch:%#x ret:%d",
144 LOCAL_PR_ARG
, __entry
->changed
, __entry
->ret
148 TRACE_EVENT(drv_bss_info_changed
,
149 TP_PROTO(struct ieee80211_local
*local
,
150 struct ieee80211_vif
*vif
,
151 struct ieee80211_bss_conf
*info
,
154 TP_ARGS(local
, vif
, info
, changed
),
162 __field(bool, shortpre
)
163 __field(bool, shortslot
)
166 __field(u16
, assoc_cap
)
167 __field(u64
, timestamp
)
168 __field(u32
, basic_rates
)
169 __field(u32
, changed
)
175 __entry
->changed
= changed
;
176 __entry
->aid
= info
->aid
;
177 __entry
->assoc
= info
->assoc
;
178 __entry
->shortpre
= info
->use_short_preamble
;
179 __entry
->cts
= info
->use_cts_prot
;
180 __entry
->shortslot
= info
->use_short_slot
;
181 __entry
->dtimper
= info
->dtim_period
;
182 __entry
->bcnint
= info
->beacon_int
;
183 __entry
->assoc_cap
= info
->assoc_capability
;
184 __entry
->timestamp
= info
->timestamp
;
185 __entry
->basic_rates
= info
->basic_rates
;
189 LOCAL_PR_FMT VIF_PR_FMT
" changed:%#x",
190 LOCAL_PR_ARG
, VIF_PR_ARG
, __entry
->changed
194 TRACE_EVENT(drv_configure_filter
,
195 TP_PROTO(struct ieee80211_local
*local
,
196 unsigned int changed_flags
,
197 unsigned int *total_flags
,
200 TP_ARGS(local
, changed_flags
, total_flags
, mc_count
),
204 __field(unsigned int, changed
)
205 __field(unsigned int, total
)
211 __entry
->changed
= changed_flags
;
212 __entry
->total
= *total_flags
;
213 __entry
->mc
= mc_count
;
217 LOCAL_PR_FMT
" changed:%#x total:%#x mc:%d",
218 LOCAL_PR_ARG
, __entry
->changed
, __entry
->total
, __entry
->mc
222 TRACE_EVENT(drv_set_tim
,
223 TP_PROTO(struct ieee80211_local
*local
,
224 struct ieee80211_sta
*sta
, bool set
, int ret
),
226 TP_ARGS(local
, sta
, set
, ret
),
243 LOCAL_PR_FMT STA_PR_FMT
" set:%d ret:%d",
244 LOCAL_PR_ARG
, STA_PR_FMT
, __entry
->set
, __entry
->ret
248 TRACE_EVENT(drv_set_key
,
249 TP_PROTO(struct ieee80211_local
*local
,
250 enum set_key_cmd cmd
, struct ieee80211_vif
*vif
,
251 struct ieee80211_sta
*sta
,
252 struct ieee80211_key_conf
*key
, int ret
),
254 TP_ARGS(local
, cmd
, vif
, sta
, key
, ret
),
260 __field(enum ieee80211_key_alg
, alg
)
261 __field(u8
, hw_key_idx
)
271 __entry
->alg
= key
->alg
;
272 __entry
->flags
= key
->flags
;
273 __entry
->keyidx
= key
->keyidx
;
274 __entry
->hw_key_idx
= key
->hw_key_idx
;
279 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" ret:%d",
280 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->ret
284 TRACE_EVENT(drv_update_tkip_key
,
285 TP_PROTO(struct ieee80211_local
*local
,
286 struct ieee80211_key_conf
*conf
,
287 const u8
*address
, u32 iv32
),
289 TP_ARGS(local
, conf
, address
, iv32
),
299 memcpy(__entry
->addr
, address
, 6);
300 __entry
->iv32
= iv32
;
304 LOCAL_PR_FMT
" addr:%pM iv32:%#x",
305 LOCAL_PR_ARG
, __entry
->addr
, __entry
->iv32
309 TRACE_EVENT(drv_hw_scan
,
310 TP_PROTO(struct ieee80211_local
*local
,
311 struct cfg80211_scan_request
*req
, int ret
),
313 TP_ARGS(local
, req
, ret
),
326 LOCAL_PR_FMT
" ret:%d",
327 LOCAL_PR_ARG
, __entry
->ret
331 TRACE_EVENT(drv_sw_scan_start
,
332 TP_PROTO(struct ieee80211_local
*local
),
345 LOCAL_PR_FMT
, LOCAL_PR_ARG
349 TRACE_EVENT(drv_sw_scan_complete
,
350 TP_PROTO(struct ieee80211_local
*local
),
363 LOCAL_PR_FMT
, LOCAL_PR_ARG
367 TRACE_EVENT(drv_get_stats
,
368 TP_PROTO(struct ieee80211_local
*local
,
369 struct ieee80211_low_level_stats
*stats
,
372 TP_ARGS(local
, stats
, ret
),
377 __field(unsigned int, ackfail
)
378 __field(unsigned int, rtsfail
)
379 __field(unsigned int, fcserr
)
380 __field(unsigned int, rtssucc
)
386 __entry
->ackfail
= stats
->dot11ACKFailureCount
;
387 __entry
->rtsfail
= stats
->dot11RTSFailureCount
;
388 __entry
->fcserr
= stats
->dot11FCSErrorCount
;
389 __entry
->rtssucc
= stats
->dot11RTSSuccessCount
;
393 LOCAL_PR_FMT
" ret:%d",
394 LOCAL_PR_ARG
, __entry
->ret
398 TRACE_EVENT(drv_get_tkip_seq
,
399 TP_PROTO(struct ieee80211_local
*local
,
400 u8 hw_key_idx
, u32
*iv32
, u16
*iv16
),
402 TP_ARGS(local
, hw_key_idx
, iv32
, iv16
),
406 __field(u8
, hw_key_idx
)
413 __entry
->hw_key_idx
= hw_key_idx
;
414 __entry
->iv32
= *iv32
;
415 __entry
->iv16
= *iv16
;
419 LOCAL_PR_FMT
, LOCAL_PR_ARG
423 TRACE_EVENT(drv_set_rts_threshold
,
424 TP_PROTO(struct ieee80211_local
*local
, u32 value
, int ret
),
426 TP_ARGS(local
, value
, ret
),
437 __entry
->value
= value
;
441 LOCAL_PR_FMT
" value:%d ret:%d",
442 LOCAL_PR_ARG
, __entry
->value
, __entry
->ret
446 TRACE_EVENT(drv_sta_notify
,
447 TP_PROTO(struct ieee80211_local
*local
,
448 struct ieee80211_vif
*vif
,
449 enum sta_notify_cmd cmd
,
450 struct ieee80211_sta
*sta
),
452 TP_ARGS(local
, vif
, cmd
, sta
),
469 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT
" cmd:%d",
470 LOCAL_PR_ARG
, VIF_PR_ARG
, STA_PR_ARG
, __entry
->cmd
474 TRACE_EVENT(drv_conf_tx
,
475 TP_PROTO(struct ieee80211_local
*local
, u16 queue
,
476 const struct ieee80211_tx_queue_params
*params
,
479 TP_ARGS(local
, queue
, params
, ret
),
493 __entry
->queue
= queue
;
495 __entry
->txop
= params
->txop
;
496 __entry
->cw_max
= params
->cw_max
;
497 __entry
->cw_min
= params
->cw_min
;
498 __entry
->aifs
= params
->aifs
;
502 LOCAL_PR_FMT
" queue:%d ret:%d",
503 LOCAL_PR_ARG
, __entry
->queue
, __entry
->ret
507 TRACE_EVENT(drv_get_tx_stats
,
508 TP_PROTO(struct ieee80211_local
*local
,
509 struct ieee80211_tx_queue_stats
*stats
,
512 TP_ARGS(local
, stats
, ret
),
525 LOCAL_PR_FMT
" ret:%d",
526 LOCAL_PR_ARG
, __entry
->ret
530 TRACE_EVENT(drv_get_tsf
,
531 TP_PROTO(struct ieee80211_local
*local
, u64 ret
),
546 LOCAL_PR_FMT
" ret:%llu",
547 LOCAL_PR_ARG
, (unsigned long long)__entry
->ret
551 TRACE_EVENT(drv_set_tsf
,
552 TP_PROTO(struct ieee80211_local
*local
, u64 tsf
),
567 LOCAL_PR_FMT
" tsf:%llu",
568 LOCAL_PR_ARG
, (unsigned long long)__entry
->tsf
572 TRACE_EVENT(drv_reset_tsf
,
573 TP_PROTO(struct ieee80211_local
*local
),
586 LOCAL_PR_FMT
, LOCAL_PR_ARG
590 TRACE_EVENT(drv_tx_last_beacon
,
591 TP_PROTO(struct ieee80211_local
*local
, int ret
),
606 LOCAL_PR_FMT
" ret:%d",
607 LOCAL_PR_ARG
, __entry
->ret
611 TRACE_EVENT(drv_ampdu_action
,
612 TP_PROTO(struct ieee80211_local
*local
,
613 enum ieee80211_ampdu_mlme_action action
,
614 struct ieee80211_sta
*sta
, u16 tid
,
617 TP_ARGS(local
, action
, sta
, tid
, ssn
, ret
),
632 __entry
->action
= action
;
638 LOCAL_PR_FMT STA_PR_FMT
" action:%d tid:%d ret:%d",
639 LOCAL_PR_ARG
, STA_PR_ARG
, __entry
->action
, __entry
->tid
, __entry
->ret
642 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
644 #undef TRACE_INCLUDE_PATH
645 #define TRACE_INCLUDE_PATH .
646 #undef TRACE_INCLUDE_FILE
647 #define TRACE_INCLUDE_FILE driver-trace
648 #include <trace/define_trace.h>