trace.h 101.1 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
B
Beni Lev 已提交
2 3 4 5 6 7 8 9 10
#undef TRACE_SYSTEM
#define TRACE_SYSTEM cfg80211

#if !defined(__RDEV_OPS_TRACE) || defined(TRACE_HEADER_MULTI_READ)
#define __RDEV_OPS_TRACE

#include <linux/tracepoint.h>

#include <linux/rtnetlink.h>
11
#include <linux/etherdevice.h>
B
Beni Lev 已提交
12 13 14 15 16 17 18 19
#include <net/cfg80211.h>
#include "core.h"

#define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)
#define MAC_ASSIGN(entry_mac, given_mac) do {			     \
	if (given_mac)						     \
		memcpy(__entry->entry_mac, given_mac, ETH_ALEN);     \
	else							     \
20
		eth_zero_addr(__entry->entry_mac);		     \
B
Beni Lev 已提交
21 22 23 24
	} while (0)
#define MAC_PR_FMT "%pM"
#define MAC_PR_ARG(entry_mac) (__entry->entry_mac)

25 26 27 28 29 30 31
#define MAXNAME		32
#define WIPHY_ENTRY	__array(char, wiphy_name, 32)
#define WIPHY_ASSIGN	strlcpy(__entry->wiphy_name, wiphy_name(wiphy), MAXNAME)
#define WIPHY_PR_FMT	"%s"
#define WIPHY_PR_ARG	__entry->wiphy_name

#define WDEV_ENTRY	__field(u32, id)
J
Johannes Berg 已提交
32 33
#define WDEV_ASSIGN	(__entry->id) = (!IS_ERR_OR_NULL(wdev)	\
					 ? wdev->identifier : 0)
34 35 36 37 38
#define WDEV_PR_FMT	"wdev(%u)"
#define WDEV_PR_ARG	(__entry->id)

#define NETDEV_ENTRY	__array(char, name, IFNAMSIZ) \
			__field(int, ifindex)
B
Beni Lev 已提交
39 40 41 42 43
#define NETDEV_ASSIGN					       \
	do {						       \
		memcpy(__entry->name, netdev->name, IFNAMSIZ); \
		(__entry->ifindex) = (netdev->ifindex);	       \
	} while (0)
44 45
#define NETDEV_PR_FMT	"netdev:%s(%d)"
#define NETDEV_PR_ARG	__entry->name, __entry->ifindex
B
Beni Lev 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

#define MESH_CFG_ENTRY __field(u16, dot11MeshRetryTimeout)		   \
		       __field(u16, dot11MeshConfirmTimeout)		   \
		       __field(u16, dot11MeshHoldingTimeout)		   \
		       __field(u16, dot11MeshMaxPeerLinks)		   \
		       __field(u8, dot11MeshMaxRetries)			   \
		       __field(u8, dot11MeshTTL)			   \
		       __field(u8, element_ttl)				   \
		       __field(bool, auto_open_plinks)			   \
		       __field(u32, dot11MeshNbrOffsetMaxNeighbor)	   \
		       __field(u8, dot11MeshHWMPmaxPREQretries)		   \
		       __field(u32, path_refresh_time)			   \
		       __field(u32, dot11MeshHWMPactivePathTimeout)	   \
		       __field(u16, min_discovery_timeout)		   \
		       __field(u16, dot11MeshHWMPpreqMinInterval)	   \
		       __field(u16, dot11MeshHWMPperrMinInterval)	   \
		       __field(u16, dot11MeshHWMPnetDiameterTraversalTime) \
		       __field(u8, dot11MeshHWMPRootMode)		   \
		       __field(u16, dot11MeshHWMPRannInterval)		   \
		       __field(bool, dot11MeshGateAnnouncementProtocol)	   \
		       __field(bool, dot11MeshForwarding)		   \
		       __field(s32, rssi_threshold)			   \
		       __field(u16, ht_opmode)				   \
		       __field(u32, dot11MeshHWMPactivePathToRootTimeout)  \
		       __field(u16, dot11MeshHWMProotInterval)		   \
71 72
		       __field(u16, dot11MeshHWMPconfirmationInterval)	   \
		       __field(bool, dot11MeshNolearn)
B
Beni Lev 已提交
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
#define MESH_CFG_ASSIGN							      \
	do {								      \
		__entry->dot11MeshRetryTimeout = conf->dot11MeshRetryTimeout; \
		__entry->dot11MeshConfirmTimeout =			      \
				conf->dot11MeshConfirmTimeout;		      \
		__entry->dot11MeshHoldingTimeout =			      \
				conf->dot11MeshHoldingTimeout;		      \
		__entry->dot11MeshMaxPeerLinks = conf->dot11MeshMaxPeerLinks; \
		__entry->dot11MeshMaxRetries = conf->dot11MeshMaxRetries;     \
		__entry->dot11MeshTTL = conf->dot11MeshTTL;		      \
		__entry->element_ttl = conf->element_ttl;		      \
		__entry->auto_open_plinks = conf->auto_open_plinks;	      \
		__entry->dot11MeshNbrOffsetMaxNeighbor =		      \
				conf->dot11MeshNbrOffsetMaxNeighbor;	      \
		__entry->dot11MeshHWMPmaxPREQretries =			      \
				conf->dot11MeshHWMPmaxPREQretries;	      \
		__entry->path_refresh_time = conf->path_refresh_time;	      \
		__entry->dot11MeshHWMPactivePathTimeout =		      \
				conf->dot11MeshHWMPactivePathTimeout;	      \
		__entry->min_discovery_timeout = conf->min_discovery_timeout; \
		__entry->dot11MeshHWMPpreqMinInterval =			      \
				conf->dot11MeshHWMPpreqMinInterval;	      \
		__entry->dot11MeshHWMPperrMinInterval =			      \
				conf->dot11MeshHWMPperrMinInterval;	      \
		__entry->dot11MeshHWMPnetDiameterTraversalTime =	      \
				conf->dot11MeshHWMPnetDiameterTraversalTime;  \
		__entry->dot11MeshHWMPRootMode = conf->dot11MeshHWMPRootMode; \
		__entry->dot11MeshHWMPRannInterval =			      \
				conf->dot11MeshHWMPRannInterval;	      \
		__entry->dot11MeshGateAnnouncementProtocol =		      \
				conf->dot11MeshGateAnnouncementProtocol;      \
		__entry->dot11MeshForwarding = conf->dot11MeshForwarding;     \
		__entry->rssi_threshold = conf->rssi_threshold;		      \
		__entry->ht_opmode = conf->ht_opmode;			      \
		__entry->dot11MeshHWMPactivePathToRootTimeout =		      \
				conf->dot11MeshHWMPactivePathToRootTimeout;   \
		__entry->dot11MeshHWMProotInterval =			      \
				conf->dot11MeshHWMProotInterval;	      \
		__entry->dot11MeshHWMPconfirmationInterval =		      \
				conf->dot11MeshHWMPconfirmationInterval;      \
113
		__entry->dot11MeshNolearn = conf->dot11MeshNolearn;	      \
B
Beni Lev 已提交
114 115
	} while (0)

116
#define CHAN_ENTRY __field(enum nl80211_band, band) \
117 118
		   __field(u32, center_freq)		\
		   __field(u16, freq_offset)
B
Beni Lev 已提交
119 120 121 122 123
#define CHAN_ASSIGN(chan)					  \
	do {							  \
		if (chan) {					  \
			__entry->band = chan->band;		  \
			__entry->center_freq = chan->center_freq; \
124
			__entry->freq_offset = chan->freq_offset; \
B
Beni Lev 已提交
125 126 127
		} else {					  \
			__entry->band = 0;			  \
			__entry->center_freq = 0;		  \
128
			__entry->freq_offset = 0;		  \
B
Beni Lev 已提交
129 130
		}						  \
	} while (0)
131 132
#define CHAN_PR_FMT "band: %d, freq: %u.%03u"
#define CHAN_PR_ARG __entry->band, __entry->center_freq, __entry->freq_offset
B
Beni Lev 已提交
133

134
#define CHAN_DEF_ENTRY __field(enum nl80211_band, band)		\
135
		       __field(u32, control_freq)			\
136
		       __field(u32, freq_offset)			\
137 138
		       __field(u32, width)				\
		       __field(u32, center_freq1)			\
139
		       __field(u32, freq1_offset)			\
140
		       __field(u32, center_freq2)
141 142 143 144
#define CHAN_DEF_ASSIGN(chandef)					\
	do {								\
		if ((chandef) && (chandef)->chan) {			\
			__entry->band = (chandef)->chan->band;		\
145
			__entry->control_freq =				\
146
				(chandef)->chan->center_freq;		\
147 148
			__entry->freq_offset =				\
				(chandef)->chan->freq_offset;		\
149 150
			__entry->width = (chandef)->width;		\
			__entry->center_freq1 = (chandef)->center_freq1;\
151
			__entry->freq1_offset = (chandef)->freq1_offset;\
152
			__entry->center_freq2 = (chandef)->center_freq2;\
153 154
		} else {						\
			__entry->band = 0;				\
155
			__entry->control_freq = 0;			\
156
			__entry->freq_offset = 0;			\
157 158
			__entry->width = 0;				\
			__entry->center_freq1 = 0;			\
159
			__entry->freq1_offset = 0;			\
160
			__entry->center_freq2 = 0;			\
161 162
		}							\
	} while (0)
163
#define CHAN_DEF_PR_FMT							\
164
	"band: %d, control freq: %u.%03u, width: %d, cf1: %u.%03u, cf2: %u"
165
#define CHAN_DEF_PR_ARG __entry->band, __entry->control_freq,		\
166 167
			__entry->freq_offset, __entry->width,		\
			__entry->center_freq1, __entry->freq1_offset,	\
168
			__entry->center_freq2
169

170 171 172 173 174 175 176 177 178 179 180 181 182
#define FILS_AAD_ASSIGN(fa)						\
	do {								\
		if (fa) {						\
			ether_addr_copy(__entry->macaddr, fa->macaddr);	\
			__entry->kek_len = fa->kek_len;			\
		} else {						\
			eth_zero_addr(__entry->macaddr);		\
			__entry->kek_len = 0;				\
		}							\
	} while (0)
#define FILS_AAD_PR_FMT							\
	"macaddr: %pM, kek_len: %d"

B
Beni Lev 已提交
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
#define SINFO_ENTRY __field(int, generation)	    \
		    __field(u32, connected_time)    \
		    __field(u32, inactive_time)	    \
		    __field(u32, rx_bytes)	    \
		    __field(u32, tx_bytes)	    \
		    __field(u32, rx_packets)	    \
		    __field(u32, tx_packets)	    \
		    __field(u32, tx_retries)	    \
		    __field(u32, tx_failed)	    \
		    __field(u32, rx_dropped_misc)   \
		    __field(u32, beacon_loss_count) \
		    __field(u16, llid)		    \
		    __field(u16, plid)		    \
		    __field(u8, plink_state)
#define SINFO_ASSIGN						       \
	do {							       \
		__entry->generation = sinfo->generation;	       \
		__entry->connected_time = sinfo->connected_time;       \
		__entry->inactive_time = sinfo->inactive_time;	       \
		__entry->rx_bytes = sinfo->rx_bytes;		       \
		__entry->tx_bytes = sinfo->tx_bytes;		       \
		__entry->rx_packets = sinfo->rx_packets;	       \
		__entry->tx_packets = sinfo->tx_packets;	       \
		__entry->tx_retries = sinfo->tx_retries;	       \
		__entry->tx_failed = sinfo->tx_failed;		       \
		__entry->rx_dropped_misc = sinfo->rx_dropped_misc;     \
		__entry->beacon_loss_count = sinfo->beacon_loss_count; \
		__entry->llid = sinfo->llid;			       \
		__entry->plid = sinfo->plid;			       \
		__entry->plink_state = sinfo->plink_state;	       \
	} while (0)

#define BOOL_TO_STR(bo) (bo) ? "true" : "false"

217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
#define QOS_MAP_ENTRY __field(u8, num_des)			\
		      __array(u8, dscp_exception,		\
			      2 * IEEE80211_QOS_MAP_MAX_EX)	\
		      __array(u8, up, IEEE80211_QOS_MAP_LEN_MIN)
#define QOS_MAP_ASSIGN(qos_map)					\
	do {							\
		if ((qos_map)) {				\
			__entry->num_des = (qos_map)->num_des;	\
			memcpy(__entry->dscp_exception,		\
			       &(qos_map)->dscp_exception,	\
			       2 * IEEE80211_QOS_MAP_MAX_EX);	\
			memcpy(__entry->up, &(qos_map)->up,	\
			       IEEE80211_QOS_MAP_LEN_MIN);	\
		} else {					\
			__entry->num_des = 0;			\
			memset(__entry->dscp_exception, 0,	\
			       2 * IEEE80211_QOS_MAP_MAX_EX);	\
			memset(__entry->up, 0,			\
			       IEEE80211_QOS_MAP_LEN_MIN);	\
		}						\
	} while (0)

B
Beni Lev 已提交
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
/*************************************************************
 *			rdev->ops traces		     *
 *************************************************************/

TRACE_EVENT(rdev_suspend,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_wowlan *wow),
	TP_ARGS(wiphy, wow),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(bool, any)
		__field(bool, disconnect)
		__field(bool, magic_pkt)
		__field(bool, gtk_rekey_failure)
		__field(bool, eap_identity_req)
		__field(bool, four_way_handshake)
		__field(bool, rfkill_release)
		__field(bool, valid_wow)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		if (wow) {
			__entry->any = wow->any;
			__entry->disconnect = wow->disconnect;
			__entry->magic_pkt = wow->magic_pkt;
			__entry->gtk_rekey_failure = wow->gtk_rekey_failure;
			__entry->eap_identity_req = wow->eap_identity_req;
			__entry->four_way_handshake = wow->four_way_handshake;
			__entry->rfkill_release = wow->rfkill_release;
			__entry->valid_wow = true;
		} else {
			__entry->valid_wow = false;
		}
	),
	TP_printk(WIPHY_PR_FMT ", wow%s - any: %d, disconnect: %d, "
		  "magic pkt: %d, gtk rekey failure: %d, eap identify req: %d, "
		  "four way handshake: %d, rfkill release: %d.",
		  WIPHY_PR_ARG, __entry->valid_wow ? "" : "(Not configured!)",
		  __entry->any, __entry->disconnect, __entry->magic_pkt,
		  __entry->gtk_rekey_failure, __entry->eap_identity_req,
		  __entry->four_way_handshake, __entry->rfkill_release)
);

TRACE_EVENT(rdev_return_int,
	TP_PROTO(struct wiphy *wiphy, int ret),
	TP_ARGS(wiphy, ret),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, ret)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->ret = ret;
	),
	TP_printk(WIPHY_PR_FMT ", returned: %d", WIPHY_PR_ARG, __entry->ret)
);

TRACE_EVENT(rdev_scan,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_scan_request *request),
	TP_ARGS(wiphy, request),
	TP_STRUCT__entry(
		WIPHY_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
);

DECLARE_EVENT_CLASS(wiphy_only_evt,
	TP_PROTO(struct wiphy *wiphy),
	TP_ARGS(wiphy),
	TP_STRUCT__entry(
		WIPHY_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
);

DEFINE_EVENT(wiphy_only_evt, rdev_resume,
	TP_PROTO(struct wiphy *wiphy),
	TP_ARGS(wiphy)
);

DEFINE_EVENT(wiphy_only_evt, rdev_return_void,
	TP_PROTO(struct wiphy *wiphy),
	TP_ARGS(wiphy)
);

DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
	TP_PROTO(struct wiphy *wiphy),
	TP_ARGS(wiphy)
);

DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,
	TP_PROTO(struct wiphy *wiphy),
	TP_ARGS(wiphy)
);

DECLARE_EVENT_CLASS(wiphy_enabled_evt,
	TP_PROTO(struct wiphy *wiphy, bool enabled),
	TP_ARGS(wiphy, enabled),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(bool, enabled)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->enabled = enabled;
	),
	TP_printk(WIPHY_PR_FMT ", %senabled ",
		  WIPHY_PR_ARG, __entry->enabled ? "" : "not ")
);

DEFINE_EVENT(wiphy_enabled_evt, rdev_set_wakeup,
	TP_PROTO(struct wiphy *wiphy, bool enabled),
	TP_ARGS(wiphy, enabled)
);

TRACE_EVENT(rdev_add_virtual_intf,
	TP_PROTO(struct wiphy *wiphy, char *name, enum nl80211_iftype type),
	TP_ARGS(wiphy, name, type),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__string(vir_intf_name, name ? name : "<noname>")
		__field(enum nl80211_iftype, type)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__assign_str(vir_intf_name, name ? name : "<noname>");
		__entry->type = type;
	),
	TP_printk(WIPHY_PR_FMT ", virtual intf name: %s, type: %d",
		  WIPHY_PR_ARG, __get_str(vir_intf_name), __entry->type)
);

DECLARE_EVENT_CLASS(wiphy_wdev_evt,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
	),
387
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
B
Beni Lev 已提交
388 389
);

390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
DECLARE_EVENT_CLASS(wiphy_wdev_cookie_evt,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
	TP_ARGS(wiphy, wdev, cookie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->cookie = cookie;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %lld",
		  WIPHY_PR_ARG, WDEV_PR_ARG,
		  (unsigned long long)__entry->cookie)
);

B
Beni Lev 已提交
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431
DEFINE_EVENT(wiphy_wdev_evt, rdev_return_wdev,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_del_virtual_intf,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

TRACE_EVENT(rdev_change_virtual_intf,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 enum nl80211_iftype type),
	TP_ARGS(wiphy, netdev, type),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(enum nl80211_iftype, type)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->type = type;
	),
432
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", type: %d",
B
Beni Lev 已提交
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->type)
);

DECLARE_EVENT_CLASS(key_handle,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
		 bool pairwise, const u8 *mac_addr),
	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(mac_addr)
		__field(u8, key_index)
		__field(bool, pairwise)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(mac_addr, mac_addr);
		__entry->key_index = key_index;
		__entry->pairwise = pairwise;
	),
454
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key_index: %u, pairwise: %s, mac addr: " MAC_PR_FMT,
B
Beni Lev 已提交
455 456 457 458
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
		  BOOL_TO_STR(__entry->pairwise), MAC_PR_ARG(mac_addr))
);

459
DEFINE_EVENT(key_handle, rdev_get_key,
B
Beni Lev 已提交
460 461 462 463 464
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
		 bool pairwise, const u8 *mac_addr),
	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
);

465
DEFINE_EVENT(key_handle, rdev_del_key,
B
Beni Lev 已提交
466 467 468 469 470
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
		 bool pairwise, const u8 *mac_addr),
	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr)
);

471
TRACE_EVENT(rdev_add_key,
B
Beni Lev 已提交
472
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
		 bool pairwise, const u8 *mac_addr, u8 mode),
	TP_ARGS(wiphy, netdev, key_index, pairwise, mac_addr, mode),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(mac_addr)
		__field(u8, key_index)
		__field(bool, pairwise)
		__field(u8, mode)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(mac_addr, mac_addr);
		__entry->key_index = key_index;
		__entry->pairwise = pairwise;
		__entry->mode = mode;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key_index: %u, "
		  "mode: %u, pairwise: %s, mac addr: " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
		  __entry->mode, BOOL_TO_STR(__entry->pairwise),
		  MAC_PR_ARG(mac_addr))
B
Beni Lev 已提交
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515
);

TRACE_EVENT(rdev_set_default_key,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
		 bool unicast, bool multicast),
	TP_ARGS(wiphy, netdev, key_index, unicast, multicast),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u8, key_index)
		__field(bool, unicast)
		__field(bool, multicast)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->key_index = key_index;
		__entry->unicast = unicast;
		__entry->multicast = multicast;
	),
516
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u, unicast: %s, multicast: %s",
B
Beni Lev 已提交
517 518 519 520 521 522 523 524
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index,
		  BOOL_TO_STR(__entry->unicast),
		  BOOL_TO_STR(__entry->multicast))
);

TRACE_EVENT(rdev_set_default_mgmt_key,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index),
	TP_ARGS(wiphy, netdev, key_index),
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u8, key_index)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->key_index = key_index;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index)
);

TRACE_EVENT(rdev_set_default_beacon_key,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 key_index),
	TP_ARGS(wiphy, netdev, key_index),
B
Beni Lev 已提交
542 543 544 545 546 547 548 549 550 551
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u8, key_index)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->key_index = key_index;
	),
552
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", key index: %u",
B
Beni Lev 已提交
553 554 555 556 557 558 559 560 561 562
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->key_index)
);

TRACE_EVENT(rdev_start_ap,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_ap_settings *settings),
	TP_ARGS(wiphy, netdev, settings),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
563
		CHAN_DEF_ENTRY
B
Beni Lev 已提交
564 565 566 567 568 569 570 571 572 573 574 575
		__field(int, beacon_interval)
		__field(int, dtim_period)
		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
		__field(enum nl80211_hidden_ssid, hidden_ssid)
		__field(u32, wpa_ver)
		__field(bool, privacy)
		__field(enum nl80211_auth_type, auth_type)
		__field(int, inactivity_timeout)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
576
		CHAN_DEF_ASSIGN(&settings->chandef);
B
Beni Lev 已提交
577 578 579 580 581 582 583 584 585 586
		__entry->beacon_interval = settings->beacon_interval;
		__entry->dtim_period = settings->dtim_period;
		__entry->hidden_ssid = settings->hidden_ssid;
		__entry->wpa_ver = settings->crypto.wpa_versions;
		__entry->privacy = settings->privacy;
		__entry->auth_type = settings->auth_type;
		__entry->inactivity_timeout = settings->inactivity_timeout;
		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
		memcpy(__entry->ssid, settings->ssid, settings->ssid_len);
	),
587
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", AP settings - ssid: %s, "
588
		  CHAN_DEF_PR_FMT ", beacon interval: %d, dtim period: %d, "
B
Beni Lev 已提交
589 590
		  "hidden ssid: %d, wpa versions: %u, privacy: %s, "
		  "auth type: %d, inactivity timeout: %d",
591
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_DEF_PR_ARG,
B
Beni Lev 已提交
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639
		  __entry->beacon_interval, __entry->dtim_period,
		  __entry->hidden_ssid, __entry->wpa_ver,
		  BOOL_TO_STR(__entry->privacy), __entry->auth_type,
		  __entry->inactivity_timeout)
);

TRACE_EVENT(rdev_change_beacon,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_beacon_data *info),
	TP_ARGS(wiphy, netdev, info),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__dynamic_array(u8, head, info ? info->head_len : 0)
		__dynamic_array(u8, tail, info ? info->tail_len : 0)
		__dynamic_array(u8, beacon_ies, info ? info->beacon_ies_len : 0)
		__dynamic_array(u8, proberesp_ies,
				info ? info->proberesp_ies_len : 0)
		__dynamic_array(u8, assocresp_ies,
				info ? info->assocresp_ies_len : 0)
		__dynamic_array(u8, probe_resp, info ? info->probe_resp_len : 0)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		if (info) {
			if (info->head)
				memcpy(__get_dynamic_array(head), info->head,
				       info->head_len);
			if (info->tail)
				memcpy(__get_dynamic_array(tail), info->tail,
				       info->tail_len);
			if (info->beacon_ies)
				memcpy(__get_dynamic_array(beacon_ies),
				       info->beacon_ies, info->beacon_ies_len);
			if (info->proberesp_ies)
				memcpy(__get_dynamic_array(proberesp_ies),
				       info->proberesp_ies,
				       info->proberesp_ies_len);
			if (info->assocresp_ies)
				memcpy(__get_dynamic_array(assocresp_ies),
				       info->assocresp_ies,
				       info->assocresp_ies_len);
			if (info->probe_resp)
				memcpy(__get_dynamic_array(probe_resp),
				       info->probe_resp, info->probe_resp_len);
		}
	),
640
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG)
B
Beni Lev 已提交
641 642 643 644 645 646 647 648 649 650 651 652 653
);

DECLARE_EVENT_CLASS(wiphy_netdev_evt,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
	),
654
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG)
B
Beni Lev 已提交
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
);

DEFINE_EVENT(wiphy_netdev_evt, rdev_stop_ap,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

DEFINE_EVENT(wiphy_netdev_evt, rdev_set_rekey_data,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

DEFINE_EVENT(wiphy_netdev_evt, rdev_get_mesh_config,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_mesh,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ibss,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

682 683 684 685 686
DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ocb,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

B
Beni Lev 已提交
687 688 689 690 691
DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	TP_ARGS(wiphy, netdev)
);

692 693 694 695 696
DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac,
	     TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
	     TP_ARGS(wiphy, netdev)
);

B
Beni Lev 已提交
697 698 699 700 701 702 703 704 705 706 707 708
DECLARE_EVENT_CLASS(station_add_change,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
		 struct station_parameters *params),
	TP_ARGS(wiphy, netdev, mac, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(sta_mac)
		__field(u32, sta_flags_mask)
		__field(u32, sta_flags_set)
		__field(u32, sta_modify_mask)
		__field(int, listen_interval)
709
		__field(u16, capability)
B
Beni Lev 已提交
710 711 712 713
		__field(u16, aid)
		__field(u8, plink_action)
		__field(u8, plink_state)
		__field(u8, uapsd_queues)
714 715 716
		__field(u8, max_sp)
		__field(u8, opmode_notif)
		__field(bool, opmode_notif_used)
B
Beni Lev 已提交
717
		__array(u8, ht_capa, (int)sizeof(struct ieee80211_ht_cap))
718
		__array(u8, vht_capa, (int)sizeof(struct ieee80211_vht_cap))
719
		__array(char, vlan, IFNAMSIZ)
720 721 722 723 724 725 726
		__dynamic_array(u8, supported_rates,
				params->supported_rates_len)
		__dynamic_array(u8, ext_capab, params->ext_capab_len)
		__dynamic_array(u8, supported_channels,
				params->supported_channels_len)
		__dynamic_array(u8, supported_oper_classes,
				params->supported_oper_classes_len)
B
Beni Lev 已提交
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(sta_mac, mac);
		__entry->sta_flags_mask = params->sta_flags_mask;
		__entry->sta_flags_set = params->sta_flags_set;
		__entry->sta_modify_mask = params->sta_modify_mask;
		__entry->listen_interval = params->listen_interval;
		__entry->aid = params->aid;
		__entry->plink_action = params->plink_action;
		__entry->plink_state = params->plink_state;
		__entry->uapsd_queues = params->uapsd_queues;
		memset(__entry->ht_capa, 0, sizeof(struct ieee80211_ht_cap));
		if (params->ht_capa)
			memcpy(__entry->ht_capa, params->ht_capa,
			       sizeof(struct ieee80211_ht_cap));
744 745 746 747
		memset(__entry->vht_capa, 0, sizeof(struct ieee80211_vht_cap));
		if (params->vht_capa)
			memcpy(__entry->vht_capa, params->vht_capa,
			       sizeof(struct ieee80211_vht_cap));
748 749 750
		memset(__entry->vlan, 0, sizeof(__entry->vlan));
		if (params->vlan)
			memcpy(__entry->vlan, params->vlan->name, IFNAMSIZ);
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772
		if (params->supported_rates && params->supported_rates_len)
			memcpy(__get_dynamic_array(supported_rates),
			       params->supported_rates,
			       params->supported_rates_len);
		if (params->ext_capab && params->ext_capab_len)
			memcpy(__get_dynamic_array(ext_capab),
			       params->ext_capab,
			       params->ext_capab_len);
		if (params->supported_channels &&
		    params->supported_channels_len)
			memcpy(__get_dynamic_array(supported_channels),
			       params->supported_channels,
			       params->supported_channels_len);
		if (params->supported_oper_classes &&
		    params->supported_oper_classes_len)
			memcpy(__get_dynamic_array(supported_oper_classes),
			       params->supported_oper_classes,
			       params->supported_oper_classes_len);
		__entry->max_sp = params->max_sp;
		__entry->capability = params->capability;
		__entry->opmode_notif = params->opmode_notif;
		__entry->opmode_notif_used = params->opmode_notif_used;
B
Beni Lev 已提交
773
	),
774
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
B
Beni Lev 已提交
775 776
		  ", station flags mask: %u, station flags set: %u, "
		  "station modify mask: %u, listen interval: %d, aid: %u, "
777
		  "plink action: %u, plink state: %u, uapsd queues: %u, vlan:%s",
B
Beni Lev 已提交
778 779 780 781
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
		  __entry->sta_flags_mask, __entry->sta_flags_set,
		  __entry->sta_modify_mask, __entry->listen_interval,
		  __entry->aid, __entry->plink_action, __entry->plink_state,
782
		  __entry->uapsd_queues, __entry->vlan)
B
Beni Lev 已提交
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
);

DEFINE_EVENT(station_add_change, rdev_add_station,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
		 struct station_parameters *params),
	TP_ARGS(wiphy, netdev, mac, params)
);

DEFINE_EVENT(station_add_change, rdev_change_station,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
		 struct station_parameters *params),
	TP_ARGS(wiphy, netdev, mac, params)
);

DECLARE_EVENT_CLASS(wiphy_netdev_mac_evt,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
	TP_ARGS(wiphy, netdev, mac),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(sta_mac)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(sta_mac, mac);
	),
810
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
B
Beni Lev 已提交
811 812 813
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac))
);

814 815 816 817 818 819 820 821
DECLARE_EVENT_CLASS(station_del,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct station_del_parameters *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(sta_mac)
822 823
		__field(u8, subtype)
		__field(u16, reason_code)
824 825 826 827 828
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(sta_mac, params->mac);
829 830
		__entry->subtype = params->subtype;
		__entry->reason_code = params->reason_code;
831
	),
832 833 834 835
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT
		  ", subtype: %u, reason_code: %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
		  __entry->subtype, __entry->reason_code)
836 837 838 839 840 841
);

DEFINE_EVENT(station_del, rdev_del_station,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct station_del_parameters *params),
	TP_ARGS(wiphy, netdev, params)
B
Beni Lev 已提交
842 843 844 845 846 847 848 849 850 851 852 853 854
);

DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
	TP_ARGS(wiphy, netdev, mac)
);

DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_mpath,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
	TP_ARGS(wiphy, netdev, mac)
);

TRACE_EVENT(rdev_dump_station,
855
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
B
Beni Lev 已提交
856
		 u8 *mac),
857
	TP_ARGS(wiphy, netdev, _idx, mac),
B
Beni Lev 已提交
858 859 860 861 862 863 864 865 866 867
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(sta_mac)
		__field(int, idx)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(sta_mac, mac);
868
		__entry->idx = _idx;
B
Beni Lev 已提交
869
	),
870
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT ", idx: %d",
B
Beni Lev 已提交
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac),
		  __entry->idx)
);

TRACE_EVENT(rdev_return_int_station_info,
	TP_PROTO(struct wiphy *wiphy, int ret, struct station_info *sinfo),
	TP_ARGS(wiphy, ret, sinfo),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, ret)
		SINFO_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->ret = ret;
		SINFO_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT ", returned %d" ,
		  WIPHY_PR_ARG, __entry->ret)
);

DECLARE_EVENT_CLASS(mpath_evt,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
		 u8 *next_hop),
	TP_ARGS(wiphy, netdev, dst, next_hop),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(dst)
		MAC_ENTRY(next_hop)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(dst, dst);
		MAC_ASSIGN(next_hop, next_hop);
	),
908
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: " MAC_PR_FMT ", next hop: " MAC_PR_FMT,
B
Beni Lev 已提交
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dst),
		  MAC_PR_ARG(next_hop))
);

DEFINE_EVENT(mpath_evt, rdev_add_mpath,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
		 u8 *next_hop),
	TP_ARGS(wiphy, netdev, dst, next_hop)
);

DEFINE_EVENT(mpath_evt, rdev_change_mpath,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
		 u8 *next_hop),
	TP_ARGS(wiphy, netdev, dst, next_hop)
);

DEFINE_EVENT(mpath_evt, rdev_get_mpath,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
		 u8 *next_hop),
	TP_ARGS(wiphy, netdev, dst, next_hop)
);

TRACE_EVENT(rdev_dump_mpath,
932
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
B
Beni Lev 已提交
933
		 u8 *dst, u8 *next_hop),
934
	TP_ARGS(wiphy, netdev, _idx, dst, next_hop),
B
Beni Lev 已提交
935 936 937 938 939 940 941 942 943 944 945 946
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(dst)
		MAC_ENTRY(next_hop)
		__field(int, idx)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(dst, dst);
		MAC_ASSIGN(next_hop, next_hop);
947
		__entry->idx = _idx;
B
Beni Lev 已提交
948
	),
949
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: "
B
Beni Lev 已提交
950 951 952 953 954
		  MAC_PR_FMT ", next hop: " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, MAC_PR_ARG(dst),
		  MAC_PR_ARG(next_hop))
);

955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976
TRACE_EVENT(rdev_get_mpp,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u8 *dst, u8 *mpp),
	TP_ARGS(wiphy, netdev, dst, mpp),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(dst)
		MAC_ENTRY(mpp)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(dst, dst);
		MAC_ASSIGN(mpp, mpp);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: " MAC_PR_FMT
		  ", mpp: " MAC_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG,
		  MAC_PR_ARG(dst), MAC_PR_ARG(mpp))
);

TRACE_EVENT(rdev_dump_mpp,
977
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
978
		 u8 *dst, u8 *mpp),
979
	TP_ARGS(wiphy, netdev, _idx, mpp, dst),
980 981 982 983 984 985 986 987 988 989 990 991
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(dst)
		MAC_ENTRY(mpp)
		__field(int, idx)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(dst, dst);
		MAC_ASSIGN(mpp, mpp);
992
		__entry->idx = _idx;
993 994 995 996 997 998 999
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: "
		  MAC_PR_FMT ", mpp: " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, MAC_PR_ARG(dst),
		  MAC_PR_ARG(mpp))
);

B
Beni Lev 已提交
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 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
TRACE_EVENT(rdev_return_int_mpath_info,
	TP_PROTO(struct wiphy *wiphy, int ret, struct mpath_info *pinfo),
	TP_ARGS(wiphy, ret, pinfo),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, ret)
		__field(int, generation)
		__field(u32, filled)
		__field(u32, frame_qlen)
		__field(u32, sn)
		__field(u32, metric)
		__field(u32, exptime)
		__field(u32, discovery_timeout)
		__field(u8, discovery_retries)
		__field(u8, flags)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->ret = ret;
		__entry->generation = pinfo->generation;
		__entry->filled = pinfo->filled;
		__entry->frame_qlen = pinfo->frame_qlen;
		__entry->sn = pinfo->sn;
		__entry->metric = pinfo->metric;
		__entry->exptime = pinfo->exptime;
		__entry->discovery_timeout = pinfo->discovery_timeout;
		__entry->discovery_retries = pinfo->discovery_retries;
		__entry->flags = pinfo->flags;
	),
	TP_printk(WIPHY_PR_FMT ", returned %d. mpath info - generation: %d, "
		  "filled: %u, frame qlen: %u, sn: %u, metric: %u, exptime: %u,"
		  " discovery timeout: %u, discovery retries: %u, flags: %u",
		  WIPHY_PR_ARG, __entry->ret, __entry->generation,
		  __entry->filled, __entry->frame_qlen, __entry->sn,
		  __entry->metric, __entry->exptime, __entry->discovery_timeout,
		  __entry->discovery_retries, __entry->flags)
);

TRACE_EVENT(rdev_return_int_mesh_config,
	TP_PROTO(struct wiphy *wiphy, int ret, struct mesh_config *conf),
	TP_ARGS(wiphy, ret, conf),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		MESH_CFG_ENTRY
		__field(int, ret)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		MESH_CFG_ASSIGN;
		__entry->ret = ret;
	),
	TP_printk(WIPHY_PR_FMT ", returned: %d",
		  WIPHY_PR_ARG, __entry->ret)
);

TRACE_EVENT(rdev_update_mesh_config,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 mask,
		 const struct mesh_config *conf),
	TP_ARGS(wiphy, netdev, mask, conf),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MESH_CFG_ENTRY
		__field(u32, mask)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MESH_CFG_ASSIGN;
		__entry->mask = mask;
	),
1071
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mask: %u",
B
Beni Lev 已提交
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->mask)
);

TRACE_EVENT(rdev_join_mesh,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const struct mesh_config *conf,
		 const struct mesh_setup *setup),
	TP_ARGS(wiphy, netdev, conf, setup),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MESH_CFG_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MESH_CFG_ASSIGN;
	),
1090
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
B
Beni Lev 已提交
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
		  WIPHY_PR_ARG, NETDEV_PR_ARG)
);

TRACE_EVENT(rdev_change_bss,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct bss_parameters *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(int, use_cts_prot)
		__field(int, use_short_preamble)
		__field(int, use_short_slot_time)
		__field(int, ap_isolate)
		__field(int, ht_opmode)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->use_cts_prot = params->use_cts_prot;
		__entry->use_short_preamble = params->use_short_preamble;
		__entry->use_short_slot_time = params->use_short_slot_time;
		__entry->ap_isolate = params->ap_isolate;
		__entry->ht_opmode = params->ht_opmode;
	),
1116
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", use cts prot: %d, "
B
Beni Lev 已提交
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145
		  "use short preamble: %d, use short slot time: %d, "
		  "ap isolate: %d, ht opmode: %d",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->use_cts_prot,
		  __entry->use_short_preamble, __entry->use_short_slot_time,
		  __entry->ap_isolate, __entry->ht_opmode)
);

TRACE_EVENT(rdev_set_txq_params,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct ieee80211_txq_params *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(enum nl80211_ac, ac)
		__field(u16, txop)
		__field(u16, cwmin)
		__field(u16, cwmax)
		__field(u8, aifs)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->ac = params->ac;
		__entry->txop = params->txop;
		__entry->cwmin = params->cwmin;
		__entry->cwmax = params->cwmax;
		__entry->aifs = params->aifs;
	),
1146
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", ac: %d, txop: %u, cwmin: %u, cwmax: %u, aifs: %u",
B
Beni Lev 已提交
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ac, __entry->txop,
		  __entry->cwmin, __entry->cwmax, __entry->aifs)
);

TRACE_EVENT(rdev_libertas_set_mesh_channel,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct ieee80211_channel *chan),
	TP_ARGS(wiphy, netdev, chan),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		CHAN_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		CHAN_ASSIGN(chan);
	),
1165
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_PR_FMT, WIPHY_PR_ARG,
B
Beni Lev 已提交
1166 1167 1168 1169
		  NETDEV_PR_ARG, CHAN_PR_ARG)
);

TRACE_EVENT(rdev_set_monitor_channel,
1170 1171 1172
	TP_PROTO(struct wiphy *wiphy,
		 struct cfg80211_chan_def *chandef),
	TP_ARGS(wiphy, chandef),
B
Beni Lev 已提交
1173 1174
	TP_STRUCT__entry(
		WIPHY_ENTRY
1175
		CHAN_DEF_ENTRY
B
Beni Lev 已提交
1176 1177 1178
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
1179
		CHAN_DEF_ASSIGN(chandef);
B
Beni Lev 已提交
1180
	),
1181
	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
1182
		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
B
Beni Lev 已提交
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200
);

TRACE_EVENT(rdev_auth,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_auth_request *req),
	TP_ARGS(wiphy, netdev, req),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		__field(enum nl80211_auth_type, auth_type)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		if (req->bss)
			MAC_ASSIGN(bssid, req->bss->bssid);
		else
1201
			eth_zero_addr(__entry->bssid);
B
Beni Lev 已提交
1202 1203
		__entry->auth_type = req->auth_type;
	),
1204
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: " MAC_PR_FMT,
B
Beni Lev 已提交
1205 1206 1207 1208 1209 1210
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->auth_type,
		  MAC_PR_ARG(bssid))
);

TRACE_EVENT(rdev_assoc,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1211 1212 1213
		 struct cfg80211_assoc_request *req,
		 const struct cfg80211_bss_ies *bss_ies),
	TP_ARGS(wiphy, netdev, req, bss_ies),
B
Beni Lev 已提交
1214 1215 1216 1217 1218 1219 1220
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		MAC_ENTRY(prev_bssid)
		__field(bool, use_mfp)
		__field(u32, flags)
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
		__dynamic_array(u8, bss_elements, bss_ies->len)
		__field(bool, bss_elements_bcon)
		__field(u64, bss_elements_tsf)
		__dynamic_array(u8, elements, req->ie_len)
		__array(u8, ht_capa, sizeof(struct ieee80211_ht_cap))
		__array(u8, ht_capa_mask, sizeof(struct ieee80211_ht_cap))
		__array(u8, vht_capa, sizeof(struct ieee80211_vht_cap))
		__array(u8, vht_capa_mask, sizeof(struct ieee80211_vht_cap))
		__dynamic_array(u8, fils_kek, req->fils_kek_len)
		__dynamic_array(u8, fils_nonces,
				req->fils_nonces ? 2 * FILS_NONCE_LEN : 0)
B
Beni Lev 已提交
1232 1233 1234 1235 1236 1237 1238
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		if (req->bss)
			MAC_ASSIGN(bssid, req->bss->bssid);
		else
1239
			eth_zero_addr(__entry->bssid);
B
Beni Lev 已提交
1240 1241 1242
		MAC_ASSIGN(prev_bssid, req->prev_bssid);
		__entry->use_mfp = req->use_mfp;
		__entry->flags = req->flags;
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262
		if (bss_ies->len)
			memcpy(__get_dynamic_array(bss_elements),
			       bss_ies->data, bss_ies->len);
		__entry->bss_elements_bcon = bss_ies->from_beacon;
		__entry->bss_elements_tsf = bss_ies->tsf;
		if (req->ie)
			memcpy(__get_dynamic_array(elements),
			       req->ie, req->ie_len);
		memcpy(__entry->ht_capa, &req->ht_capa, sizeof(req->ht_capa));
		memcpy(__entry->ht_capa_mask, &req->ht_capa_mask,
		       sizeof(req->ht_capa_mask));
		memcpy(__entry->vht_capa, &req->vht_capa, sizeof(req->vht_capa));
		memcpy(__entry->vht_capa_mask, &req->vht_capa_mask,
		       sizeof(req->vht_capa_mask));
		if (req->fils_kek)
			memcpy(__get_dynamic_array(fils_kek),
			       req->fils_kek, req->fils_kek_len);
		if (req->fils_nonces)
			memcpy(__get_dynamic_array(fils_nonces),
			       req->fils_nonces, 2 * FILS_NONCE_LEN);
B
Beni Lev 已提交
1263
	),
1264
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
B
Beni Lev 已提交
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286
		  ", previous bssid: " MAC_PR_FMT ", use mfp: %s, flags: %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
		  MAC_PR_ARG(prev_bssid), BOOL_TO_STR(__entry->use_mfp),
		  __entry->flags)
);

TRACE_EVENT(rdev_deauth,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_deauth_request *req),
	TP_ARGS(wiphy, netdev, req),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		__field(u16, reason_code)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(bssid, req->bssid);
		__entry->reason_code = req->reason_code;
	),
1287
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", reason: %u",
B
Beni Lev 已提交
1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
		  __entry->reason_code)
);

TRACE_EVENT(rdev_disassoc,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_disassoc_request *req),
	TP_ARGS(wiphy, netdev, req),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		__field(u16, reason_code)
		__field(bool, local_state_change)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		if (req->bss)
			MAC_ASSIGN(bssid, req->bss->bssid);
		else
1309
			eth_zero_addr(__entry->bssid);
B
Beni Lev 已提交
1310 1311 1312
		__entry->reason_code = req->reason_code;
		__entry->local_state_change = req->local_state_change;
	),
1313
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
B
Beni Lev 已提交
1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333
		  ", reason: %u, local state change: %s",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid),
		  __entry->reason_code,
		  BOOL_TO_STR(__entry->local_state_change))
);

TRACE_EVENT(rdev_mgmt_tx_cancel_wait,
	TP_PROTO(struct wiphy *wiphy,
		 struct wireless_dev *wdev, u64 cookie),
	TP_ARGS(wiphy, wdev, cookie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->cookie = cookie;
	),
1334
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu ",
B
Beni Lev 已提交
1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
);

TRACE_EVENT(rdev_set_power_mgmt,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 bool enabled, int timeout),
	TP_ARGS(wiphy, netdev, enabled, timeout),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(bool, enabled)
		__field(int, timeout)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->enabled = enabled;
		__entry->timeout = timeout;
	),
1354
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %senabled, timeout: %d ",
B
Beni Lev 已提交
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371
		  WIPHY_PR_ARG, NETDEV_PR_ARG,
		  __entry->enabled ? "" : "not ", __entry->timeout)
);

TRACE_EVENT(rdev_connect,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_connect_params *sme),
	TP_ARGS(wiphy, netdev, sme),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
		__field(enum nl80211_auth_type, auth_type)
		__field(bool, privacy)
		__field(u32, wpa_versions)
		__field(u32, flags)
1372
		MAC_ENTRY(prev_bssid)
B
Beni Lev 已提交
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(bssid, sme->bssid);
		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
		memcpy(__entry->ssid, sme->ssid, sme->ssid_len);
		__entry->auth_type = sme->auth_type;
		__entry->privacy = sme->privacy;
		__entry->wpa_versions = sme->crypto.wpa_versions;
		__entry->flags = sme->flags;
1384
		MAC_ASSIGN(prev_bssid, sme->prev_bssid);
B
Beni Lev 已提交
1385
	),
1386
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
B
Beni Lev 已提交
1387
		  ", ssid: %s, auth type: %d, privacy: %s, wpa versions: %u, "
1388
		  "flags: %u, previous bssid: " MAC_PR_FMT,
B
Beni Lev 已提交
1389 1390
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid,
		  __entry->auth_type, BOOL_TO_STR(__entry->privacy),
1391
		  __entry->wpa_versions, __entry->flags, MAC_PR_ARG(prev_bssid))
B
Beni Lev 已提交
1392 1393
);

1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411
TRACE_EVENT(rdev_update_connect_params,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_connect_params *sme, u32 changed),
	TP_ARGS(wiphy, netdev, sme, changed),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u32, changed)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->changed = changed;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", parameters changed: %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG,  __entry->changed)
);

B
Beni Lev 已提交
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428
TRACE_EVENT(rdev_set_cqm_rssi_config,
	TP_PROTO(struct wiphy *wiphy,
		 struct net_device *netdev, s32 rssi_thold,
		 u32 rssi_hyst),
	TP_ARGS(wiphy, netdev, rssi_thold, rssi_hyst),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(s32, rssi_thold)
		__field(u32, rssi_hyst)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->rssi_thold = rssi_thold;
		__entry->rssi_hyst = rssi_hyst;
	),
1429
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
B
Beni Lev 已提交
1430 1431 1432 1433 1434
		  ", rssi_thold: %d, rssi_hyst: %u ",
		  WIPHY_PR_ARG, NETDEV_PR_ARG,
		 __entry->rssi_thold, __entry->rssi_hyst)
);

1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456
TRACE_EVENT(rdev_set_cqm_rssi_range_config,
	TP_PROTO(struct wiphy *wiphy,
		 struct net_device *netdev, s32 low, s32 high),
	TP_ARGS(wiphy, netdev, low, high),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(s32, rssi_low)
		__field(s32, rssi_high)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->rssi_low = low;
		__entry->rssi_high = high;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
		  ", range: %d - %d ",
		  WIPHY_PR_ARG, NETDEV_PR_ARG,
		  __entry->rssi_low, __entry->rssi_high)
);

B
Beni Lev 已提交
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474
TRACE_EVENT(rdev_set_cqm_txe_config,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 rate,
		 u32 pkts, u32 intvl),
	TP_ARGS(wiphy, netdev, rate, pkts, intvl),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u32, rate)
		__field(u32, pkts)
		__field(u32, intvl)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->rate = rate;
		__entry->pkts = pkts;
		__entry->intvl = intvl;
	),
1475
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", rate: %u, packets: %u, interval: %u",
B
Beni Lev 已提交
1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->rate, __entry->pkts,
		  __entry->intvl)
);

TRACE_EVENT(rdev_disconnect,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u16 reason_code),
	TP_ARGS(wiphy, netdev, reason_code),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u16, reason_code)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->reason_code = reason_code;
	),
1494
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", reason code: %u", WIPHY_PR_ARG,
B
Beni Lev 已提交
1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514
		  NETDEV_PR_ARG, __entry->reason_code)
);

TRACE_EVENT(rdev_join_ibss,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_ibss_params *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		__array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(bssid, params->bssid);
		memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
		memcpy(__entry->ssid, params->ssid, params->ssid_len);
	),
1515
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", ssid: %s",
B
Beni Lev 已提交
1516 1517 1518
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid)
);

1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534
TRACE_EVENT(rdev_join_ocb,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const struct ocb_setup *setup),
	TP_ARGS(wiphy, netdev, setup),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG)
);

B
Beni Lev 已提交
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549
TRACE_EVENT(rdev_set_wiphy_params,
	TP_PROTO(struct wiphy *wiphy, u32 changed),
	TP_ARGS(wiphy, changed),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(u32, changed)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->changed = changed;
	),
	TP_printk(WIPHY_PR_FMT ", changed: %u",
		  WIPHY_PR_ARG, __entry->changed)
);

1550 1551 1552 1553 1554
DEFINE_EVENT(wiphy_wdev_evt, rdev_get_tx_power,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

B
Beni Lev 已提交
1555
TRACE_EVENT(rdev_set_tx_power,
1556 1557 1558
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 enum nl80211_tx_power_setting type, int mbm),
	TP_ARGS(wiphy, wdev, type, mbm),
B
Beni Lev 已提交
1559 1560
	TP_STRUCT__entry(
		WIPHY_ENTRY
1561
		WDEV_ENTRY
B
Beni Lev 已提交
1562 1563 1564 1565 1566
		__field(enum nl80211_tx_power_setting, type)
		__field(int, mbm)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
1567
		WDEV_ASSIGN;
B
Beni Lev 已提交
1568 1569 1570
		__entry->type = type;
		__entry->mbm = mbm;
	),
1571
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type: %u, mbm: %d",
1572
		  WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
B
Beni Lev 已提交
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593
);

TRACE_EVENT(rdev_return_int_int,
	TP_PROTO(struct wiphy *wiphy, int func_ret, int func_fill),
	TP_ARGS(wiphy, func_ret, func_fill),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, func_ret)
		__field(int, func_fill)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->func_ret = func_ret;
		__entry->func_fill = func_fill;
	),
	TP_printk(WIPHY_PR_FMT ", function returns: %d, function filled: %d",
		  WIPHY_PR_ARG, __entry->func_ret, __entry->func_fill)
);

#ifdef CONFIG_NL80211_TESTMODE
TRACE_EVENT(rdev_testmode_cmd,
1594 1595
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev),
B
Beni Lev 已提交
1596 1597
	TP_STRUCT__entry(
		WIPHY_ENTRY
1598
		WDEV_ENTRY
B
Beni Lev 已提交
1599 1600 1601
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
1602
		WDEV_ASSIGN;
B
Beni Lev 已提交
1603
	),
1604
	TP_printk(WIPHY_PR_FMT WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
B
Beni Lev 已提交
1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633
);

TRACE_EVENT(rdev_testmode_dump,
	TP_PROTO(struct wiphy *wiphy),
	TP_ARGS(wiphy),
	TP_STRUCT__entry(
		WIPHY_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
);
#endif /* CONFIG_NL80211_TESTMODE */

TRACE_EVENT(rdev_set_bitrate_mask,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const u8 *peer, const struct cfg80211_bitrate_mask *mask),
	TP_ARGS(wiphy, netdev, peer, mask),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
	),
1634
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
B
Beni Lev 已提交
1635 1636 1637
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
);

1638
TRACE_EVENT(rdev_update_mgmt_frame_registrations,
B
Beni Lev 已提交
1639
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1640 1641
		 struct mgmt_frame_regs *upd),
	TP_ARGS(wiphy, wdev, upd),
B
Beni Lev 已提交
1642 1643 1644
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
1645 1646
		__field(u16, global_stypes)
		__field(u16, interface_stypes)
B
Beni Lev 已提交
1647 1648 1649 1650
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
1651 1652
		__entry->global_stypes = upd->global_stypes;
		__entry->interface_stypes = upd->interface_stypes;
B
Beni Lev 已提交
1653
	),
1654 1655 1656
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", global: 0x%.2x, intf: 0x%.2x",
		  WIPHY_PR_ARG, WDEV_PR_ARG,
		  __entry->global_stypes, __entry->interface_stypes)
B
Beni Lev 已提交
1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722
);

TRACE_EVENT(rdev_return_int_tx_rx,
	TP_PROTO(struct wiphy *wiphy, int ret, u32 tx, u32 rx),
	TP_ARGS(wiphy, ret, tx, rx),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, ret)
		__field(u32, tx)
		__field(u32, rx)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->ret = ret;
		__entry->tx = tx;
		__entry->rx = rx;
	),
	TP_printk(WIPHY_PR_FMT ", returned %d, tx: %u, rx: %u",
		  WIPHY_PR_ARG, __entry->ret, __entry->tx, __entry->rx)
);

TRACE_EVENT(rdev_return_void_tx_rx,
	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 tx_max,
		 u32 rx, u32 rx_max),
	TP_ARGS(wiphy, tx, tx_max, rx, rx_max),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(u32, tx)
		__field(u32, tx_max)
		__field(u32, rx)
		__field(u32, rx_max)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->tx = tx;
		__entry->tx_max = tx_max;
		__entry->rx = rx;
		__entry->rx_max = rx_max;
	),
	TP_printk(WIPHY_PR_FMT ", tx: %u, tx_max: %u, rx: %u, rx_max: %u ",
		  WIPHY_PR_ARG, __entry->tx, __entry->tx_max, __entry->rx,
		  __entry->rx_max)
);

DECLARE_EVENT_CLASS(tx_rx_evt,
	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
	TP_ARGS(wiphy, rx, tx),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(u32, tx)
		__field(u32, rx)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->tx = tx;
		__entry->rx = rx;
	),
	TP_printk(WIPHY_PR_FMT ", tx: %u, rx: %u ",
		  WIPHY_PR_ARG, __entry->tx, __entry->rx)
);

DEFINE_EVENT(tx_rx_evt, rdev_set_antenna,
	TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
	TP_ARGS(wiphy, rx, tx)
);

1723 1724 1725
DECLARE_EVENT_CLASS(wiphy_netdev_id_evt,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
	TP_ARGS(wiphy, netdev, id),
B
Beni Lev 已提交
1726 1727 1728
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
1729
		__field(u64, id)
B
Beni Lev 已提交
1730 1731 1732 1733
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
1734
		__entry->id = id;
B
Beni Lev 已提交
1735
	),
1736 1737 1738 1739 1740 1741 1742
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", id: %llu",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->id)
);

DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_start,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
	TP_ARGS(wiphy, netdev, id)
B
Beni Lev 已提交
1743 1744
);

1745 1746 1747 1748 1749
DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_stop,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
	TP_ARGS(wiphy, netdev, id)
);

B
Beni Lev 已提交
1750 1751 1752
TRACE_EVENT(rdev_tdls_mgmt,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u8 *peer, u8 action_code, u8 dialog_token,
1753
		 u16 status_code, u32 peer_capability,
1754
		 bool initiator, const u8 *buf, size_t len),
B
Beni Lev 已提交
1755
	TP_ARGS(wiphy, netdev, peer, action_code, dialog_token, status_code,
1756
		peer_capability, initiator, buf, len),
B
Beni Lev 已提交
1757 1758 1759 1760 1761 1762 1763
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
		__field(u8, action_code)
		__field(u8, dialog_token)
		__field(u16, status_code)
1764
		__field(u32, peer_capability)
1765
		__field(bool, initiator)
B
Beni Lev 已提交
1766 1767 1768 1769 1770 1771 1772 1773 1774
		__dynamic_array(u8, buf, len)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
		__entry->action_code = action_code;
		__entry->dialog_token = dialog_token;
		__entry->status_code = status_code;
1775
		__entry->peer_capability = peer_capability;
1776
		__entry->initiator = initiator;
B
Beni Lev 已提交
1777 1778
		memcpy(__get_dynamic_array(buf), buf, len);
	),
1779
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", action_code: %u, "
1780 1781
		  "dialog_token: %u, status_code: %u, peer_capability: %u "
		  "initiator: %s buf: %#.2x ",
B
Beni Lev 已提交
1782 1783
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
		  __entry->action_code, __entry->dialog_token,
1784
		  __entry->status_code, __entry->peer_capability,
1785
		  BOOL_TO_STR(__entry->initiator),
1786
		  ((u8 *)__get_dynamic_array(buf))[0])
B
Beni Lev 已提交
1787 1788 1789
);

TRACE_EVENT(rdev_dump_survey,
1790 1791
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx),
	TP_ARGS(wiphy, netdev, _idx),
B
Beni Lev 已提交
1792 1793 1794 1795 1796 1797 1798 1799
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(int, idx)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
1800
		__entry->idx = _idx;
B
Beni Lev 已提交
1801
	),
1802
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d",
B
Beni Lev 已提交
1803 1804 1805 1806 1807 1808 1809 1810 1811 1812
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx)
);

TRACE_EVENT(rdev_return_int_survey_info,
	TP_PROTO(struct wiphy *wiphy, int ret, struct survey_info *info),
	TP_ARGS(wiphy, ret, info),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		CHAN_ENTRY
		__field(int, ret)
1813 1814 1815 1816 1817
		__field(u64, time)
		__field(u64, time_busy)
		__field(u64, time_ext_busy)
		__field(u64, time_rx)
		__field(u64, time_tx)
1818
		__field(u64, time_scan)
B
Beni Lev 已提交
1819 1820 1821 1822 1823 1824 1825
		__field(u32, filled)
		__field(s8, noise)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		CHAN_ASSIGN(info->channel);
		__entry->ret = ret;
1826 1827 1828 1829 1830
		__entry->time = info->time;
		__entry->time_busy = info->time_busy;
		__entry->time_ext_busy = info->time_ext_busy;
		__entry->time_rx = info->time_rx;
		__entry->time_tx = info->time_tx;
1831
		__entry->time_scan = info->time_scan;
B
Beni Lev 已提交
1832 1833 1834 1835 1836 1837
		__entry->filled = info->filled;
		__entry->noise = info->noise;
	),
	TP_printk(WIPHY_PR_FMT ", returned: %d, " CHAN_PR_FMT
		  ", channel time: %llu, channel time busy: %llu, "
		  "channel time extension busy: %llu, channel time rx: %llu, "
1838
		  "channel time tx: %llu, scan time: %llu, filled: %u, noise: %d",
B
Beni Lev 已提交
1839
		  WIPHY_PR_ARG, __entry->ret, CHAN_PR_ARG,
1840 1841
		  __entry->time, __entry->time_busy,
		  __entry->time_ext_busy, __entry->time_rx,
1842 1843
		  __entry->time_tx, __entry->time_scan,
		  __entry->filled, __entry->noise)
B
Beni Lev 已提交
1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
);

TRACE_EVENT(rdev_tdls_oper,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u8 *peer, enum nl80211_tdls_operation oper),
	TP_ARGS(wiphy, netdev, peer, oper),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
		__field(enum nl80211_tdls_operation, oper)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
		__entry->oper = oper;
	),
1862
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", oper: %d",
B
Beni Lev 已提交
1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper)
);

DECLARE_EVENT_CLASS(rdev_pmksa,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_pmksa *pmksa),
	TP_ARGS(wiphy, netdev, pmksa),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(bssid, pmksa->bssid);
	),
1880
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT,
B
Beni Lev 已提交
1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid))
);

TRACE_EVENT(rdev_probe_client,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const u8 *peer),
	TP_ARGS(wiphy, netdev, peer),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
	),
1898
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
B
Beni Lev 已提交
1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
);

DEFINE_EVENT(rdev_pmksa, rdev_set_pmksa,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_pmksa *pmksa),
	TP_ARGS(wiphy, netdev, pmksa)
);

DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_pmksa *pmksa),
	TP_ARGS(wiphy, netdev, pmksa)
);

TRACE_EVENT(rdev_remain_on_channel,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 struct ieee80211_channel *chan,
1917 1918
		 unsigned int duration),
	TP_ARGS(wiphy, wdev, chan, duration),
B
Beni Lev 已提交
1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		CHAN_ENTRY
		__field(unsigned int, duration)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		CHAN_ASSIGN(chan);
		__entry->duration = duration;
	),
1931
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", duration: %u",
1932
		  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
B
Beni Lev 已提交
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964
);

TRACE_EVENT(rdev_return_int_cookie,
	TP_PROTO(struct wiphy *wiphy, int ret, u64 cookie),
	TP_ARGS(wiphy, ret, cookie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, ret)
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->ret = ret;
		__entry->cookie = cookie;
	),
	TP_printk(WIPHY_PR_FMT ", returned %d, cookie: %llu",
		  WIPHY_PR_ARG, __entry->ret, __entry->cookie)
);

TRACE_EVENT(rdev_cancel_remain_on_channel,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
	TP_ARGS(wiphy, wdev, cookie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->cookie = cookie;
	),
1965
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu",
B
Beni Lev 已提交
1966 1967 1968 1969 1970
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
);

TRACE_EVENT(rdev_mgmt_tx,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1971 1972
		 struct cfg80211_mgmt_tx_params *params),
	TP_ARGS(wiphy, wdev, params),
B
Beni Lev 已提交
1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		CHAN_ENTRY
		__field(bool, offchan)
		__field(unsigned int, wait)
		__field(bool, no_cck)
		__field(bool, dont_wait_for_ack)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
1985 1986 1987 1988 1989
		CHAN_ASSIGN(params->chan);
		__entry->offchan = params->offchan;
		__entry->wait = params->wait;
		__entry->no_cck = params->no_cck;
		__entry->dont_wait_for_ack = params->dont_wait_for_ack;
B
Beni Lev 已提交
1990
	),
1991
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", offchan: %s,"
1992
		  " wait: %u, no cck: %s, dont wait for ack: %s",
B
Beni Lev 已提交
1993
		  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
1994
		  BOOL_TO_STR(__entry->offchan), __entry->wait,
B
Beni Lev 已提交
1995 1996 1997 1998
		  BOOL_TO_STR(__entry->no_cck),
		  BOOL_TO_STR(__entry->dont_wait_for_ack))
);

1999 2000
TRACE_EVENT(rdev_tx_control_port,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2001
		 const u8 *buf, size_t len, const u8 *dest, __be16 proto,
2002
		 bool unencrypted),
2003
	TP_ARGS(wiphy, netdev, buf, len, dest, proto, unencrypted),
2004 2005 2006 2007
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(dest)
2008
		__field(__be16, proto)
2009 2010 2011 2012 2013 2014
		__field(bool, unencrypted)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(dest, dest);
2015
		__entry->proto = proto;
2016 2017
		__entry->unencrypted = unencrypted;
	),
2018 2019 2020 2021
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ","
		  " proto: 0x%x, unencrypted: %s",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dest),
		  be16_to_cpu(__entry->proto),
2022 2023 2024
		  BOOL_TO_STR(__entry->unencrypted))
);

B
Beni Lev 已提交
2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
TRACE_EVENT(rdev_set_noack_map,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u16 noack_map),
	TP_ARGS(wiphy, netdev, noack_map),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u16, noack_map)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->noack_map = noack_map;
	),
2039
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", noack_map: %u",
B
Beni Lev 已提交
2040 2041 2042 2043 2044 2045 2046 2047
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map)
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

2048 2049 2050 2051
TRACE_EVENT(rdev_return_chandef,
	TP_PROTO(struct wiphy *wiphy, int ret,
		 struct cfg80211_chan_def *chandef),
	TP_ARGS(wiphy, ret, chandef),
B
Beni Lev 已提交
2052 2053
	TP_STRUCT__entry(
		WIPHY_ENTRY
2054 2055
		__field(int, ret)
		CHAN_DEF_ENTRY
B
Beni Lev 已提交
2056 2057 2058
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
2059 2060 2061 2062 2063
		if (ret == 0)
			CHAN_DEF_ASSIGN(chandef);
		else
			CHAN_DEF_ASSIGN((struct cfg80211_chan_def *)NULL);
		__entry->ret = ret;
B
Beni Lev 已提交
2064
	),
2065
	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", ret: %d",
2066
		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->ret)
B
Beni Lev 已提交
2067 2068
);

2069 2070 2071 2072 2073 2074 2075 2076 2077 2078
DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

2079 2080 2081 2082 2083 2084 2085 2086
TRACE_EVENT(rdev_start_nan,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 struct cfg80211_nan_conf *conf),
	TP_ARGS(wiphy, wdev, conf),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u8, master_pref)
P
Peter Zijlstra 已提交
2087
		__field(u8, bands)
2088 2089 2090 2091 2092
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->master_pref = conf->master_pref;
L
Luca Coelho 已提交
2093
		__entry->bands = conf->bands;
2094 2095
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT
L
Luca Coelho 已提交
2096
		  ", master preference: %u, bands: 0x%0x",
2097
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->master_pref,
L
Luca Coelho 已提交
2098
		  __entry->bands)
2099 2100
);

2101 2102 2103 2104 2105 2106 2107 2108
TRACE_EVENT(rdev_nan_change_conf,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 struct cfg80211_nan_conf *conf, u32 changes),
	TP_ARGS(wiphy, wdev, conf, changes),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u8, master_pref)
P
Peter Zijlstra 已提交
2109 2110
		__field(u8, bands)
		__field(u32, changes)
2111 2112 2113 2114 2115
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->master_pref = conf->master_pref;
L
Luca Coelho 已提交
2116
		__entry->bands = conf->bands;
2117 2118 2119
		__entry->changes = changes;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT
L
Luca Coelho 已提交
2120
		  ", master preference: %u, bands: 0x%0x, changes: %x",
2121
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->master_pref,
L
Luca Coelho 已提交
2122
		  __entry->bands, __entry->changes)
2123 2124
);

2125 2126 2127 2128 2129
DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_nan,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168
TRACE_EVENT(rdev_add_nan_func,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 const struct cfg80211_nan_func *func),
	TP_ARGS(wiphy, wdev, func),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u8, func_type)
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->func_type = func->type;
		__entry->cookie = func->cookie
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type=%u, cookie=%llu",
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->func_type,
		  __entry->cookie)
);

TRACE_EVENT(rdev_del_nan_func,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 u64 cookie),
	TP_ARGS(wiphy, wdev, cookie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->cookie = cookie;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie=%llu",
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
);

2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179
TRACE_EVENT(rdev_set_mac_acl,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_acl_data *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u32, acl_policy)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
2180
		NETDEV_ASSIGN;
2181 2182 2183 2184 2185 2186
		__entry->acl_policy = params->acl_policy;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", acl policy: %d",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->acl_policy)
);

2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206
TRACE_EVENT(rdev_update_ft_ies,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_update_ft_ies_params *ftie),
	TP_ARGS(wiphy, netdev, ftie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u16, md)
		__dynamic_array(u8, ie, ftie->ie_len)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->md = ftie->md;
		memcpy(__get_dynamic_array(ie), ftie->ie, ftie->ie_len);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", md: 0x%x",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->md)
);

2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241
TRACE_EVENT(rdev_crit_proto_start,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 enum nl80211_crit_proto_id protocol, u16 duration),
	TP_ARGS(wiphy, wdev, protocol, duration),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u16, proto)
		__field(u16, duration)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->proto = protocol;
		__entry->duration = duration;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", proto=%x, duration=%u",
		  WIPHY_PR_ARG, WDEV_PR_ARG, __entry->proto, __entry->duration)
);

TRACE_EVENT(rdev_crit_proto_stop,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
		  WIPHY_PR_ARG, WDEV_PR_ARG)
);

2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252
TRACE_EVENT(rdev_channel_switch,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_csa_settings *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		CHAN_DEF_ENTRY
		__field(bool, radar_required)
		__field(bool, block_tx)
		__field(u8, count)
2253 2254
		__dynamic_array(u16, bcn_ofs, params->n_counter_offsets_beacon)
		__dynamic_array(u16, pres_ofs, params->n_counter_offsets_presp)
2255 2256 2257 2258 2259 2260 2261 2262
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		CHAN_DEF_ASSIGN(&params->chandef);
		__entry->radar_required = params->radar_required;
		__entry->block_tx = params->block_tx;
		__entry->count = params->count;
2263 2264 2265 2266 2267 2268 2269 2270 2271
		memcpy(__get_dynamic_array(bcn_ofs),
		       params->counter_offsets_beacon,
		       params->n_counter_offsets_beacon * sizeof(u16));

		/* probe response offsets are optional */
		if (params->n_counter_offsets_presp)
			memcpy(__get_dynamic_array(pres_ofs),
			       params->counter_offsets_presp,
			       params->n_counter_offsets_presp * sizeof(u16));
2272 2273
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
2274
		  ", block_tx: %d, count: %u, radar_required: %d",
2275
		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2276
		  __entry->block_tx, __entry->count, __entry->radar_required)
2277 2278
);

2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296
TRACE_EVENT(rdev_set_qos_map,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_qos_map *qos_map),
	TP_ARGS(wiphy, netdev, qos_map),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		QOS_MAP_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		QOS_MAP_ASSIGN(qos_map);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", num_des: %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->num_des)
);

2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314
TRACE_EVENT(rdev_set_ap_chanwidth,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_chan_def *chandef),
	TP_ARGS(wiphy, netdev, chandef),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		CHAN_DEF_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		CHAN_DEF_ASSIGN(chandef);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
);

2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359
TRACE_EVENT(rdev_add_tx_ts,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u8 tsid, const u8 *peer, u8 user_prio, u16 admitted_time),
	TP_ARGS(wiphy, netdev, tsid, peer, user_prio, admitted_time),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
		__field(u8, tsid)
		__field(u8, user_prio)
		__field(u16, admitted_time)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
		__entry->tsid = tsid;
		__entry->user_prio = user_prio;
		__entry->admitted_time = admitted_time;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", TSID %d, UP %d, time %d",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
		  __entry->tsid, __entry->user_prio, __entry->admitted_time)
);

TRACE_EVENT(rdev_del_tx_ts,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 u8 tsid, const u8 *peer),
	TP_ARGS(wiphy, netdev, tsid, peer),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
		__field(u8, tsid)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
		__entry->tsid = tsid;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ", TSID %d",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tsid)
);

2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401
TRACE_EVENT(rdev_tdls_channel_switch,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const u8 *addr, u8 oper_class,
		 struct cfg80211_chan_def *chandef),
	TP_ARGS(wiphy, netdev, addr, oper_class, chandef),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(addr)
		__field(u8, oper_class)
		CHAN_DEF_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(addr, addr);
		CHAN_DEF_ASSIGN(chandef);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT
		  " oper class %d, " CHAN_DEF_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(addr),
		  __entry->oper_class, CHAN_DEF_PR_ARG)
);

TRACE_EVENT(rdev_tdls_cancel_channel_switch,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const u8 *addr),
	TP_ARGS(wiphy, netdev, addr),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(addr)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(addr, addr);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(addr))
);

2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461
TRACE_EVENT(rdev_set_pmk,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_pmk_conf *pmk_conf),

	TP_ARGS(wiphy, netdev, pmk_conf),

	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(aa)
		__field(u8, pmk_len)
		__field(u8, pmk_r0_name_len)
		__dynamic_array(u8, pmk, pmk_conf->pmk_len)
		__dynamic_array(u8, pmk_r0_name, WLAN_PMK_NAME_LEN)
	),

	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(aa, pmk_conf->aa);
		__entry->pmk_len = pmk_conf->pmk_len;
		__entry->pmk_r0_name_len =
		pmk_conf->pmk_r0_name ? WLAN_PMK_NAME_LEN : 0;
		memcpy(__get_dynamic_array(pmk), pmk_conf->pmk,
		       pmk_conf->pmk_len);
		memcpy(__get_dynamic_array(pmk_r0_name), pmk_conf->pmk_r0_name,
		       pmk_conf->pmk_r0_name ? WLAN_PMK_NAME_LEN : 0);
	),

	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT
		  "pmk_len=%u, pmk: %s pmk_r0_name: %s", WIPHY_PR_ARG,
		  NETDEV_PR_ARG, MAC_PR_ARG(aa), __entry->pmk_len,
		  __print_array(__get_dynamic_array(pmk),
				__get_dynamic_array_len(pmk), 1),
		  __entry->pmk_r0_name_len ?
		  __print_array(__get_dynamic_array(pmk_r0_name),
				__get_dynamic_array_len(pmk_r0_name), 1) : "")
);

TRACE_EVENT(rdev_del_pmk,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *aa),

	TP_ARGS(wiphy, netdev, aa),

	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(aa)
	),

	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(aa, aa);
	),

	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(aa))
);

2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484
TRACE_EVENT(rdev_external_auth,
	    TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		     struct cfg80211_external_auth_params *params),
	    TP_ARGS(wiphy, netdev, params),
	    TP_STRUCT__entry(WIPHY_ENTRY
			     NETDEV_ENTRY
			     MAC_ENTRY(bssid)
			     __array(u8, ssid, IEEE80211_MAX_SSID_LEN + 1)
			     __field(u16, status)
	    ),
	    TP_fast_assign(WIPHY_ASSIGN;
			   NETDEV_ASSIGN;
			   MAC_ASSIGN(bssid, params->bssid);
			   memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
			   memcpy(__entry->ssid, params->ssid.ssid,
				  params->ssid.ssid_len);
			   __entry->status = params->status;
	    ),
	    TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
		      ", ssid: %s, status: %u", WIPHY_PR_ARG, NETDEV_PR_ARG,
		      __entry->bssid, __entry->ssid, __entry->status)
);

J
Johannes Berg 已提交
2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523
TRACE_EVENT(rdev_start_radar_detection,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_chan_def *chandef,
		 u32 cac_time_ms),
	TP_ARGS(wiphy, netdev, chandef, cac_time_ms),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		CHAN_DEF_ENTRY
		__field(u32, cac_time_ms)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		CHAN_DEF_ASSIGN(chandef);
		__entry->cac_time_ms = cac_time_ms;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
		  ", cac_time_ms=%u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
		  __entry->cac_time_ms)
);

TRACE_EVENT(rdev_set_mcast_rate,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 int *mcast_rate),
	TP_ARGS(wiphy, netdev, mcast_rate),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__array(int, mcast_rate, NUM_NL80211_BANDS)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		memcpy(__entry->mcast_rate, mcast_rate,
		       sizeof(int) * NUM_NL80211_BANDS);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", "
2524
		  "mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 6GHz=0x%x, 60GHz=0x%x]",
J
Johannes Berg 已提交
2525 2526 2527
		  WIPHY_PR_ARG, NETDEV_PR_ARG,
		  __entry->mcast_rate[NL80211_BAND_2GHZ],
		  __entry->mcast_rate[NL80211_BAND_5GHZ],
2528
		  __entry->mcast_rate[NL80211_BAND_6GHZ],
J
Johannes Berg 已提交
2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619
		  __entry->mcast_rate[NL80211_BAND_60GHZ])
);

TRACE_EVENT(rdev_set_coalesce,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_coalesce *coalesce),
	TP_ARGS(wiphy, coalesce),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, n_rules)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->n_rules = coalesce ? coalesce->n_rules : 0;
	),
	TP_printk(WIPHY_PR_FMT ", n_rules=%d",
		  WIPHY_PR_ARG, __entry->n_rules)
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_abort_scan,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

TRACE_EVENT(rdev_set_multicast_to_unicast,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const bool enabled),
	TP_ARGS(wiphy, netdev, enabled),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(bool, enabled)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->enabled = enabled;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", unicast: %s",
		  WIPHY_PR_ARG, NETDEV_PR_ARG,
		  BOOL_TO_STR(__entry->enabled))
);

DEFINE_EVENT(wiphy_wdev_evt, rdev_get_txq_stats,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev)
);

TRACE_EVENT(rdev_get_ftm_responder_stats,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_ftm_responder_stats *ftm_stats),

	TP_ARGS(wiphy, netdev, ftm_stats),

	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u64, timestamp)
		__field(u32, success_num)
		__field(u32, partial_num)
		__field(u32, failed_num)
		__field(u32, asap_num)
		__field(u32, non_asap_num)
		__field(u64, duration)
		__field(u32, unknown_triggers)
		__field(u32, reschedule)
		__field(u32, out_of_window)
	),

	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->success_num = ftm_stats->success_num;
		__entry->partial_num = ftm_stats->partial_num;
		__entry->failed_num = ftm_stats->failed_num;
		__entry->asap_num = ftm_stats->asap_num;
		__entry->non_asap_num = ftm_stats->non_asap_num;
		__entry->duration = ftm_stats->total_duration_ms;
		__entry->unknown_triggers = ftm_stats->unknown_triggers_num;
		__entry->reschedule = ftm_stats->reschedule_requests_num;
		__entry->out_of_window = ftm_stats->out_of_window_triggers_num;
	),

	TP_printk(WIPHY_PR_FMT "Ftm responder stats: success %u, partial %u, "
		"failed %u, asap %u, non asap %u, total duration %llu, unknown "
		"triggers %u, rescheduled %u, out of window %u", WIPHY_PR_ARG,
		__entry->success_num, __entry->partial_num, __entry->failed_num,
		__entry->asap_num, __entry->non_asap_num, __entry->duration,
		__entry->unknown_triggers, __entry->reschedule,
		__entry->out_of_window)
);

2620 2621 2622 2623 2624 2625 2626 2627 2628 2629
DEFINE_EVENT(wiphy_wdev_cookie_evt, rdev_start_pmsr,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
	TP_ARGS(wiphy, wdev, cookie)
);

DEFINE_EVENT(wiphy_wdev_cookie_evt, rdev_abort_pmsr,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
	TP_ARGS(wiphy, wdev, cookie)
);

2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647
TRACE_EVENT(rdev_set_fils_aad,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_fils_aad *fils_aad),
	TP_ARGS(wiphy, netdev, fils_aad),
	TP_STRUCT__entry(WIPHY_ENTRY
		NETDEV_ENTRY
		__array(u8, macaddr, ETH_ALEN)
		__field(u8, kek_len)
	),
	TP_fast_assign(WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		FILS_AAD_ASSIGN(fils_aad);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " FILS_AAD_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->macaddr,
		  __entry->kek_len)
);

2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713
/*************************************************************
 *	     cfg80211 exported functions traces		     *
 *************************************************************/

TRACE_EVENT(cfg80211_return_bool,
	TP_PROTO(bool ret),
	TP_ARGS(ret),
	TP_STRUCT__entry(
		__field(bool, ret)
	),
	TP_fast_assign(
		__entry->ret = ret;
	),
	TP_printk("returned %s", BOOL_TO_STR(__entry->ret))
);

DECLARE_EVENT_CLASS(cfg80211_netdev_mac_evt,
	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
	TP_ARGS(netdev, macaddr),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(macaddr)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(macaddr, macaddr);
	),
	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
		  NETDEV_PR_ARG, MAC_PR_ARG(macaddr))
);

DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_notify_new_peer_candidate,
	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
	TP_ARGS(netdev, macaddr)
);

DECLARE_EVENT_CLASS(netdev_evt_only,
	TP_PROTO(struct net_device *netdev),
	TP_ARGS(netdev),
	TP_STRUCT__entry(
		NETDEV_ENTRY
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
	),
	TP_printk(NETDEV_PR_FMT , NETDEV_PR_ARG)
);

DEFINE_EVENT(netdev_evt_only, cfg80211_send_rx_auth,
	TP_PROTO(struct net_device *netdev),
	TP_ARGS(netdev)
);

TRACE_EVENT(cfg80211_send_rx_assoc,
	TP_PROTO(struct net_device *netdev, struct cfg80211_bss *bss),
	TP_ARGS(netdev, bss),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		CHAN_ENTRY
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(bssid, bss->bssid);
		CHAN_ASSIGN(bss->channel);
	),
2714
	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", " CHAN_PR_FMT,
2715 2716 2717
		  NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
);

2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731
DECLARE_EVENT_CLASS(netdev_frame_event,
	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
	TP_ARGS(netdev, buf, len),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		__dynamic_array(u8, frame, len)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		memcpy(__get_dynamic_array(frame), buf, len);
	),
	TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x",
		  NETDEV_PR_ARG,
		  le16_to_cpup((__le16 *)__get_dynamic_array(frame)))
2732 2733
);

2734 2735 2736
DEFINE_EVENT(netdev_frame_event, cfg80211_rx_unprot_mlme_mgmt,
	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
	TP_ARGS(netdev, buf, len)
2737 2738
);

2739 2740 2741
DEFINE_EVENT(netdev_frame_event, cfg80211_rx_mlme_mgmt,
	TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
	TP_ARGS(netdev, buf, len)
2742 2743
);

2744
TRACE_EVENT(cfg80211_tx_mlme_mgmt,
2745 2746 2747
	TP_PROTO(struct net_device *netdev, const u8 *buf, int len,
		 bool reconnect),
	TP_ARGS(netdev, buf, len, reconnect),
2748 2749 2750
	TP_STRUCT__entry(
		NETDEV_ENTRY
		__dynamic_array(u8, frame, len)
2751
		__field(int, reconnect)
2752 2753 2754 2755
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		memcpy(__get_dynamic_array(frame), buf, len);
2756
		__entry->reconnect = reconnect;
2757
	),
2758
	TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x reconnect:%d",
2759
		  NETDEV_PR_ARG,
2760 2761
		  le16_to_cpup((__le16 *)__get_dynamic_array(frame)),
		  __entry->reconnect)
2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804
);

DECLARE_EVENT_CLASS(netdev_mac_evt,
	TP_PROTO(struct net_device *netdev, const u8 *mac),
	TP_ARGS(netdev, mac),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(mac)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(mac, mac)
	),
	TP_printk(NETDEV_PR_FMT ", mac: " MAC_PR_FMT,
		  NETDEV_PR_ARG, MAC_PR_ARG(mac))
);

DEFINE_EVENT(netdev_mac_evt, cfg80211_send_auth_timeout,
	TP_PROTO(struct net_device *netdev, const u8 *mac),
	TP_ARGS(netdev, mac)
);

DEFINE_EVENT(netdev_mac_evt, cfg80211_send_assoc_timeout,
	TP_PROTO(struct net_device *netdev, const u8 *mac),
	TP_ARGS(netdev, mac)
);

TRACE_EVENT(cfg80211_michael_mic_failure,
	TP_PROTO(struct net_device *netdev, const u8 *addr,
		 enum nl80211_key_type key_type, int key_id, const u8 *tsc),
	TP_ARGS(netdev, addr, key_type, key_id, tsc),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(addr)
		__field(enum nl80211_key_type, key_type)
		__field(int, key_id)
		__array(u8, tsc, 6)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(addr, addr);
		__entry->key_type = key_type;
		__entry->key_id = key_id;
E
Eliad Peller 已提交
2805 2806
		if (tsc)
			memcpy(__entry->tsc, tsc, 6);
2807
	),
2808
	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT ", key type: %d, key id: %d, tsc: %pm",
2809 2810 2811 2812 2813 2814 2815
		  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->key_type,
		  __entry->key_id, __entry->tsc)
);

TRACE_EVENT(cfg80211_ready_on_channel,
	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
		 struct ieee80211_channel *chan,
2816 2817
		 unsigned int duration),
	TP_ARGS(wdev, cookie, chan, duration),
2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829
	TP_STRUCT__entry(
		WDEV_ENTRY
		__field(u64, cookie)
		CHAN_ENTRY
		__field(unsigned int, duration)
	),
	TP_fast_assign(
		WDEV_ASSIGN;
		__entry->cookie = cookie;
		CHAN_ASSIGN(chan);
		__entry->duration = duration;
	),
2830
	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
2831
		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
2832
		  __entry->duration)
2833 2834 2835 2836
);

TRACE_EVENT(cfg80211_ready_on_channel_expired,
	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
2837 2838
		 struct ieee80211_channel *chan),
	TP_ARGS(wdev, cookie, chan),
2839 2840 2841 2842 2843 2844 2845 2846 2847 2848
	TP_STRUCT__entry(
		WDEV_ENTRY
		__field(u64, cookie)
		CHAN_ENTRY
	),
	TP_fast_assign(
		WDEV_ASSIGN;
		__entry->cookie = cookie;
		CHAN_ASSIGN(chan);
	),
2849 2850
	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
2851 2852
);

2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870
TRACE_EVENT(cfg80211_tx_mgmt_expired,
	TP_PROTO(struct wireless_dev *wdev, u64 cookie,
		 struct ieee80211_channel *chan),
	TP_ARGS(wdev, cookie, chan),
	TP_STRUCT__entry(
		WDEV_ENTRY
		__field(u64, cookie)
		CHAN_ENTRY
	),
	TP_fast_assign(
		WDEV_ASSIGN;
		__entry->cookie = cookie;
		CHAN_ASSIGN(chan);
	),
	TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
		  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
);

2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884
TRACE_EVENT(cfg80211_new_sta,
	TP_PROTO(struct net_device *netdev, const u8 *mac_addr,
		 struct station_info *sinfo),
	TP_ARGS(netdev, mac_addr, sinfo),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(mac_addr)
		SINFO_ENTRY
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(mac_addr, mac_addr);
		SINFO_ASSIGN;
	),
2885
	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT,
2886 2887 2888 2889 2890 2891 2892 2893 2894
		  NETDEV_PR_ARG, MAC_PR_ARG(mac_addr))
);

DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta,
	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
	TP_ARGS(netdev, macaddr)
);

TRACE_EVENT(cfg80211_rx_mgmt,
2895 2896
	TP_PROTO(struct wireless_dev *wdev, int freq, int sig_dbm),
	TP_ARGS(wdev, freq, sig_dbm),
2897 2898 2899
	TP_STRUCT__entry(
		WDEV_ENTRY
		__field(int, freq)
2900
		__field(int, sig_dbm)
2901 2902 2903 2904
	),
	TP_fast_assign(
		WDEV_ASSIGN;
		__entry->freq = freq;
2905
		__entry->sig_dbm = sig_dbm;
2906
	),
2907 2908
	TP_printk(WDEV_PR_FMT ", freq: "KHZ_F", sig dbm: %d",
		  WDEV_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925
);

TRACE_EVENT(cfg80211_mgmt_tx_status,
	TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
	TP_ARGS(wdev, cookie, ack),
	TP_STRUCT__entry(
		WDEV_ENTRY
		__field(u64, cookie)
		__field(bool, ack)
	),
	TP_fast_assign(
		WDEV_ASSIGN;
		__entry->cookie = cookie;
		__entry->ack = ack;
	),
	TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
		  WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942
);

TRACE_EVENT(cfg80211_control_port_tx_status,
	TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
	TP_ARGS(wdev, cookie, ack),
	TP_STRUCT__entry(
		WDEV_ENTRY
		__field(u64, cookie)
		__field(bool, ack)
	),
	TP_fast_assign(
		WDEV_ASSIGN;
		__entry->cookie = cookie;
		__entry->ack = ack;
	),
	TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
		  WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
2943 2944
);

2945
TRACE_EVENT(cfg80211_rx_control_port,
2946 2947 2948
	TP_PROTO(struct net_device *netdev, struct sk_buff *skb,
		 bool unencrypted),
	TP_ARGS(netdev, skb, unencrypted),
2949 2950
	TP_STRUCT__entry(
		NETDEV_ENTRY
2951 2952
		__field(int, len)
		MAC_ENTRY(from)
2953 2954 2955 2956 2957
		__field(u16, proto)
		__field(bool, unencrypted)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
2958 2959 2960
		__entry->len = skb->len;
		MAC_ASSIGN(from, eth_hdr(skb)->h_source);
		__entry->proto = be16_to_cpu(skb->protocol);
2961 2962
		__entry->unencrypted = unencrypted;
	),
2963 2964
	TP_printk(NETDEV_PR_FMT ", len=%d, " MAC_PR_FMT ", proto: 0x%x, unencrypted: %s",
		  NETDEV_PR_ARG, __entry->len, MAC_PR_ARG(from),
2965 2966 2967
		  __entry->proto, BOOL_TO_STR(__entry->unencrypted))
);

2968 2969
TRACE_EVENT(cfg80211_cqm_rssi_notify,
	TP_PROTO(struct net_device *netdev,
2970 2971 2972
		 enum nl80211_cqm_rssi_threshold_event rssi_event,
		 s32 rssi_level),
	TP_ARGS(netdev, rssi_event, rssi_level),
2973 2974 2975
	TP_STRUCT__entry(
		NETDEV_ENTRY
		__field(enum nl80211_cqm_rssi_threshold_event, rssi_event)
2976
		__field(s32, rssi_level)
2977 2978 2979 2980
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		__entry->rssi_event = rssi_event;
2981
		__entry->rssi_level = rssi_level;
2982
	),
2983 2984
	TP_printk(NETDEV_PR_FMT ", rssi event: %d, level: %d",
		  NETDEV_PR_ARG, __entry->rssi_event, __entry->rssi_level)
2985 2986
);

2987
TRACE_EVENT(cfg80211_reg_can_beacon,
2988
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
2989 2990
		 enum nl80211_iftype iftype, bool check_no_ir),
	TP_ARGS(wiphy, chandef, iftype, check_no_ir),
2991 2992
	TP_STRUCT__entry(
		WIPHY_ENTRY
2993
		CHAN_DEF_ENTRY
2994
		__field(enum nl80211_iftype, iftype)
2995
		__field(bool, check_no_ir)
2996 2997 2998
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
2999
		CHAN_DEF_ASSIGN(chandef);
3000
		__entry->iftype = iftype;
3001
		__entry->check_no_ir = check_no_ir;
3002
	),
3003 3004 3005
	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d check_no_ir=%s",
		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype,
		  BOOL_TO_STR(__entry->check_no_ir))
3006 3007
);

3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022
TRACE_EVENT(cfg80211_chandef_dfs_required,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
	TP_ARGS(wiphy, chandef),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		CHAN_DEF_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		CHAN_DEF_ASSIGN(chandef);
	),
	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
);

3023
TRACE_EVENT(cfg80211_ch_switch_notify,
3024 3025 3026
	TP_PROTO(struct net_device *netdev,
		 struct cfg80211_chan_def *chandef),
	TP_ARGS(netdev, chandef),
3027 3028
	TP_STRUCT__entry(
		NETDEV_ENTRY
3029
		CHAN_DEF_ENTRY
3030 3031 3032
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
3033
		CHAN_DEF_ASSIGN(chandef);
3034
	),
3035
	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
3036
		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
3037 3038
);

3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054
TRACE_EVENT(cfg80211_ch_switch_started_notify,
	TP_PROTO(struct net_device *netdev,
		 struct cfg80211_chan_def *chandef),
	TP_ARGS(netdev, chandef),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		CHAN_DEF_ENTRY
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		CHAN_DEF_ASSIGN(chandef);
	),
	TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
		  NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
);

3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084
TRACE_EVENT(cfg80211_radar_event,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
	TP_ARGS(wiphy, chandef),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		CHAN_DEF_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		CHAN_DEF_ASSIGN(chandef);
	),
	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
);

TRACE_EVENT(cfg80211_cac_event,
	TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt),
	TP_ARGS(netdev, evt),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		__field(enum nl80211_radar_event, evt)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		__entry->evt = evt;
	),
	TP_printk(NETDEV_PR_FMT ",  event: %d",
		  NETDEV_PR_ARG, __entry->evt)
);

3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095
DECLARE_EVENT_CLASS(cfg80211_rx_evt,
	TP_PROTO(struct net_device *netdev, const u8 *addr),
	TP_ARGS(netdev, addr),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(addr)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(addr, addr);
	),
3096
	TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT, NETDEV_PR_ARG, MAC_PR_ARG(addr))
3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108
);

DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_spurious_frame,
	TP_PROTO(struct net_device *netdev, const u8 *addr),
	TP_ARGS(netdev, addr)
);

DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_unexpected_4addr_frame,
	TP_PROTO(struct net_device *netdev, const u8 *addr),
	TP_ARGS(netdev, addr)
);

3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126
TRACE_EVENT(cfg80211_ibss_joined,
	TP_PROTO(struct net_device *netdev, const u8 *bssid,
		 struct ieee80211_channel *channel),
	TP_ARGS(netdev, bssid, channel),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(bssid)
		CHAN_ENTRY
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(bssid, bssid);
		CHAN_ASSIGN(channel);
	),
	TP_printk(NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", " CHAN_PR_FMT,
		  NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
);

3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142
TRACE_EVENT(cfg80211_probe_status,
	TP_PROTO(struct net_device *netdev, const u8 *addr, u64 cookie,
		 bool acked),
	TP_ARGS(netdev, addr, cookie, acked),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(addr)
		__field(u64, cookie)
		__field(bool, acked)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(addr, addr);
		__entry->cookie = cookie;
		__entry->acked = acked;
	),
3143
	TP_printk(NETDEV_PR_FMT " addr:" MAC_PR_FMT ", cookie: %llu, acked: %s",
3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204
		  NETDEV_PR_ARG, MAC_PR_ARG(addr), __entry->cookie,
		  BOOL_TO_STR(__entry->acked))
);

TRACE_EVENT(cfg80211_cqm_pktloss_notify,
	TP_PROTO(struct net_device *netdev, const u8 *peer, u32 num_packets),
	TP_ARGS(netdev, peer, num_packets),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		MAC_ENTRY(peer)
		__field(u32, num_packets)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
		__entry->num_packets = num_packets;
	),
	TP_printk(NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", num of lost packets: %u",
		  NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->num_packets)
);

DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_gtk_rekey_notify,
	TP_PROTO(struct net_device *netdev, const u8 *macaddr),
	TP_ARGS(netdev, macaddr)
);

TRACE_EVENT(cfg80211_pmksa_candidate_notify,
	TP_PROTO(struct net_device *netdev, int index, const u8 *bssid,
		 bool preauth),
	TP_ARGS(netdev, index, bssid, preauth),
	TP_STRUCT__entry(
		NETDEV_ENTRY
		__field(int, index)
		MAC_ENTRY(bssid)
		__field(bool, preauth)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		__entry->index = index;
		MAC_ASSIGN(bssid, bssid);
		__entry->preauth = preauth;
	),
	TP_printk(NETDEV_PR_FMT ", index:%d, bssid: " MAC_PR_FMT ", pre auth: %s",
		  NETDEV_PR_ARG, __entry->index, MAC_PR_ARG(bssid),
		  BOOL_TO_STR(__entry->preauth))
);

TRACE_EVENT(cfg80211_report_obss_beacon,
	TP_PROTO(struct wiphy *wiphy, const u8 *frame, size_t len,
		 int freq, int sig_dbm),
	TP_ARGS(wiphy, frame, len, freq, sig_dbm),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(int, freq)
		__field(int, sig_dbm)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->freq = freq;
		__entry->sig_dbm = sig_dbm;
	),
3205 3206
	TP_printk(WIPHY_PR_FMT ", freq: "KHZ_F", sig_dbm: %d",
		  WIPHY_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
3207 3208
);

3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231
TRACE_EVENT(cfg80211_tdls_oper_request,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer,
		 enum nl80211_tdls_operation oper, u16 reason_code),
	TP_ARGS(wiphy, netdev, peer, oper, reason_code),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
		__field(enum nl80211_tdls_operation, oper)
		__field(u16, reason_code)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
		__entry->oper = oper;
		__entry->reason_code = reason_code;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", oper: %d, reason_code %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper,
		  __entry->reason_code)
	);

3232
TRACE_EVENT(cfg80211_scan_done,
3233 3234 3235
	TP_PROTO(struct cfg80211_scan_request *request,
		 struct cfg80211_scan_info *info),
	TP_ARGS(request, info),
3236 3237 3238
	TP_STRUCT__entry(
		__field(u32, n_channels)
		__dynamic_array(u8, ie, request ? request->ie_len : 0)
3239
		__array(u32, rates, NUM_NL80211_BANDS)
3240 3241 3242 3243
		__field(u32, wdev_id)
		MAC_ENTRY(wiphy_mac)
		__field(bool, no_cck)
		__field(bool, aborted)
3244 3245
		__field(u64, scan_start_tsf)
		MAC_ENTRY(tsf_bssid)
3246 3247 3248 3249 3250 3251
	),
	TP_fast_assign(
		if (request) {
			memcpy(__get_dynamic_array(ie), request->ie,
			       request->ie_len);
			memcpy(__entry->rates, request->rates,
3252
			       NUM_NL80211_BANDS);
3253 3254 3255 3256 3257 3258 3259
			__entry->wdev_id = request->wdev ?
					request->wdev->identifier : 0;
			if (request->wiphy)
				MAC_ASSIGN(wiphy_mac,
					   request->wiphy->perm_addr);
			__entry->no_cck = request->no_cck;
		}
3260 3261 3262 3263 3264
		if (info) {
			__entry->aborted = info->aborted;
			__entry->scan_start_tsf = info->scan_start_tsf;
			MAC_ASSIGN(tsf_bssid, info->tsf_bssid);
		}
3265
	),
3266 3267 3268 3269
	TP_printk("aborted: %s, scan start (TSF): %llu, tsf_bssid: " MAC_PR_FMT,
		  BOOL_TO_STR(__entry->aborted),
		  (unsigned long long)__entry->scan_start_tsf,
		  MAC_PR_ARG(tsf_bssid))
3270 3271
);

3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283
DECLARE_EVENT_CLASS(wiphy_id_evt,
	TP_PROTO(struct wiphy *wiphy, u64 id),
	TP_ARGS(wiphy, id),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(u64, id)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->id = id;
	),
	TP_printk(WIPHY_PR_FMT ", id: %llu", WIPHY_PR_ARG, __entry->id)
3284 3285
);

3286 3287 3288 3289 3290 3291 3292 3293
DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_stopped,
	TP_PROTO(struct wiphy *wiphy, u64 id),
	TP_ARGS(wiphy, id)
);

DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_results,
	TP_PROTO(struct wiphy *wiphy, u64 id),
	TP_ARGS(wiphy, id)
3294 3295 3296 3297 3298
);

TRACE_EVENT(cfg80211_get_bss,
	TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
		 const u8 *bssid, const u8 *ssid, size_t ssid_len,
3299 3300 3301
		 enum ieee80211_bss_type bss_type,
		 enum ieee80211_privacy privacy),
	TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, bss_type, privacy),
3302 3303 3304 3305 3306
	TP_STRUCT__entry(
		WIPHY_ENTRY
		CHAN_ENTRY
		MAC_ENTRY(bssid)
		__dynamic_array(u8, ssid, ssid_len)
3307 3308
		__field(enum ieee80211_bss_type, bss_type)
		__field(enum ieee80211_privacy, privacy)
3309 3310 3311 3312 3313 3314
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		CHAN_ASSIGN(channel);
		MAC_ASSIGN(bssid, bssid);
		memcpy(__get_dynamic_array(ssid), ssid, ssid_len);
3315 3316 3317 3318 3319 3320 3321 3322
		__entry->bss_type = bss_type;
		__entry->privacy = privacy;
	),
	TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", " MAC_PR_FMT
		  ", buf: %#.2x, bss_type: %d, privacy: %d",
		  WIPHY_PR_ARG, CHAN_PR_ARG, MAC_PR_ARG(bssid),
		  ((u8 *)__get_dynamic_array(ssid))[0], __entry->bss_type,
		  __entry->privacy)
3323 3324
);

3325 3326 3327 3328
TRACE_EVENT(cfg80211_inform_bss_frame,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_inform_bss *data,
		 struct ieee80211_mgmt *mgmt, size_t len),
	TP_ARGS(wiphy, data, mgmt, len),
3329 3330 3331
	TP_STRUCT__entry(
		WIPHY_ENTRY
		CHAN_ENTRY
3332
		__field(enum nl80211_bss_scan_width, scan_width)
3333 3334
		__dynamic_array(u8, mgmt, len)
		__field(s32, signal)
3335
		__field(u64, ts_boottime)
3336 3337
		__field(u64, parent_tsf)
		MAC_ENTRY(parent_bssid)
3338 3339 3340
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
3341 3342
		CHAN_ASSIGN(data->chan);
		__entry->scan_width = data->scan_width;
3343 3344
		if (mgmt)
			memcpy(__get_dynamic_array(mgmt), mgmt, len);
3345 3346
		__entry->signal = data->signal;
		__entry->ts_boottime = data->boottime_ns;
3347 3348 3349 3350 3351 3352 3353 3354 3355
		__entry->parent_tsf = data->parent_tsf;
		MAC_ASSIGN(parent_bssid, data->parent_bssid);
	),
	TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT
		  "(scan_width: %d) signal: %d, tsb:%llu, detect_tsf:%llu, tsf_bssid: "
		  MAC_PR_FMT, WIPHY_PR_ARG, CHAN_PR_ARG, __entry->scan_width,
		  __entry->signal, (unsigned long long)__entry->ts_boottime,
		  (unsigned long long)__entry->parent_tsf,
		  MAC_PR_ARG(parent_bssid))
3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368
);

DECLARE_EVENT_CLASS(cfg80211_bss_evt,
	TP_PROTO(struct cfg80211_bss *pub),
	TP_ARGS(pub),
	TP_STRUCT__entry(
		MAC_ENTRY(bssid)
		CHAN_ENTRY
	),
	TP_fast_assign(
		MAC_ASSIGN(bssid, pub->bssid);
		CHAN_ASSIGN(pub->channel);
	),
3369
	TP_printk(MAC_PR_FMT ", " CHAN_PR_FMT, MAC_PR_ARG(bssid), CHAN_PR_ARG)
3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400
);

DEFINE_EVENT(cfg80211_bss_evt, cfg80211_return_bss,
	TP_PROTO(struct cfg80211_bss *pub),
	TP_ARGS(pub)
);

TRACE_EVENT(cfg80211_return_uint,
	TP_PROTO(unsigned int ret),
	TP_ARGS(ret),
	TP_STRUCT__entry(
		__field(unsigned int, ret)
	),
	TP_fast_assign(
		__entry->ret = ret;
	),
	TP_printk("ret: %d", __entry->ret)
);

TRACE_EVENT(cfg80211_return_u32,
	TP_PROTO(u32 ret),
	TP_ARGS(ret),
	TP_STRUCT__entry(
		__field(u32, ret)
	),
	TP_fast_assign(
		__entry->ret = ret;
	),
	TP_printk("ret: %u", __entry->ret)
);

3401 3402 3403 3404 3405 3406 3407
TRACE_EVENT(cfg80211_report_wowlan_wakeup,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 struct cfg80211_wowlan_wakeup *wakeup),
	TP_ARGS(wiphy, wdev, wakeup),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
3408
		__field(bool, non_wireless)
3409 3410 3411 3412 3413 3414 3415 3416
		__field(bool, disconnect)
		__field(bool, magic_pkt)
		__field(bool, gtk_rekey_failure)
		__field(bool, eap_identity_req)
		__field(bool, four_way_handshake)
		__field(bool, rfkill_release)
		__field(s32, pattern_idx)
		__field(u32, packet_len)
3417 3418
		__dynamic_array(u8, packet,
				wakeup ? wakeup->packet_present_len : 0)
3419 3420 3421 3422
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
3423 3424 3425 3426 3427 3428 3429 3430 3431 3432
		__entry->non_wireless = !wakeup;
		__entry->disconnect = wakeup ? wakeup->disconnect : false;
		__entry->magic_pkt = wakeup ? wakeup->magic_pkt : false;
		__entry->gtk_rekey_failure = wakeup ? wakeup->gtk_rekey_failure : false;
		__entry->eap_identity_req = wakeup ? wakeup->eap_identity_req : false;
		__entry->four_way_handshake = wakeup ? wakeup->four_way_handshake : false;
		__entry->rfkill_release = wakeup ? wakeup->rfkill_release : false;
		__entry->pattern_idx = wakeup ? wakeup->pattern_idx : false;
		__entry->packet_len = wakeup ? wakeup->packet_len : false;
		if (wakeup && wakeup->packet && wakeup->packet_present_len)
3433 3434 3435 3436 3437 3438
			memcpy(__get_dynamic_array(packet), wakeup->packet,
			       wakeup->packet_present_len);
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
);

3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464
TRACE_EVENT(cfg80211_ft_event,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_ft_event_params *ft_event),
	TP_ARGS(wiphy, netdev, ft_event),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__dynamic_array(u8, ies, ft_event->ies_len)
		MAC_ENTRY(target_ap)
		__dynamic_array(u8, ric_ies, ft_event->ric_ies_len)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		if (ft_event->ies)
			memcpy(__get_dynamic_array(ies), ft_event->ies,
			       ft_event->ies_len);
		MAC_ASSIGN(target_ap, ft_event->target_ap);
		if (ft_event->ric_ies)
			memcpy(__get_dynamic_array(ric_ies), ft_event->ric_ies,
			       ft_event->ric_ies_len);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", target_ap: " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
);

3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478
TRACE_EVENT(cfg80211_stop_iface,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
	TP_ARGS(wiphy, wdev),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
		  WIPHY_PR_ARG, WDEV_PR_ARG)
);
3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518

TRACE_EVENT(cfg80211_pmsr_report,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
		 u64 cookie, const u8 *addr),
	TP_ARGS(wiphy, wdev, cookie, addr),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u64, cookie)
		MAC_ENTRY(addr)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->cookie = cookie;
		MAC_ASSIGN(addr, addr);
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie:%lld, " MAC_PR_FMT,
		  WIPHY_PR_ARG, WDEV_PR_ARG,
		  (unsigned long long)__entry->cookie,
		  MAC_PR_ARG(addr))
);

TRACE_EVENT(cfg80211_pmsr_complete,
	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
	TP_ARGS(wiphy, wdev, cookie),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		WDEV_ENTRY
		__field(u64, cookie)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		WDEV_ASSIGN;
		__entry->cookie = cookie;
	),
	TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie:%lld",
		  WIPHY_PR_ARG, WDEV_PR_ARG,
		  (unsigned long long)__entry->cookie)
);
3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556

TRACE_EVENT(rdev_update_owe_info,
	    TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		     struct cfg80211_update_owe_info *owe_info),
	    TP_ARGS(wiphy, netdev, owe_info),
	    TP_STRUCT__entry(WIPHY_ENTRY
			     NETDEV_ENTRY
			     MAC_ENTRY(peer)
			     __field(u16, status)
			     __dynamic_array(u8, ie, owe_info->ie_len)),
	    TP_fast_assign(WIPHY_ASSIGN;
			   NETDEV_ASSIGN;
			   MAC_ASSIGN(peer, owe_info->peer);
			   __entry->status = owe_info->status;
			   memcpy(__get_dynamic_array(ie),
				  owe_info->ie, owe_info->ie_len);),
	    TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT
		  " status %d", WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer),
		  __entry->status)
);

TRACE_EVENT(cfg80211_update_owe_info_event,
	    TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		     struct cfg80211_update_owe_info *owe_info),
	    TP_ARGS(wiphy, netdev, owe_info),
	    TP_STRUCT__entry(WIPHY_ENTRY
			     NETDEV_ENTRY
			     MAC_ENTRY(peer)
			     __dynamic_array(u8, ie, owe_info->ie_len)),
	    TP_fast_assign(WIPHY_ASSIGN;
			   NETDEV_ASSIGN;
			   MAC_ASSIGN(peer, owe_info->peer);
			   memcpy(__get_dynamic_array(ie), owe_info->ie,
				  owe_info->ie_len);),
	    TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
		      WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
);

3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574
TRACE_EVENT(rdev_probe_mesh_link,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 const u8 *dest, const u8 *buf, size_t len),
	TP_ARGS(wiphy, netdev, dest, buf, len),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(dest)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(dest, dest);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dest))
);

3575 3576
TRACE_EVENT(rdev_set_tid_config,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
J
Johannes Berg 已提交
3577
		 struct cfg80211_tid_config *tid_conf),
3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594
	TP_ARGS(wiphy, netdev, tid_conf),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, tid_conf->peer);
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT,
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer))
);

TRACE_EVENT(rdev_reset_tid_config,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
J
Johannes Berg 已提交
3595 3596
		 const u8 *peer, u8 tids),
	TP_ARGS(wiphy, netdev, peer, tids),
3597 3598 3599 3600
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		MAC_ENTRY(peer)
J
Johannes Berg 已提交
3601
		__field(u8, tids)
3602 3603 3604 3605 3606
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		MAC_ASSIGN(peer, peer);
J
Johannes Berg 已提交
3607
		__entry->tids = tids;
3608
	),
J
Johannes Berg 已提交
3609 3610
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", tids: 0x%x",
		  WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->tids)
3611
);
3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630

TRACE_EVENT(rdev_set_sar_specs,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_sar_specs *sar),
	TP_ARGS(wiphy, sar),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		__field(u16, type)
		__field(u16, num)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		__entry->type = sar->type;
		__entry->num = sar->num_sub_specs;

	),
	TP_printk(WIPHY_PR_FMT ", Set type:%d, num_specs:%d",
		  WIPHY_PR_ARG, __entry->type, __entry->num)
);

3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661
TRACE_EVENT(rdev_color_change,
	TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
		 struct cfg80211_color_change_settings *params),
	TP_ARGS(wiphy, netdev, params),
	TP_STRUCT__entry(
		WIPHY_ENTRY
		NETDEV_ENTRY
		__field(u8, count)
		__field(u16, bcn_ofs)
		__field(u16, pres_ofs)
	),
	TP_fast_assign(
		WIPHY_ASSIGN;
		NETDEV_ASSIGN;
		__entry->count = params->count;
		__entry->bcn_ofs = params->counter_offset_beacon;
		__entry->pres_ofs = params->counter_offset_presp;
	),
	TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
		  ", count: %u",
		  WIPHY_PR_ARG, NETDEV_PR_ARG,
		  __entry->count)
);

TRACE_EVENT(cfg80211_bss_color_notify,
	TP_PROTO(struct net_device *netdev,
		 enum nl80211_commands cmd,
		 u8 count, u64 color_bitmap),
	TP_ARGS(netdev, cmd, count, color_bitmap),
	TP_STRUCT__entry(
		NETDEV_ENTRY
3662
		__field(u32, cmd)
3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676
		__field(u8, count)
		__field(u64, color_bitmap)
	),
	TP_fast_assign(
		NETDEV_ASSIGN;
		__entry->cmd = cmd;
		__entry->count = count;
		__entry->color_bitmap = color_bitmap;
	),
	TP_printk(NETDEV_PR_FMT ", cmd: %x, count: %u, bitmap: %llx",
		  NETDEV_PR_ARG, __entry->cmd, __entry->count,
		  __entry->color_bitmap)
);

3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695
TRACE_EVENT(rdev_set_radar_offchan,
	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),

	TP_ARGS(wiphy, chandef),

	TP_STRUCT__entry(
		WIPHY_ENTRY
		CHAN_DEF_ENTRY
	),

	TP_fast_assign(
		WIPHY_ASSIGN;
		CHAN_DEF_ASSIGN(chandef)
	),

	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
);

B
Beni Lev 已提交
3696 3697 3698 3699 3700 3701 3702
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h>