trace.h 49.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
#define __MAC80211_DRIVER_TRACE

#include <linux/tracepoint.h>
#include <net/mac80211.h>
#include "ieee80211_i.h"

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mac80211

#define MAXNAME		32
#define LOCAL_ENTRY	__array(char, wiphy_name, 32)
#define LOCAL_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
#define LOCAL_PR_FMT	"%s"
#define LOCAL_PR_ARG	__entry->wiphy_name

#define STA_ENTRY	__array(char, sta_addr, ETH_ALEN)
#define STA_ASSIGN	(sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
19
#define STA_NAMED_ASSIGN(s)	memcpy(__entry->sta_addr, (s)->addr, ETH_ALEN)
20 21 22
#define STA_PR_FMT	" sta:%pM"
#define STA_PR_ARG	__entry->sta_addr

23 24
#define VIF_ENTRY	__field(enum nl80211_iftype, vif_type) __field(void *, sdata)	\
			__field(bool, p2p)						\
Eliad Peller's avatar
Eliad Peller committed
25
			__string(vif_name, sdata->name)
26 27
#define VIF_ASSIGN	__entry->vif_type = sdata->vif.type; __entry->sdata = sdata;	\
			__entry->p2p = sdata->vif.p2p;					\
Eliad Peller's avatar
Eliad Peller committed
28
			__assign_str(vif_name, sdata->name)
29 30
#define VIF_PR_FMT	" vif:%s(%d%s)"
#define VIF_PR_ARG	__get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
31

32 33 34
#define CHANDEF_ENTRY	__field(u32, control_freq)					\
			__field(u32, chan_width)					\
			__field(u32, center_freq1)					\
35
			__field(u32, center_freq2)
36 37 38 39
#define CHANDEF_ASSIGN(c)								\
			__entry->control_freq = (c)->chan ? (c)->chan->center_freq : 0;	\
			__entry->chan_width = (c)->width;				\
			__entry->center_freq1 = (c)->center_freq1;			\
40
			__entry->center_freq2 = (c)->center_freq2;
41
#define CHANDEF_PR_FMT	" control:%d MHz width:%d center: %d/%d MHz"
42
#define CHANDEF_PR_ARG	__entry->control_freq, __entry->chan_width,			\
43 44
			__entry->center_freq1, __entry->center_freq2

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#define MIN_CHANDEF_ENTRY								\
			__field(u32, min_control_freq)					\
			__field(u32, min_chan_width)					\
			__field(u32, min_center_freq1)					\
			__field(u32, min_center_freq2)

#define MIN_CHANDEF_ASSIGN(c)								\
			__entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0;	\
			__entry->min_chan_width = (c)->width;				\
			__entry->min_center_freq1 = (c)->center_freq1;			\
			__entry->min_center_freq2 = (c)->center_freq2;
#define MIN_CHANDEF_PR_FMT	" min_control:%d MHz min_width:%d min_center: %d/%d MHz"
#define MIN_CHANDEF_PR_ARG	__entry->min_control_freq, __entry->min_chan_width,	\
			__entry->min_center_freq1, __entry->min_center_freq2

60
#define CHANCTX_ENTRY	CHANDEF_ENTRY							\
61
			MIN_CHANDEF_ENTRY						\
62
			__field(u8, rx_chains_static)					\
63
			__field(u8, rx_chains_dynamic)
64
#define CHANCTX_ASSIGN	CHANDEF_ASSIGN(&ctx->conf.def)					\
65
			MIN_CHANDEF_ASSIGN(&ctx->conf.min_def)				\
66
			__entry->rx_chains_static = ctx->conf.rx_chains_static;		\
67
			__entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
68 69
#define CHANCTX_PR_FMT	CHANDEF_PR_FMT MIN_CHANDEF_PR_FMT " chains:%d/%d"
#define CHANCTX_PR_ARG	CHANDEF_PR_ARG,	MIN_CHANDEF_PR_ARG,				\
70
			__entry->rx_chains_static, __entry->rx_chains_dynamic
71 72 73



Johannes Berg's avatar
Johannes Berg committed
74 75 76 77
/*
 * Tracing for driver callbacks.
 */

78
DECLARE_EVENT_CLASS(local_only_evt,
79 80 81 82 83 84 85 86 87 88
	TP_PROTO(struct ieee80211_local *local),
	TP_ARGS(local),
	TP_STRUCT__entry(
		LOCAL_ENTRY
	),
	TP_fast_assign(
		LOCAL_ASSIGN;
	),
	TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
);
89

90 91 92 93 94 95 96 97
DECLARE_EVENT_CLASS(local_sdata_addr_evt,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
98
		__array(char, addr, ETH_ALEN)
99 100 101 102 103
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
104
		memcpy(__entry->addr, sdata->vif.addr, ETH_ALEN);
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
	),

	TP_printk(
		LOCAL_PR_FMT  VIF_PR_FMT " addr:%pM",
		LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
	)
);

DECLARE_EVENT_CLASS(local_u32_evt,
	TP_PROTO(struct ieee80211_local *local, u32 value),
	TP_ARGS(local, value),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u32, value)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->value = value;
	),

	TP_printk(
		LOCAL_PR_FMT " value:%d",
		LOCAL_PR_ARG, __entry->value
	)
);

133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
DECLARE_EVENT_CLASS(local_sdata_evt,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
	),

	TP_printk(
		LOCAL_PR_FMT VIF_PR_FMT,
		LOCAL_PR_ARG, VIF_PR_ARG
	)
);

154 155 156 157 158
DEFINE_EVENT(local_only_evt, drv_return_void,
	TP_PROTO(struct ieee80211_local *local),
	TP_ARGS(local)
);

159 160
TRACE_EVENT(drv_return_int,
	TP_PROTO(struct ieee80211_local *local, int ret),
161 162 163 164 165
	TP_ARGS(local, ret),
	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(int, ret)
	),
166 167 168 169 170 171
	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->ret = ret;
	),
	TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
);
172

173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
TRACE_EVENT(drv_return_bool,
	TP_PROTO(struct ieee80211_local *local, bool ret),
	TP_ARGS(local, ret),
	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(bool, ret)
	),
	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->ret = ret;
	),
	TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
		  "true" : "false")
);

188 189 190 191 192 193 194 195 196 197 198 199 200 201
TRACE_EVENT(drv_return_u32,
	TP_PROTO(struct ieee80211_local *local, u32 ret),
	TP_ARGS(local, ret),
	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u32, ret)
	),
	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->ret = ret;
	),
	TP_printk(LOCAL_PR_FMT " - %u", LOCAL_PR_ARG, __entry->ret)
);

202 203 204 205 206 207 208
TRACE_EVENT(drv_return_u64,
	TP_PROTO(struct ieee80211_local *local, u64 ret),
	TP_ARGS(local, ret),
	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u64, ret)
	),
209 210 211 212
	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->ret = ret;
	),
213 214 215
	TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
);

216
DEFINE_EVENT(local_only_evt, drv_start,
217
	TP_PROTO(struct ieee80211_local *local),
218
	TP_ARGS(local)
219 220
);

221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
	     TP_PROTO(struct ieee80211_local *local, u32 sset),
	     TP_ARGS(local, sset)
);

DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
	     TP_PROTO(struct ieee80211_local *local, u32 sset),
	     TP_ARGS(local, sset)
);

DEFINE_EVENT(local_only_evt, drv_get_et_stats,
	     TP_PROTO(struct ieee80211_local *local),
	     TP_ARGS(local)
);

236 237 238 239 240 241 242 243 244 245
DEFINE_EVENT(local_only_evt, drv_suspend,
	TP_PROTO(struct ieee80211_local *local),
	TP_ARGS(local)
);

DEFINE_EVENT(local_only_evt, drv_resume,
	TP_PROTO(struct ieee80211_local *local),
	TP_ARGS(local)
);

246 247 248 249 250 251 252 253 254 255 256 257 258 259
TRACE_EVENT(drv_set_wakeup,
	TP_PROTO(struct ieee80211_local *local, bool enabled),
	TP_ARGS(local, enabled),
	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(bool, enabled)
	),
	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->enabled = enabled;
	),
	TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
);

260
DEFINE_EVENT(local_only_evt, drv_stop,
261
	TP_PROTO(struct ieee80211_local *local),
262
	TP_ARGS(local)
263 264
);

265
DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
266
	TP_PROTO(struct ieee80211_local *local,
267
		 struct ieee80211_sub_if_data *sdata),
268
	TP_ARGS(local, sdata)
269 270
);

271 272 273
TRACE_EVENT(drv_change_interface,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
274
		 enum nl80211_iftype type, bool p2p),
275

276
	TP_ARGS(local, sdata, type, p2p),
277 278 279 280 281

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		__field(u32, new_type)
282
		__field(bool, new_p2p)
283 284 285 286 287 288
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		__entry->new_type = type;
289
		__entry->new_p2p = p2p;
290 291 292
	),

	TP_printk(
293 294 295
		LOCAL_PR_FMT  VIF_PR_FMT " new type:%d%s",
		LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
		__entry->new_p2p ? "/p2p" : ""
296 297 298
	)
);

299 300 301 302
DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
303 304 305 306
);

TRACE_EVENT(drv_config,
	TP_PROTO(struct ieee80211_local *local,
307
		 u32 changed),
308

309
	TP_ARGS(local, changed),
310 311 312 313

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u32, changed)
314 315 316 317 318 319 320
		__field(u32, flags)
		__field(int, power_level)
		__field(int, dynamic_ps_timeout)
		__field(int, max_sleep_period)
		__field(u16, listen_interval)
		__field(u8, long_frame_max_tx_count)
		__field(u8, short_frame_max_tx_count)
321
		CHANDEF_ENTRY
322
		__field(int, smps)
323 324 325 326 327
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->changed = changed;
328 329 330 331 332
		__entry->flags = local->hw.conf.flags;
		__entry->power_level = local->hw.conf.power_level;
		__entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
		__entry->max_sleep_period = local->hw.conf.max_sleep_period;
		__entry->listen_interval = local->hw.conf.listen_interval;
333 334 335 336
		__entry->long_frame_max_tx_count =
			local->hw.conf.long_frame_max_tx_count;
		__entry->short_frame_max_tx_count =
			local->hw.conf.short_frame_max_tx_count;
337
		CHANDEF_ASSIGN(&local->hw.conf.chandef)
338
		__entry->smps = local->hw.conf.smps_mode;
339 340 341
	),

	TP_printk(
342 343
		LOCAL_PR_FMT " ch:%#x" CHANDEF_PR_FMT,
		LOCAL_PR_ARG, __entry->changed, CHANDEF_PR_ARG
344 345 346 347 348
	)
);

TRACE_EVENT(drv_bss_info_changed,
	TP_PROTO(struct ieee80211_local *local,
Johannes Berg's avatar
Johannes Berg committed
349
		 struct ieee80211_sub_if_data *sdata,
350 351 352
		 struct ieee80211_bss_conf *info,
		 u32 changed),

Johannes Berg's avatar
Johannes Berg committed
353
	TP_ARGS(local, sdata, info, changed),
354 355 356 357

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
358
		__field(u32, changed)
359
		__field(bool, assoc)
360 361
		__field(bool, ibss_joined)
		__field(bool, ibss_creator)
362 363 364 365
		__field(u16, aid)
		__field(bool, cts)
		__field(bool, shortpre)
		__field(bool, shortslot)
366
		__field(bool, enable_beacon)
367 368 369
		__field(u8, dtimper)
		__field(u16, bcnint)
		__field(u16, assoc_cap)
370 371
		__field(u64, sync_tsf)
		__field(u32, sync_device_ts)
372
		__field(u8, sync_dtim_count)
373
		__field(u32, basic_rates)
374
		__array(int, mcast_rate, IEEE80211_NUM_BANDS)
375
		__field(u16, ht_operation_mode)
376 377
		__field(s32, cqm_rssi_thold);
		__field(s32, cqm_rssi_hyst);
378 379
		__field(u32, channel_width);
		__field(u32, channel_cfreq1);
380 381 382 383 384
		__dynamic_array(u32, arp_addr_list,
				info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
					IEEE80211_BSS_ARP_ADDR_LIST_LEN :
					info->arp_addr_cnt);
		__field(int, arp_addr_cnt);
385 386 387 388 389
		__field(bool, qos);
		__field(bool, idle);
		__field(bool, ps);
		__dynamic_array(u8, ssid, info->ssid_len);
		__field(bool, hidden_ssid);
390
		__field(int, txpower)
391
		__field(u8, p2p_oppps_ctwindow)
392 393 394 395 396 397 398 399
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		__entry->changed = changed;
		__entry->aid = info->aid;
		__entry->assoc = info->assoc;
400 401
		__entry->ibss_joined = info->ibss_joined;
		__entry->ibss_creator = info->ibss_creator;
402 403 404
		__entry->shortpre = info->use_short_preamble;
		__entry->cts = info->use_cts_prot;
		__entry->shortslot = info->use_short_slot;
405
		__entry->enable_beacon = info->enable_beacon;
406 407 408
		__entry->dtimper = info->dtim_period;
		__entry->bcnint = info->beacon_int;
		__entry->assoc_cap = info->assoc_capability;
409 410
		__entry->sync_tsf = info->sync_tsf;
		__entry->sync_device_ts = info->sync_device_ts;
411
		__entry->sync_dtim_count = info->sync_dtim_count;
412
		__entry->basic_rates = info->basic_rates;
413 414
		memcpy(__entry->mcast_rate, info->mcast_rate,
		       sizeof(__entry->mcast_rate));
415
		__entry->ht_operation_mode = info->ht_operation_mode;
416 417
		__entry->cqm_rssi_thold = info->cqm_rssi_thold;
		__entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
418 419
		__entry->channel_width = info->chandef.width;
		__entry->channel_cfreq1 = info->chandef.center_freq1;
420
		__entry->arp_addr_cnt = info->arp_addr_cnt;
421
		memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
422 423 424
		       sizeof(u32) * (info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
					IEEE80211_BSS_ARP_ADDR_LIST_LEN :
					info->arp_addr_cnt));
425 426 427 428 429
		__entry->qos = info->qos;
		__entry->idle = info->idle;
		__entry->ps = info->ps;
		memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
		__entry->hidden_ssid = info->hidden_ssid;
430
		__entry->txpower = info->txpower;
431
		__entry->p2p_oppps_ctwindow = info->p2p_noa_attr.oppps_ctwindow;
432 433 434 435 436 437 438 439
	),

	TP_printk(
		LOCAL_PR_FMT  VIF_PR_FMT " changed:%#x",
		LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
	)
);

440
TRACE_EVENT(drv_prepare_multicast,
441
	TP_PROTO(struct ieee80211_local *local, int mc_count),
442

443
	TP_ARGS(local, mc_count),
444 445 446 447 448 449 450 451 452 453 454 455

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(int, mc_count)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->mc_count = mc_count;
	),

	TP_printk(
456 457
		LOCAL_PR_FMT " prepare mc (%d)",
		LOCAL_PR_ARG, __entry->mc_count
458 459 460
	)
);

461 462 463 464
TRACE_EVENT(drv_configure_filter,
	TP_PROTO(struct ieee80211_local *local,
		 unsigned int changed_flags,
		 unsigned int *total_flags,
465
		 u64 multicast),
466

467
	TP_ARGS(local, changed_flags, total_flags, multicast),
468 469 470 471 472

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(unsigned int, changed)
		__field(unsigned int, total)
473
		__field(u64, multicast)
474 475 476 477 478 479
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->changed = changed_flags;
		__entry->total = *total_flags;
480
		__entry->multicast = multicast;
481 482 483
	),

	TP_printk(
484 485
		LOCAL_PR_FMT " changed:%#x total:%#x",
		LOCAL_PR_ARG, __entry->changed, __entry->total
486 487 488 489 490
	)
);

TRACE_EVENT(drv_set_tim,
	TP_PROTO(struct ieee80211_local *local,
491
		 struct ieee80211_sta *sta, bool set),
492

493
	TP_ARGS(local, sta, set),
494 495 496 497 498 499 500 501 502 503 504 505 506 507

	TP_STRUCT__entry(
		LOCAL_ENTRY
		STA_ENTRY
		__field(bool, set)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		STA_ASSIGN;
		__entry->set = set;
	),

	TP_printk(
508
		LOCAL_PR_FMT STA_PR_FMT " set:%d",
509
		LOCAL_PR_ARG, STA_PR_ARG, __entry->set
510 511 512 513 514
	)
);

TRACE_EVENT(drv_set_key,
	TP_PROTO(struct ieee80211_local *local,
Johannes Berg's avatar
Johannes Berg committed
515
		 enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
516
		 struct ieee80211_sta *sta,
517
		 struct ieee80211_key_conf *key),
518

519
	TP_ARGS(local, cmd, sdata, sta, key),
520 521 522 523 524

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		STA_ENTRY
525
		__field(u32, cipher)
526 527 528 529 530 531 532 533 534
		__field(u8, hw_key_idx)
		__field(u8, flags)
		__field(s8, keyidx)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		STA_ASSIGN;
535
		__entry->cipher = key->cipher;
536 537 538 539 540 541
		__entry->flags = key->flags;
		__entry->keyidx = key->keyidx;
		__entry->hw_key_idx = key->hw_key_idx;
	),

	TP_printk(
542 543
		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
544 545 546 547 548
	)
);

TRACE_EVENT(drv_update_tkip_key,
	TP_PROTO(struct ieee80211_local *local,
549
		 struct ieee80211_sub_if_data *sdata,
550
		 struct ieee80211_key_conf *conf,
551
		 struct ieee80211_sta *sta, u32 iv32),
552

553
	TP_ARGS(local, sdata, conf, sta, iv32),
554 555 556

	TP_STRUCT__entry(
		LOCAL_ENTRY
557 558
		VIF_ENTRY
		STA_ENTRY
559 560 561 562 563
		__field(u32, iv32)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
564 565
		VIF_ASSIGN;
		STA_ASSIGN;
566 567 568 569
		__entry->iv32 = iv32;
	),

	TP_printk(
570
		LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
Weilong Chen's avatar
Weilong Chen committed
571
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->iv32
572 573 574
	)
);

575
DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
576
	TP_PROTO(struct ieee80211_local *local,
577 578 579
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
);
580

581 582 583 584 585 586
DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
);

587 588 589 590 591
DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
);
592

593 594 595 596
DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
597 598
);

599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619
TRACE_EVENT(drv_sw_scan_start,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 const u8 *mac_addr),

	TP_ARGS(local, sdata, mac_addr),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		__array(char, mac_addr, ETH_ALEN)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		memcpy(__entry->mac_addr, mac_addr, ETH_ALEN);
	),

	TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", addr:%pM",
		  LOCAL_PR_ARG, VIF_PR_ARG, __entry->mac_addr)
620 621
);

622 623 624 625
DEFINE_EVENT(local_sdata_evt, drv_sw_scan_complete,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
);

TRACE_EVENT(drv_get_stats,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_low_level_stats *stats,
		 int ret),

	TP_ARGS(local, stats, ret),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(int, ret)
		__field(unsigned int, ackfail)
		__field(unsigned int, rtsfail)
		__field(unsigned int, fcserr)
		__field(unsigned int, rtssucc)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->ret = ret;
		__entry->ackfail = stats->dot11ACKFailureCount;
		__entry->rtsfail = stats->dot11RTSFailureCount;
		__entry->fcserr = stats->dot11FCSErrorCount;
		__entry->rtssucc = stats->dot11RTSSuccessCount;
	),

	TP_printk(
		LOCAL_PR_FMT " ret:%d",
		LOCAL_PR_ARG, __entry->ret
	)
);

TRACE_EVENT(drv_get_tkip_seq,
	TP_PROTO(struct ieee80211_local *local,
		 u8 hw_key_idx, u32 *iv32, u16 *iv16),

	TP_ARGS(local, hw_key_idx, iv32, iv16),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u8, hw_key_idx)
		__field(u32, iv32)
		__field(u16, iv16)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->hw_key_idx = hw_key_idx;
		__entry->iv32 = *iv32;
		__entry->iv16 = *iv16;
	),

	TP_printk(
		LOCAL_PR_FMT, LOCAL_PR_ARG
	)
);

684
DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
685
	TP_PROTO(struct ieee80211_local *local, u32 value),
686
	TP_ARGS(local, value)
687 688
);

689
DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
690
	TP_PROTO(struct ieee80211_local *local, u32 value),
691
	TP_ARGS(local, value)
692 693 694
);

TRACE_EVENT(drv_set_coverage_class,
695
	TP_PROTO(struct ieee80211_local *local, s16 value),
696

697
	TP_ARGS(local, value),
698 699 700

	TP_STRUCT__entry(
		LOCAL_ENTRY
701
		__field(s16, value)
702 703 704
	),

	TP_fast_assign(
705 706 707 708 709
		LOCAL_ASSIGN;
		__entry->value = value;
	),

	TP_printk(
710 711
		LOCAL_PR_FMT " value:%d",
		LOCAL_PR_ARG, __entry->value
712 713 714 715 716
	)
);

TRACE_EVENT(drv_sta_notify,
	TP_PROTO(struct ieee80211_local *local,
Johannes Berg's avatar
Johannes Berg committed
717
		 struct ieee80211_sub_if_data *sdata,
718 719 720
		 enum sta_notify_cmd cmd,
		 struct ieee80211_sta *sta),

Johannes Berg's avatar
Johannes Berg committed
721
	TP_ARGS(local, sdata, cmd, sta),
722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		STA_ENTRY
		__field(u32, cmd)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		STA_ASSIGN;
		__entry->cmd = cmd;
	),

	TP_printk(
		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " cmd:%d",
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
	)
);

743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774
TRACE_EVENT(drv_sta_state,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_sta *sta,
		 enum ieee80211_sta_state old_state,
		 enum ieee80211_sta_state new_state),

	TP_ARGS(local, sdata, sta, old_state, new_state),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		STA_ENTRY
		__field(u32, old_state)
		__field(u32, new_state)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		STA_ASSIGN;
		__entry->old_state = old_state;
		__entry->new_state = new_state;
	),

	TP_printk(
		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " state: %d->%d",
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
		__entry->old_state, __entry->new_state
	)
);

775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802
TRACE_EVENT(drv_sta_rc_update,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_sta *sta,
		 u32 changed),

	TP_ARGS(local, sdata, sta, changed),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		STA_ENTRY
		__field(u32, changed)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		STA_ASSIGN;
		__entry->changed = changed;
	),

	TP_printk(
		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT " changed: 0x%x",
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
	)
);

803
DECLARE_EVENT_CLASS(sta_event,
804 805
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
806
		 struct ieee80211_sta *sta),
807

808
	TP_ARGS(local, sdata, sta),
809 810 811 812 813 814 815 816 817 818 819 820 821 822

	TP_STRUCT__entry(
		LOCAL_ENTRY
		VIF_ENTRY
		STA_ENTRY
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		VIF_ASSIGN;
		STA_ASSIGN;
	),

	TP_printk(
823 824
		LOCAL_PR_FMT  VIF_PR_FMT  STA_PR_FMT,
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
825 826 827
	)
);

828
DEFINE_EVENT(sta_event, drv_sta_add,
829 830 831
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_sta *sta),
832 833
	TP_ARGS(local, sdata, sta)
);
834

835 836 837 838 839 840
DEFINE_EVENT(sta_event, drv_sta_remove,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_sta *sta),
	TP_ARGS(local, sdata, sta)
);
841

842 843 844 845 846
DEFINE_EVENT(sta_event, drv_sta_pre_rcu_remove,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_sta *sta),
	TP_ARGS(local, sdata, sta)
847 848
);

849 850 851 852 853 854 855
DEFINE_EVENT(sta_event, drv_sta_rate_tbl_update,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_sta *sta),
	TP_ARGS(local, sdata, sta)
);

856
TRACE_EVENT(drv_conf_tx,
857 858
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
859
		 u16 ac, const struct ieee80211_tx_queue_params *params),
860

861
	TP_ARGS(local, sdata, ac, params),
862 863 864

	TP_STRUCT__entry(
		LOCAL_ENTRY
865
		VIF_ENTRY
866
		__field(u16, ac)
867 868 869 870
		__field(u16, txop)
		__field(u16, cw_min)
		__field(u16, cw_max)
		__field(u8, aifs)
871
		__field(bool, uapsd)
872 873 874 875
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
876
		VIF_ASSIGN;
877
		__entry->ac = ac;
878 879 880 881
		__entry->txop = params->txop;
		__entry->cw_max = params->cw_max;
		__entry->cw_min = params->cw_min;
		__entry->aifs = params->aifs;
882
		__entry->uapsd = params->uapsd;
883 884 885
	),

	TP_printk(
886 887
		LOCAL_PR_FMT  VIF_PR_FMT  " AC:%d",
		LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
888 889 890
	)
);

891 892 893 894
DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
895 896 897
);

TRACE_EVENT(drv_set_tsf,
898 899 900
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 u64 tsf),
901

902
	TP_ARGS(local, sdata, tsf),
903 904 905

	TP_STRUCT__entry(
		LOCAL_ENTRY
906
		VIF_ENTRY
907 908 909 910 911
		__field(u64, tsf)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
912
		VIF_ASSIGN;
913 914 915 916
		__entry->tsf = tsf;
	),

	TP_printk(
917 918
		LOCAL_PR_FMT  VIF_PR_FMT  " tsf:%llu",
		LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
919 920 921
	)
);

922 923 924 925
DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata),
	TP_ARGS(local, sdata)
926 927
);

928
DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
929
	TP_PROTO(struct ieee80211_local *local),
930
	TP_ARGS(local)
931 932 933 934
);

TRACE_EVENT(drv_ampdu_action,
	TP_PROTO(struct ieee80211_local *local,
Johannes Berg's avatar
Johannes Berg committed
935
		 struct ieee80211_sub_if_data *sdata,
936 937
		 enum ieee80211_ampdu_mlme_action action,
		 struct ieee80211_sta *sta, u16 tid,
938
		 u16 *ssn, u8 buf_size),
939

940
	TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
941 942 943 944 945 946 947

	TP_STRUCT__entry(
		LOCAL_ENTRY
		STA_ENTRY
		__field(u32, action)
		__field(u16, tid)
		__field(u16, ssn)
948
		__field(u8, buf_size)
949
		VIF_ENTRY
950 951 952 953
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
954
		VIF_ASSIGN;
955 956 957
		STA_ASSIGN;
		__entry->action = action;
		__entry->tid = tid;
958
		__entry->ssn = ssn ? *ssn : 0;
959
		__entry->buf_size = buf_size;
960 961 962
	),

	TP_printk(
963 964 965
		LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
		LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
		__entry->tid, __entry->buf_size
966 967
	)
);
968

969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990
TRACE_EVENT(drv_get_survey,
	TP_PROTO(struct ieee80211_local *local, int idx,
		 struct survey_info *survey),

	TP_ARGS(local, idx, survey),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(int, idx)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->idx = idx;
	),

	TP_printk(
		LOCAL_PR_FMT " idx:%d",
		LOCAL_PR_ARG, __entry->idx
	)
);

991
TRACE_EVENT(drv_flush,
992 993
	TP_PROTO(struct ieee80211_local *local,
		 u32 queues, bool drop),
994

995
	TP_ARGS(local, queues, drop),
996 997 998 999

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(bool, drop)
1000
		__field(u32, queues)
1001 1002 1003 1004 1005
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->drop = drop;
1006
		__entry->queues = queues;
1007 1008 1009
	),

	TP_printk(
1010 1011
		LOCAL_PR_FMT " queues:0x%x drop:%d",
		LOCAL_PR_ARG, __entry->queues, __entry->drop
1012 1013
	)
);
Johannes Berg's avatar
Johannes Berg committed
1014

1015 1016
TRACE_EVENT(drv_channel_switch,
	TP_PROTO(struct ieee80211_local *local,
1017
		 struct ieee80211_sub_if_data *sdata,
1018 1019
		 struct ieee80211_channel_switch *ch_switch),

1020
	TP_ARGS(local, sdata, ch_switch),
1021 1022 1023

	TP_STRUCT__entry(
		LOCAL_ENTRY
1024
		VIF_ENTRY
1025
		CHANDEF_ENTRY
1026
		__field(u64, timestamp)
1027
		__field(u32, device_timestamp)
1028 1029 1030 1031 1032 1033
		__field(bool, block_tx)
		__field(u8, count)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
1034
		VIF_ASSIGN;
1035
		CHANDEF_ASSIGN(&ch_switch->chandef)
1036
		__entry->timestamp = ch_switch->timestamp;
1037
		__entry->device_timestamp = ch_switch->device_timestamp;
1038 1039 1040 1041 1042
		__entry->block_tx = ch_switch->block_tx;
		__entry->count = ch_switch->count;
	),

	TP_printk(
1043 1044
		LOCAL_PR_FMT VIF_PR_FMT " new " CHANDEF_PR_FMT " count:%d",
		LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count
1045 1046 1047
	)
);

1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097
TRACE_EVENT(drv_set_antenna,
	TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),

	TP_ARGS(local, tx_ant, rx_ant, ret),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u32, tx_ant)
		__field(u32, rx_ant)
		__field(int, ret)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->tx_ant = tx_ant;
		__entry->rx_ant = rx_ant;
		__entry->ret = ret;
	),

	TP_printk(
		LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
		LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
	)
);

TRACE_EVENT(drv_get_antenna,
	TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),

	TP_ARGS(local, tx_ant, rx_ant, ret),

	TP_STRUCT__entry(
		LOCAL_ENTRY
		__field(u32, tx_ant)
		__field(u32, rx_ant)
		__field(int, ret)
	),

	TP_fast_assign(
		LOCAL_ASSIGN;
		__entry->tx_ant = tx_ant;
		__entry->rx_ant = rx_ant;
		__entry->ret = ret;
	),

	TP_printk(
		LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
		LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
	)
);

1098
TRACE_EVENT(drv_remain_on_channel,
1099 1100 1101
	TP_PROTO(struct ieee80211_local *local,
		 struct ieee80211_sub_if_data *sdata,
		 struct ieee80211_channel *chan,
1102 1103
		 unsigned int duration,
		 enum ieee80211_roc_type type),
1104

1105
	TP_ARGS(local, sdata, chan, duration, type),
1106 1107 1108

	TP_STRUCT__entry(
		LOCAL_ENTRY
1109
		VIF_ENTRY
1110 1111
		__field(int, center_freq)
		__field(unsigned int, duration)