blob: e209cb82ff2984f50da8dea864611636aba53b3b [file] [log] [blame]
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02001#if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
2#define __MAC80211_DRIVER_TRACE
3
4#include <linux/tracepoint.h>
5#include <net/mac80211.h>
6#include "ieee80211_i.h"
7
Christian Lamparterf7428802009-07-19 23:21:07 +02008#if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02009#undef TRACE_EVENT
10#define TRACE_EVENT(name, proto, ...) \
11static inline void trace_ ## name(proto) {}
12#endif
13
14#undef TRACE_SYSTEM
15#define TRACE_SYSTEM mac80211
16
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
22
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
27
Johannes Berg12375ef2009-11-25 20:30:31 +010028#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
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020034
Johannes Bergb5878a22010-04-07 16:48:40 +020035/*
36 * Tracing for driver callbacks.
37 */
38
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020039TRACE_EVENT(drv_start,
40 TP_PROTO(struct ieee80211_local *local, int ret),
41
42 TP_ARGS(local, ret),
43
44 TP_STRUCT__entry(
45 LOCAL_ENTRY
46 __field(int, ret)
47 ),
48
49 TP_fast_assign(
50 LOCAL_ASSIGN;
51 __entry->ret = ret;
52 ),
53
54 TP_printk(
55 LOCAL_PR_FMT, LOCAL_PR_ARG
56 )
57);
58
59TRACE_EVENT(drv_stop,
60 TP_PROTO(struct ieee80211_local *local),
61
62 TP_ARGS(local),
63
64 TP_STRUCT__entry(
65 LOCAL_ENTRY
66 ),
67
68 TP_fast_assign(
69 LOCAL_ASSIGN;
70 ),
71
72 TP_printk(
73 LOCAL_PR_FMT, LOCAL_PR_ARG
74 )
75);
76
77TRACE_EVENT(drv_add_interface,
78 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +010079 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020080 int ret),
81
Johannes Berg12375ef2009-11-25 20:30:31 +010082 TP_ARGS(local, sdata, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020083
84 TP_STRUCT__entry(
85 LOCAL_ENTRY
86 VIF_ENTRY
87 __array(char, addr, 6)
88 __field(int, ret)
89 ),
90
91 TP_fast_assign(
92 LOCAL_ASSIGN;
93 VIF_ASSIGN;
Johannes Berg12375ef2009-11-25 20:30:31 +010094 memcpy(__entry->addr, sdata->vif.addr, 6);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020095 __entry->ret = ret;
96 ),
97
98 TP_printk(
99 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM ret:%d",
100 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr, __entry->ret
101 )
102);
103
104TRACE_EVENT(drv_remove_interface,
Johannes Berg12375ef2009-11-25 20:30:31 +0100105 TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200106
Johannes Berg12375ef2009-11-25 20:30:31 +0100107 TP_ARGS(local, sdata),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200108
109 TP_STRUCT__entry(
110 LOCAL_ENTRY
111 VIF_ENTRY
112 __array(char, addr, 6)
113 ),
114
115 TP_fast_assign(
116 LOCAL_ASSIGN;
117 VIF_ASSIGN;
Johannes Berg12375ef2009-11-25 20:30:31 +0100118 memcpy(__entry->addr, sdata->vif.addr, 6);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200119 ),
120
121 TP_printk(
122 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
123 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
124 )
125);
126
127TRACE_EVENT(drv_config,
128 TP_PROTO(struct ieee80211_local *local,
129 u32 changed,
130 int ret),
131
132 TP_ARGS(local, changed, ret),
133
134 TP_STRUCT__entry(
135 LOCAL_ENTRY
136 __field(u32, changed)
137 __field(int, ret)
Johannes Bergf911ab82009-11-25 19:07:20 +0100138 __field(u32, flags)
139 __field(int, power_level)
140 __field(int, dynamic_ps_timeout)
141 __field(int, max_sleep_period)
142 __field(u16, listen_interval)
143 __field(u8, long_frame_max_tx_count)
144 __field(u8, short_frame_max_tx_count)
145 __field(int, center_freq)
146 __field(int, channel_type)
Johannes Berg0f782312009-12-01 13:37:02 +0100147 __field(int, smps)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200148 ),
149
150 TP_fast_assign(
151 LOCAL_ASSIGN;
152 __entry->changed = changed;
153 __entry->ret = ret;
Johannes Bergf911ab82009-11-25 19:07:20 +0100154 __entry->flags = local->hw.conf.flags;
155 __entry->power_level = local->hw.conf.power_level;
156 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
157 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
158 __entry->listen_interval = local->hw.conf.listen_interval;
159 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
160 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
161 __entry->center_freq = local->hw.conf.channel->center_freq;
162 __entry->channel_type = local->hw.conf.channel_type;
Johannes Berg0f782312009-12-01 13:37:02 +0100163 __entry->smps = local->hw.conf.smps_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200164 ),
165
166 TP_printk(
Johannes Bergf911ab82009-11-25 19:07:20 +0100167 LOCAL_PR_FMT " ch:%#x freq:%d ret:%d",
168 LOCAL_PR_ARG, __entry->changed, __entry->center_freq, __entry->ret
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200169 )
170);
171
172TRACE_EVENT(drv_bss_info_changed,
173 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100174 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200175 struct ieee80211_bss_conf *info,
176 u32 changed),
177
Johannes Berg12375ef2009-11-25 20:30:31 +0100178 TP_ARGS(local, sdata, info, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200179
180 TP_STRUCT__entry(
181 LOCAL_ENTRY
182 VIF_ENTRY
183 __field(bool, assoc)
184 __field(u16, aid)
185 __field(bool, cts)
186 __field(bool, shortpre)
187 __field(bool, shortslot)
188 __field(u8, dtimper)
189 __field(u16, bcnint)
190 __field(u16, assoc_cap)
191 __field(u64, timestamp)
192 __field(u32, basic_rates)
193 __field(u32, changed)
Johannes Bergf911ab82009-11-25 19:07:20 +0100194 __field(bool, enable_beacon)
195 __field(u16, ht_operation_mode)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200196 ),
197
198 TP_fast_assign(
199 LOCAL_ASSIGN;
200 VIF_ASSIGN;
201 __entry->changed = changed;
202 __entry->aid = info->aid;
203 __entry->assoc = info->assoc;
204 __entry->shortpre = info->use_short_preamble;
205 __entry->cts = info->use_cts_prot;
206 __entry->shortslot = info->use_short_slot;
207 __entry->dtimper = info->dtim_period;
208 __entry->bcnint = info->beacon_int;
209 __entry->assoc_cap = info->assoc_capability;
210 __entry->timestamp = info->timestamp;
211 __entry->basic_rates = info->basic_rates;
Johannes Bergf911ab82009-11-25 19:07:20 +0100212 __entry->enable_beacon = info->enable_beacon;
213 __entry->ht_operation_mode = info->ht_operation_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200214 ),
215
216 TP_printk(
217 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
218 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
219 )
220);
221
Johannes Berg3ac64be2009-08-17 16:16:53 +0200222TRACE_EVENT(drv_prepare_multicast,
223 TP_PROTO(struct ieee80211_local *local, int mc_count, u64 ret),
224
225 TP_ARGS(local, mc_count, ret),
226
227 TP_STRUCT__entry(
228 LOCAL_ENTRY
229 __field(int, mc_count)
230 __field(u64, ret)
231 ),
232
233 TP_fast_assign(
234 LOCAL_ASSIGN;
235 __entry->mc_count = mc_count;
236 __entry->ret = ret;
237 ),
238
239 TP_printk(
240 LOCAL_PR_FMT " prepare mc (%d): %llx",
241 LOCAL_PR_ARG, __entry->mc_count,
242 (unsigned long long) __entry->ret
243 )
244);
245
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200246TRACE_EVENT(drv_configure_filter,
247 TP_PROTO(struct ieee80211_local *local,
248 unsigned int changed_flags,
249 unsigned int *total_flags,
Johannes Berg3ac64be2009-08-17 16:16:53 +0200250 u64 multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200251
Johannes Berg3ac64be2009-08-17 16:16:53 +0200252 TP_ARGS(local, changed_flags, total_flags, multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200253
254 TP_STRUCT__entry(
255 LOCAL_ENTRY
256 __field(unsigned int, changed)
257 __field(unsigned int, total)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200258 __field(u64, multicast)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200259 ),
260
261 TP_fast_assign(
262 LOCAL_ASSIGN;
263 __entry->changed = changed_flags;
264 __entry->total = *total_flags;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200265 __entry->multicast = multicast;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200266 ),
267
268 TP_printk(
Johannes Berg3ac64be2009-08-17 16:16:53 +0200269 LOCAL_PR_FMT " changed:%#x total:%#x",
270 LOCAL_PR_ARG, __entry->changed, __entry->total
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200271 )
272);
273
274TRACE_EVENT(drv_set_tim,
275 TP_PROTO(struct ieee80211_local *local,
276 struct ieee80211_sta *sta, bool set, int ret),
277
278 TP_ARGS(local, sta, set, ret),
279
280 TP_STRUCT__entry(
281 LOCAL_ENTRY
282 STA_ENTRY
283 __field(bool, set)
284 __field(int, ret)
285 ),
286
287 TP_fast_assign(
288 LOCAL_ASSIGN;
289 STA_ASSIGN;
290 __entry->set = set;
291 __entry->ret = ret;
292 ),
293
294 TP_printk(
295 LOCAL_PR_FMT STA_PR_FMT " set:%d ret:%d",
296 LOCAL_PR_ARG, STA_PR_FMT, __entry->set, __entry->ret
297 )
298);
299
300TRACE_EVENT(drv_set_key,
301 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100302 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200303 struct ieee80211_sta *sta,
304 struct ieee80211_key_conf *key, int ret),
305
Johannes Berg12375ef2009-11-25 20:30:31 +0100306 TP_ARGS(local, cmd, sdata, sta, key, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200307
308 TP_STRUCT__entry(
309 LOCAL_ENTRY
310 VIF_ENTRY
311 STA_ENTRY
312 __field(enum ieee80211_key_alg, alg)
313 __field(u8, hw_key_idx)
314 __field(u8, flags)
315 __field(s8, keyidx)
316 __field(int, ret)
317 ),
318
319 TP_fast_assign(
320 LOCAL_ASSIGN;
321 VIF_ASSIGN;
322 STA_ASSIGN;
323 __entry->alg = key->alg;
324 __entry->flags = key->flags;
325 __entry->keyidx = key->keyidx;
326 __entry->hw_key_idx = key->hw_key_idx;
327 __entry->ret = ret;
328 ),
329
330 TP_printk(
331 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
332 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
333 )
334);
335
336TRACE_EVENT(drv_update_tkip_key,
337 TP_PROTO(struct ieee80211_local *local,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100338 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200339 struct ieee80211_key_conf *conf,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100340 struct ieee80211_sta *sta, u32 iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200341
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100342 TP_ARGS(local, sdata, conf, sta, iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200343
344 TP_STRUCT__entry(
345 LOCAL_ENTRY
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100346 VIF_ENTRY
347 STA_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200348 __field(u32, iv32)
349 ),
350
351 TP_fast_assign(
352 LOCAL_ASSIGN;
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100353 VIF_ASSIGN;
354 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200355 __entry->iv32 = iv32;
356 ),
357
358 TP_printk(
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100359 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
360 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200361 )
362);
363
364TRACE_EVENT(drv_hw_scan,
365 TP_PROTO(struct ieee80211_local *local,
366 struct cfg80211_scan_request *req, int ret),
367
368 TP_ARGS(local, req, ret),
369
370 TP_STRUCT__entry(
371 LOCAL_ENTRY
372 __field(int, ret)
373 ),
374
375 TP_fast_assign(
376 LOCAL_ASSIGN;
377 __entry->ret = ret;
378 ),
379
380 TP_printk(
381 LOCAL_PR_FMT " ret:%d",
382 LOCAL_PR_ARG, __entry->ret
383 )
384);
385
386TRACE_EVENT(drv_sw_scan_start,
387 TP_PROTO(struct ieee80211_local *local),
388
389 TP_ARGS(local),
390
391 TP_STRUCT__entry(
392 LOCAL_ENTRY
393 ),
394
395 TP_fast_assign(
396 LOCAL_ASSIGN;
397 ),
398
399 TP_printk(
400 LOCAL_PR_FMT, LOCAL_PR_ARG
401 )
402);
403
404TRACE_EVENT(drv_sw_scan_complete,
405 TP_PROTO(struct ieee80211_local *local),
406
407 TP_ARGS(local),
408
409 TP_STRUCT__entry(
410 LOCAL_ENTRY
411 ),
412
413 TP_fast_assign(
414 LOCAL_ASSIGN;
415 ),
416
417 TP_printk(
418 LOCAL_PR_FMT, LOCAL_PR_ARG
419 )
420);
421
422TRACE_EVENT(drv_get_stats,
423 TP_PROTO(struct ieee80211_local *local,
424 struct ieee80211_low_level_stats *stats,
425 int ret),
426
427 TP_ARGS(local, stats, ret),
428
429 TP_STRUCT__entry(
430 LOCAL_ENTRY
431 __field(int, ret)
432 __field(unsigned int, ackfail)
433 __field(unsigned int, rtsfail)
434 __field(unsigned int, fcserr)
435 __field(unsigned int, rtssucc)
436 ),
437
438 TP_fast_assign(
439 LOCAL_ASSIGN;
440 __entry->ret = ret;
441 __entry->ackfail = stats->dot11ACKFailureCount;
442 __entry->rtsfail = stats->dot11RTSFailureCount;
443 __entry->fcserr = stats->dot11FCSErrorCount;
444 __entry->rtssucc = stats->dot11RTSSuccessCount;
445 ),
446
447 TP_printk(
448 LOCAL_PR_FMT " ret:%d",
449 LOCAL_PR_ARG, __entry->ret
450 )
451);
452
453TRACE_EVENT(drv_get_tkip_seq,
454 TP_PROTO(struct ieee80211_local *local,
455 u8 hw_key_idx, u32 *iv32, u16 *iv16),
456
457 TP_ARGS(local, hw_key_idx, iv32, iv16),
458
459 TP_STRUCT__entry(
460 LOCAL_ENTRY
461 __field(u8, hw_key_idx)
462 __field(u32, iv32)
463 __field(u16, iv16)
464 ),
465
466 TP_fast_assign(
467 LOCAL_ASSIGN;
468 __entry->hw_key_idx = hw_key_idx;
469 __entry->iv32 = *iv32;
470 __entry->iv16 = *iv16;
471 ),
472
473 TP_printk(
474 LOCAL_PR_FMT, LOCAL_PR_ARG
475 )
476);
477
478TRACE_EVENT(drv_set_rts_threshold,
479 TP_PROTO(struct ieee80211_local *local, u32 value, int ret),
480
481 TP_ARGS(local, value, ret),
482
483 TP_STRUCT__entry(
484 LOCAL_ENTRY
485 __field(u32, value)
486 __field(int, ret)
487 ),
488
489 TP_fast_assign(
490 LOCAL_ASSIGN;
491 __entry->ret = ret;
492 __entry->value = value;
493 ),
494
495 TP_printk(
496 LOCAL_PR_FMT " value:%d ret:%d",
497 LOCAL_PR_ARG, __entry->value, __entry->ret
498 )
499);
500
Lukáš Turek310bc672009-12-21 22:50:48 +0100501TRACE_EVENT(drv_set_coverage_class,
502 TP_PROTO(struct ieee80211_local *local, u8 value, int ret),
503
504 TP_ARGS(local, value, ret),
505
506 TP_STRUCT__entry(
507 LOCAL_ENTRY
508 __field(u8, value)
509 __field(int, ret)
510 ),
511
512 TP_fast_assign(
513 LOCAL_ASSIGN;
514 __entry->ret = ret;
515 __entry->value = value;
516 ),
517
518 TP_printk(
519 LOCAL_PR_FMT " value:%d ret:%d",
520 LOCAL_PR_ARG, __entry->value, __entry->ret
521 )
522);
523
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200524TRACE_EVENT(drv_sta_notify,
525 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100526 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200527 enum sta_notify_cmd cmd,
528 struct ieee80211_sta *sta),
529
Johannes Berg12375ef2009-11-25 20:30:31 +0100530 TP_ARGS(local, sdata, cmd, sta),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200531
532 TP_STRUCT__entry(
533 LOCAL_ENTRY
534 VIF_ENTRY
535 STA_ENTRY
536 __field(u32, cmd)
537 ),
538
539 TP_fast_assign(
540 LOCAL_ASSIGN;
541 VIF_ASSIGN;
542 STA_ASSIGN;
543 __entry->cmd = cmd;
544 ),
545
546 TP_printk(
547 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
548 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
549 )
550);
551
Johannes Berg34e89502010-02-03 13:59:58 +0100552TRACE_EVENT(drv_sta_add,
553 TP_PROTO(struct ieee80211_local *local,
554 struct ieee80211_sub_if_data *sdata,
555 struct ieee80211_sta *sta, int ret),
556
557 TP_ARGS(local, sdata, sta, ret),
558
559 TP_STRUCT__entry(
560 LOCAL_ENTRY
561 VIF_ENTRY
562 STA_ENTRY
563 __field(int, ret)
564 ),
565
566 TP_fast_assign(
567 LOCAL_ASSIGN;
568 VIF_ASSIGN;
569 STA_ASSIGN;
570 __entry->ret = ret;
571 ),
572
573 TP_printk(
574 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
575 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
576 )
577);
578
579TRACE_EVENT(drv_sta_remove,
580 TP_PROTO(struct ieee80211_local *local,
581 struct ieee80211_sub_if_data *sdata,
582 struct ieee80211_sta *sta),
583
584 TP_ARGS(local, sdata, sta),
585
586 TP_STRUCT__entry(
587 LOCAL_ENTRY
588 VIF_ENTRY
589 STA_ENTRY
590 ),
591
592 TP_fast_assign(
593 LOCAL_ASSIGN;
594 VIF_ASSIGN;
595 STA_ASSIGN;
596 ),
597
598 TP_printk(
599 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
600 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
601 )
602);
603
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200604TRACE_EVENT(drv_conf_tx,
605 TP_PROTO(struct ieee80211_local *local, u16 queue,
606 const struct ieee80211_tx_queue_params *params,
607 int ret),
608
609 TP_ARGS(local, queue, params, ret),
610
611 TP_STRUCT__entry(
612 LOCAL_ENTRY
613 __field(u16, queue)
614 __field(u16, txop)
615 __field(u16, cw_min)
616 __field(u16, cw_max)
617 __field(u8, aifs)
618 __field(int, ret)
619 ),
620
621 TP_fast_assign(
622 LOCAL_ASSIGN;
623 __entry->queue = queue;
624 __entry->ret = ret;
625 __entry->txop = params->txop;
626 __entry->cw_max = params->cw_max;
627 __entry->cw_min = params->cw_min;
628 __entry->aifs = params->aifs;
629 ),
630
631 TP_printk(
632 LOCAL_PR_FMT " queue:%d ret:%d",
633 LOCAL_PR_ARG, __entry->queue, __entry->ret
634 )
635);
636
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200637TRACE_EVENT(drv_get_tsf,
638 TP_PROTO(struct ieee80211_local *local, u64 ret),
639
640 TP_ARGS(local, ret),
641
642 TP_STRUCT__entry(
643 LOCAL_ENTRY
644 __field(u64, ret)
645 ),
646
647 TP_fast_assign(
648 LOCAL_ASSIGN;
649 __entry->ret = ret;
650 ),
651
652 TP_printk(
653 LOCAL_PR_FMT " ret:%llu",
654 LOCAL_PR_ARG, (unsigned long long)__entry->ret
655 )
656);
657
658TRACE_EVENT(drv_set_tsf,
659 TP_PROTO(struct ieee80211_local *local, u64 tsf),
660
661 TP_ARGS(local, tsf),
662
663 TP_STRUCT__entry(
664 LOCAL_ENTRY
665 __field(u64, tsf)
666 ),
667
668 TP_fast_assign(
669 LOCAL_ASSIGN;
670 __entry->tsf = tsf;
671 ),
672
673 TP_printk(
674 LOCAL_PR_FMT " tsf:%llu",
675 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
676 )
677);
678
679TRACE_EVENT(drv_reset_tsf,
680 TP_PROTO(struct ieee80211_local *local),
681
682 TP_ARGS(local),
683
684 TP_STRUCT__entry(
685 LOCAL_ENTRY
686 ),
687
688 TP_fast_assign(
689 LOCAL_ASSIGN;
690 ),
691
692 TP_printk(
693 LOCAL_PR_FMT, LOCAL_PR_ARG
694 )
695);
696
697TRACE_EVENT(drv_tx_last_beacon,
698 TP_PROTO(struct ieee80211_local *local, int ret),
699
700 TP_ARGS(local, ret),
701
702 TP_STRUCT__entry(
703 LOCAL_ENTRY
704 __field(int, ret)
705 ),
706
707 TP_fast_assign(
708 LOCAL_ASSIGN;
709 __entry->ret = ret;
710 ),
711
712 TP_printk(
713 LOCAL_PR_FMT " ret:%d",
714 LOCAL_PR_ARG, __entry->ret
715 )
716);
717
718TRACE_EVENT(drv_ampdu_action,
719 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100720 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200721 enum ieee80211_ampdu_mlme_action action,
722 struct ieee80211_sta *sta, u16 tid,
723 u16 *ssn, int ret),
724
Johannes Berg12375ef2009-11-25 20:30:31 +0100725 TP_ARGS(local, sdata, action, sta, tid, ssn, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200726
727 TP_STRUCT__entry(
728 LOCAL_ENTRY
729 STA_ENTRY
730 __field(u32, action)
731 __field(u16, tid)
732 __field(u16, ssn)
733 __field(int, ret)
Johannes Bergc951ad32009-11-16 12:00:38 +0100734 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200735 ),
736
737 TP_fast_assign(
738 LOCAL_ASSIGN;
Johannes Bergc951ad32009-11-16 12:00:38 +0100739 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200740 STA_ASSIGN;
741 __entry->ret = ret;
742 __entry->action = action;
743 __entry->tid = tid;
Zhu Yi3092ad02010-01-26 15:58:57 +0800744 __entry->ssn = ssn ? *ssn : 0;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200745 ),
746
747 TP_printk(
Johannes Bergc951ad32009-11-16 12:00:38 +0100748 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d ret:%d",
749 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid, __entry->ret
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200750 )
751);
Johannes Berga80f7c02009-12-23 13:15:32 +0100752
753TRACE_EVENT(drv_flush,
754 TP_PROTO(struct ieee80211_local *local, bool drop),
755
756 TP_ARGS(local, drop),
757
758 TP_STRUCT__entry(
759 LOCAL_ENTRY
760 __field(bool, drop)
761 ),
762
763 TP_fast_assign(
764 LOCAL_ASSIGN;
765 __entry->drop = drop;
766 ),
767
768 TP_printk(
769 LOCAL_PR_FMT " drop:%d",
770 LOCAL_PR_ARG, __entry->drop
771 )
772);
Johannes Bergb5878a22010-04-07 16:48:40 +0200773
774/*
775 * Tracing for API calls that drivers call.
776 */
777
778TRACE_EVENT(api_start_tx_ba_session,
779 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
780
781 TP_ARGS(sta, tid),
782
783 TP_STRUCT__entry(
784 STA_ENTRY
785 __field(u16, tid)
786 ),
787
788 TP_fast_assign(
789 STA_ASSIGN;
790 __entry->tid = tid;
791 ),
792
793 TP_printk(
794 STA_PR_FMT " tid:%d",
795 STA_PR_ARG, __entry->tid
796 )
797);
798
799TRACE_EVENT(api_start_tx_ba_cb,
800 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
801
802 TP_ARGS(sdata, ra, tid),
803
804 TP_STRUCT__entry(
805 VIF_ENTRY
806 __array(u8, ra, ETH_ALEN)
807 __field(u16, tid)
808 ),
809
810 TP_fast_assign(
811 VIF_ASSIGN;
812 memcpy(__entry->ra, ra, ETH_ALEN);
813 __entry->tid = tid;
814 ),
815
816 TP_printk(
817 VIF_PR_FMT " ra:%pM tid:%d",
818 VIF_PR_ARG, __entry->ra, __entry->tid
819 )
820);
821
822TRACE_EVENT(api_stop_tx_ba_session,
823 TP_PROTO(struct ieee80211_sta *sta, u16 tid, u16 initiator),
824
825 TP_ARGS(sta, tid, initiator),
826
827 TP_STRUCT__entry(
828 STA_ENTRY
829 __field(u16, tid)
830 __field(u16, initiator)
831 ),
832
833 TP_fast_assign(
834 STA_ASSIGN;
835 __entry->tid = tid;
836 __entry->initiator = initiator;
837 ),
838
839 TP_printk(
840 STA_PR_FMT " tid:%d initiator:%d",
841 STA_PR_ARG, __entry->tid, __entry->initiator
842 )
843);
844
845TRACE_EVENT(api_stop_tx_ba_cb,
846 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
847
848 TP_ARGS(sdata, ra, tid),
849
850 TP_STRUCT__entry(
851 VIF_ENTRY
852 __array(u8, ra, ETH_ALEN)
853 __field(u16, tid)
854 ),
855
856 TP_fast_assign(
857 VIF_ASSIGN;
858 memcpy(__entry->ra, ra, ETH_ALEN);
859 __entry->tid = tid;
860 ),
861
862 TP_printk(
863 VIF_PR_FMT " ra:%pM tid:%d",
864 VIF_PR_ARG, __entry->ra, __entry->tid
865 )
866);
867
868TRACE_EVENT(api_restart_hw,
869 TP_PROTO(struct ieee80211_local *local),
870
871 TP_ARGS(local),
872
873 TP_STRUCT__entry(
874 LOCAL_ENTRY
875 ),
876
877 TP_fast_assign(
878 LOCAL_ASSIGN;
879 ),
880
881 TP_printk(
882 LOCAL_PR_FMT,
883 LOCAL_PR_ARG
884 )
885);
886
887TRACE_EVENT(api_beacon_loss,
888 TP_PROTO(struct ieee80211_sub_if_data *sdata),
889
890 TP_ARGS(sdata),
891
892 TP_STRUCT__entry(
893 VIF_ENTRY
894 ),
895
896 TP_fast_assign(
897 VIF_ASSIGN;
898 ),
899
900 TP_printk(
901 VIF_PR_FMT,
902 VIF_PR_ARG
903 )
904);
905
906TRACE_EVENT(api_connection_loss,
907 TP_PROTO(struct ieee80211_sub_if_data *sdata),
908
909 TP_ARGS(sdata),
910
911 TP_STRUCT__entry(
912 VIF_ENTRY
913 ),
914
915 TP_fast_assign(
916 VIF_ASSIGN;
917 ),
918
919 TP_printk(
920 VIF_PR_FMT,
921 VIF_PR_ARG
922 )
923);
924
925TRACE_EVENT(api_cqm_rssi_notify,
926 TP_PROTO(struct ieee80211_sub_if_data *sdata,
927 enum nl80211_cqm_rssi_threshold_event rssi_event),
928
929 TP_ARGS(sdata, rssi_event),
930
931 TP_STRUCT__entry(
932 VIF_ENTRY
933 __field(u32, rssi_event)
934 ),
935
936 TP_fast_assign(
937 VIF_ASSIGN;
938 __entry->rssi_event = rssi_event;
939 ),
940
941 TP_printk(
942 VIF_PR_FMT " event:%d",
943 VIF_PR_ARG, __entry->rssi_event
944 )
945);
946
947TRACE_EVENT(api_scan_completed,
948 TP_PROTO(struct ieee80211_local *local, bool aborted),
949
950 TP_ARGS(local, aborted),
951
952 TP_STRUCT__entry(
953 LOCAL_ENTRY
954 __field(bool, aborted)
955 ),
956
957 TP_fast_assign(
958 LOCAL_ASSIGN;
959 __entry->aborted = aborted;
960 ),
961
962 TP_printk(
963 LOCAL_PR_FMT " aborted:%d",
964 LOCAL_PR_ARG, __entry->aborted
965 )
966);
967
968TRACE_EVENT(api_sta_block_awake,
969 TP_PROTO(struct ieee80211_local *local,
970 struct ieee80211_sta *sta, bool block),
971
972 TP_ARGS(local, sta, block),
973
974 TP_STRUCT__entry(
975 LOCAL_ENTRY
976 STA_ENTRY
977 __field(bool, block)
978 ),
979
980 TP_fast_assign(
981 LOCAL_ASSIGN;
982 STA_ASSIGN;
983 __entry->block = block;
984 ),
985
986 TP_printk(
987 LOCAL_PR_FMT STA_PR_FMT " block:%d",
988 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
989 )
990);
991
992/*
993 * Tracing for internal functions
994 * (which may also be called in response to driver calls)
995 */
996
997TRACE_EVENT(wake_queue,
998 TP_PROTO(struct ieee80211_local *local, u16 queue,
999 enum queue_stop_reason reason),
1000
1001 TP_ARGS(local, queue, reason),
1002
1003 TP_STRUCT__entry(
1004 LOCAL_ENTRY
1005 __field(u16, queue)
1006 __field(u32, reason)
1007 ),
1008
1009 TP_fast_assign(
1010 LOCAL_ASSIGN;
1011 __entry->queue = queue;
1012 __entry->reason = reason;
1013 ),
1014
1015 TP_printk(
1016 LOCAL_PR_FMT " queue:%d, reason:%d",
1017 LOCAL_PR_ARG, __entry->queue, __entry->reason
1018 )
1019);
1020
1021TRACE_EVENT(stop_queue,
1022 TP_PROTO(struct ieee80211_local *local, u16 queue,
1023 enum queue_stop_reason reason),
1024
1025 TP_ARGS(local, queue, reason),
1026
1027 TP_STRUCT__entry(
1028 LOCAL_ENTRY
1029 __field(u16, queue)
1030 __field(u32, reason)
1031 ),
1032
1033 TP_fast_assign(
1034 LOCAL_ASSIGN;
1035 __entry->queue = queue;
1036 __entry->reason = reason;
1037 ),
1038
1039 TP_printk(
1040 LOCAL_PR_FMT " queue:%d, reason:%d",
1041 LOCAL_PR_ARG, __entry->queue, __entry->reason
1042 )
1043);
Christian Lamparterf7428802009-07-19 23:21:07 +02001044#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02001045
1046#undef TRACE_INCLUDE_PATH
1047#define TRACE_INCLUDE_PATH .
1048#undef TRACE_INCLUDE_FILE
1049#define TRACE_INCLUDE_FILE driver-trace
1050#include <trace/define_trace.h>