Staging: echo: fix up remaining checkpatch.pl issues
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / net / mac80211 / driver-trace.h
blob37b9051afcf3ebb17b7a5651ac6685eb9d58698e
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 *, 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),
36 TP_ARGS(local, ret),
38 TP_STRUCT__entry(
39 LOCAL_ENTRY
40 __field(int, ret)
43 TP_fast_assign(
44 LOCAL_ASSIGN;
45 __entry->ret = ret;
48 TP_printk(
49 LOCAL_PR_FMT, LOCAL_PR_ARG
53 TRACE_EVENT(drv_stop,
54 TP_PROTO(struct ieee80211_local *local),
56 TP_ARGS(local),
58 TP_STRUCT__entry(
59 LOCAL_ENTRY
62 TP_fast_assign(
63 LOCAL_ASSIGN;
66 TP_printk(
67 LOCAL_PR_FMT, LOCAL_PR_ARG
71 TRACE_EVENT(drv_add_interface,
72 TP_PROTO(struct ieee80211_local *local,
73 const u8 *addr,
74 struct ieee80211_vif *vif,
75 int ret),
77 TP_ARGS(local, addr, vif, ret),
79 TP_STRUCT__entry(
80 LOCAL_ENTRY
81 VIF_ENTRY
82 __array(char, addr, 6)
83 __field(int, ret)
86 TP_fast_assign(
87 LOCAL_ASSIGN;
88 VIF_ASSIGN;
89 memcpy(__entry->addr, addr, 6);
90 __entry->ret = ret;
93 TP_printk(
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),
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, 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)
136 TP_fast_assign(
137 LOCAL_ASSIGN;
138 __entry->changed = changed;
139 __entry->ret = ret;
142 TP_printk(
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,
152 u32 changed),
154 TP_ARGS(local, vif, info, changed),
156 TP_STRUCT__entry(
157 LOCAL_ENTRY
158 VIF_ENTRY
159 __field(bool, assoc)
160 __field(u16, aid)
161 __field(bool, cts)
162 __field(bool, shortpre)
163 __field(bool, shortslot)
164 __field(u8, dtimper)
165 __field(u16, bcnint)
166 __field(u16, assoc_cap)
167 __field(u64, timestamp)
168 __field(u32, basic_rates)
169 __field(u32, changed)
172 TP_fast_assign(
173 LOCAL_ASSIGN;
174 VIF_ASSIGN;
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;
188 TP_printk(
189 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
190 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
194 TRACE_EVENT(drv_prepare_multicast,
195 TP_PROTO(struct ieee80211_local *local, int mc_count, u64 ret),
197 TP_ARGS(local, mc_count, ret),
199 TP_STRUCT__entry(
200 LOCAL_ENTRY
201 __field(int, mc_count)
202 __field(u64, ret)
205 TP_fast_assign(
206 LOCAL_ASSIGN;
207 __entry->mc_count = mc_count;
208 __entry->ret = ret;
211 TP_printk(
212 LOCAL_PR_FMT " prepare mc (%d): %llx",
213 LOCAL_PR_ARG, __entry->mc_count,
214 (unsigned long long) __entry->ret
218 TRACE_EVENT(drv_configure_filter,
219 TP_PROTO(struct ieee80211_local *local,
220 unsigned int changed_flags,
221 unsigned int *total_flags,
222 u64 multicast),
224 TP_ARGS(local, changed_flags, total_flags, multicast),
226 TP_STRUCT__entry(
227 LOCAL_ENTRY
228 __field(unsigned int, changed)
229 __field(unsigned int, total)
230 __field(u64, multicast)
233 TP_fast_assign(
234 LOCAL_ASSIGN;
235 __entry->changed = changed_flags;
236 __entry->total = *total_flags;
237 __entry->multicast = multicast;
240 TP_printk(
241 LOCAL_PR_FMT " changed:%#x total:%#x",
242 LOCAL_PR_ARG, __entry->changed, __entry->total
246 TRACE_EVENT(drv_set_tim,
247 TP_PROTO(struct ieee80211_local *local,
248 struct ieee80211_sta *sta, bool set, int ret),
250 TP_ARGS(local, sta, set, ret),
252 TP_STRUCT__entry(
253 LOCAL_ENTRY
254 STA_ENTRY
255 __field(bool, set)
256 __field(int, ret)
259 TP_fast_assign(
260 LOCAL_ASSIGN;
261 STA_ASSIGN;
262 __entry->set = set;
263 __entry->ret = ret;
266 TP_printk(
267 LOCAL_PR_FMT STA_PR_FMT " set:%d ret:%d",
268 LOCAL_PR_ARG, STA_PR_FMT, __entry->set, __entry->ret
272 TRACE_EVENT(drv_set_key,
273 TP_PROTO(struct ieee80211_local *local,
274 enum set_key_cmd cmd, struct ieee80211_vif *vif,
275 struct ieee80211_sta *sta,
276 struct ieee80211_key_conf *key, int ret),
278 TP_ARGS(local, cmd, vif, sta, key, ret),
280 TP_STRUCT__entry(
281 LOCAL_ENTRY
282 VIF_ENTRY
283 STA_ENTRY
284 __field(enum ieee80211_key_alg, alg)
285 __field(u8, hw_key_idx)
286 __field(u8, flags)
287 __field(s8, keyidx)
288 __field(int, ret)
291 TP_fast_assign(
292 LOCAL_ASSIGN;
293 VIF_ASSIGN;
294 STA_ASSIGN;
295 __entry->alg = key->alg;
296 __entry->flags = key->flags;
297 __entry->keyidx = key->keyidx;
298 __entry->hw_key_idx = key->hw_key_idx;
299 __entry->ret = ret;
302 TP_printk(
303 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
304 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
308 TRACE_EVENT(drv_update_tkip_key,
309 TP_PROTO(struct ieee80211_local *local,
310 struct ieee80211_key_conf *conf,
311 const u8 *address, u32 iv32),
313 TP_ARGS(local, conf, address, iv32),
315 TP_STRUCT__entry(
316 LOCAL_ENTRY
317 __array(u8, addr, 6)
318 __field(u32, iv32)
321 TP_fast_assign(
322 LOCAL_ASSIGN;
323 memcpy(__entry->addr, address, 6);
324 __entry->iv32 = iv32;
327 TP_printk(
328 LOCAL_PR_FMT " addr:%pM iv32:%#x",
329 LOCAL_PR_ARG, __entry->addr, __entry->iv32
333 TRACE_EVENT(drv_hw_scan,
334 TP_PROTO(struct ieee80211_local *local,
335 struct cfg80211_scan_request *req, int ret),
337 TP_ARGS(local, req, ret),
339 TP_STRUCT__entry(
340 LOCAL_ENTRY
341 __field(int, ret)
344 TP_fast_assign(
345 LOCAL_ASSIGN;
346 __entry->ret = ret;
349 TP_printk(
350 LOCAL_PR_FMT " ret:%d",
351 LOCAL_PR_ARG, __entry->ret
355 TRACE_EVENT(drv_sw_scan_start,
356 TP_PROTO(struct ieee80211_local *local),
358 TP_ARGS(local),
360 TP_STRUCT__entry(
361 LOCAL_ENTRY
364 TP_fast_assign(
365 LOCAL_ASSIGN;
368 TP_printk(
369 LOCAL_PR_FMT, LOCAL_PR_ARG
373 TRACE_EVENT(drv_sw_scan_complete,
374 TP_PROTO(struct ieee80211_local *local),
376 TP_ARGS(local),
378 TP_STRUCT__entry(
379 LOCAL_ENTRY
382 TP_fast_assign(
383 LOCAL_ASSIGN;
386 TP_printk(
387 LOCAL_PR_FMT, LOCAL_PR_ARG
391 TRACE_EVENT(drv_get_stats,
392 TP_PROTO(struct ieee80211_local *local,
393 struct ieee80211_low_level_stats *stats,
394 int ret),
396 TP_ARGS(local, stats, ret),
398 TP_STRUCT__entry(
399 LOCAL_ENTRY
400 __field(int, ret)
401 __field(unsigned int, ackfail)
402 __field(unsigned int, rtsfail)
403 __field(unsigned int, fcserr)
404 __field(unsigned int, rtssucc)
407 TP_fast_assign(
408 LOCAL_ASSIGN;
409 __entry->ret = ret;
410 __entry->ackfail = stats->dot11ACKFailureCount;
411 __entry->rtsfail = stats->dot11RTSFailureCount;
412 __entry->fcserr = stats->dot11FCSErrorCount;
413 __entry->rtssucc = stats->dot11RTSSuccessCount;
416 TP_printk(
417 LOCAL_PR_FMT " ret:%d",
418 LOCAL_PR_ARG, __entry->ret
422 TRACE_EVENT(drv_get_tkip_seq,
423 TP_PROTO(struct ieee80211_local *local,
424 u8 hw_key_idx, u32 *iv32, u16 *iv16),
426 TP_ARGS(local, hw_key_idx, iv32, iv16),
428 TP_STRUCT__entry(
429 LOCAL_ENTRY
430 __field(u8, hw_key_idx)
431 __field(u32, iv32)
432 __field(u16, iv16)
435 TP_fast_assign(
436 LOCAL_ASSIGN;
437 __entry->hw_key_idx = hw_key_idx;
438 __entry->iv32 = *iv32;
439 __entry->iv16 = *iv16;
442 TP_printk(
443 LOCAL_PR_FMT, LOCAL_PR_ARG
447 TRACE_EVENT(drv_set_rts_threshold,
448 TP_PROTO(struct ieee80211_local *local, u32 value, int ret),
450 TP_ARGS(local, value, ret),
452 TP_STRUCT__entry(
453 LOCAL_ENTRY
454 __field(u32, value)
455 __field(int, ret)
458 TP_fast_assign(
459 LOCAL_ASSIGN;
460 __entry->ret = ret;
461 __entry->value = value;
464 TP_printk(
465 LOCAL_PR_FMT " value:%d ret:%d",
466 LOCAL_PR_ARG, __entry->value, __entry->ret
470 TRACE_EVENT(drv_sta_notify,
471 TP_PROTO(struct ieee80211_local *local,
472 struct ieee80211_vif *vif,
473 enum sta_notify_cmd cmd,
474 struct ieee80211_sta *sta),
476 TP_ARGS(local, vif, cmd, sta),
478 TP_STRUCT__entry(
479 LOCAL_ENTRY
480 VIF_ENTRY
481 STA_ENTRY
482 __field(u32, cmd)
485 TP_fast_assign(
486 LOCAL_ASSIGN;
487 VIF_ASSIGN;
488 STA_ASSIGN;
489 __entry->cmd = cmd;
492 TP_printk(
493 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
494 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
498 TRACE_EVENT(drv_conf_tx,
499 TP_PROTO(struct ieee80211_local *local, u16 queue,
500 const struct ieee80211_tx_queue_params *params,
501 int ret),
503 TP_ARGS(local, queue, params, ret),
505 TP_STRUCT__entry(
506 LOCAL_ENTRY
507 __field(u16, queue)
508 __field(u16, txop)
509 __field(u16, cw_min)
510 __field(u16, cw_max)
511 __field(u8, aifs)
512 __field(int, ret)
515 TP_fast_assign(
516 LOCAL_ASSIGN;
517 __entry->queue = queue;
518 __entry->ret = ret;
519 __entry->txop = params->txop;
520 __entry->cw_max = params->cw_max;
521 __entry->cw_min = params->cw_min;
522 __entry->aifs = params->aifs;
525 TP_printk(
526 LOCAL_PR_FMT " queue:%d ret:%d",
527 LOCAL_PR_ARG, __entry->queue, __entry->ret
531 TRACE_EVENT(drv_get_tx_stats,
532 TP_PROTO(struct ieee80211_local *local,
533 struct ieee80211_tx_queue_stats *stats,
534 int ret),
536 TP_ARGS(local, stats, ret),
538 TP_STRUCT__entry(
539 LOCAL_ENTRY
540 __field(int, ret)
543 TP_fast_assign(
544 LOCAL_ASSIGN;
545 __entry->ret = ret;
548 TP_printk(
549 LOCAL_PR_FMT " ret:%d",
550 LOCAL_PR_ARG, __entry->ret
554 TRACE_EVENT(drv_get_tsf,
555 TP_PROTO(struct ieee80211_local *local, u64 ret),
557 TP_ARGS(local, ret),
559 TP_STRUCT__entry(
560 LOCAL_ENTRY
561 __field(u64, ret)
564 TP_fast_assign(
565 LOCAL_ASSIGN;
566 __entry->ret = ret;
569 TP_printk(
570 LOCAL_PR_FMT " ret:%llu",
571 LOCAL_PR_ARG, (unsigned long long)__entry->ret
575 TRACE_EVENT(drv_set_tsf,
576 TP_PROTO(struct ieee80211_local *local, u64 tsf),
578 TP_ARGS(local, tsf),
580 TP_STRUCT__entry(
581 LOCAL_ENTRY
582 __field(u64, tsf)
585 TP_fast_assign(
586 LOCAL_ASSIGN;
587 __entry->tsf = tsf;
590 TP_printk(
591 LOCAL_PR_FMT " tsf:%llu",
592 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
596 TRACE_EVENT(drv_reset_tsf,
597 TP_PROTO(struct ieee80211_local *local),
599 TP_ARGS(local),
601 TP_STRUCT__entry(
602 LOCAL_ENTRY
605 TP_fast_assign(
606 LOCAL_ASSIGN;
609 TP_printk(
610 LOCAL_PR_FMT, LOCAL_PR_ARG
614 TRACE_EVENT(drv_tx_last_beacon,
615 TP_PROTO(struct ieee80211_local *local, int ret),
617 TP_ARGS(local, ret),
619 TP_STRUCT__entry(
620 LOCAL_ENTRY
621 __field(int, ret)
624 TP_fast_assign(
625 LOCAL_ASSIGN;
626 __entry->ret = ret;
629 TP_printk(
630 LOCAL_PR_FMT " ret:%d",
631 LOCAL_PR_ARG, __entry->ret
635 TRACE_EVENT(drv_ampdu_action,
636 TP_PROTO(struct ieee80211_local *local,
637 enum ieee80211_ampdu_mlme_action action,
638 struct ieee80211_sta *sta, u16 tid,
639 u16 *ssn, int ret),
641 TP_ARGS(local, action, sta, tid, ssn, ret),
643 TP_STRUCT__entry(
644 LOCAL_ENTRY
645 STA_ENTRY
646 __field(u32, action)
647 __field(u16, tid)
648 __field(u16, ssn)
649 __field(int, ret)
652 TP_fast_assign(
653 LOCAL_ASSIGN;
654 STA_ASSIGN;
655 __entry->ret = ret;
656 __entry->action = action;
657 __entry->tid = tid;
658 __entry->ssn = *ssn;
661 TP_printk(
662 LOCAL_PR_FMT STA_PR_FMT " action:%d tid:%d ret:%d",
663 LOCAL_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid, __entry->ret
666 #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
668 #undef TRACE_INCLUDE_PATH
669 #define TRACE_INCLUDE_PATH .
670 #undef TRACE_INCLUDE_FILE
671 #define TRACE_INCLUDE_FILE driver-trace
672 #include <trace/define_trace.h>