blob: 7ea544d8643665ba07a9d952c96eca3169c9c2b2 [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
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02008#undef TRACE_SYSTEM
9#define TRACE_SYSTEM mac80211
10
11#define MAXNAME 32
12#define LOCAL_ENTRY __array(char, wiphy_name, 32)
13#define LOCAL_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
14#define LOCAL_PR_FMT "%s"
15#define LOCAL_PR_ARG __entry->wiphy_name
16
17#define STA_ENTRY __array(char, sta_addr, ETH_ALEN)
18#define STA_ASSIGN (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
19#define STA_PR_FMT " sta:%pM"
20#define STA_PR_ARG __entry->sta_addr
21
Johannes Berg2ca27bc2010-09-16 14:58:23 +020022#define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
23 __field(bool, p2p) \
Johannes Berg12375ef2009-11-25 20:30:31 +010024 __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
Johannes Berg2ca27bc2010-09-16 14:58:23 +020025#define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
26 __entry->p2p = sdata->vif.p2p; \
Johannes Berg12375ef2009-11-25 20:30:31 +010027 __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
Johannes Berg2ca27bc2010-09-16 14:58:23 +020028#define VIF_PR_FMT " vif:%s(%d%s)"
29#define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
Johannes Berg0a2b8bb2009-07-07 13:46:22 +020030
Johannes Bergb5878a22010-04-07 16:48:40 +020031/*
32 * Tracing for driver callbacks.
33 */
34
Johannes Bergba99d932011-01-26 09:22:15 +010035DECLARE_EVENT_CLASS(local_only_evt,
Johannes Berg4efc76b2010-06-10 10:56:20 +020036 TP_PROTO(struct ieee80211_local *local),
37 TP_ARGS(local),
38 TP_STRUCT__entry(
39 LOCAL_ENTRY
40 ),
41 TP_fast_assign(
42 LOCAL_ASSIGN;
43 ),
44 TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
45);
46
Luciano Coelho92ddc112011-05-09 14:40:06 +030047DECLARE_EVENT_CLASS(local_sdata_addr_evt,
48 TP_PROTO(struct ieee80211_local *local,
49 struct ieee80211_sub_if_data *sdata),
50 TP_ARGS(local, sdata),
51
52 TP_STRUCT__entry(
53 LOCAL_ENTRY
54 VIF_ENTRY
55 __array(char, addr, 6)
56 ),
57
58 TP_fast_assign(
59 LOCAL_ASSIGN;
60 VIF_ASSIGN;
61 memcpy(__entry->addr, sdata->vif.addr, 6);
62 ),
63
64 TP_printk(
65 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
66 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
67 )
68);
69
70DECLARE_EVENT_CLASS(local_u32_evt,
71 TP_PROTO(struct ieee80211_local *local, u32 value),
72 TP_ARGS(local, value),
73
74 TP_STRUCT__entry(
75 LOCAL_ENTRY
76 __field(u32, value)
77 ),
78
79 TP_fast_assign(
80 LOCAL_ASSIGN;
81 __entry->value = value;
82 ),
83
84 TP_printk(
85 LOCAL_PR_FMT " value:%d",
86 LOCAL_PR_ARG, __entry->value
87 )
88);
89
Luciano Coelho79f460c2011-05-11 17:09:36 +030090DECLARE_EVENT_CLASS(local_sdata_evt,
91 TP_PROTO(struct ieee80211_local *local,
92 struct ieee80211_sub_if_data *sdata),
93 TP_ARGS(local, sdata),
94
95 TP_STRUCT__entry(
96 LOCAL_ENTRY
97 VIF_ENTRY
98 ),
99
100 TP_fast_assign(
101 LOCAL_ASSIGN;
102 VIF_ASSIGN;
103 ),
104
105 TP_printk(
106 LOCAL_PR_FMT VIF_PR_FMT,
107 LOCAL_PR_ARG, VIF_PR_ARG
108 )
109);
110
Johannes Bergba99d932011-01-26 09:22:15 +0100111DEFINE_EVENT(local_only_evt, drv_return_void,
112 TP_PROTO(struct ieee80211_local *local),
113 TP_ARGS(local)
114);
115
Johannes Berg4efc76b2010-06-10 10:56:20 +0200116TRACE_EVENT(drv_return_int,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200117 TP_PROTO(struct ieee80211_local *local, int ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200118 TP_ARGS(local, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200119 TP_STRUCT__entry(
120 LOCAL_ENTRY
121 __field(int, ret)
122 ),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200123 TP_fast_assign(
124 LOCAL_ASSIGN;
125 __entry->ret = ret;
126 ),
Johannes Berg4efc76b2010-06-10 10:56:20 +0200127 TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
128);
129
Vivek Natarajane8306f92011-04-06 11:41:10 +0530130TRACE_EVENT(drv_return_bool,
131 TP_PROTO(struct ieee80211_local *local, bool ret),
132 TP_ARGS(local, ret),
133 TP_STRUCT__entry(
134 LOCAL_ENTRY
135 __field(bool, ret)
136 ),
137 TP_fast_assign(
138 LOCAL_ASSIGN;
139 __entry->ret = ret;
140 ),
141 TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
142 "true" : "false")
143);
144
Johannes Berg4efc76b2010-06-10 10:56:20 +0200145TRACE_EVENT(drv_return_u64,
146 TP_PROTO(struct ieee80211_local *local, u64 ret),
147 TP_ARGS(local, ret),
148 TP_STRUCT__entry(
149 LOCAL_ENTRY
150 __field(u64, ret)
151 ),
152 TP_fast_assign(
153 LOCAL_ASSIGN;
154 __entry->ret = ret;
155 ),
156 TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
157);
158
Johannes Bergba99d932011-01-26 09:22:15 +0100159DEFINE_EVENT(local_only_evt, drv_start,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200160 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100161 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200162);
163
Johannes Bergeecc4802011-05-04 15:37:29 +0200164DEFINE_EVENT(local_only_evt, drv_suspend,
165 TP_PROTO(struct ieee80211_local *local),
166 TP_ARGS(local)
167);
168
169DEFINE_EVENT(local_only_evt, drv_resume,
170 TP_PROTO(struct ieee80211_local *local),
171 TP_ARGS(local)
172);
173
Johannes Bergba99d932011-01-26 09:22:15 +0100174DEFINE_EVENT(local_only_evt, drv_stop,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200175 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100176 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200177);
178
Luciano Coelho92ddc112011-05-09 14:40:06 +0300179DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200180 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200181 struct ieee80211_sub_if_data *sdata),
Luciano Coelho92ddc112011-05-09 14:40:06 +0300182 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200183);
184
Johannes Berg34d4bc42010-08-27 12:35:58 +0200185TRACE_EVENT(drv_change_interface,
186 TP_PROTO(struct ieee80211_local *local,
187 struct ieee80211_sub_if_data *sdata,
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200188 enum nl80211_iftype type, bool p2p),
Johannes Berg34d4bc42010-08-27 12:35:58 +0200189
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200190 TP_ARGS(local, sdata, type, p2p),
Johannes Berg34d4bc42010-08-27 12:35:58 +0200191
192 TP_STRUCT__entry(
193 LOCAL_ENTRY
194 VIF_ENTRY
195 __field(u32, new_type)
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200196 __field(bool, new_p2p)
Johannes Berg34d4bc42010-08-27 12:35:58 +0200197 ),
198
199 TP_fast_assign(
200 LOCAL_ASSIGN;
201 VIF_ASSIGN;
202 __entry->new_type = type;
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200203 __entry->new_p2p = p2p;
Johannes Berg34d4bc42010-08-27 12:35:58 +0200204 ),
205
206 TP_printk(
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200207 LOCAL_PR_FMT VIF_PR_FMT " new type:%d%s",
208 LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
209 __entry->new_p2p ? "/p2p" : ""
Johannes Berg34d4bc42010-08-27 12:35:58 +0200210 )
211);
212
Luciano Coelho92ddc112011-05-09 14:40:06 +0300213DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
214 TP_PROTO(struct ieee80211_local *local,
215 struct ieee80211_sub_if_data *sdata),
216 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200217);
218
219TRACE_EVENT(drv_config,
220 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200221 u32 changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200222
Johannes Berg4efc76b2010-06-10 10:56:20 +0200223 TP_ARGS(local, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200224
225 TP_STRUCT__entry(
226 LOCAL_ENTRY
227 __field(u32, changed)
Johannes Bergf911ab82009-11-25 19:07:20 +0100228 __field(u32, flags)
229 __field(int, power_level)
230 __field(int, dynamic_ps_timeout)
231 __field(int, max_sleep_period)
232 __field(u16, listen_interval)
233 __field(u8, long_frame_max_tx_count)
234 __field(u8, short_frame_max_tx_count)
235 __field(int, center_freq)
236 __field(int, channel_type)
Johannes Berg0f782312009-12-01 13:37:02 +0100237 __field(int, smps)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200238 ),
239
240 TP_fast_assign(
241 LOCAL_ASSIGN;
242 __entry->changed = changed;
Johannes Bergf911ab82009-11-25 19:07:20 +0100243 __entry->flags = local->hw.conf.flags;
244 __entry->power_level = local->hw.conf.power_level;
245 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
246 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
247 __entry->listen_interval = local->hw.conf.listen_interval;
248 __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
249 __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
250 __entry->center_freq = local->hw.conf.channel->center_freq;
251 __entry->channel_type = local->hw.conf.channel_type;
Johannes Berg0f782312009-12-01 13:37:02 +0100252 __entry->smps = local->hw.conf.smps_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200253 ),
254
255 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200256 LOCAL_PR_FMT " ch:%#x freq:%d",
257 LOCAL_PR_ARG, __entry->changed, __entry->center_freq
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200258 )
259);
260
261TRACE_EVENT(drv_bss_info_changed,
262 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100263 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200264 struct ieee80211_bss_conf *info,
265 u32 changed),
266
Johannes Berg12375ef2009-11-25 20:30:31 +0100267 TP_ARGS(local, sdata, info, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200268
269 TP_STRUCT__entry(
270 LOCAL_ENTRY
271 VIF_ENTRY
272 __field(bool, assoc)
273 __field(u16, aid)
274 __field(bool, cts)
275 __field(bool, shortpre)
276 __field(bool, shortslot)
277 __field(u8, dtimper)
278 __field(u16, bcnint)
279 __field(u16, assoc_cap)
280 __field(u64, timestamp)
281 __field(u32, basic_rates)
282 __field(u32, changed)
Johannes Bergf911ab82009-11-25 19:07:20 +0100283 __field(bool, enable_beacon)
284 __field(u16, ht_operation_mode)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200285 ),
286
287 TP_fast_assign(
288 LOCAL_ASSIGN;
289 VIF_ASSIGN;
290 __entry->changed = changed;
291 __entry->aid = info->aid;
292 __entry->assoc = info->assoc;
293 __entry->shortpre = info->use_short_preamble;
294 __entry->cts = info->use_cts_prot;
295 __entry->shortslot = info->use_short_slot;
296 __entry->dtimper = info->dtim_period;
297 __entry->bcnint = info->beacon_int;
298 __entry->assoc_cap = info->assoc_capability;
Johannes Berge9ac0742012-03-13 14:29:30 +0100299 __entry->timestamp = info->last_tsf;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200300 __entry->basic_rates = info->basic_rates;
Johannes Bergf911ab82009-11-25 19:07:20 +0100301 __entry->enable_beacon = info->enable_beacon;
302 __entry->ht_operation_mode = info->ht_operation_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200303 ),
304
305 TP_printk(
306 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
307 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
308 )
309);
310
Johannes Berg3ac64be2009-08-17 16:16:53 +0200311TRACE_EVENT(drv_prepare_multicast,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200312 TP_PROTO(struct ieee80211_local *local, int mc_count),
Johannes Berg3ac64be2009-08-17 16:16:53 +0200313
Johannes Berg4efc76b2010-06-10 10:56:20 +0200314 TP_ARGS(local, mc_count),
Johannes Berg3ac64be2009-08-17 16:16:53 +0200315
316 TP_STRUCT__entry(
317 LOCAL_ENTRY
318 __field(int, mc_count)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200319 ),
320
321 TP_fast_assign(
322 LOCAL_ASSIGN;
323 __entry->mc_count = mc_count;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200324 ),
325
326 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200327 LOCAL_PR_FMT " prepare mc (%d)",
328 LOCAL_PR_ARG, __entry->mc_count
Johannes Berg3ac64be2009-08-17 16:16:53 +0200329 )
330);
331
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200332TRACE_EVENT(drv_configure_filter,
333 TP_PROTO(struct ieee80211_local *local,
334 unsigned int changed_flags,
335 unsigned int *total_flags,
Johannes Berg3ac64be2009-08-17 16:16:53 +0200336 u64 multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200337
Johannes Berg3ac64be2009-08-17 16:16:53 +0200338 TP_ARGS(local, changed_flags, total_flags, multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200339
340 TP_STRUCT__entry(
341 LOCAL_ENTRY
342 __field(unsigned int, changed)
343 __field(unsigned int, total)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200344 __field(u64, multicast)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200345 ),
346
347 TP_fast_assign(
348 LOCAL_ASSIGN;
349 __entry->changed = changed_flags;
350 __entry->total = *total_flags;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200351 __entry->multicast = multicast;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200352 ),
353
354 TP_printk(
Johannes Berg3ac64be2009-08-17 16:16:53 +0200355 LOCAL_PR_FMT " changed:%#x total:%#x",
356 LOCAL_PR_ARG, __entry->changed, __entry->total
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200357 )
358);
359
360TRACE_EVENT(drv_set_tim,
361 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200362 struct ieee80211_sta *sta, bool set),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200363
Johannes Berg4efc76b2010-06-10 10:56:20 +0200364 TP_ARGS(local, sta, set),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200365
366 TP_STRUCT__entry(
367 LOCAL_ENTRY
368 STA_ENTRY
369 __field(bool, set)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200370 ),
371
372 TP_fast_assign(
373 LOCAL_ASSIGN;
374 STA_ASSIGN;
375 __entry->set = set;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200376 ),
377
378 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200379 LOCAL_PR_FMT STA_PR_FMT " set:%d",
380 LOCAL_PR_ARG, STA_PR_FMT, __entry->set
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200381 )
382);
383
384TRACE_EVENT(drv_set_key,
385 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100386 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200387 struct ieee80211_sta *sta,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200388 struct ieee80211_key_conf *key),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200389
Johannes Berg4efc76b2010-06-10 10:56:20 +0200390 TP_ARGS(local, cmd, sdata, sta, key),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200391
392 TP_STRUCT__entry(
393 LOCAL_ENTRY
394 VIF_ENTRY
395 STA_ENTRY
Johannes Berg97359d12010-08-10 09:46:38 +0200396 __field(u32, cipher)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200397 __field(u8, hw_key_idx)
398 __field(u8, flags)
399 __field(s8, keyidx)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200400 ),
401
402 TP_fast_assign(
403 LOCAL_ASSIGN;
404 VIF_ASSIGN;
405 STA_ASSIGN;
Johannes Berg97359d12010-08-10 09:46:38 +0200406 __entry->cipher = key->cipher;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200407 __entry->flags = key->flags;
408 __entry->keyidx = key->keyidx;
409 __entry->hw_key_idx = key->hw_key_idx;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200410 ),
411
412 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200413 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
414 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200415 )
416);
417
418TRACE_EVENT(drv_update_tkip_key,
419 TP_PROTO(struct ieee80211_local *local,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100420 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200421 struct ieee80211_key_conf *conf,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100422 struct ieee80211_sta *sta, u32 iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200423
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100424 TP_ARGS(local, sdata, conf, sta, iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200425
426 TP_STRUCT__entry(
427 LOCAL_ENTRY
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100428 VIF_ENTRY
429 STA_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200430 __field(u32, iv32)
431 ),
432
433 TP_fast_assign(
434 LOCAL_ASSIGN;
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100435 VIF_ASSIGN;
436 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200437 __entry->iv32 = iv32;
438 ),
439
440 TP_printk(
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100441 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
442 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200443 )
444);
445
Luciano Coelho79f460c2011-05-11 17:09:36 +0300446DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200447 TP_PROTO(struct ieee80211_local *local,
Luciano Coelho79f460c2011-05-11 17:09:36 +0300448 struct ieee80211_sub_if_data *sdata),
449 TP_ARGS(local, sdata)
450);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200451
Eliad Pellerb8564392011-06-13 12:47:30 +0300452DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
453 TP_PROTO(struct ieee80211_local *local,
454 struct ieee80211_sub_if_data *sdata),
455 TP_ARGS(local, sdata)
456);
457
Luciano Coelho79f460c2011-05-11 17:09:36 +0300458DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
459 TP_PROTO(struct ieee80211_local *local,
460 struct ieee80211_sub_if_data *sdata),
461 TP_ARGS(local, sdata)
462);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200463
Luciano Coelho79f460c2011-05-11 17:09:36 +0300464DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
465 TP_PROTO(struct ieee80211_local *local,
466 struct ieee80211_sub_if_data *sdata),
467 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200468);
469
Johannes Bergba99d932011-01-26 09:22:15 +0100470DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200471 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100472 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200473);
474
Johannes Bergba99d932011-01-26 09:22:15 +0100475DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200476 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100477 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200478);
479
480TRACE_EVENT(drv_get_stats,
481 TP_PROTO(struct ieee80211_local *local,
482 struct ieee80211_low_level_stats *stats,
483 int ret),
484
485 TP_ARGS(local, stats, ret),
486
487 TP_STRUCT__entry(
488 LOCAL_ENTRY
489 __field(int, ret)
490 __field(unsigned int, ackfail)
491 __field(unsigned int, rtsfail)
492 __field(unsigned int, fcserr)
493 __field(unsigned int, rtssucc)
494 ),
495
496 TP_fast_assign(
497 LOCAL_ASSIGN;
498 __entry->ret = ret;
499 __entry->ackfail = stats->dot11ACKFailureCount;
500 __entry->rtsfail = stats->dot11RTSFailureCount;
501 __entry->fcserr = stats->dot11FCSErrorCount;
502 __entry->rtssucc = stats->dot11RTSSuccessCount;
503 ),
504
505 TP_printk(
506 LOCAL_PR_FMT " ret:%d",
507 LOCAL_PR_ARG, __entry->ret
508 )
509);
510
511TRACE_EVENT(drv_get_tkip_seq,
512 TP_PROTO(struct ieee80211_local *local,
513 u8 hw_key_idx, u32 *iv32, u16 *iv16),
514
515 TP_ARGS(local, hw_key_idx, iv32, iv16),
516
517 TP_STRUCT__entry(
518 LOCAL_ENTRY
519 __field(u8, hw_key_idx)
520 __field(u32, iv32)
521 __field(u16, iv16)
522 ),
523
524 TP_fast_assign(
525 LOCAL_ASSIGN;
526 __entry->hw_key_idx = hw_key_idx;
527 __entry->iv32 = *iv32;
528 __entry->iv16 = *iv16;
529 ),
530
531 TP_printk(
532 LOCAL_PR_FMT, LOCAL_PR_ARG
533 )
534);
535
Luciano Coelho92ddc112011-05-09 14:40:06 +0300536DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
Arik Nemtsovf23a4782010-11-08 11:51:06 +0200537 TP_PROTO(struct ieee80211_local *local, u32 value),
Luciano Coelho92ddc112011-05-09 14:40:06 +0300538 TP_ARGS(local, value)
Arik Nemtsovf23a4782010-11-08 11:51:06 +0200539);
540
Luciano Coelho92ddc112011-05-09 14:40:06 +0300541DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200542 TP_PROTO(struct ieee80211_local *local, u32 value),
Luciano Coelho92ddc112011-05-09 14:40:06 +0300543 TP_ARGS(local, value)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200544);
545
Lukáš Turek310bc672009-12-21 22:50:48 +0100546TRACE_EVENT(drv_set_coverage_class,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200547 TP_PROTO(struct ieee80211_local *local, u8 value),
Lukáš Turek310bc672009-12-21 22:50:48 +0100548
Johannes Berg4efc76b2010-06-10 10:56:20 +0200549 TP_ARGS(local, value),
Lukáš Turek310bc672009-12-21 22:50:48 +0100550
551 TP_STRUCT__entry(
552 LOCAL_ENTRY
553 __field(u8, value)
Lukáš Turek310bc672009-12-21 22:50:48 +0100554 ),
555
556 TP_fast_assign(
557 LOCAL_ASSIGN;
Lukáš Turek310bc672009-12-21 22:50:48 +0100558 __entry->value = value;
559 ),
560
561 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200562 LOCAL_PR_FMT " value:%d",
563 LOCAL_PR_ARG, __entry->value
Lukáš Turek310bc672009-12-21 22:50:48 +0100564 )
565);
566
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200567TRACE_EVENT(drv_sta_notify,
568 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100569 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200570 enum sta_notify_cmd cmd,
571 struct ieee80211_sta *sta),
572
Johannes Berg12375ef2009-11-25 20:30:31 +0100573 TP_ARGS(local, sdata, cmd, sta),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200574
575 TP_STRUCT__entry(
576 LOCAL_ENTRY
577 VIF_ENTRY
578 STA_ENTRY
579 __field(u32, cmd)
580 ),
581
582 TP_fast_assign(
583 LOCAL_ASSIGN;
584 VIF_ASSIGN;
585 STA_ASSIGN;
586 __entry->cmd = cmd;
587 ),
588
589 TP_printk(
590 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
591 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
592 )
593);
594
Johannes Bergf09603a2012-01-20 13:55:21 +0100595TRACE_EVENT(drv_sta_state,
596 TP_PROTO(struct ieee80211_local *local,
597 struct ieee80211_sub_if_data *sdata,
598 struct ieee80211_sta *sta,
599 enum ieee80211_sta_state old_state,
600 enum ieee80211_sta_state new_state),
601
602 TP_ARGS(local, sdata, sta, old_state, new_state),
603
604 TP_STRUCT__entry(
605 LOCAL_ENTRY
606 VIF_ENTRY
607 STA_ENTRY
608 __field(u32, old_state)
609 __field(u32, new_state)
610 ),
611
612 TP_fast_assign(
613 LOCAL_ASSIGN;
614 VIF_ASSIGN;
615 STA_ASSIGN;
616 __entry->old_state = old_state;
617 __entry->new_state = new_state;
618 ),
619
620 TP_printk(
621 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " state: %d->%d",
622 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
623 __entry->old_state, __entry->new_state
624 )
625);
626
Johannes Berg8f727ef2012-03-30 08:43:32 +0200627TRACE_EVENT(drv_sta_rc_update,
628 TP_PROTO(struct ieee80211_local *local,
629 struct ieee80211_sub_if_data *sdata,
630 struct ieee80211_sta *sta,
631 u32 changed),
632
633 TP_ARGS(local, sdata, sta, changed),
634
635 TP_STRUCT__entry(
636 LOCAL_ENTRY
637 VIF_ENTRY
638 STA_ENTRY
639 __field(u32, changed)
640 ),
641
642 TP_fast_assign(
643 LOCAL_ASSIGN;
644 VIF_ASSIGN;
645 STA_ASSIGN;
646 __entry->changed = changed;
647 ),
648
649 TP_printk(
650 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
651 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
652 )
653);
654
Johannes Berg34e89502010-02-03 13:59:58 +0100655TRACE_EVENT(drv_sta_add,
656 TP_PROTO(struct ieee80211_local *local,
657 struct ieee80211_sub_if_data *sdata,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200658 struct ieee80211_sta *sta),
Johannes Berg34e89502010-02-03 13:59:58 +0100659
Johannes Berg4efc76b2010-06-10 10:56:20 +0200660 TP_ARGS(local, sdata, sta),
Johannes Berg34e89502010-02-03 13:59:58 +0100661
662 TP_STRUCT__entry(
663 LOCAL_ENTRY
664 VIF_ENTRY
665 STA_ENTRY
Johannes Berg34e89502010-02-03 13:59:58 +0100666 ),
667
668 TP_fast_assign(
669 LOCAL_ASSIGN;
670 VIF_ASSIGN;
671 STA_ASSIGN;
Johannes Berg34e89502010-02-03 13:59:58 +0100672 ),
673
674 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200675 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
676 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
Johannes Berg34e89502010-02-03 13:59:58 +0100677 )
678);
679
680TRACE_EVENT(drv_sta_remove,
681 TP_PROTO(struct ieee80211_local *local,
682 struct ieee80211_sub_if_data *sdata,
683 struct ieee80211_sta *sta),
684
685 TP_ARGS(local, sdata, sta),
686
687 TP_STRUCT__entry(
688 LOCAL_ENTRY
689 VIF_ENTRY
690 STA_ENTRY
691 ),
692
693 TP_fast_assign(
694 LOCAL_ASSIGN;
695 VIF_ASSIGN;
696 STA_ASSIGN;
697 ),
698
699 TP_printk(
700 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
701 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
702 )
703);
704
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200705TRACE_EVENT(drv_conf_tx,
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300706 TP_PROTO(struct ieee80211_local *local,
707 struct ieee80211_sub_if_data *sdata,
708 u16 queue,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200709 const struct ieee80211_tx_queue_params *params),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200710
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300711 TP_ARGS(local, sdata, queue, params),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200712
713 TP_STRUCT__entry(
714 LOCAL_ENTRY
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300715 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200716 __field(u16, queue)
717 __field(u16, txop)
718 __field(u16, cw_min)
719 __field(u16, cw_max)
720 __field(u8, aifs)
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300721 __field(bool, uapsd)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200722 ),
723
724 TP_fast_assign(
725 LOCAL_ASSIGN;
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300726 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200727 __entry->queue = queue;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200728 __entry->txop = params->txop;
729 __entry->cw_max = params->cw_max;
730 __entry->cw_min = params->cw_min;
731 __entry->aifs = params->aifs;
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300732 __entry->uapsd = params->uapsd;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200733 ),
734
735 TP_printk(
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300736 LOCAL_PR_FMT VIF_PR_FMT " queue:%d",
737 LOCAL_PR_ARG, VIF_PR_ARG, __entry->queue
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200738 )
739);
740
Eliad Peller37a41b42011-09-21 14:06:11 +0300741DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
742 TP_PROTO(struct ieee80211_local *local,
743 struct ieee80211_sub_if_data *sdata),
744 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200745);
746
747TRACE_EVENT(drv_set_tsf,
Eliad Peller37a41b42011-09-21 14:06:11 +0300748 TP_PROTO(struct ieee80211_local *local,
749 struct ieee80211_sub_if_data *sdata,
750 u64 tsf),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200751
Eliad Peller37a41b42011-09-21 14:06:11 +0300752 TP_ARGS(local, sdata, tsf),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200753
754 TP_STRUCT__entry(
755 LOCAL_ENTRY
Eliad Peller37a41b42011-09-21 14:06:11 +0300756 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200757 __field(u64, tsf)
758 ),
759
760 TP_fast_assign(
761 LOCAL_ASSIGN;
Eliad Peller37a41b42011-09-21 14:06:11 +0300762 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200763 __entry->tsf = tsf;
764 ),
765
766 TP_printk(
Eliad Peller37a41b42011-09-21 14:06:11 +0300767 LOCAL_PR_FMT VIF_PR_FMT " tsf:%llu",
768 LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200769 )
770);
771
Eliad Peller37a41b42011-09-21 14:06:11 +0300772DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
773 TP_PROTO(struct ieee80211_local *local,
774 struct ieee80211_sub_if_data *sdata),
775 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200776);
777
Johannes Bergba99d932011-01-26 09:22:15 +0100778DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200779 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100780 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200781);
782
783TRACE_EVENT(drv_ampdu_action,
784 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100785 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200786 enum ieee80211_ampdu_mlme_action action,
787 struct ieee80211_sta *sta, u16 tid,
Johannes Berg0b01f032011-01-18 13:51:05 +0100788 u16 *ssn, u8 buf_size),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200789
Johannes Berg0b01f032011-01-18 13:51:05 +0100790 TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200791
792 TP_STRUCT__entry(
793 LOCAL_ENTRY
794 STA_ENTRY
795 __field(u32, action)
796 __field(u16, tid)
797 __field(u16, ssn)
Johannes Berg0b01f032011-01-18 13:51:05 +0100798 __field(u8, buf_size)
Johannes Bergc951ad32009-11-16 12:00:38 +0100799 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200800 ),
801
802 TP_fast_assign(
803 LOCAL_ASSIGN;
Johannes Bergc951ad32009-11-16 12:00:38 +0100804 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200805 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200806 __entry->action = action;
807 __entry->tid = tid;
Zhu Yi3092ad02010-01-26 15:58:57 +0800808 __entry->ssn = ssn ? *ssn : 0;
Johannes Berg0b01f032011-01-18 13:51:05 +0100809 __entry->buf_size = buf_size;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200810 ),
811
812 TP_printk(
Johannes Berg0b01f032011-01-18 13:51:05 +0100813 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
814 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
815 __entry->tid, __entry->buf_size
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200816 )
817);
Johannes Berga80f7c02009-12-23 13:15:32 +0100818
John W. Linvillec466d4e2010-06-29 14:51:23 -0400819TRACE_EVENT(drv_get_survey,
820 TP_PROTO(struct ieee80211_local *local, int idx,
821 struct survey_info *survey),
822
823 TP_ARGS(local, idx, survey),
824
825 TP_STRUCT__entry(
826 LOCAL_ENTRY
827 __field(int, idx)
828 ),
829
830 TP_fast_assign(
831 LOCAL_ASSIGN;
832 __entry->idx = idx;
833 ),
834
835 TP_printk(
836 LOCAL_PR_FMT " idx:%d",
837 LOCAL_PR_ARG, __entry->idx
838 )
839);
840
Johannes Berga80f7c02009-12-23 13:15:32 +0100841TRACE_EVENT(drv_flush,
842 TP_PROTO(struct ieee80211_local *local, bool drop),
843
844 TP_ARGS(local, drop),
845
846 TP_STRUCT__entry(
847 LOCAL_ENTRY
848 __field(bool, drop)
849 ),
850
851 TP_fast_assign(
852 LOCAL_ASSIGN;
853 __entry->drop = drop;
854 ),
855
856 TP_printk(
857 LOCAL_PR_FMT " drop:%d",
858 LOCAL_PR_ARG, __entry->drop
859 )
860);
Johannes Bergb5878a22010-04-07 16:48:40 +0200861
Johannes Berg5ce6e432010-05-11 16:20:57 +0200862TRACE_EVENT(drv_channel_switch,
863 TP_PROTO(struct ieee80211_local *local,
864 struct ieee80211_channel_switch *ch_switch),
865
866 TP_ARGS(local, ch_switch),
867
868 TP_STRUCT__entry(
869 LOCAL_ENTRY
870 __field(u64, timestamp)
871 __field(bool, block_tx)
872 __field(u16, freq)
873 __field(u8, count)
874 ),
875
876 TP_fast_assign(
877 LOCAL_ASSIGN;
878 __entry->timestamp = ch_switch->timestamp;
879 __entry->block_tx = ch_switch->block_tx;
880 __entry->freq = ch_switch->channel->center_freq;
881 __entry->count = ch_switch->count;
882 ),
883
884 TP_printk(
885 LOCAL_PR_FMT " new freq:%u count:%d",
886 LOCAL_PR_ARG, __entry->freq, __entry->count
887 )
888);
889
Bruno Randolf15d96752010-11-10 12:50:56 +0900890TRACE_EVENT(drv_set_antenna,
891 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
892
893 TP_ARGS(local, tx_ant, rx_ant, ret),
894
895 TP_STRUCT__entry(
896 LOCAL_ENTRY
897 __field(u32, tx_ant)
898 __field(u32, rx_ant)
899 __field(int, ret)
900 ),
901
902 TP_fast_assign(
903 LOCAL_ASSIGN;
904 __entry->tx_ant = tx_ant;
905 __entry->rx_ant = rx_ant;
906 __entry->ret = ret;
907 ),
908
909 TP_printk(
910 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
911 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
912 )
913);
914
915TRACE_EVENT(drv_get_antenna,
916 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
917
918 TP_ARGS(local, tx_ant, rx_ant, ret),
919
920 TP_STRUCT__entry(
921 LOCAL_ENTRY
922 __field(u32, tx_ant)
923 __field(u32, rx_ant)
924 __field(int, ret)
925 ),
926
927 TP_fast_assign(
928 LOCAL_ASSIGN;
929 __entry->tx_ant = tx_ant;
930 __entry->rx_ant = rx_ant;
931 __entry->ret = ret;
932 ),
933
934 TP_printk(
935 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
936 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
937 )
938);
939
Johannes Berg21f83582010-12-18 17:20:47 +0100940TRACE_EVENT(drv_remain_on_channel,
941 TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
942 enum nl80211_channel_type chantype, unsigned int duration),
943
944 TP_ARGS(local, chan, chantype, duration),
945
946 TP_STRUCT__entry(
947 LOCAL_ENTRY
948 __field(int, center_freq)
949 __field(int, channel_type)
950 __field(unsigned int, duration)
951 ),
952
953 TP_fast_assign(
954 LOCAL_ASSIGN;
955 __entry->center_freq = chan->center_freq;
956 __entry->channel_type = chantype;
957 __entry->duration = duration;
958 ),
959
960 TP_printk(
961 LOCAL_PR_FMT " freq:%dMHz duration:%dms",
962 LOCAL_PR_ARG, __entry->center_freq, __entry->duration
963 )
964);
965
Johannes Bergba99d932011-01-26 09:22:15 +0100966DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
Johannes Berg21f83582010-12-18 17:20:47 +0100967 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100968 TP_ARGS(local)
Johannes Berg21f83582010-12-18 17:20:47 +0100969);
970
Johannes Berg5f16a432011-02-25 15:36:57 +0100971TRACE_EVENT(drv_offchannel_tx,
972 TP_PROTO(struct ieee80211_local *local, struct sk_buff *skb,
973 struct ieee80211_channel *chan,
974 enum nl80211_channel_type channel_type,
975 unsigned int wait),
976
977 TP_ARGS(local, skb, chan, channel_type, wait),
978
979 TP_STRUCT__entry(
980 LOCAL_ENTRY
981 __field(int, center_freq)
982 __field(int, channel_type)
983 __field(unsigned int, wait)
984 ),
985
986 TP_fast_assign(
987 LOCAL_ASSIGN;
988 __entry->center_freq = chan->center_freq;
989 __entry->channel_type = channel_type;
990 __entry->wait = wait;
991 ),
992
993 TP_printk(
994 LOCAL_PR_FMT " freq:%dMHz, wait:%dms",
995 LOCAL_PR_ARG, __entry->center_freq, __entry->wait
996 )
997);
998
John W. Linville38c09152011-03-07 16:19:18 -0500999TRACE_EVENT(drv_set_ringparam,
1000 TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
1001
1002 TP_ARGS(local, tx, rx),
1003
1004 TP_STRUCT__entry(
1005 LOCAL_ENTRY
1006 __field(u32, tx)
1007 __field(u32, rx)
1008 ),
1009
1010 TP_fast_assign(
1011 LOCAL_ASSIGN;
1012 __entry->tx = tx;
1013 __entry->rx = rx;
1014 ),
1015
1016 TP_printk(
1017 LOCAL_PR_FMT " tx:%d rx %d",
1018 LOCAL_PR_ARG, __entry->tx, __entry->rx
1019 )
1020);
1021
1022TRACE_EVENT(drv_get_ringparam,
1023 TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1024 u32 *rx, u32 *rx_max),
1025
1026 TP_ARGS(local, tx, tx_max, rx, rx_max),
1027
1028 TP_STRUCT__entry(
1029 LOCAL_ENTRY
1030 __field(u32, tx)
1031 __field(u32, tx_max)
1032 __field(u32, rx)
1033 __field(u32, rx_max)
1034 ),
1035
1036 TP_fast_assign(
1037 LOCAL_ASSIGN;
1038 __entry->tx = *tx;
1039 __entry->tx_max = *tx_max;
1040 __entry->rx = *rx;
1041 __entry->rx_max = *rx_max;
1042 ),
1043
1044 TP_printk(
1045 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1046 LOCAL_PR_ARG,
1047 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1048 )
1049);
1050
Vivek Natarajane8306f92011-04-06 11:41:10 +05301051DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1052 TP_PROTO(struct ieee80211_local *local),
1053 TP_ARGS(local)
1054);
1055
Johannes Berg5f16a432011-02-25 15:36:57 +01001056DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1057 TP_PROTO(struct ieee80211_local *local),
1058 TP_ARGS(local)
1059);
1060
Sujith Manoharanbdbfd6b2011-04-27 16:56:51 +05301061TRACE_EVENT(drv_set_bitrate_mask,
1062 TP_PROTO(struct ieee80211_local *local,
1063 struct ieee80211_sub_if_data *sdata,
1064 const struct cfg80211_bitrate_mask *mask),
1065
1066 TP_ARGS(local, sdata, mask),
1067
1068 TP_STRUCT__entry(
1069 LOCAL_ENTRY
1070 VIF_ENTRY
1071 __field(u32, legacy_2g)
1072 __field(u32, legacy_5g)
1073 ),
1074
1075 TP_fast_assign(
1076 LOCAL_ASSIGN;
1077 VIF_ASSIGN;
1078 __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
1079 __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
1080 ),
1081
1082 TP_printk(
1083 LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1084 LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1085 )
1086);
1087
Johannes Bergc68f4b82011-07-05 16:35:41 +02001088TRACE_EVENT(drv_set_rekey_data,
1089 TP_PROTO(struct ieee80211_local *local,
1090 struct ieee80211_sub_if_data *sdata,
1091 struct cfg80211_gtk_rekey_data *data),
1092
1093 TP_ARGS(local, sdata, data),
1094
1095 TP_STRUCT__entry(
1096 LOCAL_ENTRY
1097 VIF_ENTRY
1098 __array(u8, kek, NL80211_KEK_LEN)
1099 __array(u8, kck, NL80211_KCK_LEN)
1100 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1101 ),
1102
1103 TP_fast_assign(
1104 LOCAL_ASSIGN;
1105 VIF_ASSIGN;
1106 memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1107 memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1108 memcpy(__entry->replay_ctr, data->replay_ctr,
1109 NL80211_REPLAY_CTR_LEN);
1110 ),
1111
1112 TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1113 LOCAL_PR_ARG, VIF_PR_ARG)
1114);
1115
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001116TRACE_EVENT(drv_rssi_callback,
1117 TP_PROTO(struct ieee80211_local *local,
1118 enum ieee80211_rssi_event rssi_event),
1119
1120 TP_ARGS(local, rssi_event),
1121
1122 TP_STRUCT__entry(
1123 LOCAL_ENTRY
1124 __field(u32, rssi_event)
1125 ),
1126
1127 TP_fast_assign(
1128 LOCAL_ASSIGN;
1129 __entry->rssi_event = rssi_event;
1130 ),
1131
1132 TP_printk(
1133 LOCAL_PR_FMT " rssi_event:%d",
1134 LOCAL_PR_ARG, __entry->rssi_event
1135 )
1136);
1137
Johannes Berg40b96402011-09-29 16:04:38 +02001138DECLARE_EVENT_CLASS(release_evt,
Johannes Berg4049e092011-09-29 16:04:32 +02001139 TP_PROTO(struct ieee80211_local *local,
1140 struct ieee80211_sta *sta,
1141 u16 tids, int num_frames,
1142 enum ieee80211_frame_release_type reason,
1143 bool more_data),
1144
1145 TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1146
1147 TP_STRUCT__entry(
1148 LOCAL_ENTRY
1149 STA_ENTRY
1150 __field(u16, tids)
1151 __field(int, num_frames)
1152 __field(int, reason)
1153 __field(bool, more_data)
1154 ),
1155
1156 TP_fast_assign(
1157 LOCAL_ASSIGN;
1158 STA_ASSIGN;
1159 __entry->tids = tids;
1160 __entry->num_frames = num_frames;
1161 __entry->reason = reason;
1162 __entry->more_data = more_data;
1163 ),
1164
1165 TP_printk(
1166 LOCAL_PR_FMT STA_PR_FMT
1167 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1168 LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1169 __entry->reason, __entry->more_data
1170 )
1171);
1172
Johannes Berg40b96402011-09-29 16:04:38 +02001173DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1174 TP_PROTO(struct ieee80211_local *local,
1175 struct ieee80211_sta *sta,
1176 u16 tids, int num_frames,
1177 enum ieee80211_frame_release_type reason,
1178 bool more_data),
1179
1180 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1181);
1182
1183DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1184 TP_PROTO(struct ieee80211_local *local,
1185 struct ieee80211_sta *sta,
1186 u16 tids, int num_frames,
1187 enum ieee80211_frame_release_type reason,
1188 bool more_data),
1189
1190 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1191);
1192
Johannes Bergb5878a22010-04-07 16:48:40 +02001193/*
1194 * Tracing for API calls that drivers call.
1195 */
1196
1197TRACE_EVENT(api_start_tx_ba_session,
1198 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1199
1200 TP_ARGS(sta, tid),
1201
1202 TP_STRUCT__entry(
1203 STA_ENTRY
1204 __field(u16, tid)
1205 ),
1206
1207 TP_fast_assign(
1208 STA_ASSIGN;
1209 __entry->tid = tid;
1210 ),
1211
1212 TP_printk(
1213 STA_PR_FMT " tid:%d",
1214 STA_PR_ARG, __entry->tid
1215 )
1216);
1217
1218TRACE_EVENT(api_start_tx_ba_cb,
1219 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1220
1221 TP_ARGS(sdata, ra, tid),
1222
1223 TP_STRUCT__entry(
1224 VIF_ENTRY
1225 __array(u8, ra, ETH_ALEN)
1226 __field(u16, tid)
1227 ),
1228
1229 TP_fast_assign(
1230 VIF_ASSIGN;
1231 memcpy(__entry->ra, ra, ETH_ALEN);
1232 __entry->tid = tid;
1233 ),
1234
1235 TP_printk(
1236 VIF_PR_FMT " ra:%pM tid:%d",
1237 VIF_PR_ARG, __entry->ra, __entry->tid
1238 )
1239);
1240
1241TRACE_EVENT(api_stop_tx_ba_session,
Johannes Berg6a8579d2010-05-27 14:41:07 +02001242 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
Johannes Bergb5878a22010-04-07 16:48:40 +02001243
Johannes Berg6a8579d2010-05-27 14:41:07 +02001244 TP_ARGS(sta, tid),
Johannes Bergb5878a22010-04-07 16:48:40 +02001245
1246 TP_STRUCT__entry(
1247 STA_ENTRY
1248 __field(u16, tid)
Johannes Bergb5878a22010-04-07 16:48:40 +02001249 ),
1250
1251 TP_fast_assign(
1252 STA_ASSIGN;
1253 __entry->tid = tid;
Johannes Bergb5878a22010-04-07 16:48:40 +02001254 ),
1255
1256 TP_printk(
Johannes Berg6a8579d2010-05-27 14:41:07 +02001257 STA_PR_FMT " tid:%d",
1258 STA_PR_ARG, __entry->tid
Johannes Bergb5878a22010-04-07 16:48:40 +02001259 )
1260);
1261
1262TRACE_EVENT(api_stop_tx_ba_cb,
1263 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1264
1265 TP_ARGS(sdata, ra, tid),
1266
1267 TP_STRUCT__entry(
1268 VIF_ENTRY
1269 __array(u8, ra, ETH_ALEN)
1270 __field(u16, tid)
1271 ),
1272
1273 TP_fast_assign(
1274 VIF_ASSIGN;
1275 memcpy(__entry->ra, ra, ETH_ALEN);
1276 __entry->tid = tid;
1277 ),
1278
1279 TP_printk(
1280 VIF_PR_FMT " ra:%pM tid:%d",
1281 VIF_PR_ARG, __entry->ra, __entry->tid
1282 )
1283);
1284
Johannes Bergba99d932011-01-26 09:22:15 +01001285DEFINE_EVENT(local_only_evt, api_restart_hw,
Johannes Bergb5878a22010-04-07 16:48:40 +02001286 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001287 TP_ARGS(local)
Johannes Bergb5878a22010-04-07 16:48:40 +02001288);
1289
1290TRACE_EVENT(api_beacon_loss,
1291 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1292
1293 TP_ARGS(sdata),
1294
1295 TP_STRUCT__entry(
1296 VIF_ENTRY
1297 ),
1298
1299 TP_fast_assign(
1300 VIF_ASSIGN;
1301 ),
1302
1303 TP_printk(
1304 VIF_PR_FMT,
1305 VIF_PR_ARG
1306 )
1307);
1308
1309TRACE_EVENT(api_connection_loss,
1310 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1311
1312 TP_ARGS(sdata),
1313
1314 TP_STRUCT__entry(
1315 VIF_ENTRY
1316 ),
1317
1318 TP_fast_assign(
1319 VIF_ASSIGN;
1320 ),
1321
1322 TP_printk(
1323 VIF_PR_FMT,
1324 VIF_PR_ARG
1325 )
1326);
1327
1328TRACE_EVENT(api_cqm_rssi_notify,
1329 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1330 enum nl80211_cqm_rssi_threshold_event rssi_event),
1331
1332 TP_ARGS(sdata, rssi_event),
1333
1334 TP_STRUCT__entry(
1335 VIF_ENTRY
1336 __field(u32, rssi_event)
1337 ),
1338
1339 TP_fast_assign(
1340 VIF_ASSIGN;
1341 __entry->rssi_event = rssi_event;
1342 ),
1343
1344 TP_printk(
1345 VIF_PR_FMT " event:%d",
1346 VIF_PR_ARG, __entry->rssi_event
1347 )
1348);
1349
1350TRACE_EVENT(api_scan_completed,
1351 TP_PROTO(struct ieee80211_local *local, bool aborted),
1352
1353 TP_ARGS(local, aborted),
1354
1355 TP_STRUCT__entry(
1356 LOCAL_ENTRY
1357 __field(bool, aborted)
1358 ),
1359
1360 TP_fast_assign(
1361 LOCAL_ASSIGN;
1362 __entry->aborted = aborted;
1363 ),
1364
1365 TP_printk(
1366 LOCAL_PR_FMT " aborted:%d",
1367 LOCAL_PR_ARG, __entry->aborted
1368 )
1369);
1370
Luciano Coelho79f460c2011-05-11 17:09:36 +03001371TRACE_EVENT(api_sched_scan_results,
1372 TP_PROTO(struct ieee80211_local *local),
1373
1374 TP_ARGS(local),
1375
1376 TP_STRUCT__entry(
1377 LOCAL_ENTRY
1378 ),
1379
1380 TP_fast_assign(
1381 LOCAL_ASSIGN;
1382 ),
1383
1384 TP_printk(
1385 LOCAL_PR_FMT, LOCAL_PR_ARG
1386 )
1387);
1388
1389TRACE_EVENT(api_sched_scan_stopped,
1390 TP_PROTO(struct ieee80211_local *local),
1391
1392 TP_ARGS(local),
1393
1394 TP_STRUCT__entry(
1395 LOCAL_ENTRY
1396 ),
1397
1398 TP_fast_assign(
1399 LOCAL_ASSIGN;
1400 ),
1401
1402 TP_printk(
1403 LOCAL_PR_FMT, LOCAL_PR_ARG
1404 )
1405);
1406
Johannes Bergb5878a22010-04-07 16:48:40 +02001407TRACE_EVENT(api_sta_block_awake,
1408 TP_PROTO(struct ieee80211_local *local,
1409 struct ieee80211_sta *sta, bool block),
1410
1411 TP_ARGS(local, sta, block),
1412
1413 TP_STRUCT__entry(
1414 LOCAL_ENTRY
1415 STA_ENTRY
1416 __field(bool, block)
1417 ),
1418
1419 TP_fast_assign(
1420 LOCAL_ASSIGN;
1421 STA_ASSIGN;
1422 __entry->block = block;
1423 ),
1424
1425 TP_printk(
1426 LOCAL_PR_FMT STA_PR_FMT " block:%d",
1427 LOCAL_PR_ARG, STA_PR_FMT, __entry->block
1428 )
1429);
1430
Johannes Berg5ce6e432010-05-11 16:20:57 +02001431TRACE_EVENT(api_chswitch_done,
1432 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1433
1434 TP_ARGS(sdata, success),
1435
1436 TP_STRUCT__entry(
1437 VIF_ENTRY
1438 __field(bool, success)
1439 ),
1440
1441 TP_fast_assign(
1442 VIF_ASSIGN;
1443 __entry->success = success;
1444 ),
1445
1446 TP_printk(
1447 VIF_PR_FMT " success=%d",
1448 VIF_PR_ARG, __entry->success
1449 )
1450);
1451
Johannes Bergba99d932011-01-26 09:22:15 +01001452DEFINE_EVENT(local_only_evt, api_ready_on_channel,
Johannes Berg21f83582010-12-18 17:20:47 +01001453 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001454 TP_ARGS(local)
Johannes Berg21f83582010-12-18 17:20:47 +01001455);
1456
Johannes Bergba99d932011-01-26 09:22:15 +01001457DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
Johannes Berg21f83582010-12-18 17:20:47 +01001458 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001459 TP_ARGS(local)
Johannes Berg21f83582010-12-18 17:20:47 +01001460);
1461
Johannes Bergc68f4b82011-07-05 16:35:41 +02001462TRACE_EVENT(api_gtk_rekey_notify,
1463 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1464 const u8 *bssid, const u8 *replay_ctr),
1465
1466 TP_ARGS(sdata, bssid, replay_ctr),
1467
1468 TP_STRUCT__entry(
1469 VIF_ENTRY
1470 __array(u8, bssid, ETH_ALEN)
1471 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1472 ),
1473
1474 TP_fast_assign(
1475 VIF_ASSIGN;
1476 memcpy(__entry->bssid, bssid, ETH_ALEN);
1477 memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
1478 ),
1479
1480 TP_printk(VIF_PR_FMT, VIF_PR_ARG)
1481);
1482
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001483TRACE_EVENT(api_enable_rssi_reports,
1484 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1485 int rssi_min_thold, int rssi_max_thold),
1486
1487 TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
1488
1489 TP_STRUCT__entry(
1490 VIF_ENTRY
1491 __field(int, rssi_min_thold)
1492 __field(int, rssi_max_thold)
1493 ),
1494
1495 TP_fast_assign(
1496 VIF_ASSIGN;
1497 __entry->rssi_min_thold = rssi_min_thold;
1498 __entry->rssi_max_thold = rssi_max_thold;
1499 ),
1500
1501 TP_printk(
1502 VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
1503 VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
1504 )
1505);
1506
Johannes Berg37fbd902011-09-29 16:04:39 +02001507TRACE_EVENT(api_eosp,
1508 TP_PROTO(struct ieee80211_local *local,
1509 struct ieee80211_sta *sta),
1510
1511 TP_ARGS(local, sta),
1512
1513 TP_STRUCT__entry(
1514 LOCAL_ENTRY
1515 STA_ENTRY
1516 ),
1517
1518 TP_fast_assign(
1519 LOCAL_ASSIGN;
1520 STA_ASSIGN;
1521 ),
1522
1523 TP_printk(
1524 LOCAL_PR_FMT STA_PR_FMT,
1525 LOCAL_PR_ARG, STA_PR_FMT
1526 )
1527);
1528
Johannes Bergb5878a22010-04-07 16:48:40 +02001529/*
1530 * Tracing for internal functions
1531 * (which may also be called in response to driver calls)
1532 */
1533
1534TRACE_EVENT(wake_queue,
1535 TP_PROTO(struct ieee80211_local *local, u16 queue,
1536 enum queue_stop_reason reason),
1537
1538 TP_ARGS(local, queue, reason),
1539
1540 TP_STRUCT__entry(
1541 LOCAL_ENTRY
1542 __field(u16, queue)
1543 __field(u32, reason)
1544 ),
1545
1546 TP_fast_assign(
1547 LOCAL_ASSIGN;
1548 __entry->queue = queue;
1549 __entry->reason = reason;
1550 ),
1551
1552 TP_printk(
1553 LOCAL_PR_FMT " queue:%d, reason:%d",
1554 LOCAL_PR_ARG, __entry->queue, __entry->reason
1555 )
1556);
1557
1558TRACE_EVENT(stop_queue,
1559 TP_PROTO(struct ieee80211_local *local, u16 queue,
1560 enum queue_stop_reason reason),
1561
1562 TP_ARGS(local, queue, reason),
1563
1564 TP_STRUCT__entry(
1565 LOCAL_ENTRY
1566 __field(u16, queue)
1567 __field(u32, reason)
1568 ),
1569
1570 TP_fast_assign(
1571 LOCAL_ASSIGN;
1572 __entry->queue = queue;
1573 __entry->reason = reason;
1574 ),
1575
1576 TP_printk(
1577 LOCAL_PR_FMT " queue:%d, reason:%d",
1578 LOCAL_PR_ARG, __entry->queue, __entry->reason
1579 )
1580);
Christian Lamparterf7428802009-07-19 23:21:07 +02001581#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02001582
1583#undef TRACE_INCLUDE_PATH
1584#define TRACE_INCLUDE_PATH .
1585#undef TRACE_INCLUDE_FILE
1586#define TRACE_INCLUDE_FILE driver-trace
1587#include <trace/define_trace.h>