blob: 8db560190ca65e5581095058d45d2eef41eb430a [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 Bergf142c6b2012-06-18 20:07:15 +020027 __assign_str(vif_name, sdata->dev ? sdata->dev->name : sdata->name)
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
Karl Beldan675a0b02013-03-25 16:26:57 +010031#define CHANDEF_ENTRY __field(u32, control_freq) \
32 __field(u32, chan_width) \
33 __field(u32, center_freq1) \
Johannes Berg5a32aff2012-12-21 12:36:33 +010034 __field(u32, center_freq2)
Karl Beldan675a0b02013-03-25 16:26:57 +010035#define CHANDEF_ASSIGN(c) \
36 __entry->control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
37 __entry->chan_width = (c)->width; \
38 __entry->center_freq1 = (c)->center_freq1; \
Johannes Berg757af6f2013-02-08 21:29:59 +010039 __entry->center_freq2 = (c)->center_freq2;
Johannes Berg5a32aff2012-12-21 12:36:33 +010040#define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
Karl Beldan675a0b02013-03-25 16:26:57 +010041#define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \
Johannes Berg5a32aff2012-12-21 12:36:33 +010042 __entry->center_freq1, __entry->center_freq2
43
Eliad Peller21f659b2013-11-11 20:14:01 +020044#define MIN_CHANDEF_ENTRY \
45 __field(u32, min_control_freq) \
46 __field(u32, min_chan_width) \
47 __field(u32, min_center_freq1) \
48 __field(u32, min_center_freq2)
49
50#define MIN_CHANDEF_ASSIGN(c) \
51 __entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
52 __entry->min_chan_width = (c)->width; \
53 __entry->min_center_freq1 = (c)->center_freq1; \
54 __entry->min_center_freq2 = (c)->center_freq2;
55#define MIN_CHANDEF_PR_FMT " min_control:%d MHz min_width:%d min_center: %d/%d MHz"
56#define MIN_CHANDEF_PR_ARG __entry->min_control_freq, __entry->min_chan_width, \
57 __entry->min_center_freq1, __entry->min_center_freq2
58
Karl Beldan675a0b02013-03-25 16:26:57 +010059#define CHANCTX_ENTRY CHANDEF_ENTRY \
Eliad Peller21f659b2013-11-11 20:14:01 +020060 MIN_CHANDEF_ENTRY \
Karl Beldan675a0b02013-03-25 16:26:57 +010061 __field(u8, rx_chains_static) \
Johannes Berg04ecd252012-09-11 14:34:12 +020062 __field(u8, rx_chains_dynamic)
Karl Beldan675a0b02013-03-25 16:26:57 +010063#define CHANCTX_ASSIGN CHANDEF_ASSIGN(&ctx->conf.def) \
Eliad Peller21f659b2013-11-11 20:14:01 +020064 MIN_CHANDEF_ASSIGN(&ctx->conf.min_def) \
Karl Beldan675a0b02013-03-25 16:26:57 +010065 __entry->rx_chains_static = ctx->conf.rx_chains_static; \
Johannes Berg04ecd252012-09-11 14:34:12 +020066 __entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
Eliad Peller21f659b2013-11-11 20:14:01 +020067#define CHANCTX_PR_FMT CHANDEF_PR_FMT MIN_CHANDEF_PR_FMT " chains:%d/%d"
68#define CHANCTX_PR_ARG CHANDEF_PR_ARG, MIN_CHANDEF_PR_ARG, \
Johannes Berg04ecd252012-09-11 14:34:12 +020069 __entry->rx_chains_static, __entry->rx_chains_dynamic
Michal Kaziorc3645ea2012-06-26 14:37:17 +020070
71
72
Johannes Bergb5878a22010-04-07 16:48:40 +020073/*
74 * Tracing for driver callbacks.
75 */
76
Johannes Bergba99d932011-01-26 09:22:15 +010077DECLARE_EVENT_CLASS(local_only_evt,
Johannes Berg4efc76b2010-06-10 10:56:20 +020078 TP_PROTO(struct ieee80211_local *local),
79 TP_ARGS(local),
80 TP_STRUCT__entry(
81 LOCAL_ENTRY
82 ),
83 TP_fast_assign(
84 LOCAL_ASSIGN;
85 ),
86 TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
87);
88
Luciano Coelho92ddc112011-05-09 14:40:06 +030089DECLARE_EVENT_CLASS(local_sdata_addr_evt,
90 TP_PROTO(struct ieee80211_local *local,
91 struct ieee80211_sub_if_data *sdata),
92 TP_ARGS(local, sdata),
93
94 TP_STRUCT__entry(
95 LOCAL_ENTRY
96 VIF_ENTRY
97 __array(char, addr, 6)
98 ),
99
100 TP_fast_assign(
101 LOCAL_ASSIGN;
102 VIF_ASSIGN;
103 memcpy(__entry->addr, sdata->vif.addr, 6);
104 ),
105
106 TP_printk(
107 LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
108 LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
109 )
110);
111
112DECLARE_EVENT_CLASS(local_u32_evt,
113 TP_PROTO(struct ieee80211_local *local, u32 value),
114 TP_ARGS(local, value),
115
116 TP_STRUCT__entry(
117 LOCAL_ENTRY
118 __field(u32, value)
119 ),
120
121 TP_fast_assign(
122 LOCAL_ASSIGN;
123 __entry->value = value;
124 ),
125
126 TP_printk(
127 LOCAL_PR_FMT " value:%d",
128 LOCAL_PR_ARG, __entry->value
129 )
130);
131
Luciano Coelho79f460c2011-05-11 17:09:36 +0300132DECLARE_EVENT_CLASS(local_sdata_evt,
133 TP_PROTO(struct ieee80211_local *local,
134 struct ieee80211_sub_if_data *sdata),
135 TP_ARGS(local, sdata),
136
137 TP_STRUCT__entry(
138 LOCAL_ENTRY
139 VIF_ENTRY
140 ),
141
142 TP_fast_assign(
143 LOCAL_ASSIGN;
144 VIF_ASSIGN;
145 ),
146
147 TP_printk(
148 LOCAL_PR_FMT VIF_PR_FMT,
149 LOCAL_PR_ARG, VIF_PR_ARG
150 )
151);
152
Johannes Bergba99d932011-01-26 09:22:15 +0100153DEFINE_EVENT(local_only_evt, drv_return_void,
154 TP_PROTO(struct ieee80211_local *local),
155 TP_ARGS(local)
156);
157
Johannes Berg4efc76b2010-06-10 10:56:20 +0200158TRACE_EVENT(drv_return_int,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200159 TP_PROTO(struct ieee80211_local *local, int ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200160 TP_ARGS(local, ret),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200161 TP_STRUCT__entry(
162 LOCAL_ENTRY
163 __field(int, ret)
164 ),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200165 TP_fast_assign(
166 LOCAL_ASSIGN;
167 __entry->ret = ret;
168 ),
Johannes Berg4efc76b2010-06-10 10:56:20 +0200169 TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
170);
171
Vivek Natarajane8306f92011-04-06 11:41:10 +0530172TRACE_EVENT(drv_return_bool,
173 TP_PROTO(struct ieee80211_local *local, bool ret),
174 TP_ARGS(local, ret),
175 TP_STRUCT__entry(
176 LOCAL_ENTRY
177 __field(bool, ret)
178 ),
179 TP_fast_assign(
180 LOCAL_ASSIGN;
181 __entry->ret = ret;
182 ),
183 TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
184 "true" : "false")
185);
186
Johannes Berg4efc76b2010-06-10 10:56:20 +0200187TRACE_EVENT(drv_return_u64,
188 TP_PROTO(struct ieee80211_local *local, u64 ret),
189 TP_ARGS(local, ret),
190 TP_STRUCT__entry(
191 LOCAL_ENTRY
192 __field(u64, ret)
193 ),
194 TP_fast_assign(
195 LOCAL_ASSIGN;
196 __entry->ret = ret;
197 ),
198 TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
199);
200
Johannes Bergba99d932011-01-26 09:22:15 +0100201DEFINE_EVENT(local_only_evt, drv_start,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200202 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100203 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200204);
205
Ben Greeare3521142012-04-23 12:50:31 -0700206DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
207 TP_PROTO(struct ieee80211_local *local, u32 sset),
208 TP_ARGS(local, sset)
209);
210
211DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
212 TP_PROTO(struct ieee80211_local *local, u32 sset),
213 TP_ARGS(local, sset)
214);
215
216DEFINE_EVENT(local_only_evt, drv_get_et_stats,
217 TP_PROTO(struct ieee80211_local *local),
218 TP_ARGS(local)
219);
220
Johannes Bergeecc4802011-05-04 15:37:29 +0200221DEFINE_EVENT(local_only_evt, drv_suspend,
222 TP_PROTO(struct ieee80211_local *local),
223 TP_ARGS(local)
224);
225
226DEFINE_EVENT(local_only_evt, drv_resume,
227 TP_PROTO(struct ieee80211_local *local),
228 TP_ARGS(local)
229);
230
Johannes Berg6d525632012-04-04 15:05:25 +0200231TRACE_EVENT(drv_set_wakeup,
232 TP_PROTO(struct ieee80211_local *local, bool enabled),
233 TP_ARGS(local, enabled),
234 TP_STRUCT__entry(
235 LOCAL_ENTRY
236 __field(bool, enabled)
237 ),
238 TP_fast_assign(
239 LOCAL_ASSIGN;
240 __entry->enabled = enabled;
241 ),
242 TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
243);
244
Johannes Bergba99d932011-01-26 09:22:15 +0100245DEFINE_EVENT(local_only_evt, drv_stop,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200246 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100247 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200248);
249
Luciano Coelho92ddc112011-05-09 14:40:06 +0300250DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200251 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200252 struct ieee80211_sub_if_data *sdata),
Luciano Coelho92ddc112011-05-09 14:40:06 +0300253 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200254);
255
Johannes Berg34d4bc42010-08-27 12:35:58 +0200256TRACE_EVENT(drv_change_interface,
257 TP_PROTO(struct ieee80211_local *local,
258 struct ieee80211_sub_if_data *sdata,
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200259 enum nl80211_iftype type, bool p2p),
Johannes Berg34d4bc42010-08-27 12:35:58 +0200260
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200261 TP_ARGS(local, sdata, type, p2p),
Johannes Berg34d4bc42010-08-27 12:35:58 +0200262
263 TP_STRUCT__entry(
264 LOCAL_ENTRY
265 VIF_ENTRY
266 __field(u32, new_type)
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200267 __field(bool, new_p2p)
Johannes Berg34d4bc42010-08-27 12:35:58 +0200268 ),
269
270 TP_fast_assign(
271 LOCAL_ASSIGN;
272 VIF_ASSIGN;
273 __entry->new_type = type;
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200274 __entry->new_p2p = p2p;
Johannes Berg34d4bc42010-08-27 12:35:58 +0200275 ),
276
277 TP_printk(
Johannes Berg2ca27bc2010-09-16 14:58:23 +0200278 LOCAL_PR_FMT VIF_PR_FMT " new type:%d%s",
279 LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
280 __entry->new_p2p ? "/p2p" : ""
Johannes Berg34d4bc42010-08-27 12:35:58 +0200281 )
282);
283
Luciano Coelho92ddc112011-05-09 14:40:06 +0300284DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
285 TP_PROTO(struct ieee80211_local *local,
286 struct ieee80211_sub_if_data *sdata),
287 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200288);
289
290TRACE_EVENT(drv_config,
291 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200292 u32 changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200293
Johannes Berg4efc76b2010-06-10 10:56:20 +0200294 TP_ARGS(local, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200295
296 TP_STRUCT__entry(
297 LOCAL_ENTRY
298 __field(u32, changed)
Johannes Bergf911ab82009-11-25 19:07:20 +0100299 __field(u32, flags)
300 __field(int, power_level)
301 __field(int, dynamic_ps_timeout)
302 __field(int, max_sleep_period)
303 __field(u16, listen_interval)
304 __field(u8, long_frame_max_tx_count)
305 __field(u8, short_frame_max_tx_count)
Karl Beldan675a0b02013-03-25 16:26:57 +0100306 CHANDEF_ENTRY
Johannes Berg0f782312009-12-01 13:37:02 +0100307 __field(int, smps)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200308 ),
309
310 TP_fast_assign(
311 LOCAL_ASSIGN;
312 __entry->changed = changed;
Johannes Bergf911ab82009-11-25 19:07:20 +0100313 __entry->flags = local->hw.conf.flags;
314 __entry->power_level = local->hw.conf.power_level;
315 __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
316 __entry->max_sleep_period = local->hw.conf.max_sleep_period;
317 __entry->listen_interval = local->hw.conf.listen_interval;
Johannes Berg3d01be72012-07-26 14:27:39 +0200318 __entry->long_frame_max_tx_count =
319 local->hw.conf.long_frame_max_tx_count;
320 __entry->short_frame_max_tx_count =
321 local->hw.conf.short_frame_max_tx_count;
Karl Beldan675a0b02013-03-25 16:26:57 +0100322 CHANDEF_ASSIGN(&local->hw.conf.chandef)
Johannes Berg0f782312009-12-01 13:37:02 +0100323 __entry->smps = local->hw.conf.smps_mode;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200324 ),
325
326 TP_printk(
Karl Beldan675a0b02013-03-25 16:26:57 +0100327 LOCAL_PR_FMT " ch:%#x" CHANDEF_PR_FMT,
328 LOCAL_PR_ARG, __entry->changed, CHANDEF_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200329 )
330);
331
332TRACE_EVENT(drv_bss_info_changed,
333 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100334 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200335 struct ieee80211_bss_conf *info,
336 u32 changed),
337
Johannes Berg12375ef2009-11-25 20:30:31 +0100338 TP_ARGS(local, sdata, info, changed),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200339
340 TP_STRUCT__entry(
341 LOCAL_ENTRY
342 VIF_ENTRY
Johannes Berg1724ffb2012-10-24 11:38:30 +0200343 __field(u32, changed)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200344 __field(bool, assoc)
Johannes Berg1724ffb2012-10-24 11:38:30 +0200345 __field(bool, ibss_joined)
346 __field(bool, ibss_creator)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200347 __field(u16, aid)
348 __field(bool, cts)
349 __field(bool, shortpre)
350 __field(bool, shortslot)
Johannes Berg1724ffb2012-10-24 11:38:30 +0200351 __field(bool, enable_beacon)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200352 __field(u8, dtimper)
353 __field(u16, bcnint)
354 __field(u16, assoc_cap)
Johannes Berg8c358bc2012-05-22 22:13:05 +0200355 __field(u64, sync_tsf)
356 __field(u32, sync_device_ts)
Johannes Bergef429da2013-02-05 17:48:40 +0100357 __field(u8, sync_dtim_count)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200358 __field(u32, basic_rates)
Johannes Berg1724ffb2012-10-24 11:38:30 +0200359 __array(int, mcast_rate, IEEE80211_NUM_BANDS)
Johannes Bergf911ab82009-11-25 19:07:20 +0100360 __field(u16, ht_operation_mode)
Johannes Berg1724ffb2012-10-24 11:38:30 +0200361 __field(s32, cqm_rssi_thold);
362 __field(s32, cqm_rssi_hyst);
Johannes Berg4bf88532012-11-09 11:39:59 +0100363 __field(u32, channel_width);
364 __field(u32, channel_cfreq1);
Johannes Berg0f19b412013-01-14 16:39:07 +0100365 __dynamic_array(u32, arp_addr_list,
366 info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
367 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
368 info->arp_addr_cnt);
369 __field(int, arp_addr_cnt);
Johannes Berg1724ffb2012-10-24 11:38:30 +0200370 __field(bool, qos);
371 __field(bool, idle);
372 __field(bool, ps);
373 __dynamic_array(u8, ssid, info->ssid_len);
374 __field(bool, hidden_ssid);
Johannes Berg1ea6f9c2012-10-24 10:59:25 +0200375 __field(int, txpower)
Janusz Dziedzic67baf662013-03-21 15:47:56 +0100376 __field(u8, p2p_oppps_ctwindow)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200377 ),
378
379 TP_fast_assign(
380 LOCAL_ASSIGN;
381 VIF_ASSIGN;
382 __entry->changed = changed;
383 __entry->aid = info->aid;
384 __entry->assoc = info->assoc;
Johannes Berg1724ffb2012-10-24 11:38:30 +0200385 __entry->ibss_joined = info->ibss_joined;
386 __entry->ibss_creator = info->ibss_creator;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200387 __entry->shortpre = info->use_short_preamble;
388 __entry->cts = info->use_cts_prot;
389 __entry->shortslot = info->use_short_slot;
Johannes Berg1724ffb2012-10-24 11:38:30 +0200390 __entry->enable_beacon = info->enable_beacon;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200391 __entry->dtimper = info->dtim_period;
392 __entry->bcnint = info->beacon_int;
393 __entry->assoc_cap = info->assoc_capability;
Johannes Berg8c358bc2012-05-22 22:13:05 +0200394 __entry->sync_tsf = info->sync_tsf;
395 __entry->sync_device_ts = info->sync_device_ts;
Johannes Bergef429da2013-02-05 17:48:40 +0100396 __entry->sync_dtim_count = info->sync_dtim_count;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200397 __entry->basic_rates = info->basic_rates;
Johannes Berg1724ffb2012-10-24 11:38:30 +0200398 memcpy(__entry->mcast_rate, info->mcast_rate,
399 sizeof(__entry->mcast_rate));
Johannes Bergf911ab82009-11-25 19:07:20 +0100400 __entry->ht_operation_mode = info->ht_operation_mode;
Johannes Berg1724ffb2012-10-24 11:38:30 +0200401 __entry->cqm_rssi_thold = info->cqm_rssi_thold;
402 __entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
Johannes Berg4bf88532012-11-09 11:39:59 +0100403 __entry->channel_width = info->chandef.width;
404 __entry->channel_cfreq1 = info->chandef.center_freq1;
Johannes Berg0f19b412013-01-14 16:39:07 +0100405 __entry->arp_addr_cnt = info->arp_addr_cnt;
Johannes Berg1724ffb2012-10-24 11:38:30 +0200406 memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
Johannes Berg0f19b412013-01-14 16:39:07 +0100407 sizeof(u32) * (info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
408 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
409 info->arp_addr_cnt));
Johannes Berg1724ffb2012-10-24 11:38:30 +0200410 __entry->qos = info->qos;
411 __entry->idle = info->idle;
412 __entry->ps = info->ps;
413 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
414 __entry->hidden_ssid = info->hidden_ssid;
Johannes Berg1ea6f9c2012-10-24 10:59:25 +0200415 __entry->txpower = info->txpower;
Janusz Dziedzic67baf662013-03-21 15:47:56 +0100416 __entry->p2p_oppps_ctwindow = info->p2p_noa_attr.oppps_ctwindow;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200417 ),
418
419 TP_printk(
420 LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
421 LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
422 )
423);
424
Johannes Berg3ac64be2009-08-17 16:16:53 +0200425TRACE_EVENT(drv_prepare_multicast,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200426 TP_PROTO(struct ieee80211_local *local, int mc_count),
Johannes Berg3ac64be2009-08-17 16:16:53 +0200427
Johannes Berg4efc76b2010-06-10 10:56:20 +0200428 TP_ARGS(local, mc_count),
Johannes Berg3ac64be2009-08-17 16:16:53 +0200429
430 TP_STRUCT__entry(
431 LOCAL_ENTRY
432 __field(int, mc_count)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200433 ),
434
435 TP_fast_assign(
436 LOCAL_ASSIGN;
437 __entry->mc_count = mc_count;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200438 ),
439
440 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200441 LOCAL_PR_FMT " prepare mc (%d)",
442 LOCAL_PR_ARG, __entry->mc_count
Johannes Berg3ac64be2009-08-17 16:16:53 +0200443 )
444);
445
Alexander Bondar488b3662013-02-11 14:56:29 +0200446TRACE_EVENT(drv_set_multicast_list,
447 TP_PROTO(struct ieee80211_local *local,
448 struct ieee80211_sub_if_data *sdata, int mc_count),
449
450 TP_ARGS(local, sdata, mc_count),
451
452 TP_STRUCT__entry(
453 LOCAL_ENTRY
454 __field(bool, allmulti)
455 __field(int, mc_count)
456 ),
457
458 TP_fast_assign(
459 LOCAL_ASSIGN;
460 __entry->allmulti = sdata->flags & IEEE80211_SDATA_ALLMULTI;
461 __entry->mc_count = mc_count;
462 ),
463
464 TP_printk(
465 LOCAL_PR_FMT " configure mc filter, count=%d, allmulti=%d",
466 LOCAL_PR_ARG, __entry->mc_count, __entry->allmulti
467 )
468);
469
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200470TRACE_EVENT(drv_configure_filter,
471 TP_PROTO(struct ieee80211_local *local,
472 unsigned int changed_flags,
473 unsigned int *total_flags,
Johannes Berg3ac64be2009-08-17 16:16:53 +0200474 u64 multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200475
Johannes Berg3ac64be2009-08-17 16:16:53 +0200476 TP_ARGS(local, changed_flags, total_flags, multicast),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200477
478 TP_STRUCT__entry(
479 LOCAL_ENTRY
480 __field(unsigned int, changed)
481 __field(unsigned int, total)
Johannes Berg3ac64be2009-08-17 16:16:53 +0200482 __field(u64, multicast)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200483 ),
484
485 TP_fast_assign(
486 LOCAL_ASSIGN;
487 __entry->changed = changed_flags;
488 __entry->total = *total_flags;
Johannes Berg3ac64be2009-08-17 16:16:53 +0200489 __entry->multicast = multicast;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200490 ),
491
492 TP_printk(
Johannes Berg3ac64be2009-08-17 16:16:53 +0200493 LOCAL_PR_FMT " changed:%#x total:%#x",
494 LOCAL_PR_ARG, __entry->changed, __entry->total
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200495 )
496);
497
498TRACE_EVENT(drv_set_tim,
499 TP_PROTO(struct ieee80211_local *local,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200500 struct ieee80211_sta *sta, bool set),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200501
Johannes Berg4efc76b2010-06-10 10:56:20 +0200502 TP_ARGS(local, sta, set),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200503
504 TP_STRUCT__entry(
505 LOCAL_ENTRY
506 STA_ENTRY
507 __field(bool, set)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200508 ),
509
510 TP_fast_assign(
511 LOCAL_ASSIGN;
512 STA_ASSIGN;
513 __entry->set = set;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200514 ),
515
516 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200517 LOCAL_PR_FMT STA_PR_FMT " set:%d",
Seth Forshee15ac7c42013-02-15 13:15:48 -0600518 LOCAL_PR_ARG, STA_PR_ARG, __entry->set
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200519 )
520);
521
522TRACE_EVENT(drv_set_key,
523 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100524 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200525 struct ieee80211_sta *sta,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200526 struct ieee80211_key_conf *key),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200527
Johannes Berg4efc76b2010-06-10 10:56:20 +0200528 TP_ARGS(local, cmd, sdata, sta, key),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200529
530 TP_STRUCT__entry(
531 LOCAL_ENTRY
532 VIF_ENTRY
533 STA_ENTRY
Johannes Berg97359d12010-08-10 09:46:38 +0200534 __field(u32, cipher)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200535 __field(u8, hw_key_idx)
536 __field(u8, flags)
537 __field(s8, keyidx)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200538 ),
539
540 TP_fast_assign(
541 LOCAL_ASSIGN;
542 VIF_ASSIGN;
543 STA_ASSIGN;
Johannes Berg97359d12010-08-10 09:46:38 +0200544 __entry->cipher = key->cipher;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200545 __entry->flags = key->flags;
546 __entry->keyidx = key->keyidx;
547 __entry->hw_key_idx = key->hw_key_idx;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200548 ),
549
550 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200551 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
552 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200553 )
554);
555
556TRACE_EVENT(drv_update_tkip_key,
557 TP_PROTO(struct ieee80211_local *local,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100558 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200559 struct ieee80211_key_conf *conf,
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100560 struct ieee80211_sta *sta, u32 iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200561
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100562 TP_ARGS(local, sdata, conf, sta, iv32),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200563
564 TP_STRUCT__entry(
565 LOCAL_ENTRY
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100566 VIF_ENTRY
567 STA_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200568 __field(u32, iv32)
569 ),
570
571 TP_fast_assign(
572 LOCAL_ASSIGN;
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100573 VIF_ASSIGN;
574 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200575 __entry->iv32 = iv32;
576 ),
577
578 TP_printk(
Johannes Bergb3fbdcf2010-01-21 11:40:47 +0100579 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
580 LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200581 )
582);
583
Luciano Coelho79f460c2011-05-11 17:09:36 +0300584DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200585 TP_PROTO(struct ieee80211_local *local,
Luciano Coelho79f460c2011-05-11 17:09:36 +0300586 struct ieee80211_sub_if_data *sdata),
587 TP_ARGS(local, sdata)
588);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200589
Eliad Pellerb8564392011-06-13 12:47:30 +0300590DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
591 TP_PROTO(struct ieee80211_local *local,
592 struct ieee80211_sub_if_data *sdata),
593 TP_ARGS(local, sdata)
594);
595
Luciano Coelho79f460c2011-05-11 17:09:36 +0300596DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
597 TP_PROTO(struct ieee80211_local *local,
598 struct ieee80211_sub_if_data *sdata),
599 TP_ARGS(local, sdata)
600);
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200601
Luciano Coelho79f460c2011-05-11 17:09:36 +0300602DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
603 TP_PROTO(struct ieee80211_local *local,
604 struct ieee80211_sub_if_data *sdata),
605 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200606);
607
Johannes Bergba99d932011-01-26 09:22:15 +0100608DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200609 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100610 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200611);
612
Johannes Bergba99d932011-01-26 09:22:15 +0100613DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200614 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100615 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200616);
617
618TRACE_EVENT(drv_get_stats,
619 TP_PROTO(struct ieee80211_local *local,
620 struct ieee80211_low_level_stats *stats,
621 int ret),
622
623 TP_ARGS(local, stats, ret),
624
625 TP_STRUCT__entry(
626 LOCAL_ENTRY
627 __field(int, ret)
628 __field(unsigned int, ackfail)
629 __field(unsigned int, rtsfail)
630 __field(unsigned int, fcserr)
631 __field(unsigned int, rtssucc)
632 ),
633
634 TP_fast_assign(
635 LOCAL_ASSIGN;
636 __entry->ret = ret;
637 __entry->ackfail = stats->dot11ACKFailureCount;
638 __entry->rtsfail = stats->dot11RTSFailureCount;
639 __entry->fcserr = stats->dot11FCSErrorCount;
640 __entry->rtssucc = stats->dot11RTSSuccessCount;
641 ),
642
643 TP_printk(
644 LOCAL_PR_FMT " ret:%d",
645 LOCAL_PR_ARG, __entry->ret
646 )
647);
648
649TRACE_EVENT(drv_get_tkip_seq,
650 TP_PROTO(struct ieee80211_local *local,
651 u8 hw_key_idx, u32 *iv32, u16 *iv16),
652
653 TP_ARGS(local, hw_key_idx, iv32, iv16),
654
655 TP_STRUCT__entry(
656 LOCAL_ENTRY
657 __field(u8, hw_key_idx)
658 __field(u32, iv32)
659 __field(u16, iv16)
660 ),
661
662 TP_fast_assign(
663 LOCAL_ASSIGN;
664 __entry->hw_key_idx = hw_key_idx;
665 __entry->iv32 = *iv32;
666 __entry->iv16 = *iv16;
667 ),
668
669 TP_printk(
670 LOCAL_PR_FMT, LOCAL_PR_ARG
671 )
672);
673
Luciano Coelho92ddc112011-05-09 14:40:06 +0300674DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
Arik Nemtsovf23a4782010-11-08 11:51:06 +0200675 TP_PROTO(struct ieee80211_local *local, u32 value),
Luciano Coelho92ddc112011-05-09 14:40:06 +0300676 TP_ARGS(local, value)
Arik Nemtsovf23a4782010-11-08 11:51:06 +0200677);
678
Luciano Coelho92ddc112011-05-09 14:40:06 +0300679DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200680 TP_PROTO(struct ieee80211_local *local, u32 value),
Luciano Coelho92ddc112011-05-09 14:40:06 +0300681 TP_ARGS(local, value)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200682);
683
Lukáš Turek310bc672009-12-21 22:50:48 +0100684TRACE_EVENT(drv_set_coverage_class,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200685 TP_PROTO(struct ieee80211_local *local, u8 value),
Lukáš Turek310bc672009-12-21 22:50:48 +0100686
Johannes Berg4efc76b2010-06-10 10:56:20 +0200687 TP_ARGS(local, value),
Lukáš Turek310bc672009-12-21 22:50:48 +0100688
689 TP_STRUCT__entry(
690 LOCAL_ENTRY
691 __field(u8, value)
Lukáš Turek310bc672009-12-21 22:50:48 +0100692 ),
693
694 TP_fast_assign(
695 LOCAL_ASSIGN;
Lukáš Turek310bc672009-12-21 22:50:48 +0100696 __entry->value = value;
697 ),
698
699 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200700 LOCAL_PR_FMT " value:%d",
701 LOCAL_PR_ARG, __entry->value
Lukáš Turek310bc672009-12-21 22:50:48 +0100702 )
703);
704
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200705TRACE_EVENT(drv_sta_notify,
706 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100707 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200708 enum sta_notify_cmd cmd,
709 struct ieee80211_sta *sta),
710
Johannes Berg12375ef2009-11-25 20:30:31 +0100711 TP_ARGS(local, sdata, cmd, sta),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200712
713 TP_STRUCT__entry(
714 LOCAL_ENTRY
715 VIF_ENTRY
716 STA_ENTRY
717 __field(u32, cmd)
718 ),
719
720 TP_fast_assign(
721 LOCAL_ASSIGN;
722 VIF_ASSIGN;
723 STA_ASSIGN;
724 __entry->cmd = cmd;
725 ),
726
727 TP_printk(
728 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
729 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
730 )
731);
732
Johannes Bergf09603a2012-01-20 13:55:21 +0100733TRACE_EVENT(drv_sta_state,
734 TP_PROTO(struct ieee80211_local *local,
735 struct ieee80211_sub_if_data *sdata,
736 struct ieee80211_sta *sta,
737 enum ieee80211_sta_state old_state,
738 enum ieee80211_sta_state new_state),
739
740 TP_ARGS(local, sdata, sta, old_state, new_state),
741
742 TP_STRUCT__entry(
743 LOCAL_ENTRY
744 VIF_ENTRY
745 STA_ENTRY
746 __field(u32, old_state)
747 __field(u32, new_state)
748 ),
749
750 TP_fast_assign(
751 LOCAL_ASSIGN;
752 VIF_ASSIGN;
753 STA_ASSIGN;
754 __entry->old_state = old_state;
755 __entry->new_state = new_state;
756 ),
757
758 TP_printk(
759 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " state: %d->%d",
760 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
761 __entry->old_state, __entry->new_state
762 )
763);
764
Johannes Berg8f727ef2012-03-30 08:43:32 +0200765TRACE_EVENT(drv_sta_rc_update,
766 TP_PROTO(struct ieee80211_local *local,
767 struct ieee80211_sub_if_data *sdata,
768 struct ieee80211_sta *sta,
769 u32 changed),
770
771 TP_ARGS(local, sdata, sta, changed),
772
773 TP_STRUCT__entry(
774 LOCAL_ENTRY
775 VIF_ENTRY
776 STA_ENTRY
777 __field(u32, changed)
778 ),
779
780 TP_fast_assign(
781 LOCAL_ASSIGN;
782 VIF_ASSIGN;
783 STA_ASSIGN;
784 __entry->changed = changed;
785 ),
786
787 TP_printk(
788 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
789 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
790 )
791);
792
Johannes Berg34e89502010-02-03 13:59:58 +0100793TRACE_EVENT(drv_sta_add,
794 TP_PROTO(struct ieee80211_local *local,
795 struct ieee80211_sub_if_data *sdata,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200796 struct ieee80211_sta *sta),
Johannes Berg34e89502010-02-03 13:59:58 +0100797
Johannes Berg4efc76b2010-06-10 10:56:20 +0200798 TP_ARGS(local, sdata, sta),
Johannes Berg34e89502010-02-03 13:59:58 +0100799
800 TP_STRUCT__entry(
801 LOCAL_ENTRY
802 VIF_ENTRY
803 STA_ENTRY
Johannes Berg34e89502010-02-03 13:59:58 +0100804 ),
805
806 TP_fast_assign(
807 LOCAL_ASSIGN;
808 VIF_ASSIGN;
809 STA_ASSIGN;
Johannes Berg34e89502010-02-03 13:59:58 +0100810 ),
811
812 TP_printk(
Johannes Berg4efc76b2010-06-10 10:56:20 +0200813 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
814 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
Johannes Berg34e89502010-02-03 13:59:58 +0100815 )
816);
817
818TRACE_EVENT(drv_sta_remove,
819 TP_PROTO(struct ieee80211_local *local,
820 struct ieee80211_sub_if_data *sdata,
821 struct ieee80211_sta *sta),
822
823 TP_ARGS(local, sdata, sta),
824
825 TP_STRUCT__entry(
826 LOCAL_ENTRY
827 VIF_ENTRY
828 STA_ENTRY
829 ),
830
831 TP_fast_assign(
832 LOCAL_ASSIGN;
833 VIF_ASSIGN;
834 STA_ASSIGN;
835 ),
836
837 TP_printk(
838 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
839 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
840 )
841);
842
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200843TRACE_EVENT(drv_conf_tx,
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300844 TP_PROTO(struct ieee80211_local *local,
845 struct ieee80211_sub_if_data *sdata,
Johannes Berga3304b02012-03-28 11:04:24 +0200846 u16 ac, const struct ieee80211_tx_queue_params *params),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200847
Johannes Berga3304b02012-03-28 11:04:24 +0200848 TP_ARGS(local, sdata, ac, params),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200849
850 TP_STRUCT__entry(
851 LOCAL_ENTRY
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300852 VIF_ENTRY
Johannes Berga3304b02012-03-28 11:04:24 +0200853 __field(u16, ac)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200854 __field(u16, txop)
855 __field(u16, cw_min)
856 __field(u16, cw_max)
857 __field(u8, aifs)
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300858 __field(bool, uapsd)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200859 ),
860
861 TP_fast_assign(
862 LOCAL_ASSIGN;
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300863 VIF_ASSIGN;
Johannes Berga3304b02012-03-28 11:04:24 +0200864 __entry->ac = ac;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200865 __entry->txop = params->txop;
866 __entry->cw_max = params->cw_max;
867 __entry->cw_min = params->cw_min;
868 __entry->aifs = params->aifs;
Eliad Pellerf6f3def2011-09-25 20:06:54 +0300869 __entry->uapsd = params->uapsd;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200870 ),
871
872 TP_printk(
Johannes Berga3304b02012-03-28 11:04:24 +0200873 LOCAL_PR_FMT VIF_PR_FMT " AC:%d",
874 LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200875 )
876);
877
Eliad Peller37a41b42011-09-21 14:06:11 +0300878DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
879 TP_PROTO(struct ieee80211_local *local,
880 struct ieee80211_sub_if_data *sdata),
881 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200882);
883
884TRACE_EVENT(drv_set_tsf,
Eliad Peller37a41b42011-09-21 14:06:11 +0300885 TP_PROTO(struct ieee80211_local *local,
886 struct ieee80211_sub_if_data *sdata,
887 u64 tsf),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200888
Eliad Peller37a41b42011-09-21 14:06:11 +0300889 TP_ARGS(local, sdata, tsf),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200890
891 TP_STRUCT__entry(
892 LOCAL_ENTRY
Eliad Peller37a41b42011-09-21 14:06:11 +0300893 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200894 __field(u64, tsf)
895 ),
896
897 TP_fast_assign(
898 LOCAL_ASSIGN;
Eliad Peller37a41b42011-09-21 14:06:11 +0300899 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200900 __entry->tsf = tsf;
901 ),
902
903 TP_printk(
Eliad Peller37a41b42011-09-21 14:06:11 +0300904 LOCAL_PR_FMT VIF_PR_FMT " tsf:%llu",
905 LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200906 )
907);
908
Eliad Peller37a41b42011-09-21 14:06:11 +0300909DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
910 TP_PROTO(struct ieee80211_local *local,
911 struct ieee80211_sub_if_data *sdata),
912 TP_ARGS(local, sdata)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200913);
914
Johannes Bergba99d932011-01-26 09:22:15 +0100915DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
Johannes Berg4efc76b2010-06-10 10:56:20 +0200916 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +0100917 TP_ARGS(local)
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200918);
919
920TRACE_EVENT(drv_ampdu_action,
921 TP_PROTO(struct ieee80211_local *local,
Johannes Berg12375ef2009-11-25 20:30:31 +0100922 struct ieee80211_sub_if_data *sdata,
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200923 enum ieee80211_ampdu_mlme_action action,
924 struct ieee80211_sta *sta, u16 tid,
Johannes Berg0b01f032011-01-18 13:51:05 +0100925 u16 *ssn, u8 buf_size),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200926
Johannes Berg0b01f032011-01-18 13:51:05 +0100927 TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200928
929 TP_STRUCT__entry(
930 LOCAL_ENTRY
931 STA_ENTRY
932 __field(u32, action)
933 __field(u16, tid)
934 __field(u16, ssn)
Johannes Berg0b01f032011-01-18 13:51:05 +0100935 __field(u8, buf_size)
Johannes Bergc951ad32009-11-16 12:00:38 +0100936 VIF_ENTRY
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200937 ),
938
939 TP_fast_assign(
940 LOCAL_ASSIGN;
Johannes Bergc951ad32009-11-16 12:00:38 +0100941 VIF_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200942 STA_ASSIGN;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200943 __entry->action = action;
944 __entry->tid = tid;
Zhu Yi3092ad02010-01-26 15:58:57 +0800945 __entry->ssn = ssn ? *ssn : 0;
Johannes Berg0b01f032011-01-18 13:51:05 +0100946 __entry->buf_size = buf_size;
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200947 ),
948
949 TP_printk(
Johannes Berg0b01f032011-01-18 13:51:05 +0100950 LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
951 LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
952 __entry->tid, __entry->buf_size
Johannes Berg0a2b8bb2009-07-07 13:46:22 +0200953 )
954);
Johannes Berga80f7c02009-12-23 13:15:32 +0100955
John W. Linvillec466d4e2010-06-29 14:51:23 -0400956TRACE_EVENT(drv_get_survey,
957 TP_PROTO(struct ieee80211_local *local, int idx,
958 struct survey_info *survey),
959
960 TP_ARGS(local, idx, survey),
961
962 TP_STRUCT__entry(
963 LOCAL_ENTRY
964 __field(int, idx)
965 ),
966
967 TP_fast_assign(
968 LOCAL_ASSIGN;
969 __entry->idx = idx;
970 ),
971
972 TP_printk(
973 LOCAL_PR_FMT " idx:%d",
974 LOCAL_PR_ARG, __entry->idx
975 )
976);
977
Johannes Berga80f7c02009-12-23 13:15:32 +0100978TRACE_EVENT(drv_flush,
Johannes Berg39ecc012013-02-13 12:11:00 +0100979 TP_PROTO(struct ieee80211_local *local,
980 u32 queues, bool drop),
Johannes Berga80f7c02009-12-23 13:15:32 +0100981
Johannes Berg39ecc012013-02-13 12:11:00 +0100982 TP_ARGS(local, queues, drop),
Johannes Berga80f7c02009-12-23 13:15:32 +0100983
984 TP_STRUCT__entry(
985 LOCAL_ENTRY
986 __field(bool, drop)
Johannes Berg39ecc012013-02-13 12:11:00 +0100987 __field(u32, queues)
Johannes Berga80f7c02009-12-23 13:15:32 +0100988 ),
989
990 TP_fast_assign(
991 LOCAL_ASSIGN;
992 __entry->drop = drop;
Johannes Berg39ecc012013-02-13 12:11:00 +0100993 __entry->queues = queues;
Johannes Berga80f7c02009-12-23 13:15:32 +0100994 ),
995
996 TP_printk(
Johannes Berg39ecc012013-02-13 12:11:00 +0100997 LOCAL_PR_FMT " queues:0x%x drop:%d",
998 LOCAL_PR_ARG, __entry->queues, __entry->drop
Johannes Berga80f7c02009-12-23 13:15:32 +0100999 )
1000);
Johannes Bergb5878a22010-04-07 16:48:40 +02001001
Johannes Berg5ce6e432010-05-11 16:20:57 +02001002TRACE_EVENT(drv_channel_switch,
1003 TP_PROTO(struct ieee80211_local *local,
1004 struct ieee80211_channel_switch *ch_switch),
1005
1006 TP_ARGS(local, ch_switch),
1007
1008 TP_STRUCT__entry(
1009 LOCAL_ENTRY
Johannes Berg85220d72013-03-25 18:29:27 +01001010 CHANDEF_ENTRY
Johannes Berg5ce6e432010-05-11 16:20:57 +02001011 __field(u64, timestamp)
1012 __field(bool, block_tx)
Johannes Berg5ce6e432010-05-11 16:20:57 +02001013 __field(u8, count)
1014 ),
1015
1016 TP_fast_assign(
1017 LOCAL_ASSIGN;
Johannes Berg85220d72013-03-25 18:29:27 +01001018 CHANDEF_ASSIGN(&ch_switch->chandef)
Johannes Berg5ce6e432010-05-11 16:20:57 +02001019 __entry->timestamp = ch_switch->timestamp;
1020 __entry->block_tx = ch_switch->block_tx;
Johannes Berg5ce6e432010-05-11 16:20:57 +02001021 __entry->count = ch_switch->count;
1022 ),
1023
1024 TP_printk(
Johannes Berg85220d72013-03-25 18:29:27 +01001025 LOCAL_PR_FMT " new " CHANDEF_PR_FMT " count:%d",
1026 LOCAL_PR_ARG, CHANDEF_PR_ARG, __entry->count
Johannes Berg5ce6e432010-05-11 16:20:57 +02001027 )
1028);
1029
Bruno Randolf15d96752010-11-10 12:50:56 +09001030TRACE_EVENT(drv_set_antenna,
1031 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
1032
1033 TP_ARGS(local, tx_ant, rx_ant, ret),
1034
1035 TP_STRUCT__entry(
1036 LOCAL_ENTRY
1037 __field(u32, tx_ant)
1038 __field(u32, rx_ant)
1039 __field(int, ret)
1040 ),
1041
1042 TP_fast_assign(
1043 LOCAL_ASSIGN;
1044 __entry->tx_ant = tx_ant;
1045 __entry->rx_ant = rx_ant;
1046 __entry->ret = ret;
1047 ),
1048
1049 TP_printk(
1050 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1051 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1052 )
1053);
1054
1055TRACE_EVENT(drv_get_antenna,
1056 TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
1057
1058 TP_ARGS(local, tx_ant, rx_ant, ret),
1059
1060 TP_STRUCT__entry(
1061 LOCAL_ENTRY
1062 __field(u32, tx_ant)
1063 __field(u32, rx_ant)
1064 __field(int, ret)
1065 ),
1066
1067 TP_fast_assign(
1068 LOCAL_ASSIGN;
1069 __entry->tx_ant = tx_ant;
1070 __entry->rx_ant = rx_ant;
1071 __entry->ret = ret;
1072 ),
1073
1074 TP_printk(
1075 LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
1076 LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
1077 )
1078);
1079
Johannes Berg21f83582010-12-18 17:20:47 +01001080TRACE_EVENT(drv_remain_on_channel,
Eliad Peller49884562012-11-19 17:05:09 +02001081 TP_PROTO(struct ieee80211_local *local,
1082 struct ieee80211_sub_if_data *sdata,
1083 struct ieee80211_channel *chan,
Ilan Peerd339d5c2013-02-12 09:34:13 +02001084 unsigned int duration,
1085 enum ieee80211_roc_type type),
Johannes Berg21f83582010-12-18 17:20:47 +01001086
Ilan Peerd339d5c2013-02-12 09:34:13 +02001087 TP_ARGS(local, sdata, chan, duration, type),
Johannes Berg21f83582010-12-18 17:20:47 +01001088
1089 TP_STRUCT__entry(
1090 LOCAL_ENTRY
Eliad Peller49884562012-11-19 17:05:09 +02001091 VIF_ENTRY
Johannes Berg21f83582010-12-18 17:20:47 +01001092 __field(int, center_freq)
Johannes Berg21f83582010-12-18 17:20:47 +01001093 __field(unsigned int, duration)
Ilan Peerd339d5c2013-02-12 09:34:13 +02001094 __field(u32, type)
Johannes Berg21f83582010-12-18 17:20:47 +01001095 ),
1096
1097 TP_fast_assign(
1098 LOCAL_ASSIGN;
Eliad Peller49884562012-11-19 17:05:09 +02001099 VIF_ASSIGN;
Johannes Berg21f83582010-12-18 17:20:47 +01001100 __entry->center_freq = chan->center_freq;
Johannes Berg21f83582010-12-18 17:20:47 +01001101 __entry->duration = duration;
Ilan Peerd339d5c2013-02-12 09:34:13 +02001102 __entry->type = type;
Johannes Berg21f83582010-12-18 17:20:47 +01001103 ),
1104
1105 TP_printk(
Ilan Peerd339d5c2013-02-12 09:34:13 +02001106 LOCAL_PR_FMT VIF_PR_FMT " freq:%dMHz duration:%dms type=%d",
Eliad Peller49884562012-11-19 17:05:09 +02001107 LOCAL_PR_ARG, VIF_PR_ARG,
Ilan Peerd339d5c2013-02-12 09:34:13 +02001108 __entry->center_freq, __entry->duration, __entry->type
Johannes Berg21f83582010-12-18 17:20:47 +01001109 )
1110);
1111
Johannes Bergba99d932011-01-26 09:22:15 +01001112DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
Johannes Berg21f83582010-12-18 17:20:47 +01001113 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001114 TP_ARGS(local)
Johannes Berg21f83582010-12-18 17:20:47 +01001115);
1116
John W. Linville38c09152011-03-07 16:19:18 -05001117TRACE_EVENT(drv_set_ringparam,
1118 TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
1119
1120 TP_ARGS(local, tx, rx),
1121
1122 TP_STRUCT__entry(
1123 LOCAL_ENTRY
1124 __field(u32, tx)
1125 __field(u32, rx)
1126 ),
1127
1128 TP_fast_assign(
1129 LOCAL_ASSIGN;
1130 __entry->tx = tx;
1131 __entry->rx = rx;
1132 ),
1133
1134 TP_printk(
1135 LOCAL_PR_FMT " tx:%d rx %d",
1136 LOCAL_PR_ARG, __entry->tx, __entry->rx
1137 )
1138);
1139
1140TRACE_EVENT(drv_get_ringparam,
1141 TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
1142 u32 *rx, u32 *rx_max),
1143
1144 TP_ARGS(local, tx, tx_max, rx, rx_max),
1145
1146 TP_STRUCT__entry(
1147 LOCAL_ENTRY
1148 __field(u32, tx)
1149 __field(u32, tx_max)
1150 __field(u32, rx)
1151 __field(u32, rx_max)
1152 ),
1153
1154 TP_fast_assign(
1155 LOCAL_ASSIGN;
1156 __entry->tx = *tx;
1157 __entry->tx_max = *tx_max;
1158 __entry->rx = *rx;
1159 __entry->rx_max = *rx_max;
1160 ),
1161
1162 TP_printk(
1163 LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
1164 LOCAL_PR_ARG,
1165 __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
1166 )
1167);
1168
Vivek Natarajane8306f92011-04-06 11:41:10 +05301169DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
1170 TP_PROTO(struct ieee80211_local *local),
1171 TP_ARGS(local)
1172);
1173
Johannes Berg5f16a432011-02-25 15:36:57 +01001174DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
1175 TP_PROTO(struct ieee80211_local *local),
1176 TP_ARGS(local)
1177);
1178
Sujith Manoharanbdbfd6b2011-04-27 16:56:51 +05301179TRACE_EVENT(drv_set_bitrate_mask,
1180 TP_PROTO(struct ieee80211_local *local,
1181 struct ieee80211_sub_if_data *sdata,
1182 const struct cfg80211_bitrate_mask *mask),
1183
1184 TP_ARGS(local, sdata, mask),
1185
1186 TP_STRUCT__entry(
1187 LOCAL_ENTRY
1188 VIF_ENTRY
1189 __field(u32, legacy_2g)
1190 __field(u32, legacy_5g)
1191 ),
1192
1193 TP_fast_assign(
1194 LOCAL_ASSIGN;
1195 VIF_ASSIGN;
1196 __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
1197 __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
1198 ),
1199
1200 TP_printk(
1201 LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
1202 LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
1203 )
1204);
1205
Johannes Bergc68f4b82011-07-05 16:35:41 +02001206TRACE_EVENT(drv_set_rekey_data,
1207 TP_PROTO(struct ieee80211_local *local,
1208 struct ieee80211_sub_if_data *sdata,
1209 struct cfg80211_gtk_rekey_data *data),
1210
1211 TP_ARGS(local, sdata, data),
1212
1213 TP_STRUCT__entry(
1214 LOCAL_ENTRY
1215 VIF_ENTRY
1216 __array(u8, kek, NL80211_KEK_LEN)
1217 __array(u8, kck, NL80211_KCK_LEN)
1218 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1219 ),
1220
1221 TP_fast_assign(
1222 LOCAL_ASSIGN;
1223 VIF_ASSIGN;
1224 memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
1225 memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
1226 memcpy(__entry->replay_ctr, data->replay_ctr,
1227 NL80211_REPLAY_CTR_LEN);
1228 ),
1229
1230 TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
1231 LOCAL_PR_ARG, VIF_PR_ARG)
1232);
1233
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001234TRACE_EVENT(drv_rssi_callback,
1235 TP_PROTO(struct ieee80211_local *local,
Emmanuel Grumbach887da912013-01-20 17:32:41 +02001236 struct ieee80211_sub_if_data *sdata,
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001237 enum ieee80211_rssi_event rssi_event),
1238
Emmanuel Grumbach887da912013-01-20 17:32:41 +02001239 TP_ARGS(local, sdata, rssi_event),
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001240
1241 TP_STRUCT__entry(
1242 LOCAL_ENTRY
Emmanuel Grumbach887da912013-01-20 17:32:41 +02001243 VIF_ENTRY
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001244 __field(u32, rssi_event)
1245 ),
1246
1247 TP_fast_assign(
1248 LOCAL_ASSIGN;
Emmanuel Grumbach887da912013-01-20 17:32:41 +02001249 VIF_ASSIGN;
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001250 __entry->rssi_event = rssi_event;
1251 ),
1252
1253 TP_printk(
Emmanuel Grumbach887da912013-01-20 17:32:41 +02001254 LOCAL_PR_FMT VIF_PR_FMT " rssi_event:%d",
1255 LOCAL_PR_ARG, VIF_PR_ARG, __entry->rssi_event
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001256 )
1257);
1258
Johannes Berg40b96402011-09-29 16:04:38 +02001259DECLARE_EVENT_CLASS(release_evt,
Johannes Berg4049e092011-09-29 16:04:32 +02001260 TP_PROTO(struct ieee80211_local *local,
1261 struct ieee80211_sta *sta,
1262 u16 tids, int num_frames,
1263 enum ieee80211_frame_release_type reason,
1264 bool more_data),
1265
1266 TP_ARGS(local, sta, tids, num_frames, reason, more_data),
1267
1268 TP_STRUCT__entry(
1269 LOCAL_ENTRY
1270 STA_ENTRY
1271 __field(u16, tids)
1272 __field(int, num_frames)
1273 __field(int, reason)
1274 __field(bool, more_data)
1275 ),
1276
1277 TP_fast_assign(
1278 LOCAL_ASSIGN;
1279 STA_ASSIGN;
1280 __entry->tids = tids;
1281 __entry->num_frames = num_frames;
1282 __entry->reason = reason;
1283 __entry->more_data = more_data;
1284 ),
1285
1286 TP_printk(
1287 LOCAL_PR_FMT STA_PR_FMT
1288 " TIDs:0x%.4x frames:%d reason:%d more:%d",
1289 LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
1290 __entry->reason, __entry->more_data
1291 )
1292);
1293
Johannes Berg40b96402011-09-29 16:04:38 +02001294DEFINE_EVENT(release_evt, drv_release_buffered_frames,
1295 TP_PROTO(struct ieee80211_local *local,
1296 struct ieee80211_sta *sta,
1297 u16 tids, int num_frames,
1298 enum ieee80211_frame_release_type reason,
1299 bool more_data),
1300
1301 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1302);
1303
1304DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
1305 TP_PROTO(struct ieee80211_local *local,
1306 struct ieee80211_sta *sta,
1307 u16 tids, int num_frames,
1308 enum ieee80211_frame_release_type reason,
1309 bool more_data),
1310
1311 TP_ARGS(local, sta, tids, num_frames, reason, more_data)
1312);
1313
Victor Goldenshtein66572cf2012-06-21 10:56:46 +03001314TRACE_EVENT(drv_get_rssi,
1315 TP_PROTO(struct ieee80211_local *local, struct ieee80211_sta *sta,
1316 s8 rssi, int ret),
1317
1318 TP_ARGS(local, sta, rssi, ret),
1319
1320 TP_STRUCT__entry(
1321 LOCAL_ENTRY
1322 STA_ENTRY
1323 __field(s8, rssi)
1324 __field(int, ret)
1325 ),
1326
1327 TP_fast_assign(
1328 LOCAL_ASSIGN;
1329 STA_ASSIGN;
1330 __entry->rssi = rssi;
1331 __entry->ret = ret;
1332 ),
1333
1334 TP_printk(
1335 LOCAL_PR_FMT STA_PR_FMT " rssi:%d ret:%d",
1336 LOCAL_PR_ARG, STA_PR_ARG, __entry->rssi, __entry->ret
1337 )
1338);
1339
Johannes Berga1845fc2012-06-27 13:18:36 +02001340DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
1341 TP_PROTO(struct ieee80211_local *local,
1342 struct ieee80211_sub_if_data *sdata),
1343
1344 TP_ARGS(local, sdata)
1345);
1346
Michal Kaziorc3645ea2012-06-26 14:37:17 +02001347DECLARE_EVENT_CLASS(local_chanctx,
1348 TP_PROTO(struct ieee80211_local *local,
1349 struct ieee80211_chanctx *ctx),
1350
1351 TP_ARGS(local, ctx),
1352
1353 TP_STRUCT__entry(
1354 LOCAL_ENTRY
1355 CHANCTX_ENTRY
1356 ),
1357
1358 TP_fast_assign(
1359 LOCAL_ASSIGN;
1360 CHANCTX_ASSIGN;
1361 ),
1362
1363 TP_printk(
1364 LOCAL_PR_FMT CHANCTX_PR_FMT,
1365 LOCAL_PR_ARG, CHANCTX_PR_ARG
1366 )
1367);
1368
1369DEFINE_EVENT(local_chanctx, drv_add_chanctx,
1370 TP_PROTO(struct ieee80211_local *local,
1371 struct ieee80211_chanctx *ctx),
1372 TP_ARGS(local, ctx)
1373);
1374
1375DEFINE_EVENT(local_chanctx, drv_remove_chanctx,
1376 TP_PROTO(struct ieee80211_local *local,
1377 struct ieee80211_chanctx *ctx),
1378 TP_ARGS(local, ctx)
1379);
1380
1381TRACE_EVENT(drv_change_chanctx,
1382 TP_PROTO(struct ieee80211_local *local,
1383 struct ieee80211_chanctx *ctx,
1384 u32 changed),
1385
1386 TP_ARGS(local, ctx, changed),
1387
1388 TP_STRUCT__entry(
1389 LOCAL_ENTRY
1390 CHANCTX_ENTRY
1391 __field(u32, changed)
1392 ),
1393
1394 TP_fast_assign(
1395 LOCAL_ASSIGN;
1396 CHANCTX_ASSIGN;
1397 __entry->changed = changed;
1398 ),
1399
1400 TP_printk(
1401 LOCAL_PR_FMT CHANCTX_PR_FMT " changed:%#x",
1402 LOCAL_PR_ARG, CHANCTX_PR_ARG, __entry->changed
1403 )
1404);
1405
1406DECLARE_EVENT_CLASS(local_sdata_chanctx,
1407 TP_PROTO(struct ieee80211_local *local,
1408 struct ieee80211_sub_if_data *sdata,
1409 struct ieee80211_chanctx *ctx),
1410
1411 TP_ARGS(local, sdata, ctx),
1412
1413 TP_STRUCT__entry(
1414 LOCAL_ENTRY
1415 VIF_ENTRY
1416 CHANCTX_ENTRY
1417 ),
1418
1419 TP_fast_assign(
1420 LOCAL_ASSIGN;
1421 VIF_ASSIGN;
1422 CHANCTX_ASSIGN;
1423 ),
1424
1425 TP_printk(
1426 LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT,
1427 LOCAL_PR_ARG, VIF_PR_ARG, CHANCTX_PR_ARG
1428 )
1429);
1430
1431DEFINE_EVENT(local_sdata_chanctx, drv_assign_vif_chanctx,
1432 TP_PROTO(struct ieee80211_local *local,
1433 struct ieee80211_sub_if_data *sdata,
1434 struct ieee80211_chanctx *ctx),
1435 TP_ARGS(local, sdata, ctx)
1436);
1437
1438DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
1439 TP_PROTO(struct ieee80211_local *local,
1440 struct ieee80211_sub_if_data *sdata,
1441 struct ieee80211_chanctx *ctx),
1442 TP_ARGS(local, sdata, ctx)
1443);
1444
Johannes Berg10416382012-10-19 15:44:42 +02001445TRACE_EVENT(drv_start_ap,
1446 TP_PROTO(struct ieee80211_local *local,
1447 struct ieee80211_sub_if_data *sdata,
1448 struct ieee80211_bss_conf *info),
1449
1450 TP_ARGS(local, sdata, info),
1451
1452 TP_STRUCT__entry(
1453 LOCAL_ENTRY
1454 VIF_ENTRY
1455 __field(u8, dtimper)
1456 __field(u16, bcnint)
1457 __dynamic_array(u8, ssid, info->ssid_len);
1458 __field(bool, hidden_ssid);
1459 ),
1460
1461 TP_fast_assign(
1462 LOCAL_ASSIGN;
1463 VIF_ASSIGN;
1464 __entry->dtimper = info->dtim_period;
1465 __entry->bcnint = info->beacon_int;
1466 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
1467 __entry->hidden_ssid = info->hidden_ssid;
1468 ),
1469
1470 TP_printk(
1471 LOCAL_PR_FMT VIF_PR_FMT,
1472 LOCAL_PR_ARG, VIF_PR_ARG
1473 )
1474);
1475
1476DEFINE_EVENT(local_sdata_evt, drv_stop_ap,
1477 TP_PROTO(struct ieee80211_local *local,
1478 struct ieee80211_sub_if_data *sdata),
1479 TP_ARGS(local, sdata)
1480);
1481
Johannes Berg9214ad72012-11-06 19:18:13 +01001482DEFINE_EVENT(local_only_evt, drv_restart_complete,
1483 TP_PROTO(struct ieee80211_local *local),
1484 TP_ARGS(local)
1485);
1486
Johannes Berga65240c2013-01-14 15:14:34 +01001487#if IS_ENABLED(CONFIG_IPV6)
1488DEFINE_EVENT(local_sdata_evt, drv_ipv6_addr_change,
1489 TP_PROTO(struct ieee80211_local *local,
1490 struct ieee80211_sub_if_data *sdata),
1491 TP_ARGS(local, sdata)
1492);
1493#endif
1494
Johannes Berg55fff502013-08-19 18:48:41 +02001495TRACE_EVENT(drv_join_ibss,
1496 TP_PROTO(struct ieee80211_local *local,
1497 struct ieee80211_sub_if_data *sdata,
1498 struct ieee80211_bss_conf *info),
1499
1500 TP_ARGS(local, sdata, info),
1501
1502 TP_STRUCT__entry(
1503 LOCAL_ENTRY
1504 VIF_ENTRY
1505 __field(u8, dtimper)
1506 __field(u16, bcnint)
1507 __dynamic_array(u8, ssid, info->ssid_len);
1508 ),
1509
1510 TP_fast_assign(
1511 LOCAL_ASSIGN;
1512 VIF_ASSIGN;
1513 __entry->dtimper = info->dtim_period;
1514 __entry->bcnint = info->beacon_int;
1515 memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
1516 ),
1517
1518 TP_printk(
1519 LOCAL_PR_FMT VIF_PR_FMT,
1520 LOCAL_PR_ARG, VIF_PR_ARG
1521 )
1522);
1523
1524DEFINE_EVENT(local_sdata_evt, drv_leave_ibss,
1525 TP_PROTO(struct ieee80211_local *local,
1526 struct ieee80211_sub_if_data *sdata),
1527 TP_ARGS(local, sdata)
1528);
1529
Johannes Bergb5878a22010-04-07 16:48:40 +02001530/*
1531 * Tracing for API calls that drivers call.
1532 */
1533
1534TRACE_EVENT(api_start_tx_ba_session,
1535 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
1536
1537 TP_ARGS(sta, tid),
1538
1539 TP_STRUCT__entry(
1540 STA_ENTRY
1541 __field(u16, tid)
1542 ),
1543
1544 TP_fast_assign(
1545 STA_ASSIGN;
1546 __entry->tid = tid;
1547 ),
1548
1549 TP_printk(
1550 STA_PR_FMT " tid:%d",
1551 STA_PR_ARG, __entry->tid
1552 )
1553);
1554
1555TRACE_EVENT(api_start_tx_ba_cb,
1556 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1557
1558 TP_ARGS(sdata, ra, tid),
1559
1560 TP_STRUCT__entry(
1561 VIF_ENTRY
1562 __array(u8, ra, ETH_ALEN)
1563 __field(u16, tid)
1564 ),
1565
1566 TP_fast_assign(
1567 VIF_ASSIGN;
1568 memcpy(__entry->ra, ra, ETH_ALEN);
1569 __entry->tid = tid;
1570 ),
1571
1572 TP_printk(
1573 VIF_PR_FMT " ra:%pM tid:%d",
1574 VIF_PR_ARG, __entry->ra, __entry->tid
1575 )
1576);
1577
1578TRACE_EVENT(api_stop_tx_ba_session,
Johannes Berg6a8579d2010-05-27 14:41:07 +02001579 TP_PROTO(struct ieee80211_sta *sta, u16 tid),
Johannes Bergb5878a22010-04-07 16:48:40 +02001580
Johannes Berg6a8579d2010-05-27 14:41:07 +02001581 TP_ARGS(sta, tid),
Johannes Bergb5878a22010-04-07 16:48:40 +02001582
1583 TP_STRUCT__entry(
1584 STA_ENTRY
1585 __field(u16, tid)
Johannes Bergb5878a22010-04-07 16:48:40 +02001586 ),
1587
1588 TP_fast_assign(
1589 STA_ASSIGN;
1590 __entry->tid = tid;
Johannes Bergb5878a22010-04-07 16:48:40 +02001591 ),
1592
1593 TP_printk(
Johannes Berg6a8579d2010-05-27 14:41:07 +02001594 STA_PR_FMT " tid:%d",
1595 STA_PR_ARG, __entry->tid
Johannes Bergb5878a22010-04-07 16:48:40 +02001596 )
1597);
1598
1599TRACE_EVENT(api_stop_tx_ba_cb,
1600 TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
1601
1602 TP_ARGS(sdata, ra, tid),
1603
1604 TP_STRUCT__entry(
1605 VIF_ENTRY
1606 __array(u8, ra, ETH_ALEN)
1607 __field(u16, tid)
1608 ),
1609
1610 TP_fast_assign(
1611 VIF_ASSIGN;
1612 memcpy(__entry->ra, ra, ETH_ALEN);
1613 __entry->tid = tid;
1614 ),
1615
1616 TP_printk(
1617 VIF_PR_FMT " ra:%pM tid:%d",
1618 VIF_PR_ARG, __entry->ra, __entry->tid
1619 )
1620);
1621
Johannes Bergba99d932011-01-26 09:22:15 +01001622DEFINE_EVENT(local_only_evt, api_restart_hw,
Johannes Bergb5878a22010-04-07 16:48:40 +02001623 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001624 TP_ARGS(local)
Johannes Bergb5878a22010-04-07 16:48:40 +02001625);
1626
1627TRACE_EVENT(api_beacon_loss,
1628 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1629
1630 TP_ARGS(sdata),
1631
1632 TP_STRUCT__entry(
1633 VIF_ENTRY
1634 ),
1635
1636 TP_fast_assign(
1637 VIF_ASSIGN;
1638 ),
1639
1640 TP_printk(
1641 VIF_PR_FMT,
1642 VIF_PR_ARG
1643 )
1644);
1645
1646TRACE_EVENT(api_connection_loss,
1647 TP_PROTO(struct ieee80211_sub_if_data *sdata),
1648
1649 TP_ARGS(sdata),
1650
1651 TP_STRUCT__entry(
1652 VIF_ENTRY
1653 ),
1654
1655 TP_fast_assign(
1656 VIF_ASSIGN;
1657 ),
1658
1659 TP_printk(
1660 VIF_PR_FMT,
1661 VIF_PR_ARG
1662 )
1663);
1664
1665TRACE_EVENT(api_cqm_rssi_notify,
1666 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1667 enum nl80211_cqm_rssi_threshold_event rssi_event),
1668
1669 TP_ARGS(sdata, rssi_event),
1670
1671 TP_STRUCT__entry(
1672 VIF_ENTRY
1673 __field(u32, rssi_event)
1674 ),
1675
1676 TP_fast_assign(
1677 VIF_ASSIGN;
1678 __entry->rssi_event = rssi_event;
1679 ),
1680
1681 TP_printk(
1682 VIF_PR_FMT " event:%d",
1683 VIF_PR_ARG, __entry->rssi_event
1684 )
1685);
1686
1687TRACE_EVENT(api_scan_completed,
1688 TP_PROTO(struct ieee80211_local *local, bool aborted),
1689
1690 TP_ARGS(local, aborted),
1691
1692 TP_STRUCT__entry(
1693 LOCAL_ENTRY
1694 __field(bool, aborted)
1695 ),
1696
1697 TP_fast_assign(
1698 LOCAL_ASSIGN;
1699 __entry->aborted = aborted;
1700 ),
1701
1702 TP_printk(
1703 LOCAL_PR_FMT " aborted:%d",
1704 LOCAL_PR_ARG, __entry->aborted
1705 )
1706);
1707
Luciano Coelho79f460c2011-05-11 17:09:36 +03001708TRACE_EVENT(api_sched_scan_results,
1709 TP_PROTO(struct ieee80211_local *local),
1710
1711 TP_ARGS(local),
1712
1713 TP_STRUCT__entry(
1714 LOCAL_ENTRY
1715 ),
1716
1717 TP_fast_assign(
1718 LOCAL_ASSIGN;
1719 ),
1720
1721 TP_printk(
1722 LOCAL_PR_FMT, LOCAL_PR_ARG
1723 )
1724);
1725
1726TRACE_EVENT(api_sched_scan_stopped,
1727 TP_PROTO(struct ieee80211_local *local),
1728
1729 TP_ARGS(local),
1730
1731 TP_STRUCT__entry(
1732 LOCAL_ENTRY
1733 ),
1734
1735 TP_fast_assign(
1736 LOCAL_ASSIGN;
1737 ),
1738
1739 TP_printk(
1740 LOCAL_PR_FMT, LOCAL_PR_ARG
1741 )
1742);
1743
Johannes Bergb5878a22010-04-07 16:48:40 +02001744TRACE_EVENT(api_sta_block_awake,
1745 TP_PROTO(struct ieee80211_local *local,
1746 struct ieee80211_sta *sta, bool block),
1747
1748 TP_ARGS(local, sta, block),
1749
1750 TP_STRUCT__entry(
1751 LOCAL_ENTRY
1752 STA_ENTRY
1753 __field(bool, block)
1754 ),
1755
1756 TP_fast_assign(
1757 LOCAL_ASSIGN;
1758 STA_ASSIGN;
1759 __entry->block = block;
1760 ),
1761
1762 TP_printk(
1763 LOCAL_PR_FMT STA_PR_FMT " block:%d",
Seth Forshee15ac7c42013-02-15 13:15:48 -06001764 LOCAL_PR_ARG, STA_PR_ARG, __entry->block
Johannes Bergb5878a22010-04-07 16:48:40 +02001765 )
1766);
1767
Johannes Berg5ce6e432010-05-11 16:20:57 +02001768TRACE_EVENT(api_chswitch_done,
1769 TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
1770
1771 TP_ARGS(sdata, success),
1772
1773 TP_STRUCT__entry(
1774 VIF_ENTRY
1775 __field(bool, success)
1776 ),
1777
1778 TP_fast_assign(
1779 VIF_ASSIGN;
1780 __entry->success = success;
1781 ),
1782
1783 TP_printk(
1784 VIF_PR_FMT " success=%d",
1785 VIF_PR_ARG, __entry->success
1786 )
1787);
1788
Johannes Bergba99d932011-01-26 09:22:15 +01001789DEFINE_EVENT(local_only_evt, api_ready_on_channel,
Johannes Berg21f83582010-12-18 17:20:47 +01001790 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001791 TP_ARGS(local)
Johannes Berg21f83582010-12-18 17:20:47 +01001792);
1793
Johannes Bergba99d932011-01-26 09:22:15 +01001794DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
Johannes Berg21f83582010-12-18 17:20:47 +01001795 TP_PROTO(struct ieee80211_local *local),
Johannes Bergba99d932011-01-26 09:22:15 +01001796 TP_ARGS(local)
Johannes Berg21f83582010-12-18 17:20:47 +01001797);
1798
Johannes Bergc68f4b82011-07-05 16:35:41 +02001799TRACE_EVENT(api_gtk_rekey_notify,
1800 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1801 const u8 *bssid, const u8 *replay_ctr),
1802
1803 TP_ARGS(sdata, bssid, replay_ctr),
1804
1805 TP_STRUCT__entry(
1806 VIF_ENTRY
1807 __array(u8, bssid, ETH_ALEN)
1808 __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
1809 ),
1810
1811 TP_fast_assign(
1812 VIF_ASSIGN;
1813 memcpy(__entry->bssid, bssid, ETH_ALEN);
1814 memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
1815 ),
1816
1817 TP_printk(VIF_PR_FMT, VIF_PR_ARG)
1818);
1819
Meenakshi Venkataraman615f7b92011-07-08 08:46:22 -07001820TRACE_EVENT(api_enable_rssi_reports,
1821 TP_PROTO(struct ieee80211_sub_if_data *sdata,
1822 int rssi_min_thold, int rssi_max_thold),
1823
1824 TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
1825
1826 TP_STRUCT__entry(
1827 VIF_ENTRY
1828 __field(int, rssi_min_thold)
1829 __field(int, rssi_max_thold)
1830 ),
1831
1832 TP_fast_assign(
1833 VIF_ASSIGN;
1834 __entry->rssi_min_thold = rssi_min_thold;
1835 __entry->rssi_max_thold = rssi_max_thold;
1836 ),
1837
1838 TP_printk(
1839 VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
1840 VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
1841 )
1842);
1843
Johannes Berg37fbd902011-09-29 16:04:39 +02001844TRACE_EVENT(api_eosp,
1845 TP_PROTO(struct ieee80211_local *local,
1846 struct ieee80211_sta *sta),
1847
1848 TP_ARGS(local, sta),
1849
1850 TP_STRUCT__entry(
1851 LOCAL_ENTRY
1852 STA_ENTRY
1853 ),
1854
1855 TP_fast_assign(
1856 LOCAL_ASSIGN;
1857 STA_ASSIGN;
1858 ),
1859
1860 TP_printk(
1861 LOCAL_PR_FMT STA_PR_FMT,
Seth Forshee15ac7c42013-02-15 13:15:48 -06001862 LOCAL_PR_ARG, STA_PR_ARG
Johannes Berg37fbd902011-09-29 16:04:39 +02001863 )
1864);
1865
Johannes Bergb5878a22010-04-07 16:48:40 +02001866/*
1867 * Tracing for internal functions
1868 * (which may also be called in response to driver calls)
1869 */
1870
1871TRACE_EVENT(wake_queue,
1872 TP_PROTO(struct ieee80211_local *local, u16 queue,
1873 enum queue_stop_reason reason),
1874
1875 TP_ARGS(local, queue, reason),
1876
1877 TP_STRUCT__entry(
1878 LOCAL_ENTRY
1879 __field(u16, queue)
1880 __field(u32, reason)
1881 ),
1882
1883 TP_fast_assign(
1884 LOCAL_ASSIGN;
1885 __entry->queue = queue;
1886 __entry->reason = reason;
1887 ),
1888
1889 TP_printk(
1890 LOCAL_PR_FMT " queue:%d, reason:%d",
1891 LOCAL_PR_ARG, __entry->queue, __entry->reason
1892 )
1893);
1894
1895TRACE_EVENT(stop_queue,
1896 TP_PROTO(struct ieee80211_local *local, u16 queue,
1897 enum queue_stop_reason reason),
1898
1899 TP_ARGS(local, queue, reason),
1900
1901 TP_STRUCT__entry(
1902 LOCAL_ENTRY
1903 __field(u16, queue)
1904 __field(u32, reason)
1905 ),
1906
1907 TP_fast_assign(
1908 LOCAL_ASSIGN;
1909 __entry->queue = queue;
1910 __entry->reason = reason;
1911 ),
1912
1913 TP_printk(
1914 LOCAL_PR_FMT " queue:%d, reason:%d",
1915 LOCAL_PR_ARG, __entry->queue, __entry->reason
1916 )
1917);
Johannes Berg3fae0272012-06-22 13:36:25 +02001918
Yoni Divinskyde5fad82012-05-30 11:36:39 +03001919TRACE_EVENT(drv_set_default_unicast_key,
1920 TP_PROTO(struct ieee80211_local *local,
1921 struct ieee80211_sub_if_data *sdata,
1922 int key_idx),
1923
1924 TP_ARGS(local, sdata, key_idx),
1925
1926 TP_STRUCT__entry(
1927 LOCAL_ENTRY
1928 VIF_ENTRY
1929 __field(int, key_idx)
1930 ),
1931
1932 TP_fast_assign(
1933 LOCAL_ASSIGN;
1934 VIF_ASSIGN;
1935 __entry->key_idx = key_idx;
1936 ),
1937
1938 TP_printk(LOCAL_PR_FMT VIF_PR_FMT " key_idx:%d",
1939 LOCAL_PR_ARG, VIF_PR_ARG, __entry->key_idx)
1940);
1941
Simon Wunderlich164eb022013-02-08 18:16:20 +01001942TRACE_EVENT(api_radar_detected,
1943 TP_PROTO(struct ieee80211_local *local),
1944
1945 TP_ARGS(local),
1946
1947 TP_STRUCT__entry(
1948 LOCAL_ENTRY
1949 ),
1950
1951 TP_fast_assign(
1952 LOCAL_ASSIGN;
1953 ),
1954
1955 TP_printk(
1956 LOCAL_PR_FMT " radar detected",
1957 LOCAL_PR_ARG
1958 )
1959);
1960
Simon Wunderlich73da7d52013-07-11 16:09:06 +02001961TRACE_EVENT(drv_channel_switch_beacon,
1962 TP_PROTO(struct ieee80211_local *local,
1963 struct ieee80211_sub_if_data *sdata,
1964 struct cfg80211_chan_def *chandef),
1965
1966 TP_ARGS(local, sdata, chandef),
1967
1968 TP_STRUCT__entry(
1969 LOCAL_ENTRY
1970 VIF_ENTRY
1971 CHANDEF_ENTRY
1972 ),
1973
1974 TP_fast_assign(
1975 LOCAL_ASSIGN;
1976 VIF_ASSIGN;
1977 CHANDEF_ASSIGN(chandef);
1978 ),
1979
1980 TP_printk(
1981 LOCAL_PR_FMT VIF_PR_FMT " channel switch to " CHANDEF_PR_FMT,
1982 LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG
1983 )
1984);
1985
1986
Johannes Berg3fae0272012-06-22 13:36:25 +02001987#ifdef CONFIG_MAC80211_MESSAGE_TRACING
1988#undef TRACE_SYSTEM
1989#define TRACE_SYSTEM mac80211_msg
1990
1991#define MAX_MSG_LEN 100
1992
1993DECLARE_EVENT_CLASS(mac80211_msg_event,
1994 TP_PROTO(struct va_format *vaf),
1995
1996 TP_ARGS(vaf),
1997
1998 TP_STRUCT__entry(
1999 __dynamic_array(char, msg, MAX_MSG_LEN)
2000 ),
2001
2002 TP_fast_assign(
2003 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
2004 MAX_MSG_LEN, vaf->fmt,
2005 *vaf->va) >= MAX_MSG_LEN);
2006 ),
2007
2008 TP_printk("%s", __get_str(msg))
2009);
2010
2011DEFINE_EVENT(mac80211_msg_event, mac80211_info,
2012 TP_PROTO(struct va_format *vaf),
2013 TP_ARGS(vaf)
2014);
2015DEFINE_EVENT(mac80211_msg_event, mac80211_dbg,
2016 TP_PROTO(struct va_format *vaf),
2017 TP_ARGS(vaf)
2018);
2019DEFINE_EVENT(mac80211_msg_event, mac80211_err,
2020 TP_PROTO(struct va_format *vaf),
2021 TP_ARGS(vaf)
2022);
2023#endif
2024
Christian Lamparterf7428802009-07-19 23:21:07 +02002025#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02002026
2027#undef TRACE_INCLUDE_PATH
2028#define TRACE_INCLUDE_PATH .
2029#undef TRACE_INCLUDE_FILE
Johannes Berg011ad0e2012-06-22 12:55:52 +02002030#define TRACE_INCLUDE_FILE trace
Johannes Berg0a2b8bb2009-07-07 13:46:22 +02002031#include <trace/define_trace.h>