drivers/md: Remove unnecessary casts of void *
[firewire-audio.git] / net / mac80211 / driver-trace.h
blob41baf730a5c7b92f2debfb73ebfaf3b6bd3b079b
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__)
9 #undef TRACE_EVENT
10 #define TRACE_EVENT(name, proto, ...) \
11 static inline void trace_ ## name(proto) {}
12 #endif
14 #undef TRACE_SYSTEM
15 #define TRACE_SYSTEM mac80211
17 #define MAXNAME 32
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 *, sdata) \
29 __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
30 #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
31 __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
32 #define VIF_PR_FMT " vif:%s(%d)"
33 #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type
35 TRACE_EVENT(drv_start,
36 TP_PROTO(struct ieee80211_local *local, int ret),
38 TP_ARGS(local, ret),
40 TP_STRUCT__entry(
41 LOCAL_ENTRY
42 __field(int, ret)
45 TP_fast_assign(
46 LOCAL_ASSIGN;
47 __entry->ret = ret;
50 TP_printk(
51 LOCAL_PR_FMT, LOCAL_PR_ARG
55 TRACE_EVENT(drv_stop,
56 TP_PROTO(struct ieee80211_local *local),
58 TP_ARGS(local),
60 TP_STRUCT__entry(
61 LOCAL_ENTRY
64 TP_fast_assign(
65 LOCAL_ASSIGN;
68 TP_printk(
69 LOCAL_PR_FMT, LOCAL_PR_ARG
73 TRACE_EVENT(drv_add_interface,
74 TP_PROTO(struct ieee80211_local *local,
75 struct ieee80211_sub_if_data *sdata,
76 int ret),
78 TP_ARGS(local, sdata, ret),
80 TP_STRUCT__entry(
81 LOCAL_ENTRY
82 VIF_ENTRY
83 __array(char, addr, 6)
84 __field(int, ret)
87 TP_fast_assign(
88 LOCAL_ASSIGN;
89 VIF_ASSIGN;
90 memcpy(__entry->addr, sdata->vif.addr, 6);
91 __entry->ret = ret;
94 TP_printk(
95 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM ret:%d",
96 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr, __entry->ret
100 TRACE_EVENT(drv_remove_interface,
101 TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),
103 TP_ARGS(local, sdata),
105 TP_STRUCT__entry(
106 LOCAL_ENTRY
107 VIF_ENTRY
108 __array(char, addr, 6)
111 TP_fast_assign(
112 LOCAL_ASSIGN;
113 VIF_ASSIGN;
114 memcpy(__entry->addr, sdata->vif.addr, 6);
117 TP_printk(
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,
125 u32 changed,
126 int ret),
128 TP_ARGS(local, changed, ret),
130 TP_STRUCT__entry(
131 LOCAL_ENTRY
132 __field(u32, changed)
133 __field(int, ret)
134 __field(u32, flags)
135 __field(int, power_level)
136 __field(int, dynamic_ps_timeout)
137 __field(int, max_sleep_period)
138 __field(u16, listen_interval)
139 __field(u8, long_frame_max_tx_count)
140 __field(u8, short_frame_max_tx_count)
141 __field(int, center_freq)
142 __field(int, channel_type)
143 __field(int, smps)
146 TP_fast_assign(
147 LOCAL_ASSIGN;
148 __entry->changed = changed;
149 __entry->ret = ret;
150 __entry->flags = local->hw.conf.flags;
151 __entry->power_level = local->hw.conf.power_level;
152 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
153 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
154 __entry->listen_interval = local->hw.conf.listen_interval;
155 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
156 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
157 __entry->center_freq = local->hw.conf.channel->center_freq;
158 __entry->channel_type = local->hw.conf.channel_type;
159 __entry->smps = local->hw.conf.smps_mode;
162 TP_printk(
163 LOCAL_PR_FMT " ch:%#x freq:%d ret:%d",
164 LOCAL_PR_ARG, __entry->changed, __entry->center_freq, __entry->ret
168 TRACE_EVENT(drv_bss_info_changed,
169 TP_PROTO(struct ieee80211_local *local,
170 struct ieee80211_sub_if_data *sdata,
171 struct ieee80211_bss_conf *info,
172 u32 changed),
174 TP_ARGS(local, sdata, info, changed),
176 TP_STRUCT__entry(
177 LOCAL_ENTRY
178 VIF_ENTRY
179 __field(bool, assoc)
180 __field(u16, aid)
181 __field(bool, cts)
182 __field(bool, shortpre)
183 __field(bool, shortslot)
184 __field(u8, dtimper)
185 __field(u16, bcnint)
186 __field(u16, assoc_cap)
187 __field(u64, timestamp)
188 __field(u32, basic_rates)
189 __field(u32, changed)
190 __field(bool, enable_beacon)
191 __field(u16, ht_operation_mode)
194 TP_fast_assign(
195 LOCAL_ASSIGN;
196 VIF_ASSIGN;
197 __entry->changed = changed;
198 __entry->aid = info->aid;
199 __entry->assoc = info->assoc;
200 __entry->shortpre = info->use_short_preamble;
201 __entry->cts = info->use_cts_prot;
202 __entry->shortslot = info->use_short_slot;
203 __entry->dtimper = info->dtim_period;
204 __entry->bcnint = info->beacon_int;
205 __entry->assoc_cap = info->assoc_capability;
206 __entry->timestamp = info->timestamp;
207 __entry->basic_rates = info->basic_rates;
208 __entry->enable_beacon = info->enable_beacon;
209 __entry->ht_operation_mode = info->ht_operation_mode;
212 TP_printk(
213 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
214 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
218 TRACE_EVENT(drv_prepare_multicast,
219 TP_PROTO(struct ieee80211_local *local, int mc_count, u64 ret),
221 TP_ARGS(local, mc_count, ret),
223 TP_STRUCT__entry(
224 LOCAL_ENTRY
225 __field(int, mc_count)
226 __field(u64, ret)
229 TP_fast_assign(
230 LOCAL_ASSIGN;
231 __entry->mc_count = mc_count;
232 __entry->ret = ret;
235 TP_printk(
236 LOCAL_PR_FMT " prepare mc (%d): %llx",
237 LOCAL_PR_ARG, __entry->mc_count,
238 (unsigned long long) __entry->ret
242 TRACE_EVENT(drv_configure_filter,
243 TP_PROTO(struct ieee80211_local *local,
244 unsigned int changed_flags,
245 unsigned int *total_flags,
246 u64 multicast),
248 TP_ARGS(local, changed_flags, total_flags, multicast),
250 TP_STRUCT__entry(
251 LOCAL_ENTRY
252 __field(unsigned int, changed)
253 __field(unsigned int, total)
254 __field(u64, multicast)
257 TP_fast_assign(
258 LOCAL_ASSIGN;
259 __entry->changed = changed_flags;
260 __entry->total = *total_flags;
261 __entry->multicast = multicast;
264 TP_printk(
265 LOCAL_PR_FMT " changed:%#x total:%#x",
266 LOCAL_PR_ARG, __entry->changed, __entry->total
270 TRACE_EVENT(drv_set_tim,
271 TP_PROTO(struct ieee80211_local *local,
272 struct ieee80211_sta *sta, bool set, int ret),
274 TP_ARGS(local, sta, set, ret),
276 TP_STRUCT__entry(
277 LOCAL_ENTRY
278 STA_ENTRY
279 __field(bool, set)
280 __field(int, ret)
283 TP_fast_assign(
284 LOCAL_ASSIGN;
285 STA_ASSIGN;
286 __entry->set = set;
287 __entry->ret = ret;
290 TP_printk(
291 LOCAL_PR_FMT STA_PR_FMT " set:%d ret:%d",
292 LOCAL_PR_ARG, STA_PR_FMT, __entry->set, __entry->ret
296 TRACE_EVENT(drv_set_key,
297 TP_PROTO(struct ieee80211_local *local,
298 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
299 struct ieee80211_sta *sta,
300 struct ieee80211_key_conf *key, int ret),
302 TP_ARGS(local, cmd, sdata, sta, key, ret),
304 TP_STRUCT__entry(
305 LOCAL_ENTRY
306 VIF_ENTRY
307 STA_ENTRY
308 __field(enum ieee80211_key_alg, alg)
309 __field(u8, hw_key_idx)
310 __field(u8, flags)
311 __field(s8, keyidx)
312 __field(int, ret)
315 TP_fast_assign(
316 LOCAL_ASSIGN;
317 VIF_ASSIGN;
318 STA_ASSIGN;
319 __entry->alg = key->alg;
320 __entry->flags = key->flags;
321 __entry->keyidx = key->keyidx;
322 __entry->hw_key_idx = key->hw_key_idx;
323 __entry->ret = ret;
326 TP_printk(
327 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
328 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
332 TRACE_EVENT(drv_update_tkip_key,
333 TP_PROTO(struct ieee80211_local *local,
334 struct ieee80211_sub_if_data *sdata,
335 struct ieee80211_key_conf *conf,
336 struct ieee80211_sta *sta, u32 iv32),
338 TP_ARGS(local, sdata, conf, sta, iv32),
340 TP_STRUCT__entry(
341 LOCAL_ENTRY
342 VIF_ENTRY
343 STA_ENTRY
344 __field(u32, iv32)
347 TP_fast_assign(
348 LOCAL_ASSIGN;
349 VIF_ASSIGN;
350 STA_ASSIGN;
351 __entry->iv32 = iv32;
354 TP_printk(
355 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
356 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
360 TRACE_EVENT(drv_hw_scan,
361 TP_PROTO(struct ieee80211_local *local,
362 struct cfg80211_scan_request *req, int ret),
364 TP_ARGS(local, req, ret),
366 TP_STRUCT__entry(
367 LOCAL_ENTRY
368 __field(int, ret)
371 TP_fast_assign(
372 LOCAL_ASSIGN;
373 __entry->ret = ret;
376 TP_printk(
377 LOCAL_PR_FMT " ret:%d",
378 LOCAL_PR_ARG, __entry->ret
382 TRACE_EVENT(drv_sw_scan_start,
383 TP_PROTO(struct ieee80211_local *local),
385 TP_ARGS(local),
387 TP_STRUCT__entry(
388 LOCAL_ENTRY
391 TP_fast_assign(
392 LOCAL_ASSIGN;
395 TP_printk(
396 LOCAL_PR_FMT, LOCAL_PR_ARG
400 TRACE_EVENT(drv_sw_scan_complete,
401 TP_PROTO(struct ieee80211_local *local),
403 TP_ARGS(local),
405 TP_STRUCT__entry(
406 LOCAL_ENTRY
409 TP_fast_assign(
410 LOCAL_ASSIGN;
413 TP_printk(
414 LOCAL_PR_FMT, LOCAL_PR_ARG
418 TRACE_EVENT(drv_get_stats,
419 TP_PROTO(struct ieee80211_local *local,
420 struct ieee80211_low_level_stats *stats,
421 int ret),
423 TP_ARGS(local, stats, ret),
425 TP_STRUCT__entry(
426 LOCAL_ENTRY
427 __field(int, ret)
428 __field(unsigned int, ackfail)
429 __field(unsigned int, rtsfail)
430 __field(unsigned int, fcserr)
431 __field(unsigned int, rtssucc)
434 TP_fast_assign(
435 LOCAL_ASSIGN;
436 __entry->ret = ret;
437 __entry->ackfail = stats->dot11ACKFailureCount;
438 __entry->rtsfail = stats->dot11RTSFailureCount;
439 __entry->fcserr = stats->dot11FCSErrorCount;
440 __entry->rtssucc = stats->dot11RTSSuccessCount;
443 TP_printk(
444 LOCAL_PR_FMT " ret:%d",
445 LOCAL_PR_ARG, __entry->ret
449 TRACE_EVENT(drv_get_tkip_seq,
450 TP_PROTO(struct ieee80211_local *local,
451 u8 hw_key_idx, u32 *iv32, u16 *iv16),
453 TP_ARGS(local, hw_key_idx, iv32, iv16),
455 TP_STRUCT__entry(
456 LOCAL_ENTRY
457 __field(u8, hw_key_idx)
458 __field(u32, iv32)
459 __field(u16, iv16)
462 TP_fast_assign(
463 LOCAL_ASSIGN;
464 __entry->hw_key_idx = hw_key_idx;
465 __entry->iv32 = *iv32;
466 __entry->iv16 = *iv16;
469 TP_printk(
470 LOCAL_PR_FMT, LOCAL_PR_ARG
474 TRACE_EVENT(drv_set_rts_threshold,
475 TP_PROTO(struct ieee80211_local *local, u32 value, int ret),
477 TP_ARGS(local, value, ret),
479 TP_STRUCT__entry(
480 LOCAL_ENTRY
481 __field(u32, value)
482 __field(int, ret)
485 TP_fast_assign(
486 LOCAL_ASSIGN;
487 __entry->ret = ret;
488 __entry->value = value;
491 TP_printk(
492 LOCAL_PR_FMT " value:%d ret:%d",
493 LOCAL_PR_ARG, __entry->value, __entry->ret
497 TRACE_EVENT(drv_set_coverage_class,
498 TP_PROTO(struct ieee80211_local *local, u8 value, int ret),
500 TP_ARGS(local, value, ret),
502 TP_STRUCT__entry(
503 LOCAL_ENTRY
504 __field(u8, value)
505 __field(int, ret)
508 TP_fast_assign(
509 LOCAL_ASSIGN;
510 __entry->ret = ret;
511 __entry->value = value;
514 TP_printk(
515 LOCAL_PR_FMT " value:%d ret:%d",
516 LOCAL_PR_ARG, __entry->value, __entry->ret
520 TRACE_EVENT(drv_sta_notify,
521 TP_PROTO(struct ieee80211_local *local,
522 struct ieee80211_sub_if_data *sdata,
523 enum sta_notify_cmd cmd,
524 struct ieee80211_sta *sta),
526 TP_ARGS(local, sdata, cmd, sta),
528 TP_STRUCT__entry(
529 LOCAL_ENTRY
530 VIF_ENTRY
531 STA_ENTRY
532 __field(u32, cmd)
535 TP_fast_assign(
536 LOCAL_ASSIGN;
537 VIF_ASSIGN;
538 STA_ASSIGN;
539 __entry->cmd = cmd;
542 TP_printk(
543 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
544 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
548 TRACE_EVENT(drv_sta_add,
549 TP_PROTO(struct ieee80211_local *local,
550 struct ieee80211_sub_if_data *sdata,
551 struct ieee80211_sta *sta, int ret),
553 TP_ARGS(local, sdata, sta, ret),
555 TP_STRUCT__entry(
556 LOCAL_ENTRY
557 VIF_ENTRY
558 STA_ENTRY
559 __field(int, ret)
562 TP_fast_assign(
563 LOCAL_ASSIGN;
564 VIF_ASSIGN;
565 STA_ASSIGN;
566 __entry->ret = ret;
569 TP_printk(
570 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
571 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
575 TRACE_EVENT(drv_sta_remove,
576 TP_PROTO(struct ieee80211_local *local,
577 struct ieee80211_sub_if_data *sdata,
578 struct ieee80211_sta *sta),
580 TP_ARGS(local, sdata, sta),
582 TP_STRUCT__entry(
583 LOCAL_ENTRY
584 VIF_ENTRY
585 STA_ENTRY
588 TP_fast_assign(
589 LOCAL_ASSIGN;
590 VIF_ASSIGN;
591 STA_ASSIGN;
594 TP_printk(
595 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
596 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
600 TRACE_EVENT(drv_conf_tx,
601 TP_PROTO(struct ieee80211_local *local, u16 queue,
602 const struct ieee80211_tx_queue_params *params,
603 int ret),
605 TP_ARGS(local, queue, params, ret),
607 TP_STRUCT__entry(
608 LOCAL_ENTRY
609 __field(u16, queue)
610 __field(u16, txop)
611 __field(u16, cw_min)
612 __field(u16, cw_max)
613 __field(u8, aifs)
614 __field(int, ret)
617 TP_fast_assign(
618 LOCAL_ASSIGN;
619 __entry->queue = queue;
620 __entry->ret = ret;
621 __entry->txop = params->txop;
622 __entry->cw_max = params->cw_max;
623 __entry->cw_min = params->cw_min;
624 __entry->aifs = params->aifs;
627 TP_printk(
628 LOCAL_PR_FMT " queue:%d ret:%d",
629 LOCAL_PR_ARG, __entry->queue, __entry->ret
633 TRACE_EVENT(drv_get_tsf,
634 TP_PROTO(struct ieee80211_local *local, u64 ret),
636 TP_ARGS(local, ret),
638 TP_STRUCT__entry(
639 LOCAL_ENTRY
640 __field(u64, ret)
643 TP_fast_assign(
644 LOCAL_ASSIGN;
645 __entry->ret = ret;
648 TP_printk(
649 LOCAL_PR_FMT " ret:%llu",
650 LOCAL_PR_ARG, (unsigned long long)__entry->ret
654 TRACE_EVENT(drv_set_tsf,
655 TP_PROTO(struct ieee80211_local *local, u64 tsf),
657 TP_ARGS(local, tsf),
659 TP_STRUCT__entry(
660 LOCAL_ENTRY
661 __field(u64, tsf)
664 TP_fast_assign(
665 LOCAL_ASSIGN;
666 __entry->tsf = tsf;
669 TP_printk(
670 LOCAL_PR_FMT " tsf:%llu",
671 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
675 TRACE_EVENT(drv_reset_tsf,
676 TP_PROTO(struct ieee80211_local *local),
678 TP_ARGS(local),
680 TP_STRUCT__entry(
681 LOCAL_ENTRY
684 TP_fast_assign(
685 LOCAL_ASSIGN;
688 TP_printk(
689 LOCAL_PR_FMT, LOCAL_PR_ARG
693 TRACE_EVENT(drv_tx_last_beacon,
694 TP_PROTO(struct ieee80211_local *local, int ret),
696 TP_ARGS(local, ret),
698 TP_STRUCT__entry(
699 LOCAL_ENTRY
700 __field(int, ret)
703 TP_fast_assign(
704 LOCAL_ASSIGN;
705 __entry->ret = ret;
708 TP_printk(
709 LOCAL_PR_FMT " ret:%d",
710 LOCAL_PR_ARG, __entry->ret
714 TRACE_EVENT(drv_ampdu_action,
715 TP_PROTO(struct ieee80211_local *local,
716 struct ieee80211_sub_if_data *sdata,
717 enum ieee80211_ampdu_mlme_action action,
718 struct ieee80211_sta *sta, u16 tid,
719 u16 *ssn, int ret),
721 TP_ARGS(local, sdata, action, sta, tid, ssn, ret),
723 TP_STRUCT__entry(
724 LOCAL_ENTRY
725 STA_ENTRY
726 __field(u32, action)
727 __field(u16, tid)
728 __field(u16, ssn)
729 __field(int, ret)
730 VIF_ENTRY
733 TP_fast_assign(
734 LOCAL_ASSIGN;
735 VIF_ASSIGN;
736 STA_ASSIGN;
737 __entry->ret = ret;
738 __entry->action = action;
739 __entry->tid = tid;
740 __entry->ssn = ssn ? *ssn : 0;
743 TP_printk(
744 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d ret:%d",
745 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid, __entry->ret
749 TRACE_EVENT(drv_flush,
750 TP_PROTO(struct ieee80211_local *local, bool drop),
752 TP_ARGS(local, drop),
754 TP_STRUCT__entry(
755 LOCAL_ENTRY
756 __field(bool, drop)
759 TP_fast_assign(
760 LOCAL_ASSIGN;
761 __entry->drop = drop;
764 TP_printk(
765 LOCAL_PR_FMT " drop:%d",
766 LOCAL_PR_ARG, __entry->drop
769 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
771 #undef TRACE_INCLUDE_PATH
772 #define TRACE_INCLUDE_PATH .
773 #undef TRACE_INCLUDE_FILE
774 #define TRACE_INCLUDE_FILE driver-trace
775 #include <trace/define_trace.h>