blob: 6a9b2342a9c2d3982c83d235149762271a4f9c83 [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,
Johannes Berga060bbf2010-04-27 11:59:34 +0200366 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200367 struct cfg80211_scan_request *req, int ret),
368
Johannes Berga060bbf2010-04-27 11:59:34 +0200369 TP_ARGS(local, sdata, req, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200370
371 TP_STRUCT__entry(
372 LOCAL_ENTRY
Johannes Berga060bbf2010-04-27 11:59:34 +0200373 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200374 __field(int, ret)
375 ),
376
377 TP_fast_assign(
378 LOCAL_ASSIGN;
Johannes Berga060bbf2010-04-27 11:59:34 +0200379 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200380 __entry->ret = ret;
381 ),
382
383 TP_printk(
Johannes Berga060bbf2010-04-27 11:59:34 +0200384 LOCAL_PR_FMT VIF_PR_FMT " ret:%d",
385 LOCAL_PR_ARG,VIF_PR_ARG, __entry->ret
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200386 )
387);
388
389TRACE_EVENT(drv_sw_scan_start,
390 TP_PROTO(struct ieee80211_local *local),
391
392 TP_ARGS(local),
393
394 TP_STRUCT__entry(
395 LOCAL_ENTRY
396 ),
397
398 TP_fast_assign(
399 LOCAL_ASSIGN;
400 ),
401
402 TP_printk(
403 LOCAL_PR_FMT, LOCAL_PR_ARG
404 )
405);
406
407TRACE_EVENT(drv_sw_scan_complete,
408 TP_PROTO(struct ieee80211_local *local),
409
410 TP_ARGS(local),
411
412 TP_STRUCT__entry(
413 LOCAL_ENTRY
414 ),
415
416 TP_fast_assign(
417 LOCAL_ASSIGN;
418 ),
419
420 TP_printk(
421 LOCAL_PR_FMT, LOCAL_PR_ARG
422 )
423);
424
425TRACE_EVENT(drv_get_stats,
426 TP_PROTO(struct ieee80211_local *local,
427 struct ieee80211_low_level_stats *stats,
428 int ret),
429
430 TP_ARGS(local, stats, ret),
431
432 TP_STRUCT__entry(
433 LOCAL_ENTRY
434 __field(int, ret)
435 __field(unsigned int, ackfail)
436 __field(unsigned int, rtsfail)
437 __field(unsigned int, fcserr)
438 __field(unsigned int, rtssucc)
439 ),
440
441 TP_fast_assign(
442 LOCAL_ASSIGN;
443 __entry->ret = ret;
444 __entry->ackfail = stats->dot11ACKFailureCount;
445 __entry->rtsfail = stats->dot11RTSFailureCount;
446 __entry->fcserr = stats->dot11FCSErrorCount;
447 __entry->rtssucc = stats->dot11RTSSuccessCount;
448 ),
449
450 TP_printk(
451 LOCAL_PR_FMT " ret:%d",
452 LOCAL_PR_ARG, __entry->ret
453 )
454);
455
456TRACE_EVENT(drv_get_tkip_seq,
457 TP_PROTO(struct ieee80211_local *local,
458 u8 hw_key_idx, u32 *iv32, u16 *iv16),
459
460 TP_ARGS(local, hw_key_idx, iv32, iv16),
461
462 TP_STRUCT__entry(
463 LOCAL_ENTRY
464 __field(u8, hw_key_idx)
465 __field(u32, iv32)
466 __field(u16, iv16)
467 ),
468
469 TP_fast_assign(
470 LOCAL_ASSIGN;
471 __entry->hw_key_idx = hw_key_idx;
472 __entry->iv32 = *iv32;
473 __entry->iv16 = *iv16;
474 ),
475
476 TP_printk(
477 LOCAL_PR_FMT, LOCAL_PR_ARG
478 )
479);
480
481TRACE_EVENT(drv_set_rts_threshold,
482 TP_PROTO(struct ieee80211_local *local, u32 value, int ret),
483
484 TP_ARGS(local, value, ret),
485
486 TP_STRUCT__entry(
487 LOCAL_ENTRY
488 __field(u32, value)
489 __field(int, ret)
490 ),
491
492 TP_fast_assign(
493 LOCAL_ASSIGN;
494 __entry->ret = ret;
495 __entry->value = value;
496 ),
497
498 TP_printk(
499 LOCAL_PR_FMT " value:%d ret:%d",
500 LOCAL_PR_ARG, __entry->value, __entry->ret
501 )
502);
503
Lukáš Turek310bc672009-12-21 22:50:48 +0100504TRACE_EVENT(drv_set_coverage_class,
505 TP_PROTO(struct ieee80211_local *local, u8 value, int ret),
506
507 TP_ARGS(local, value, ret),
508
509 TP_STRUCT__entry(
510 LOCAL_ENTRY
511 __field(u8, value)
512 __field(int, ret)
513 ),
514
515 TP_fast_assign(
516 LOCAL_ASSIGN;
517 __entry->ret = ret;
518 __entry->value = value;
519 ),
520
521 TP_printk(
522 LOCAL_PR_FMT " value:%d ret:%d",
523 LOCAL_PR_ARG, __entry->value, __entry->ret
524 )
525);
526
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200527TRACE_EVENT(drv_sta_notify,
528 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100529 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200530 enum sta_notify_cmd cmd,
531 struct ieee80211_sta *sta),
532
Johannes Berg12375ef2009-11-25 20:30:31 +0100533 TP_ARGS(local, sdata, cmd, sta),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200534
535 TP_STRUCT__entry(
536 LOCAL_ENTRY
537 VIF_ENTRY
538 STA_ENTRY
539 __field(u32, cmd)
540 ),
541
542 TP_fast_assign(
543 LOCAL_ASSIGN;
544 VIF_ASSIGN;
545 STA_ASSIGN;
546 __entry->cmd = cmd;
547 ),
548
549 TP_printk(
550 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
551 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
552 )
553);
554
Johannes Berg34e89502010-02-03 13:59:58 +0100555TRACE_EVENT(drv_sta_add,
556 TP_PROTO(struct ieee80211_local *local,
557 struct ieee80211_sub_if_data *sdata,
558 struct ieee80211_sta *sta, int ret),
559
560 TP_ARGS(local, sdata, sta, ret),
561
562 TP_STRUCT__entry(
563 LOCAL_ENTRY
564 VIF_ENTRY
565 STA_ENTRY
566 __field(int, ret)
567 ),
568
569 TP_fast_assign(
570 LOCAL_ASSIGN;
571 VIF_ASSIGN;
572 STA_ASSIGN;
573 __entry->ret = ret;
574 ),
575
576 TP_printk(
577 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ret:%d",
578 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ret
579 )
580);
581
582TRACE_EVENT(drv_sta_remove,
583 TP_PROTO(struct ieee80211_local *local,
584 struct ieee80211_sub_if_data *sdata,
585 struct ieee80211_sta *sta),
586
587 TP_ARGS(local, sdata, sta),
588
589 TP_STRUCT__entry(
590 LOCAL_ENTRY
591 VIF_ENTRY
592 STA_ENTRY
593 ),
594
595 TP_fast_assign(
596 LOCAL_ASSIGN;
597 VIF_ASSIGN;
598 STA_ASSIGN;
599 ),
600
601 TP_printk(
602 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
603 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
604 )
605);
606
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200607TRACE_EVENT(drv_conf_tx,
608 TP_PROTO(struct ieee80211_local *local, u16 queue,
609 const struct ieee80211_tx_queue_params *params,
610 int ret),
611
612 TP_ARGS(local, queue, params, ret),
613
614 TP_STRUCT__entry(
615 LOCAL_ENTRY
616 __field(u16, queue)
617 __field(u16, txop)
618 __field(u16, cw_min)
619 __field(u16, cw_max)
620 __field(u8, aifs)
621 __field(int, ret)
622 ),
623
624 TP_fast_assign(
625 LOCAL_ASSIGN;
626 __entry->queue = queue;
627 __entry->ret = ret;
628 __entry->txop = params->txop;
629 __entry->cw_max = params->cw_max;
630 __entry->cw_min = params->cw_min;
631 __entry->aifs = params->aifs;
632 ),
633
634 TP_printk(
635 LOCAL_PR_FMT " queue:%d ret:%d",
636 LOCAL_PR_ARG, __entry->queue, __entry->ret
637 )
638);
639
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200640TRACE_EVENT(drv_get_tsf,
641 TP_PROTO(struct ieee80211_local *local, u64 ret),
642
643 TP_ARGS(local, ret),
644
645 TP_STRUCT__entry(
646 LOCAL_ENTRY
647 __field(u64, ret)
648 ),
649
650 TP_fast_assign(
651 LOCAL_ASSIGN;
652 __entry->ret = ret;
653 ),
654
655 TP_printk(
656 LOCAL_PR_FMT " ret:%llu",
657 LOCAL_PR_ARG, (unsigned long long)__entry->ret
658 )
659);
660
661TRACE_EVENT(drv_set_tsf,
662 TP_PROTO(struct ieee80211_local *local, u64 tsf),
663
664 TP_ARGS(local, tsf),
665
666 TP_STRUCT__entry(
667 LOCAL_ENTRY
668 __field(u64, tsf)
669 ),
670
671 TP_fast_assign(
672 LOCAL_ASSIGN;
673 __entry->tsf = tsf;
674 ),
675
676 TP_printk(
677 LOCAL_PR_FMT " tsf:%llu",
678 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
679 )
680);
681
682TRACE_EVENT(drv_reset_tsf,
683 TP_PROTO(struct ieee80211_local *local),
684
685 TP_ARGS(local),
686
687 TP_STRUCT__entry(
688 LOCAL_ENTRY
689 ),
690
691 TP_fast_assign(
692 LOCAL_ASSIGN;
693 ),
694
695 TP_printk(
696 LOCAL_PR_FMT, LOCAL_PR_ARG
697 )
698);
699
700TRACE_EVENT(drv_tx_last_beacon,
701 TP_PROTO(struct ieee80211_local *local, int ret),
702
703 TP_ARGS(local, ret),
704
705 TP_STRUCT__entry(
706 LOCAL_ENTRY
707 __field(int, ret)
708 ),
709
710 TP_fast_assign(
711 LOCAL_ASSIGN;
712 __entry->ret = ret;
713 ),
714
715 TP_printk(
716 LOCAL_PR_FMT " ret:%d",
717 LOCAL_PR_ARG, __entry->ret
718 )
719);
720
721TRACE_EVENT(drv_ampdu_action,
722 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100723 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200724 enum ieee80211_ampdu_mlme_action action,
725 struct ieee80211_sta *sta, u16 tid,
726 u16 *ssn, int ret),
727
Johannes Berg12375ef2009-11-25 20:30:31 +0100728 TP_ARGS(local, sdata, action, sta, tid, ssn, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200729
730 TP_STRUCT__entry(
731 LOCAL_ENTRY
732 STA_ENTRY
733 __field(u32, action)
734 __field(u16, tid)
735 __field(u16, ssn)
736 __field(int, ret)
Johannes Bergc951ad32009-11-16 12:00:38 +0100737 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200738 ),
739
740 TP_fast_assign(
741 LOCAL_ASSIGN;
Johannes Bergc951ad32009-11-16 12:00:38 +0100742 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200743 STA_ASSIGN;
744 __entry->ret = ret;
745 __entry->action = action;
746 __entry->tid = tid;
Zhu Yi3092ad02010-01-26 15:58:57 +0800747 __entry->ssn = ssn ? *ssn : 0;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200748 ),
749
750 TP_printk(
Johannes Bergc951ad32009-11-16 12:00:38 +0100751 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d ret:%d",
752 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid, __entry->ret
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200753 )
754);
Johannes Berga80f7c02009-12-23 13:15:32 +0100755
756TRACE_EVENT(drv_flush,
757 TP_PROTO(struct ieee80211_local *local, bool drop),
758
759 TP_ARGS(local, drop),
760
761 TP_STRUCT__entry(
762 LOCAL_ENTRY
763 __field(bool, drop)
764 ),
765
766 TP_fast_assign(
767 LOCAL_ASSIGN;
768 __entry->drop = drop;
769 ),
770
771 TP_printk(
772 LOCAL_PR_FMT " drop:%d",
773 LOCAL_PR_ARG, __entry->drop
774 )
775);
Johannes Bergb5878a22010-04-07 16:48:40 +0200776
Johannes Berg5ce6e432010-05-11 16:20:57 +0200777TRACE_EVENT(drv_channel_switch,
778 TP_PROTO(struct ieee80211_local *local,
779 struct ieee80211_channel_switch *ch_switch),
780
781 TP_ARGS(local, ch_switch),
782
783 TP_STRUCT__entry(
784 LOCAL_ENTRY
785 __field(u64, timestamp)
786 __field(bool, block_tx)
787 __field(u16, freq)
788 __field(u8, count)
789 ),
790
791 TP_fast_assign(
792 LOCAL_ASSIGN;
793 __entry->timestamp = ch_switch->timestamp;
794 __entry->block_tx = ch_switch->block_tx;
795 __entry->freq = ch_switch->channel->center_freq;
796 __entry->count = ch_switch->count;
797 ),
798
799 TP_printk(
800 LOCAL_PR_FMT " new freq:%u count:%d",
801 LOCAL_PR_ARG, __entry->freq, __entry->count
802 )
803);
804
Johannes Bergb5878a22010-04-07 16:48:40 +0200805/*
806 * Tracing for API calls that drivers call.
807 */
808
809TRACE_EVENT(api_start_tx_ba_session,
810 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
811
812 TP_ARGS(sta, tid),
813
814 TP_STRUCT__entry(
815 STA_ENTRY
816 __field(u16, tid)
817 ),
818
819 TP_fast_assign(
820 STA_ASSIGN;
821 __entry->tid = tid;
822 ),
823
824 TP_printk(
825 STA_PR_FMT " tid:%d",
826 STA_PR_ARG, __entry->tid
827 )
828);
829
830TRACE_EVENT(api_start_tx_ba_cb,
831 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
832
833 TP_ARGS(sdata, ra, tid),
834
835 TP_STRUCT__entry(
836 VIF_ENTRY
837 __array(u8, ra, ETH_ALEN)
838 __field(u16, tid)
839 ),
840
841 TP_fast_assign(
842 VIF_ASSIGN;
843 memcpy(__entry->ra, ra, ETH_ALEN);
844 __entry->tid = tid;
845 ),
846
847 TP_printk(
848 VIF_PR_FMT " ra:%pM tid:%d",
849 VIF_PR_ARG, __entry->ra, __entry->tid
850 )
851);
852
853TRACE_EVENT(api_stop_tx_ba_session,
854 TP_PROTO(struct ieee80211_sta *sta, u16 tid, u16 initiator),
855
856 TP_ARGS(sta, tid, initiator),
857
858 TP_STRUCT__entry(
859 STA_ENTRY
860 __field(u16, tid)
861 __field(u16, initiator)
862 ),
863
864 TP_fast_assign(
865 STA_ASSIGN;
866 __entry->tid = tid;
867 __entry->initiator = initiator;
868 ),
869
870 TP_printk(
871 STA_PR_FMT " tid:%d initiator:%d",
872 STA_PR_ARG, __entry->tid, __entry->initiator
873 )
874);
875
876TRACE_EVENT(api_stop_tx_ba_cb,
877 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
878
879 TP_ARGS(sdata, ra, tid),
880
881 TP_STRUCT__entry(
882 VIF_ENTRY
883 __array(u8, ra, ETH_ALEN)
884 __field(u16, tid)
885 ),
886
887 TP_fast_assign(
888 VIF_ASSIGN;
889 memcpy(__entry->ra, ra, ETH_ALEN);
890 __entry->tid = tid;
891 ),
892
893 TP_printk(
894 VIF_PR_FMT " ra:%pM tid:%d",
895 VIF_PR_ARG, __entry->ra, __entry->tid
896 )
897);
898
899TRACE_EVENT(api_restart_hw,
900 TP_PROTO(struct ieee80211_local *local),
901
902 TP_ARGS(local),
903
904 TP_STRUCT__entry(
905 LOCAL_ENTRY
906 ),
907
908 TP_fast_assign(
909 LOCAL_ASSIGN;
910 ),
911
912 TP_printk(
913 LOCAL_PR_FMT,
914 LOCAL_PR_ARG
915 )
916);
917
918TRACE_EVENT(api_beacon_loss,
919 TP_PROTO(struct ieee80211_sub_if_data *sdata),
920
921 TP_ARGS(sdata),
922
923 TP_STRUCT__entry(
924 VIF_ENTRY
925 ),
926
927 TP_fast_assign(
928 VIF_ASSIGN;
929 ),
930
931 TP_printk(
932 VIF_PR_FMT,
933 VIF_PR_ARG
934 )
935);
936
937TRACE_EVENT(api_connection_loss,
938 TP_PROTO(struct ieee80211_sub_if_data *sdata),
939
940 TP_ARGS(sdata),
941
942 TP_STRUCT__entry(
943 VIF_ENTRY
944 ),
945
946 TP_fast_assign(
947 VIF_ASSIGN;
948 ),
949
950 TP_printk(
951 VIF_PR_FMT,
952 VIF_PR_ARG
953 )
954);
955
956TRACE_EVENT(api_cqm_rssi_notify,
957 TP_PROTO(struct ieee80211_sub_if_data *sdata,
958 enum nl80211_cqm_rssi_threshold_event rssi_event),
959
960 TP_ARGS(sdata, rssi_event),
961
962 TP_STRUCT__entry(
963 VIF_ENTRY
964 __field(u32, rssi_event)
965 ),
966
967 TP_fast_assign(
968 VIF_ASSIGN;
969 __entry->rssi_event = rssi_event;
970 ),
971
972 TP_printk(
973 VIF_PR_FMT " event:%d",
974 VIF_PR_ARG, __entry->rssi_event
975 )
976);
977
978TRACE_EVENT(api_scan_completed,
979 TP_PROTO(struct ieee80211_local *local, bool aborted),
980
981 TP_ARGS(local, aborted),
982
983 TP_STRUCT__entry(
984 LOCAL_ENTRY
985 __field(bool, aborted)
986 ),
987
988 TP_fast_assign(
989 LOCAL_ASSIGN;
990 __entry->aborted = aborted;
991 ),
992
993 TP_printk(
994 LOCAL_PR_FMT " aborted:%d",
995 LOCAL_PR_ARG, __entry->aborted
996 )
997);
998
999TRACE_EVENT(api_sta_block_awake,
1000 TP_PROTO(struct ieee80211_local *local,
1001 struct ieee80211_sta *sta, bool block),
1002
1003 TP_ARGS(local, sta, block),
1004
1005 TP_STRUCT__entry(
1006 LOCAL_ENTRY
1007 STA_ENTRY
1008 __field(bool, block)
1009 ),
1010
1011 TP_fast_assign(
1012 LOCAL_ASSIGN;
1013 STA_ASSIGN;
1014 __entry->block = block;
1015 ),
1016
1017 TP_printk(
1018 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1019 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1020 )
1021);
1022
Johannes Berg5ce6e432010-05-11 16:20:57 +02001023TRACE_EVENT(api_chswitch_done,
1024 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1025
1026 TP_ARGS(sdata, success),
1027
1028 TP_STRUCT__entry(
1029 VIF_ENTRY
1030 __field(bool, success)
1031 ),
1032
1033 TP_fast_assign(
1034 VIF_ASSIGN;
1035 __entry->success = success;
1036 ),
1037
1038 TP_printk(
1039 VIF_PR_FMT " success=%d",
1040 VIF_PR_ARG, __entry->success
1041 )
1042);
1043
Johannes Bergb5878a22010-04-07 16:48:40 +02001044/*
1045 * Tracing for internal functions
1046 * (which may also be called in response to driver calls)
1047 */
1048
1049TRACE_EVENT(wake_queue,
1050 TP_PROTO(struct ieee80211_local *local, u16 queue,
1051 enum queue_stop_reason reason),
1052
1053 TP_ARGS(local, queue, reason),
1054
1055 TP_STRUCT__entry(
1056 LOCAL_ENTRY
1057 __field(u16, queue)
1058 __field(u32, reason)
1059 ),
1060
1061 TP_fast_assign(
1062 LOCAL_ASSIGN;
1063 __entry->queue = queue;
1064 __entry->reason = reason;
1065 ),
1066
1067 TP_printk(
1068 LOCAL_PR_FMT " queue:%d, reason:%d",
1069 LOCAL_PR_ARG, __entry->queue, __entry->reason
1070 )
1071);
1072
1073TRACE_EVENT(stop_queue,
1074 TP_PROTO(struct ieee80211_local *local, u16 queue,
1075 enum queue_stop_reason reason),
1076
1077 TP_ARGS(local, queue, reason),
1078
1079 TP_STRUCT__entry(
1080 LOCAL_ENTRY
1081 __field(u16, queue)
1082 __field(u32, reason)
1083 ),
1084
1085 TP_fast_assign(
1086 LOCAL_ASSIGN;
1087 __entry->queue = queue;
1088 __entry->reason = reason;
1089 ),
1090
1091 TP_printk(
1092 LOCAL_PR_FMT " queue:%d, reason:%d",
1093 LOCAL_PR_ARG, __entry->queue, __entry->reason
1094 )
1095);
Christian Lamparterf7428802009-07-19 23:21:07 +02001096#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02001097
1098#undef TRACE_INCLUDE_PATH
1099#define TRACE_INCLUDE_PATH .
1100#undef TRACE_INCLUDE_FILE
1101#define TRACE_INCLUDE_FILE driver-trace
1102#include <trace/define_trace.h>