blob: 5d5d2a97466837b75b14961bc3b14a48bd5d488e [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 Berg4efc76b2010-06-10 10:56:20 +020039TRACE_EVENT(drv_return_void,
40 TP_PROTO(struct ieee80211_local *local),
41 TP_ARGS(local),
42 TP_STRUCT__entry(
43 LOCAL_ENTRY
44 ),
45 TP_fast_assign(
46 LOCAL_ASSIGN;
47 ),
48 TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
49);
50
51TRACE_EVENT(drv_return_int,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020052 TP_PROTO(struct ieee80211_local *local, int ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020053 TP_ARGS(local, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020054 TP_STRUCT__entry(
55 LOCAL_ENTRY
56 __field(int, ret)
57 ),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020058 TP_fast_assign(
59 LOCAL_ASSIGN;
60 __entry->ret = ret;
61 ),
Johannes Berg4efc76b2010-06-10 10:56:20 +020062 TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
63);
64
65TRACE_EVENT(drv_return_u64,
66 TP_PROTO(struct ieee80211_local *local, u64 ret),
67 TP_ARGS(local, ret),
68 TP_STRUCT__entry(
69 LOCAL_ENTRY
70 __field(u64, ret)
71 ),
72 TP_fast_assign(
73 LOCAL_ASSIGN;
74 __entry->ret = ret;
75 ),
76 TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
77);
78
79TRACE_EVENT(drv_start,
80 TP_PROTO(struct ieee80211_local *local),
81
82 TP_ARGS(local),
83
84 TP_STRUCT__entry(
85 LOCAL_ENTRY
86 ),
87
88 TP_fast_assign(
89 LOCAL_ASSIGN;
90 ),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020091
92 TP_printk(
93 LOCAL_PR_FMT, LOCAL_PR_ARG
94 )
95);
96
97TRACE_EVENT(drv_stop,
98 TP_PROTO(struct ieee80211_local *local),
99
100 TP_ARGS(local),
101
102 TP_STRUCT__entry(
103 LOCAL_ENTRY
104 ),
105
106 TP_fast_assign(
107 LOCAL_ASSIGN;
108 ),
109
110 TP_printk(
111 LOCAL_PR_FMT, LOCAL_PR_ARG
112 )
113);
114
115TRACE_EVENT(drv_add_interface,
116 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200117 struct ieee80211_sub_if_data *sdata),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200118
Johannes Berg4efc76b2010-06-10 10:56:20 +0200119 TP_ARGS(local, sdata),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200120
121 TP_STRUCT__entry(
122 LOCAL_ENTRY
123 VIF_ENTRY
124 __array(char, addr, 6)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200125 ),
126
127 TP_fast_assign(
128 LOCAL_ASSIGN;
129 VIF_ASSIGN;
Johannes Berg12375ef2009-11-25 20:30:31 +0100130 memcpy(__entry->addr, sdata->vif.addr, 6);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200131 ),
132
133 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200134 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
135 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200136 )
137);
138
139TRACE_EVENT(drv_remove_interface,
Johannes Berg12375ef2009-11-25 20:30:31 +0100140 TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200141
Johannes Berg12375ef2009-11-25 20:30:31 +0100142 TP_ARGS(local, sdata),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200143
144 TP_STRUCT__entry(
145 LOCAL_ENTRY
146 VIF_ENTRY
147 __array(char, addr, 6)
148 ),
149
150 TP_fast_assign(
151 LOCAL_ASSIGN;
152 VIF_ASSIGN;
Johannes Berg12375ef2009-11-25 20:30:31 +0100153 memcpy(__entry->addr, sdata->vif.addr, 6);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200154 ),
155
156 TP_printk(
157 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
158 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
159 )
160);
161
162TRACE_EVENT(drv_config,
163 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200164 u32 changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200165
Johannes Berg4efc76b2010-06-10 10:56:20 +0200166 TP_ARGS(local, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200167
168 TP_STRUCT__entry(
169 LOCAL_ENTRY
170 __field(u32, changed)
Johannes Bergf911ab82009-11-25 19:07:20 +0100171 __field(u32, flags)
172 __field(int, power_level)
173 __field(int, dynamic_ps_timeout)
174 __field(int, max_sleep_period)
175 __field(u16, listen_interval)
176 __field(u8, long_frame_max_tx_count)
177 __field(u8, short_frame_max_tx_count)
178 __field(int, center_freq)
179 __field(int, channel_type)
Johannes Berg0f782312009-12-01 13:37:02 +0100180 __field(int, smps)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200181 ),
182
183 TP_fast_assign(
184 LOCAL_ASSIGN;
185 __entry->changed = changed;
Johannes Bergf911ab82009-11-25 19:07:20 +0100186 __entry->flags = local->hw.conf.flags;
187 __entry->power_level = local->hw.conf.power_level;
188 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
189 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
190 __entry->listen_interval = local->hw.conf.listen_interval;
191 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
192 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
193 __entry->center_freq = local->hw.conf.channel->center_freq;
194 __entry->channel_type = local->hw.conf.channel_type;
Johannes Berg0f782312009-12-01 13:37:02 +0100195 __entry->smps = local->hw.conf.smps_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200196 ),
197
198 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200199 LOCAL_PR_FMT " ch:%#x freq:%d",
200 LOCAL_PR_ARG, __entry->changed, __entry->center_freq
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200201 )
202);
203
204TRACE_EVENT(drv_bss_info_changed,
205 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100206 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200207 struct ieee80211_bss_conf *info,
208 u32 changed),
209
Johannes Berg12375ef2009-11-25 20:30:31 +0100210 TP_ARGS(local, sdata, info, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200211
212 TP_STRUCT__entry(
213 LOCAL_ENTRY
214 VIF_ENTRY
215 __field(bool, assoc)
216 __field(u16, aid)
217 __field(bool, cts)
218 __field(bool, shortpre)
219 __field(bool, shortslot)
220 __field(u8, dtimper)
221 __field(u16, bcnint)
222 __field(u16, assoc_cap)
223 __field(u64, timestamp)
224 __field(u32, basic_rates)
225 __field(u32, changed)
Johannes Bergf911ab82009-11-25 19:07:20 +0100226 __field(bool, enable_beacon)
227 __field(u16, ht_operation_mode)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200228 ),
229
230 TP_fast_assign(
231 LOCAL_ASSIGN;
232 VIF_ASSIGN;
233 __entry->changed = changed;
234 __entry->aid = info->aid;
235 __entry->assoc = info->assoc;
236 __entry->shortpre = info->use_short_preamble;
237 __entry->cts = info->use_cts_prot;
238 __entry->shortslot = info->use_short_slot;
239 __entry->dtimper = info->dtim_period;
240 __entry->bcnint = info->beacon_int;
241 __entry->assoc_cap = info->assoc_capability;
242 __entry->timestamp = info->timestamp;
243 __entry->basic_rates = info->basic_rates;
Johannes Bergf911ab82009-11-25 19:07:20 +0100244 __entry->enable_beacon = info->enable_beacon;
245 __entry->ht_operation_mode = info->ht_operation_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200246 ),
247
248 TP_printk(
249 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
250 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
251 )
252);
253
Johannes Berg3ac64be2009-08-17 16:16:53 +0200254TRACE_EVENT(drv_prepare_multicast,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200255 TP_PROTO(struct ieee80211_local *local, int mc_count),
Johannes Berg3ac64be2009-08-17 16:16:53 +0200256
Johannes Berg4efc76b2010-06-10 10:56:20 +0200257 TP_ARGS(local, mc_count),
Johannes Berg3ac64be2009-08-17 16:16:53 +0200258
259 TP_STRUCT__entry(
260 LOCAL_ENTRY
261 __field(int, mc_count)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200262 ),
263
264 TP_fast_assign(
265 LOCAL_ASSIGN;
266 __entry->mc_count = mc_count;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200267 ),
268
269 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200270 LOCAL_PR_FMT " prepare mc (%d)",
271 LOCAL_PR_ARG, __entry->mc_count
Johannes Berg3ac64be2009-08-17 16:16:53 +0200272 )
273);
274
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200275TRACE_EVENT(drv_configure_filter,
276 TP_PROTO(struct ieee80211_local *local,
277 unsigned int changed_flags,
278 unsigned int *total_flags,
Johannes Berg3ac64be2009-08-17 16:16:53 +0200279 u64 multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200280
Johannes Berg3ac64be2009-08-17 16:16:53 +0200281 TP_ARGS(local, changed_flags, total_flags, multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200282
283 TP_STRUCT__entry(
284 LOCAL_ENTRY
285 __field(unsigned int, changed)
286 __field(unsigned int, total)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200287 __field(u64, multicast)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200288 ),
289
290 TP_fast_assign(
291 LOCAL_ASSIGN;
292 __entry->changed = changed_flags;
293 __entry->total = *total_flags;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200294 __entry->multicast = multicast;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200295 ),
296
297 TP_printk(
Johannes Berg3ac64be2009-08-17 16:16:53 +0200298 LOCAL_PR_FMT " changed:%#x total:%#x",
299 LOCAL_PR_ARG, __entry->changed, __entry->total
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200300 )
301);
302
303TRACE_EVENT(drv_set_tim,
304 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200305 struct ieee80211_sta *sta, bool set),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200306
Johannes Berg4efc76b2010-06-10 10:56:20 +0200307 TP_ARGS(local, sta, set),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200308
309 TP_STRUCT__entry(
310 LOCAL_ENTRY
311 STA_ENTRY
312 __field(bool, set)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200313 ),
314
315 TP_fast_assign(
316 LOCAL_ASSIGN;
317 STA_ASSIGN;
318 __entry->set = set;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200319 ),
320
321 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200322 LOCAL_PR_FMT STA_PR_FMT " set:%d",
323 LOCAL_PR_ARG, STA_PR_FMT, __entry->set
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200324 )
325);
326
327TRACE_EVENT(drv_set_key,
328 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100329 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200330 struct ieee80211_sta *sta,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200331 struct ieee80211_key_conf *key),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200332
Johannes Berg4efc76b2010-06-10 10:56:20 +0200333 TP_ARGS(local, cmd, sdata, sta, key),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200334
335 TP_STRUCT__entry(
336 LOCAL_ENTRY
337 VIF_ENTRY
338 STA_ENTRY
339 __field(enum ieee80211_key_alg, alg)
340 __field(u8, hw_key_idx)
341 __field(u8, flags)
342 __field(s8, keyidx)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200343 ),
344
345 TP_fast_assign(
346 LOCAL_ASSIGN;
347 VIF_ASSIGN;
348 STA_ASSIGN;
349 __entry->alg = key->alg;
350 __entry->flags = key->flags;
351 __entry->keyidx = key->keyidx;
352 __entry->hw_key_idx = key->hw_key_idx;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200353 ),
354
355 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200356 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
357 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200358 )
359);
360
361TRACE_EVENT(drv_update_tkip_key,
362 TP_PROTO(struct ieee80211_local *local,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100363 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200364 struct ieee80211_key_conf *conf,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100365 struct ieee80211_sta *sta, u32 iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200366
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100367 TP_ARGS(local, sdata, conf, sta, iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200368
369 TP_STRUCT__entry(
370 LOCAL_ENTRY
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100371 VIF_ENTRY
372 STA_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200373 __field(u32, iv32)
374 ),
375
376 TP_fast_assign(
377 LOCAL_ASSIGN;
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100378 VIF_ASSIGN;
379 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200380 __entry->iv32 = iv32;
381 ),
382
383 TP_printk(
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100384 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
385 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200386 )
387);
388
389TRACE_EVENT(drv_hw_scan,
390 TP_PROTO(struct ieee80211_local *local,
Johannes Berga060bbf2010-04-27 11:59:34 +0200391 struct ieee80211_sub_if_data *sdata,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200392 struct cfg80211_scan_request *req),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200393
Johannes Berg4efc76b2010-06-10 10:56:20 +0200394 TP_ARGS(local, sdata, req),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200395
396 TP_STRUCT__entry(
397 LOCAL_ENTRY
Johannes Berga060bbf2010-04-27 11:59:34 +0200398 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200399 ),
400
401 TP_fast_assign(
402 LOCAL_ASSIGN;
Johannes Berga060bbf2010-04-27 11:59:34 +0200403 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200404 ),
405
406 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200407 LOCAL_PR_FMT VIF_PR_FMT,
408 LOCAL_PR_ARG,VIF_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200409 )
410);
411
412TRACE_EVENT(drv_sw_scan_start,
413 TP_PROTO(struct ieee80211_local *local),
414
415 TP_ARGS(local),
416
417 TP_STRUCT__entry(
418 LOCAL_ENTRY
419 ),
420
421 TP_fast_assign(
422 LOCAL_ASSIGN;
423 ),
424
425 TP_printk(
426 LOCAL_PR_FMT, LOCAL_PR_ARG
427 )
428);
429
430TRACE_EVENT(drv_sw_scan_complete,
431 TP_PROTO(struct ieee80211_local *local),
432
433 TP_ARGS(local),
434
435 TP_STRUCT__entry(
436 LOCAL_ENTRY
437 ),
438
439 TP_fast_assign(
440 LOCAL_ASSIGN;
441 ),
442
443 TP_printk(
444 LOCAL_PR_FMT, LOCAL_PR_ARG
445 )
446);
447
448TRACE_EVENT(drv_get_stats,
449 TP_PROTO(struct ieee80211_local *local,
450 struct ieee80211_low_level_stats *stats,
451 int ret),
452
453 TP_ARGS(local, stats, ret),
454
455 TP_STRUCT__entry(
456 LOCAL_ENTRY
457 __field(int, ret)
458 __field(unsigned int, ackfail)
459 __field(unsigned int, rtsfail)
460 __field(unsigned int, fcserr)
461 __field(unsigned int, rtssucc)
462 ),
463
464 TP_fast_assign(
465 LOCAL_ASSIGN;
466 __entry->ret = ret;
467 __entry->ackfail = stats->dot11ACKFailureCount;
468 __entry->rtsfail = stats->dot11RTSFailureCount;
469 __entry->fcserr = stats->dot11FCSErrorCount;
470 __entry->rtssucc = stats->dot11RTSSuccessCount;
471 ),
472
473 TP_printk(
474 LOCAL_PR_FMT " ret:%d",
475 LOCAL_PR_ARG, __entry->ret
476 )
477);
478
479TRACE_EVENT(drv_get_tkip_seq,
480 TP_PROTO(struct ieee80211_local *local,
481 u8 hw_key_idx, u32 *iv32, u16 *iv16),
482
483 TP_ARGS(local, hw_key_idx, iv32, iv16),
484
485 TP_STRUCT__entry(
486 LOCAL_ENTRY
487 __field(u8, hw_key_idx)
488 __field(u32, iv32)
489 __field(u16, iv16)
490 ),
491
492 TP_fast_assign(
493 LOCAL_ASSIGN;
494 __entry->hw_key_idx = hw_key_idx;
495 __entry->iv32 = *iv32;
496 __entry->iv16 = *iv16;
497 ),
498
499 TP_printk(
500 LOCAL_PR_FMT, LOCAL_PR_ARG
501 )
502);
503
504TRACE_EVENT(drv_set_rts_threshold,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200505 TP_PROTO(struct ieee80211_local *local, u32 value),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200506
Johannes Berg4efc76b2010-06-10 10:56:20 +0200507 TP_ARGS(local, value),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200508
509 TP_STRUCT__entry(
510 LOCAL_ENTRY
511 __field(u32, value)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200512 ),
513
514 TP_fast_assign(
515 LOCAL_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200516 __entry->value = value;
517 ),
518
519 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200520 LOCAL_PR_FMT " value:%d",
521 LOCAL_PR_ARG, __entry->value
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200522 )
523);
524
Lukáš Turek310bc672009-12-21 22:50:48 +0100525TRACE_EVENT(drv_set_coverage_class,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200526 TP_PROTO(struct ieee80211_local *local, u8 value),
Lukáš Turek310bc672009-12-21 22:50:48 +0100527
Johannes Berg4efc76b2010-06-10 10:56:20 +0200528 TP_ARGS(local, value),
Lukáš Turek310bc672009-12-21 22:50:48 +0100529
530 TP_STRUCT__entry(
531 LOCAL_ENTRY
532 __field(u8, value)
Lukáš Turek310bc672009-12-21 22:50:48 +0100533 ),
534
535 TP_fast_assign(
536 LOCAL_ASSIGN;
Lukáš Turek310bc672009-12-21 22:50:48 +0100537 __entry->value = value;
538 ),
539
540 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200541 LOCAL_PR_FMT " value:%d",
542 LOCAL_PR_ARG, __entry->value
Lukáš Turek310bc672009-12-21 22:50:48 +0100543 )
544);
545
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200546TRACE_EVENT(drv_sta_notify,
547 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100548 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200549 enum sta_notify_cmd cmd,
550 struct ieee80211_sta *sta),
551
Johannes Berg12375ef2009-11-25 20:30:31 +0100552 TP_ARGS(local, sdata, cmd, sta),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200553
554 TP_STRUCT__entry(
555 LOCAL_ENTRY
556 VIF_ENTRY
557 STA_ENTRY
558 __field(u32, cmd)
559 ),
560
561 TP_fast_assign(
562 LOCAL_ASSIGN;
563 VIF_ASSIGN;
564 STA_ASSIGN;
565 __entry->cmd = cmd;
566 ),
567
568 TP_printk(
569 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
570 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
571 )
572);
573
Johannes Berg34e89502010-02-03 13:59:58 +0100574TRACE_EVENT(drv_sta_add,
575 TP_PROTO(struct ieee80211_local *local,
576 struct ieee80211_sub_if_data *sdata,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200577 struct ieee80211_sta *sta),
Johannes Berg34e89502010-02-03 13:59:58 +0100578
Johannes Berg4efc76b2010-06-10 10:56:20 +0200579 TP_ARGS(local, sdata, sta),
Johannes Berg34e89502010-02-03 13:59:58 +0100580
581 TP_STRUCT__entry(
582 LOCAL_ENTRY
583 VIF_ENTRY
584 STA_ENTRY
Johannes Berg34e89502010-02-03 13:59:58 +0100585 ),
586
587 TP_fast_assign(
588 LOCAL_ASSIGN;
589 VIF_ASSIGN;
590 STA_ASSIGN;
Johannes Berg34e89502010-02-03 13:59:58 +0100591 ),
592
593 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200594 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
595 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
Johannes Berg34e89502010-02-03 13:59:58 +0100596 )
597);
598
599TRACE_EVENT(drv_sta_remove,
600 TP_PROTO(struct ieee80211_local *local,
601 struct ieee80211_sub_if_data *sdata,
602 struct ieee80211_sta *sta),
603
604 TP_ARGS(local, sdata, sta),
605
606 TP_STRUCT__entry(
607 LOCAL_ENTRY
608 VIF_ENTRY
609 STA_ENTRY
610 ),
611
612 TP_fast_assign(
613 LOCAL_ASSIGN;
614 VIF_ASSIGN;
615 STA_ASSIGN;
616 ),
617
618 TP_printk(
619 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
620 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
621 )
622);
623
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200624TRACE_EVENT(drv_conf_tx,
625 TP_PROTO(struct ieee80211_local *local, u16 queue,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200626 const struct ieee80211_tx_queue_params *params),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200627
Johannes Berg4efc76b2010-06-10 10:56:20 +0200628 TP_ARGS(local, queue, params),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200629
630 TP_STRUCT__entry(
631 LOCAL_ENTRY
632 __field(u16, queue)
633 __field(u16, txop)
634 __field(u16, cw_min)
635 __field(u16, cw_max)
636 __field(u8, aifs)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200637 ),
638
639 TP_fast_assign(
640 LOCAL_ASSIGN;
641 __entry->queue = queue;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200642 __entry->txop = params->txop;
643 __entry->cw_max = params->cw_max;
644 __entry->cw_min = params->cw_min;
645 __entry->aifs = params->aifs;
646 ),
647
648 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200649 LOCAL_PR_FMT " queue:%d",
650 LOCAL_PR_ARG, __entry->queue
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200651 )
652);
653
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200654TRACE_EVENT(drv_get_tsf,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200655 TP_PROTO(struct ieee80211_local *local),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200656
Johannes Berg4efc76b2010-06-10 10:56:20 +0200657 TP_ARGS(local),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200658
659 TP_STRUCT__entry(
660 LOCAL_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200661 ),
662
663 TP_fast_assign(
664 LOCAL_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200665 ),
666
667 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200668 LOCAL_PR_FMT,
669 LOCAL_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200670 )
671);
672
673TRACE_EVENT(drv_set_tsf,
674 TP_PROTO(struct ieee80211_local *local, u64 tsf),
675
676 TP_ARGS(local, tsf),
677
678 TP_STRUCT__entry(
679 LOCAL_ENTRY
680 __field(u64, tsf)
681 ),
682
683 TP_fast_assign(
684 LOCAL_ASSIGN;
685 __entry->tsf = tsf;
686 ),
687
688 TP_printk(
689 LOCAL_PR_FMT " tsf:%llu",
690 LOCAL_PR_ARG, (unsigned long long)__entry->tsf
691 )
692);
693
694TRACE_EVENT(drv_reset_tsf,
695 TP_PROTO(struct ieee80211_local *local),
696
697 TP_ARGS(local),
698
699 TP_STRUCT__entry(
700 LOCAL_ENTRY
701 ),
702
703 TP_fast_assign(
704 LOCAL_ASSIGN;
705 ),
706
707 TP_printk(
708 LOCAL_PR_FMT, LOCAL_PR_ARG
709 )
710);
711
712TRACE_EVENT(drv_tx_last_beacon,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200713 TP_PROTO(struct ieee80211_local *local),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200714
Johannes Berg4efc76b2010-06-10 10:56:20 +0200715 TP_ARGS(local),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200716
717 TP_STRUCT__entry(
718 LOCAL_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200719 ),
720
721 TP_fast_assign(
722 LOCAL_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200723 ),
724
725 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200726 LOCAL_PR_FMT,
727 LOCAL_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200728 )
729);
730
731TRACE_EVENT(drv_ampdu_action,
732 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100733 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200734 enum ieee80211_ampdu_mlme_action action,
735 struct ieee80211_sta *sta, u16 tid,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200736 u16 *ssn),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200737
Johannes Berg4efc76b2010-06-10 10:56:20 +0200738 TP_ARGS(local, sdata, action, sta, tid, ssn),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200739
740 TP_STRUCT__entry(
741 LOCAL_ENTRY
742 STA_ENTRY
743 __field(u32, action)
744 __field(u16, tid)
745 __field(u16, ssn)
Johannes Bergc951ad32009-11-16 12:00:38 +0100746 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200747 ),
748
749 TP_fast_assign(
750 LOCAL_ASSIGN;
Johannes Bergc951ad32009-11-16 12:00:38 +0100751 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200752 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200753 __entry->action = action;
754 __entry->tid = tid;
Zhu Yi3092ad02010-01-26 15:58:57 +0800755 __entry->ssn = ssn ? *ssn : 0;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200756 ),
757
758 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200759 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d",
760 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action, __entry->tid
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200761 )
762);
Johannes Berga80f7c02009-12-23 13:15:32 +0100763
John W. Linvillec466d4e2010-06-29 14:51:23 -0400764TRACE_EVENT(drv_get_survey,
765 TP_PROTO(struct ieee80211_local *local, int idx,
766 struct survey_info *survey),
767
768 TP_ARGS(local, idx, survey),
769
770 TP_STRUCT__entry(
771 LOCAL_ENTRY
772 __field(int, idx)
773 ),
774
775 TP_fast_assign(
776 LOCAL_ASSIGN;
777 __entry->idx = idx;
778 ),
779
780 TP_printk(
781 LOCAL_PR_FMT " idx:%d",
782 LOCAL_PR_ARG, __entry->idx
783 )
784);
785
Johannes Berga80f7c02009-12-23 13:15:32 +0100786TRACE_EVENT(drv_flush,
787 TP_PROTO(struct ieee80211_local *local, bool drop),
788
789 TP_ARGS(local, drop),
790
791 TP_STRUCT__entry(
792 LOCAL_ENTRY
793 __field(bool, drop)
794 ),
795
796 TP_fast_assign(
797 LOCAL_ASSIGN;
798 __entry->drop = drop;
799 ),
800
801 TP_printk(
802 LOCAL_PR_FMT " drop:%d",
803 LOCAL_PR_ARG, __entry->drop
804 )
805);
Johannes Bergb5878a22010-04-07 16:48:40 +0200806
Johannes Berg5ce6e432010-05-11 16:20:57 +0200807TRACE_EVENT(drv_channel_switch,
808 TP_PROTO(struct ieee80211_local *local,
809 struct ieee80211_channel_switch *ch_switch),
810
811 TP_ARGS(local, ch_switch),
812
813 TP_STRUCT__entry(
814 LOCAL_ENTRY
815 __field(u64, timestamp)
816 __field(bool, block_tx)
817 __field(u16, freq)
818 __field(u8, count)
819 ),
820
821 TP_fast_assign(
822 LOCAL_ASSIGN;
823 __entry->timestamp = ch_switch->timestamp;
824 __entry->block_tx = ch_switch->block_tx;
825 __entry->freq = ch_switch->channel->center_freq;
826 __entry->count = ch_switch->count;
827 ),
828
829 TP_printk(
830 LOCAL_PR_FMT " new freq:%u count:%d",
831 LOCAL_PR_ARG, __entry->freq, __entry->count
832 )
833);
834
Johannes Bergb5878a22010-04-07 16:48:40 +0200835/*
836 * Tracing for API calls that drivers call.
837 */
838
839TRACE_EVENT(api_start_tx_ba_session,
840 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
841
842 TP_ARGS(sta, tid),
843
844 TP_STRUCT__entry(
845 STA_ENTRY
846 __field(u16, tid)
847 ),
848
849 TP_fast_assign(
850 STA_ASSIGN;
851 __entry->tid = tid;
852 ),
853
854 TP_printk(
855 STA_PR_FMT " tid:%d",
856 STA_PR_ARG, __entry->tid
857 )
858);
859
860TRACE_EVENT(api_start_tx_ba_cb,
861 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
862
863 TP_ARGS(sdata, ra, tid),
864
865 TP_STRUCT__entry(
866 VIF_ENTRY
867 __array(u8, ra, ETH_ALEN)
868 __field(u16, tid)
869 ),
870
871 TP_fast_assign(
872 VIF_ASSIGN;
873 memcpy(__entry->ra, ra, ETH_ALEN);
874 __entry->tid = tid;
875 ),
876
877 TP_printk(
878 VIF_PR_FMT " ra:%pM tid:%d",
879 VIF_PR_ARG, __entry->ra, __entry->tid
880 )
881);
882
883TRACE_EVENT(api_stop_tx_ba_session,
Johannes Berg6a8579d2010-05-27 14:41:07 +0200884 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
Johannes Bergb5878a22010-04-07 16:48:40 +0200885
Johannes Berg6a8579d2010-05-27 14:41:07 +0200886 TP_ARGS(sta, tid),
Johannes Bergb5878a22010-04-07 16:48:40 +0200887
888 TP_STRUCT__entry(
889 STA_ENTRY
890 __field(u16, tid)
Johannes Bergb5878a22010-04-07 16:48:40 +0200891 ),
892
893 TP_fast_assign(
894 STA_ASSIGN;
895 __entry->tid = tid;
Johannes Bergb5878a22010-04-07 16:48:40 +0200896 ),
897
898 TP_printk(
Johannes Berg6a8579d2010-05-27 14:41:07 +0200899 STA_PR_FMT " tid:%d",
900 STA_PR_ARG, __entry->tid
Johannes Bergb5878a22010-04-07 16:48:40 +0200901 )
902);
903
904TRACE_EVENT(api_stop_tx_ba_cb,
905 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
906
907 TP_ARGS(sdata, ra, tid),
908
909 TP_STRUCT__entry(
910 VIF_ENTRY
911 __array(u8, ra, ETH_ALEN)
912 __field(u16, tid)
913 ),
914
915 TP_fast_assign(
916 VIF_ASSIGN;
917 memcpy(__entry->ra, ra, ETH_ALEN);
918 __entry->tid = tid;
919 ),
920
921 TP_printk(
922 VIF_PR_FMT " ra:%pM tid:%d",
923 VIF_PR_ARG, __entry->ra, __entry->tid
924 )
925);
926
927TRACE_EVENT(api_restart_hw,
928 TP_PROTO(struct ieee80211_local *local),
929
930 TP_ARGS(local),
931
932 TP_STRUCT__entry(
933 LOCAL_ENTRY
934 ),
935
936 TP_fast_assign(
937 LOCAL_ASSIGN;
938 ),
939
940 TP_printk(
941 LOCAL_PR_FMT,
942 LOCAL_PR_ARG
943 )
944);
945
946TRACE_EVENT(api_beacon_loss,
947 TP_PROTO(struct ieee80211_sub_if_data *sdata),
948
949 TP_ARGS(sdata),
950
951 TP_STRUCT__entry(
952 VIF_ENTRY
953 ),
954
955 TP_fast_assign(
956 VIF_ASSIGN;
957 ),
958
959 TP_printk(
960 VIF_PR_FMT,
961 VIF_PR_ARG
962 )
963);
964
965TRACE_EVENT(api_connection_loss,
966 TP_PROTO(struct ieee80211_sub_if_data *sdata),
967
968 TP_ARGS(sdata),
969
970 TP_STRUCT__entry(
971 VIF_ENTRY
972 ),
973
974 TP_fast_assign(
975 VIF_ASSIGN;
976 ),
977
978 TP_printk(
979 VIF_PR_FMT,
980 VIF_PR_ARG
981 )
982);
983
984TRACE_EVENT(api_cqm_rssi_notify,
985 TP_PROTO(struct ieee80211_sub_if_data *sdata,
986 enum nl80211_cqm_rssi_threshold_event rssi_event),
987
988 TP_ARGS(sdata, rssi_event),
989
990 TP_STRUCT__entry(
991 VIF_ENTRY
992 __field(u32, rssi_event)
993 ),
994
995 TP_fast_assign(
996 VIF_ASSIGN;
997 __entry->rssi_event = rssi_event;
998 ),
999
1000 TP_printk(
1001 VIF_PR_FMT " event:%d",
1002 VIF_PR_ARG, __entry->rssi_event
1003 )
1004);
1005
1006TRACE_EVENT(api_scan_completed,
1007 TP_PROTO(struct ieee80211_local *local, bool aborted),
1008
1009 TP_ARGS(local, aborted),
1010
1011 TP_STRUCT__entry(
1012 LOCAL_ENTRY
1013 __field(bool, aborted)
1014 ),
1015
1016 TP_fast_assign(
1017 LOCAL_ASSIGN;
1018 __entry->aborted = aborted;
1019 ),
1020
1021 TP_printk(
1022 LOCAL_PR_FMT " aborted:%d",
1023 LOCAL_PR_ARG, __entry->aborted
1024 )
1025);
1026
1027TRACE_EVENT(api_sta_block_awake,
1028 TP_PROTO(struct ieee80211_local *local,
1029 struct ieee80211_sta *sta, bool block),
1030
1031 TP_ARGS(local, sta, block),
1032
1033 TP_STRUCT__entry(
1034 LOCAL_ENTRY
1035 STA_ENTRY
1036 __field(bool, block)
1037 ),
1038
1039 TP_fast_assign(
1040 LOCAL_ASSIGN;
1041 STA_ASSIGN;
1042 __entry->block = block;
1043 ),
1044
1045 TP_printk(
1046 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1047 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1048 )
1049);
1050
Johannes Berg5ce6e432010-05-11 16:20:57 +02001051TRACE_EVENT(api_chswitch_done,
1052 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1053
1054 TP_ARGS(sdata, success),
1055
1056 TP_STRUCT__entry(
1057 VIF_ENTRY
1058 __field(bool, success)
1059 ),
1060
1061 TP_fast_assign(
1062 VIF_ASSIGN;
1063 __entry->success = success;
1064 ),
1065
1066 TP_printk(
1067 VIF_PR_FMT " success=%d",
1068 VIF_PR_ARG, __entry->success
1069 )
1070);
1071
Johannes Bergb5878a22010-04-07 16:48:40 +02001072/*
1073 * Tracing for internal functions
1074 * (which may also be called in response to driver calls)
1075 */
1076
1077TRACE_EVENT(wake_queue,
1078 TP_PROTO(struct ieee80211_local *local, u16 queue,
1079 enum queue_stop_reason reason),
1080
1081 TP_ARGS(local, queue, reason),
1082
1083 TP_STRUCT__entry(
1084 LOCAL_ENTRY
1085 __field(u16, queue)
1086 __field(u32, reason)
1087 ),
1088
1089 TP_fast_assign(
1090 LOCAL_ASSIGN;
1091 __entry->queue = queue;
1092 __entry->reason = reason;
1093 ),
1094
1095 TP_printk(
1096 LOCAL_PR_FMT " queue:%d, reason:%d",
1097 LOCAL_PR_ARG, __entry->queue, __entry->reason
1098 )
1099);
1100
1101TRACE_EVENT(stop_queue,
1102 TP_PROTO(struct ieee80211_local *local, u16 queue,
1103 enum queue_stop_reason reason),
1104
1105 TP_ARGS(local, queue, reason),
1106
1107 TP_STRUCT__entry(
1108 LOCAL_ENTRY
1109 __field(u16, queue)
1110 __field(u32, reason)
1111 ),
1112
1113 TP_fast_assign(
1114 LOCAL_ASSIGN;
1115 __entry->queue = queue;
1116 __entry->reason = reason;
1117 ),
1118
1119 TP_printk(
1120 LOCAL_PR_FMT " queue:%d, reason:%d",
1121 LOCAL_PR_ARG, __entry->queue, __entry->reason
1122 )
1123);
Christian Lamparterf7428802009-07-19 23:21:07 +02001124#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02001125
1126#undef TRACE_INCLUDE_PATH
1127#define TRACE_INCLUDE_PATH .
1128#undef TRACE_INCLUDE_FILE
1129#define TRACE_INCLUDE_FILE driver-trace
1130#include <trace/define_trace.h>