netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c
[sfrench/cifs-2.6.git] / net / wireless / trace.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Portions of this file
4  * Copyright(c) 2016-2017 Intel Deutschland GmbH
5  * Copyright (C) 2018, 2020-2024 Intel Corporation
6  */
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM cfg80211
9
10 #if !defined(__RDEV_OPS_TRACE) || defined(TRACE_HEADER_MULTI_READ)
11 #define __RDEV_OPS_TRACE
12
13 #include <linux/tracepoint.h>
14
15 #include <linux/rtnetlink.h>
16 #include <linux/etherdevice.h>
17 #include <net/cfg80211.h>
18 #include "core.h"
19
20 #define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)
21 #define MAC_ASSIGN(entry_mac, given_mac) do {                        \
22         if (given_mac)                                               \
23                 memcpy(__entry->entry_mac, given_mac, ETH_ALEN);     \
24         else                                                         \
25                 eth_zero_addr(__entry->entry_mac);                   \
26         } while (0)
27
28 #define MAXNAME         32
29 #define WIPHY_ENTRY     __array(char, wiphy_name, 32)
30 #define WIPHY_ASSIGN    strscpy(__entry->wiphy_name, wiphy_name(wiphy), MAXNAME)
31 #define WIPHY_PR_FMT    "%s"
32 #define WIPHY_PR_ARG    __entry->wiphy_name
33
34 #define WDEV_ENTRY      __field(u32, id)
35 #define WDEV_ASSIGN     (__entry->id) = (!IS_ERR_OR_NULL(wdev)  \
36                                          ? wdev->identifier : 0)
37 #define WDEV_PR_FMT     "wdev(%u)"
38 #define WDEV_PR_ARG     (__entry->id)
39
40 #define NETDEV_ENTRY    __array(char, name, IFNAMSIZ) \
41                         __field(int, ifindex)
42 #define NETDEV_ASSIGN                                          \
43         do {                                                   \
44                 memcpy(__entry->name, netdev->name, IFNAMSIZ); \
45                 (__entry->ifindex) = (netdev->ifindex);        \
46         } while (0)
47 #define NETDEV_PR_FMT   "netdev:%s(%d)"
48 #define NETDEV_PR_ARG   __entry->name, __entry->ifindex
49
50 #define MESH_CFG_ENTRY __field(u16, dot11MeshRetryTimeout)                 \
51                        __field(u16, dot11MeshConfirmTimeout)               \
52                        __field(u16, dot11MeshHoldingTimeout)               \
53                        __field(u16, dot11MeshMaxPeerLinks)                 \
54                        __field(u8, dot11MeshMaxRetries)                    \
55                        __field(u8, dot11MeshTTL)                           \
56                        __field(u8, element_ttl)                            \
57                        __field(bool, auto_open_plinks)                     \
58                        __field(u32, dot11MeshNbrOffsetMaxNeighbor)         \
59                        __field(u8, dot11MeshHWMPmaxPREQretries)            \
60                        __field(u32, path_refresh_time)                     \
61                        __field(u32, dot11MeshHWMPactivePathTimeout)        \
62                        __field(u16, min_discovery_timeout)                 \
63                        __field(u16, dot11MeshHWMPpreqMinInterval)          \
64                        __field(u16, dot11MeshHWMPperrMinInterval)          \
65                        __field(u16, dot11MeshHWMPnetDiameterTraversalTime) \
66                        __field(u8, dot11MeshHWMPRootMode)                  \
67                        __field(u16, dot11MeshHWMPRannInterval)             \
68                        __field(bool, dot11MeshGateAnnouncementProtocol)    \
69                        __field(bool, dot11MeshForwarding)                  \
70                        __field(s32, rssi_threshold)                        \
71                        __field(u16, ht_opmode)                             \
72                        __field(u32, dot11MeshHWMPactivePathToRootTimeout)  \
73                        __field(u16, dot11MeshHWMProotInterval)             \
74                        __field(u16, dot11MeshHWMPconfirmationInterval)     \
75                        __field(bool, dot11MeshNolearn)
76 #define MESH_CFG_ASSIGN                                                       \
77         do {                                                                  \
78                 __entry->dot11MeshRetryTimeout = conf->dot11MeshRetryTimeout; \
79                 __entry->dot11MeshConfirmTimeout =                            \
80                                 conf->dot11MeshConfirmTimeout;                \
81                 __entry->dot11MeshHoldingTimeout =                            \
82                                 conf->dot11MeshHoldingTimeout;                \
83                 __entry->dot11MeshMaxPeerLinks = conf->dot11MeshMaxPeerLinks; \
84                 __entry->dot11MeshMaxRetries = conf->dot11MeshMaxRetries;     \
85                 __entry->dot11MeshTTL = conf->dot11MeshTTL;                   \
86                 __entry->element_ttl = conf->element_ttl;                     \
87                 __entry->auto_open_plinks = conf->auto_open_plinks;           \
88                 __entry->dot11MeshNbrOffsetMaxNeighbor =                      \
89                                 conf->dot11MeshNbrOffsetMaxNeighbor;          \
90                 __entry->dot11MeshHWMPmaxPREQretries =                        \
91                                 conf->dot11MeshHWMPmaxPREQretries;            \
92                 __entry->path_refresh_time = conf->path_refresh_time;         \
93                 __entry->dot11MeshHWMPactivePathTimeout =                     \
94                                 conf->dot11MeshHWMPactivePathTimeout;         \
95                 __entry->min_discovery_timeout = conf->min_discovery_timeout; \
96                 __entry->dot11MeshHWMPpreqMinInterval =                       \
97                                 conf->dot11MeshHWMPpreqMinInterval;           \
98                 __entry->dot11MeshHWMPperrMinInterval =                       \
99                                 conf->dot11MeshHWMPperrMinInterval;           \
100                 __entry->dot11MeshHWMPnetDiameterTraversalTime =              \
101                                 conf->dot11MeshHWMPnetDiameterTraversalTime;  \
102                 __entry->dot11MeshHWMPRootMode = conf->dot11MeshHWMPRootMode; \
103                 __entry->dot11MeshHWMPRannInterval =                          \
104                                 conf->dot11MeshHWMPRannInterval;              \
105                 __entry->dot11MeshGateAnnouncementProtocol =                  \
106                                 conf->dot11MeshGateAnnouncementProtocol;      \
107                 __entry->dot11MeshForwarding = conf->dot11MeshForwarding;     \
108                 __entry->rssi_threshold = conf->rssi_threshold;               \
109                 __entry->ht_opmode = conf->ht_opmode;                         \
110                 __entry->dot11MeshHWMPactivePathToRootTimeout =               \
111                                 conf->dot11MeshHWMPactivePathToRootTimeout;   \
112                 __entry->dot11MeshHWMProotInterval =                          \
113                                 conf->dot11MeshHWMProotInterval;              \
114                 __entry->dot11MeshHWMPconfirmationInterval =                  \
115                                 conf->dot11MeshHWMPconfirmationInterval;      \
116                 __entry->dot11MeshNolearn = conf->dot11MeshNolearn;           \
117         } while (0)
118
119 #define CHAN_ENTRY __field(enum nl80211_band, band) \
120                    __field(u32, center_freq)            \
121                    __field(u16, freq_offset)
122 #define CHAN_ASSIGN(chan)                                         \
123         do {                                                      \
124                 if (chan) {                                       \
125                         __entry->band = chan->band;               \
126                         __entry->center_freq = chan->center_freq; \
127                         __entry->freq_offset = chan->freq_offset; \
128                 } else {                                          \
129                         __entry->band = 0;                        \
130                         __entry->center_freq = 0;                 \
131                         __entry->freq_offset = 0;                 \
132                 }                                                 \
133         } while (0)
134 #define CHAN_PR_FMT "band: %d, freq: %u.%03u"
135 #define CHAN_PR_ARG __entry->band, __entry->center_freq, __entry->freq_offset
136
137 #define CHAN_DEF_ENTRY __field(enum nl80211_band, band)         \
138                        __field(u32, control_freq)                       \
139                        __field(u32, freq_offset)                        \
140                        __field(u32, width)                              \
141                        __field(u32, center_freq1)                       \
142                        __field(u32, freq1_offset)                       \
143                        __field(u32, center_freq2)                       \
144                        __field(u16, punctured)
145 #define CHAN_DEF_ASSIGN(chandef)                                        \
146         do {                                                            \
147                 if ((chandef) && (chandef)->chan) {                     \
148                         __entry->band = (chandef)->chan->band;          \
149                         __entry->control_freq =                         \
150                                 (chandef)->chan->center_freq;           \
151                         __entry->freq_offset =                          \
152                                 (chandef)->chan->freq_offset;           \
153                         __entry->width = (chandef)->width;              \
154                         __entry->center_freq1 = (chandef)->center_freq1;\
155                         __entry->freq1_offset = (chandef)->freq1_offset;\
156                         __entry->center_freq2 = (chandef)->center_freq2;\
157                         __entry->punctured = (chandef)->punctured;      \
158                 } else {                                                \
159                         __entry->band = 0;                              \
160                         __entry->control_freq = 0;                      \
161                         __entry->freq_offset = 0;                       \
162                         __entry->width = 0;                             \
163                         __entry->center_freq1 = 0;                      \
164                         __entry->freq1_offset = 0;                      \
165                         __entry->center_freq2 = 0;                      \
166                         __entry->punctured = 0;                         \
167                 }                                                       \
168         } while (0)
169 #define CHAN_DEF_PR_FMT                                                 \
170         "band: %d, control freq: %u.%03u, width: %d, cf1: %u.%03u, cf2: %u, punct: 0x%x"
171 #define CHAN_DEF_PR_ARG __entry->band, __entry->control_freq,           \
172                         __entry->freq_offset, __entry->width,           \
173                         __entry->center_freq1, __entry->freq1_offset,   \
174                         __entry->center_freq2, __entry->punctured
175
176 #define FILS_AAD_ASSIGN(fa)                                             \
177         do {                                                            \
178                 if (fa) {                                               \
179                         ether_addr_copy(__entry->macaddr, fa->macaddr); \
180                         __entry->kek_len = fa->kek_len;                 \
181                 } else {                                                \
182                         eth_zero_addr(__entry->macaddr);                \
183                         __entry->kek_len = 0;                           \
184                 }                                                       \
185         } while (0)
186 #define FILS_AAD_PR_FMT                                                 \
187         "macaddr: %pM, kek_len: %d"
188
189 #define SINFO_ENTRY __field(int, generation)        \
190                     __field(u32, connected_time)    \
191                     __field(u32, inactive_time)     \
192                     __field(u32, rx_bytes)          \
193                     __field(u32, tx_bytes)          \
194                     __field(u32, rx_packets)        \
195                     __field(u32, tx_packets)        \
196                     __field(u32, tx_retries)        \
197                     __field(u32, tx_failed)         \
198                     __field(u32, rx_dropped_misc)   \
199                     __field(u32, beacon_loss_count) \
200                     __field(u16, llid)              \
201                     __field(u16, plid)              \
202                     __field(u8, plink_state)
203 #define SINFO_ASSIGN                                                   \
204         do {                                                           \
205                 __entry->generation = sinfo->generation;               \
206                 __entry->connected_time = sinfo->connected_time;       \
207                 __entry->inactive_time = sinfo->inactive_time;         \
208                 __entry->rx_bytes = sinfo->rx_bytes;                   \
209                 __entry->tx_bytes = sinfo->tx_bytes;                   \
210                 __entry->rx_packets = sinfo->rx_packets;               \
211                 __entry->tx_packets = sinfo->tx_packets;               \
212                 __entry->tx_retries = sinfo->tx_retries;               \
213                 __entry->tx_failed = sinfo->tx_failed;                 \
214                 __entry->rx_dropped_misc = sinfo->rx_dropped_misc;     \
215                 __entry->beacon_loss_count = sinfo->beacon_loss_count; \
216                 __entry->llid = sinfo->llid;                           \
217                 __entry->plid = sinfo->plid;                           \
218                 __entry->plink_state = sinfo->plink_state;             \
219         } while (0)
220
221 #define BOOL_TO_STR(bo) (bo) ? "true" : "false"
222
223 #define QOS_MAP_ENTRY __field(u8, num_des)                      \
224                       __array(u8, dscp_exception,               \
225                               2 * IEEE80211_QOS_MAP_MAX_EX)     \
226                       __array(u8, up, IEEE80211_QOS_MAP_LEN_MIN)
227 #define QOS_MAP_ASSIGN(qos_map)                                 \
228         do {                                                    \
229                 if ((qos_map)) {                                \
230                         __entry->num_des = (qos_map)->num_des;  \
231                         memcpy(__entry->dscp_exception,         \
232                                &(qos_map)->dscp_exception,      \
233                                2 * IEEE80211_QOS_MAP_MAX_EX);   \
234                         memcpy(__entry->up, &(qos_map)->up,     \
235                                IEEE80211_QOS_MAP_LEN_MIN);      \
236                 } else {                                        \
237                         __entry->num_des = 0;                   \
238                         memset(__entry->dscp_exception, 0,      \
239                                2 * IEEE80211_QOS_MAP_MAX_EX);   \
240                         memset(__entry->up, 0,                  \
241                                IEEE80211_QOS_MAP_LEN_MIN);      \
242                 }                                               \
243         } while (0)
244
245 /*************************************************************
246  *                      rdev->ops traces                     *
247  *************************************************************/
248
249 TRACE_EVENT(rdev_suspend,
250         TP_PROTO(struct wiphy *wiphy, struct cfg80211_wowlan *wow),
251         TP_ARGS(wiphy, wow),
252         TP_STRUCT__entry(
253                 WIPHY_ENTRY
254                 __field(bool, any)
255                 __field(bool, disconnect)
256                 __field(bool, magic_pkt)
257                 __field(bool, gtk_rekey_failure)
258                 __field(bool, eap_identity_req)
259                 __field(bool, four_way_handshake)
260                 __field(bool, rfkill_release)
261                 __field(bool, valid_wow)
262         ),
263         TP_fast_assign(
264                 WIPHY_ASSIGN;
265                 if (wow) {
266                         __entry->any = wow->any;
267                         __entry->disconnect = wow->disconnect;
268                         __entry->magic_pkt = wow->magic_pkt;
269                         __entry->gtk_rekey_failure = wow->gtk_rekey_failure;
270                         __entry->eap_identity_req = wow->eap_identity_req;
271                         __entry->four_way_handshake = wow->four_way_handshake;
272                         __entry->rfkill_release = wow->rfkill_release;
273                         __entry->valid_wow = true;
274                 } else {
275                         __entry->valid_wow = false;
276                 }
277         ),
278         TP_printk(WIPHY_PR_FMT ", wow%s - any: %d, disconnect: %d, "
279                   "magic pkt: %d, gtk rekey failure: %d, eap identify req: %d, "
280                   "four way handshake: %d, rfkill release: %d.",
281                   WIPHY_PR_ARG, __entry->valid_wow ? "" : "(Not configured!)",
282                   __entry->any, __entry->disconnect, __entry->magic_pkt,
283                   __entry->gtk_rekey_failure, __entry->eap_identity_req,
284                   __entry->four_way_handshake, __entry->rfkill_release)
285 );
286
287 TRACE_EVENT(rdev_return_int,
288         TP_PROTO(struct wiphy *wiphy, int ret),
289         TP_ARGS(wiphy, ret),
290         TP_STRUCT__entry(
291                 WIPHY_ENTRY
292                 __field(int, ret)
293         ),
294         TP_fast_assign(
295                 WIPHY_ASSIGN;
296                 __entry->ret = ret;
297         ),
298         TP_printk(WIPHY_PR_FMT ", returned: %d", WIPHY_PR_ARG, __entry->ret)
299 );
300
301 TRACE_EVENT(rdev_scan,
302         TP_PROTO(struct wiphy *wiphy, struct cfg80211_scan_request *request),
303         TP_ARGS(wiphy, request),
304         TP_STRUCT__entry(
305                 WIPHY_ENTRY
306         ),
307         TP_fast_assign(
308                 WIPHY_ASSIGN;
309         ),
310         TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
311 );
312
313 DECLARE_EVENT_CLASS(wiphy_only_evt,
314         TP_PROTO(struct wiphy *wiphy),
315         TP_ARGS(wiphy),
316         TP_STRUCT__entry(
317                 WIPHY_ENTRY
318         ),
319         TP_fast_assign(
320                 WIPHY_ASSIGN;
321         ),
322         TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
323 );
324
325 DEFINE_EVENT(wiphy_only_evt, rdev_resume,
326         TP_PROTO(struct wiphy *wiphy),
327         TP_ARGS(wiphy)
328 );
329
330 DEFINE_EVENT(wiphy_only_evt, rdev_return_void,
331         TP_PROTO(struct wiphy *wiphy),
332         TP_ARGS(wiphy)
333 );
334
335 DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
336         TP_PROTO(struct wiphy *wiphy),
337         TP_ARGS(wiphy)
338 );
339
340 DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,
341         TP_PROTO(struct wiphy *wiphy),
342         TP_ARGS(wiphy)
343 );
344
345 DECLARE_EVENT_CLASS(wiphy_enabled_evt,
346         TP_PROTO(struct wiphy *wiphy, bool enabled),
347         TP_ARGS(wiphy, enabled),
348         TP_STRUCT__entry(
349                 WIPHY_ENTRY
350                 __field(bool, enabled)
351         ),
352         TP_fast_assign(
353                 WIPHY_ASSIGN;
354                 __entry->enabled = enabled;
355         ),
356         TP_printk(WIPHY_PR_FMT ", %senabled ",
357                   WIPHY_PR_ARG, __entry->enabled ? "" : "not ")
358 );
359
360 DEFINE_EVENT(wiphy_enabled_evt, rdev_set_wakeup,
361         TP_PROTO(struct wiphy *wiphy, bool enabled),
362         TP_ARGS(wiphy, enabled)
363 );
364
365 TRACE_EVENT(rdev_add_virtual_intf,
366         TP_PROTO(struct wiphy *wiphy, char *name, enum nl80211_iftype type),
367         TP_ARGS(wiphy, name, type),
368         TP_STRUCT__entry(
369                 WIPHY_ENTRY
370                 __string(vir_intf_name, name ? name : "<noname>")
371                 __field(enum nl80211_iftype, type)
372         ),
373         TP_fast_assign(
374                 WIPHY_ASSIGN;
375                 __assign_str(vir_intf_name, name ? name : "<noname>");
376                 __entry->type = type;
377         ),
378         TP_printk(WIPHY_PR_FMT ", virtual intf name: %s, type: %d",
379                   WIPHY_PR_ARG, __get_str(vir_intf_name), __entry->type)
380 );
381
382 DECLARE_EVENT_CLASS(wiphy_wdev_evt,
383         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
384         TP_ARGS(wiphy, wdev),
385         TP_STRUCT__entry(
386                 WIPHY_ENTRY
387                 WDEV_ENTRY
388         ),
389         TP_fast_assign(
390                 WIPHY_ASSIGN;
391                 WDEV_ASSIGN;
392         ),
393         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
394 );
395
396 DECLARE_EVENT_CLASS(wiphy_wdev_cookie_evt,
397         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
398         TP_ARGS(wiphy, wdev, cookie),
399         TP_STRUCT__entry(
400                 WIPHY_ENTRY
401                 WDEV_ENTRY
402                 __field(u64, cookie)
403         ),
404         TP_fast_assign(
405                 WIPHY_ASSIGN;
406                 WDEV_ASSIGN;
407                 __entry->cookie = cookie;
408         ),
409         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %lld",
410                   WIPHY_PR_ARG, WDEV_PR_ARG,
411                   (unsigned long long)__entry->cookie)
412 );
413
414 DEFINE_EVENT(wiphy_wdev_evt, rdev_return_wdev,
415         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
416         TP_ARGS(wiphy, wdev)
417 );
418
419 DEFINE_EVENT(wiphy_wdev_evt, rdev_del_virtual_intf,
420         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
421         TP_ARGS(wiphy, wdev)
422 );
423
424 TRACE_EVENT(rdev_change_virtual_intf,
425         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
426                  enum nl80211_iftype type),
427         TP_ARGS(wiphy, netdev, type),
428         TP_STRUCT__entry(
429                 WIPHY_ENTRY
430                 NETDEV_ENTRY
431                 __field(enum nl80211_iftype, type)
432         ),
433         TP_fast_assign(
434                 WIPHY_ASSIGN;
435                 NETDEV_ASSIGN;
436                 __entry->type = type;
437         ),
438         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", type: %d",
439                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->type)
440 );
441
442 DECLARE_EVENT_CLASS(key_handle,
443         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
444                  u8 key_index, bool pairwise, const u8 *mac_addr),
445         TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr),
446         TP_STRUCT__entry(
447                 WIPHY_ENTRY
448                 NETDEV_ENTRY
449                 MAC_ENTRY(mac_addr)
450                 __field(int, link_id)
451                 __field(u8, key_index)
452                 __field(bool, pairwise)
453         ),
454         TP_fast_assign(
455                 WIPHY_ASSIGN;
456                 NETDEV_ASSIGN;
457                 MAC_ASSIGN(mac_addr, mac_addr);
458                 __entry->link_id = link_id;
459                 __entry->key_index = key_index;
460                 __entry->pairwise = pairwise;
461         ),
462         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
463                   "key_index: %u, pairwise: %s, mac addr: %pM",
464                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
465                   __entry->key_index, BOOL_TO_STR(__entry->pairwise),
466                   __entry->mac_addr)
467 );
468
469 DEFINE_EVENT(key_handle, rdev_get_key,
470         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
471                  u8 key_index, bool pairwise, const u8 *mac_addr),
472         TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr)
473 );
474
475 DEFINE_EVENT(key_handle, rdev_del_key,
476         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
477                  u8 key_index, bool pairwise, const u8 *mac_addr),
478         TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr)
479 );
480
481 TRACE_EVENT(rdev_add_key,
482         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
483                  u8 key_index, bool pairwise, const u8 *mac_addr, u8 mode),
484         TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr, mode),
485         TP_STRUCT__entry(
486                 WIPHY_ENTRY
487                 NETDEV_ENTRY
488                 MAC_ENTRY(mac_addr)
489                 __field(int, link_id)
490                 __field(u8, key_index)
491                 __field(bool, pairwise)
492                 __field(u8, mode)
493         ),
494         TP_fast_assign(
495                 WIPHY_ASSIGN;
496                 NETDEV_ASSIGN;
497                 MAC_ASSIGN(mac_addr, mac_addr);
498                 __entry->link_id = link_id;
499                 __entry->key_index = key_index;
500                 __entry->pairwise = pairwise;
501                 __entry->mode = mode;
502         ),
503         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
504                   "key_index: %u, mode: %u, pairwise: %s, "
505                   "mac addr: %pM",
506                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
507                   __entry->key_index, __entry->mode,
508                   BOOL_TO_STR(__entry->pairwise), __entry->mac_addr)
509 );
510
511 TRACE_EVENT(rdev_set_default_key,
512         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
513                  u8 key_index, bool unicast, bool multicast),
514         TP_ARGS(wiphy, netdev, link_id, key_index, unicast, multicast),
515         TP_STRUCT__entry(
516                 WIPHY_ENTRY
517                 NETDEV_ENTRY
518                 __field(int, link_id)
519                 __field(u8, key_index)
520                 __field(bool, unicast)
521                 __field(bool, multicast)
522         ),
523         TP_fast_assign(
524                 WIPHY_ASSIGN;
525                 NETDEV_ASSIGN;
526                 __entry->link_id = link_id;
527                 __entry->key_index = key_index;
528                 __entry->unicast = unicast;
529                 __entry->multicast = multicast;
530         ),
531         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
532                   "key index: %u, unicast: %s, multicast: %s",
533                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
534                   __entry->key_index, BOOL_TO_STR(__entry->unicast),
535                   BOOL_TO_STR(__entry->multicast))
536 );
537
538 TRACE_EVENT(rdev_set_default_mgmt_key,
539         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
540                  u8 key_index),
541         TP_ARGS(wiphy, netdev, link_id, key_index),
542         TP_STRUCT__entry(
543                 WIPHY_ENTRY
544                 NETDEV_ENTRY
545                 __field(int, link_id)
546                 __field(u8, key_index)
547         ),
548         TP_fast_assign(
549                 WIPHY_ASSIGN;
550                 NETDEV_ASSIGN;
551                 __entry->link_id = link_id;
552                 __entry->key_index = key_index;
553         ),
554         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
555                   "key index: %u", WIPHY_PR_ARG, NETDEV_PR_ARG,
556                   __entry->link_id, __entry->key_index)
557 );
558
559 TRACE_EVENT(rdev_set_default_beacon_key,
560         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
561                  u8 key_index),
562         TP_ARGS(wiphy, netdev, link_id, key_index),
563         TP_STRUCT__entry(
564                 WIPHY_ENTRY
565                 NETDEV_ENTRY
566                 __field(int, link_id)
567                 __field(u8, key_index)
568         ),
569         TP_fast_assign(
570                 WIPHY_ASSIGN;
571                 NETDEV_ASSIGN;
572                 __entry->link_id = link_id;
573                 __entry->key_index = key_index;
574         ),
575         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
576                   "key index: %u", WIPHY_PR_ARG, NETDEV_PR_ARG,
577                   __entry->link_id, __entry->key_index)
578 );
579
580 TRACE_EVENT(rdev_start_ap,
581         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
582                  struct cfg80211_ap_settings *settings),
583         TP_ARGS(wiphy, netdev, settings),
584         TP_STRUCT__entry(
585                 WIPHY_ENTRY
586                 NETDEV_ENTRY
587                 CHAN_DEF_ENTRY
588                 __field(int, beacon_interval)
589                 __field(int, dtim_period)
590                 __array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
591                 __field(enum nl80211_hidden_ssid, hidden_ssid)
592                 __field(u32, wpa_ver)
593                 __field(bool, privacy)
594                 __field(enum nl80211_auth_type, auth_type)
595                 __field(int, inactivity_timeout)
596                 __field(unsigned int, link_id)
597         ),
598         TP_fast_assign(
599                 WIPHY_ASSIGN;
600                 NETDEV_ASSIGN;
601                 CHAN_DEF_ASSIGN(&settings->chandef);
602                 __entry->beacon_interval = settings->beacon_interval;
603                 __entry->dtim_period = settings->dtim_period;
604                 __entry->hidden_ssid = settings->hidden_ssid;
605                 __entry->wpa_ver = settings->crypto.wpa_versions;
606                 __entry->privacy = settings->privacy;
607                 __entry->auth_type = settings->auth_type;
608                 __entry->inactivity_timeout = settings->inactivity_timeout;
609                 memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
610                 memcpy(__entry->ssid, settings->ssid, settings->ssid_len);
611                 __entry->link_id = settings->beacon.link_id;
612         ),
613         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", AP settings - ssid: %s, "
614                   CHAN_DEF_PR_FMT ", beacon interval: %d, dtim period: %d, "
615                   "hidden ssid: %d, wpa versions: %u, privacy: %s, "
616                   "auth type: %d, inactivity timeout: %d, link_id: %d",
617                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_DEF_PR_ARG,
618                   __entry->beacon_interval, __entry->dtim_period,
619                   __entry->hidden_ssid, __entry->wpa_ver,
620                   BOOL_TO_STR(__entry->privacy), __entry->auth_type,
621                   __entry->inactivity_timeout, __entry->link_id)
622 );
623
624 TRACE_EVENT(rdev_change_beacon,
625         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
626                  struct cfg80211_ap_update *info),
627         TP_ARGS(wiphy, netdev, info),
628         TP_STRUCT__entry(
629                 WIPHY_ENTRY
630                 NETDEV_ENTRY
631                 __field(int, link_id)
632                 __dynamic_array(u8, head, info->beacon.head_len)
633                 __dynamic_array(u8, tail, info->beacon.tail_len)
634                 __dynamic_array(u8, beacon_ies, info->beacon.beacon_ies_len)
635                 __dynamic_array(u8, proberesp_ies, info->beacon.proberesp_ies_len)
636                 __dynamic_array(u8, assocresp_ies, info->beacon.assocresp_ies_len)
637                 __dynamic_array(u8, probe_resp, info->beacon.probe_resp_len)
638         ),
639         TP_fast_assign(
640                 WIPHY_ASSIGN;
641                 NETDEV_ASSIGN;
642                 __entry->link_id = info->beacon.link_id;
643                 if (info->beacon.head)
644                         memcpy(__get_dynamic_array(head),
645                                info->beacon.head,
646                                info->beacon.head_len);
647                 if (info->beacon.tail)
648                         memcpy(__get_dynamic_array(tail),
649                                info->beacon.tail,
650                                info->beacon.tail_len);
651                 if (info->beacon.beacon_ies)
652                         memcpy(__get_dynamic_array(beacon_ies),
653                                info->beacon.beacon_ies,
654                                info->beacon.beacon_ies_len);
655                 if (info->beacon.proberesp_ies)
656                         memcpy(__get_dynamic_array(proberesp_ies),
657                                info->beacon.proberesp_ies,
658                                info->beacon.proberesp_ies_len);
659                 if (info->beacon.assocresp_ies)
660                         memcpy(__get_dynamic_array(assocresp_ies),
661                                info->beacon.assocresp_ies,
662                                info->beacon.assocresp_ies_len);
663                 if (info->beacon.probe_resp)
664                         memcpy(__get_dynamic_array(probe_resp),
665                                info->beacon.probe_resp,
666                                info->beacon.probe_resp_len);
667         ),
668         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id:%d",
669                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id)
670 );
671
672 TRACE_EVENT(rdev_stop_ap,
673         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
674                  unsigned int link_id),
675         TP_ARGS(wiphy, netdev, link_id),
676         TP_STRUCT__entry(
677                 WIPHY_ENTRY
678                 NETDEV_ENTRY
679                 __field(unsigned int, link_id)
680         ),
681         TP_fast_assign(
682                 WIPHY_ASSIGN;
683                 NETDEV_ASSIGN;
684                 __entry->link_id = link_id;
685         ),
686         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d",
687                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id)
688 );
689
690 DECLARE_EVENT_CLASS(wiphy_netdev_evt,
691         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
692         TP_ARGS(wiphy, netdev),
693         TP_STRUCT__entry(
694                 WIPHY_ENTRY
695                 NETDEV_ENTRY
696         ),
697         TP_fast_assign(
698                 WIPHY_ASSIGN;
699                 NETDEV_ASSIGN;
700         ),
701         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG)
702 );
703
704 DEFINE_EVENT(wiphy_netdev_evt, rdev_set_rekey_data,
705         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
706         TP_ARGS(wiphy, netdev)
707 );
708
709 DEFINE_EVENT(wiphy_netdev_evt, rdev_get_mesh_config,
710         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
711         TP_ARGS(wiphy, netdev)
712 );
713
714 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_mesh,
715         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
716         TP_ARGS(wiphy, netdev)
717 );
718
719 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ibss,
720         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
721         TP_ARGS(wiphy, netdev)
722 );
723
724 DEFINE_EVENT(wiphy_netdev_evt, rdev_leave_ocb,
725         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
726         TP_ARGS(wiphy, netdev)
727 );
728
729 DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa,
730         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
731         TP_ARGS(wiphy, netdev)
732 );
733
734 DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac,
735              TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
736              TP_ARGS(wiphy, netdev)
737 );
738
739 DECLARE_EVENT_CLASS(station_add_change,
740         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
741                  struct station_parameters *params),
742         TP_ARGS(wiphy, netdev, mac, params),
743         TP_STRUCT__entry(
744                 WIPHY_ENTRY
745                 NETDEV_ENTRY
746                 MAC_ENTRY(sta_mac)
747                 __field(u32, sta_flags_mask)
748                 __field(u32, sta_flags_set)
749                 __field(u32, sta_modify_mask)
750                 __field(int, listen_interval)
751                 __field(u16, capability)
752                 __field(u16, aid)
753                 __field(u8, plink_action)
754                 __field(u8, plink_state)
755                 __field(u8, uapsd_queues)
756                 __field(u8, max_sp)
757                 __field(u8, opmode_notif)
758                 __field(bool, opmode_notif_used)
759                 __array(u8, ht_capa, (int)sizeof(struct ieee80211_ht_cap))
760                 __array(u8, vht_capa, (int)sizeof(struct ieee80211_vht_cap))
761                 __array(char, vlan, IFNAMSIZ)
762                 __dynamic_array(u8, supported_rates,
763                                 params->link_sta_params.supported_rates_len)
764                 __dynamic_array(u8, ext_capab, params->ext_capab_len)
765                 __dynamic_array(u8, supported_channels,
766                                 params->supported_channels_len)
767                 __dynamic_array(u8, supported_oper_classes,
768                                 params->supported_oper_classes_len)
769         ),
770         TP_fast_assign(
771                 WIPHY_ASSIGN;
772                 NETDEV_ASSIGN;
773                 MAC_ASSIGN(sta_mac, mac);
774                 __entry->sta_flags_mask = params->sta_flags_mask;
775                 __entry->sta_flags_set = params->sta_flags_set;
776                 __entry->sta_modify_mask = params->sta_modify_mask;
777                 __entry->listen_interval = params->listen_interval;
778                 __entry->aid = params->aid;
779                 __entry->plink_action = params->plink_action;
780                 __entry->plink_state = params->plink_state;
781                 __entry->uapsd_queues = params->uapsd_queues;
782                 memset(__entry->ht_capa, 0, sizeof(struct ieee80211_ht_cap));
783                 if (params->link_sta_params.ht_capa)
784                         memcpy(__entry->ht_capa,
785                                params->link_sta_params.ht_capa,
786                                sizeof(struct ieee80211_ht_cap));
787                 memset(__entry->vht_capa, 0, sizeof(struct ieee80211_vht_cap));
788                 if (params->link_sta_params.vht_capa)
789                         memcpy(__entry->vht_capa,
790                                params->link_sta_params.vht_capa,
791                                sizeof(struct ieee80211_vht_cap));
792                 memset(__entry->vlan, 0, sizeof(__entry->vlan));
793                 if (params->vlan)
794                         memcpy(__entry->vlan, params->vlan->name, IFNAMSIZ);
795                 if (params->link_sta_params.supported_rates &&
796                     params->link_sta_params.supported_rates_len)
797                         memcpy(__get_dynamic_array(supported_rates),
798                                params->link_sta_params.supported_rates,
799                                params->link_sta_params.supported_rates_len);
800                 if (params->ext_capab && params->ext_capab_len)
801                         memcpy(__get_dynamic_array(ext_capab),
802                                params->ext_capab,
803                                params->ext_capab_len);
804                 if (params->supported_channels &&
805                     params->supported_channels_len)
806                         memcpy(__get_dynamic_array(supported_channels),
807                                params->supported_channels,
808                                params->supported_channels_len);
809                 if (params->supported_oper_classes &&
810                     params->supported_oper_classes_len)
811                         memcpy(__get_dynamic_array(supported_oper_classes),
812                                params->supported_oper_classes,
813                                params->supported_oper_classes_len);
814                 __entry->max_sp = params->max_sp;
815                 __entry->capability = params->capability;
816                 __entry->opmode_notif = params->link_sta_params.opmode_notif;
817                 __entry->opmode_notif_used =
818                         params->link_sta_params.opmode_notif_used;
819         ),
820         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM"
821                   ", station flags mask: 0x%x, station flags set: 0x%x, "
822                   "station modify mask: 0x%x, listen interval: %d, aid: %u, "
823                   "plink action: %u, plink state: %u, uapsd queues: %u, vlan:%s",
824                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac,
825                   __entry->sta_flags_mask, __entry->sta_flags_set,
826                   __entry->sta_modify_mask, __entry->listen_interval,
827                   __entry->aid, __entry->plink_action, __entry->plink_state,
828                   __entry->uapsd_queues, __entry->vlan)
829 );
830
831 DEFINE_EVENT(station_add_change, rdev_add_station,
832         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
833                  struct station_parameters *params),
834         TP_ARGS(wiphy, netdev, mac, params)
835 );
836
837 DEFINE_EVENT(station_add_change, rdev_change_station,
838         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
839                  struct station_parameters *params),
840         TP_ARGS(wiphy, netdev, mac, params)
841 );
842
843 DECLARE_EVENT_CLASS(wiphy_netdev_mac_evt,
844         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
845         TP_ARGS(wiphy, netdev, mac),
846         TP_STRUCT__entry(
847                 WIPHY_ENTRY
848                 NETDEV_ENTRY
849                 MAC_ENTRY(sta_mac)
850         ),
851         TP_fast_assign(
852                 WIPHY_ASSIGN;
853                 NETDEV_ASSIGN;
854                 MAC_ASSIGN(sta_mac, mac);
855         ),
856         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mac: %pM",
857                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac)
858 );
859
860 DECLARE_EVENT_CLASS(station_del,
861         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
862                  struct station_del_parameters *params),
863         TP_ARGS(wiphy, netdev, params),
864         TP_STRUCT__entry(
865                 WIPHY_ENTRY
866                 NETDEV_ENTRY
867                 MAC_ENTRY(sta_mac)
868                 __field(u8, subtype)
869                 __field(u16, reason_code)
870                 __field(int, link_id)
871         ),
872         TP_fast_assign(
873                 WIPHY_ASSIGN;
874                 NETDEV_ASSIGN;
875                 MAC_ASSIGN(sta_mac, params->mac);
876                 __entry->subtype = params->subtype;
877                 __entry->reason_code = params->reason_code;
878                 __entry->link_id = params->link_id;
879         ),
880         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM"
881                   ", subtype: %u, reason_code: %u, link_id: %d",
882                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac,
883                   __entry->subtype, __entry->reason_code,
884                   __entry->link_id)
885 );
886
887 DEFINE_EVENT(station_del, rdev_del_station,
888         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
889                  struct station_del_parameters *params),
890         TP_ARGS(wiphy, netdev, params)
891 );
892
893 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station,
894         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
895         TP_ARGS(wiphy, netdev, mac)
896 );
897
898 DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_mpath,
899         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac),
900         TP_ARGS(wiphy, netdev, mac)
901 );
902
903 TRACE_EVENT(rdev_dump_station,
904         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
905                  u8 *mac),
906         TP_ARGS(wiphy, netdev, _idx, mac),
907         TP_STRUCT__entry(
908                 WIPHY_ENTRY
909                 NETDEV_ENTRY
910                 MAC_ENTRY(sta_mac)
911                 __field(int, idx)
912         ),
913         TP_fast_assign(
914                 WIPHY_ASSIGN;
915                 NETDEV_ASSIGN;
916                 MAC_ASSIGN(sta_mac, mac);
917                 __entry->idx = _idx;
918         ),
919         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM, idx: %d",
920                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->sta_mac,
921                   __entry->idx)
922 );
923
924 TRACE_EVENT(rdev_return_int_station_info,
925         TP_PROTO(struct wiphy *wiphy, int ret, struct station_info *sinfo),
926         TP_ARGS(wiphy, ret, sinfo),
927         TP_STRUCT__entry(
928                 WIPHY_ENTRY
929                 __field(int, ret)
930                 SINFO_ENTRY
931         ),
932         TP_fast_assign(
933                 WIPHY_ASSIGN;
934                 __entry->ret = ret;
935                 SINFO_ASSIGN;
936         ),
937         TP_printk(WIPHY_PR_FMT ", returned %d" ,
938                   WIPHY_PR_ARG, __entry->ret)
939 );
940
941 DECLARE_EVENT_CLASS(mpath_evt,
942         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
943                  u8 *next_hop),
944         TP_ARGS(wiphy, netdev, dst, next_hop),
945         TP_STRUCT__entry(
946                 WIPHY_ENTRY
947                 NETDEV_ENTRY
948                 MAC_ENTRY(dst)
949                 MAC_ENTRY(next_hop)
950         ),
951         TP_fast_assign(
952                 WIPHY_ASSIGN;
953                 NETDEV_ASSIGN;
954                 MAC_ASSIGN(dst, dst);
955                 MAC_ASSIGN(next_hop, next_hop);
956         ),
957         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: %pM, next hop: %pM",
958                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->dst,
959                   __entry->next_hop)
960 );
961
962 DEFINE_EVENT(mpath_evt, rdev_add_mpath,
963         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
964                  u8 *next_hop),
965         TP_ARGS(wiphy, netdev, dst, next_hop)
966 );
967
968 DEFINE_EVENT(mpath_evt, rdev_change_mpath,
969         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
970                  u8 *next_hop),
971         TP_ARGS(wiphy, netdev, dst, next_hop)
972 );
973
974 DEFINE_EVENT(mpath_evt, rdev_get_mpath,
975         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *dst,
976                  u8 *next_hop),
977         TP_ARGS(wiphy, netdev, dst, next_hop)
978 );
979
980 TRACE_EVENT(rdev_dump_mpath,
981         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
982                  u8 *dst, u8 *next_hop),
983         TP_ARGS(wiphy, netdev, _idx, dst, next_hop),
984         TP_STRUCT__entry(
985                 WIPHY_ENTRY
986                 NETDEV_ENTRY
987                 MAC_ENTRY(dst)
988                 MAC_ENTRY(next_hop)
989                 __field(int, idx)
990         ),
991         TP_fast_assign(
992                 WIPHY_ASSIGN;
993                 NETDEV_ASSIGN;
994                 MAC_ASSIGN(dst, dst);
995                 MAC_ASSIGN(next_hop, next_hop);
996                 __entry->idx = _idx;
997         ),
998         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: %pM, next hop: %pM",
999                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, __entry->dst,
1000                   __entry->next_hop)
1001 );
1002
1003 TRACE_EVENT(rdev_get_mpp,
1004         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1005                  u8 *dst, u8 *mpp),
1006         TP_ARGS(wiphy, netdev, dst, mpp),
1007         TP_STRUCT__entry(
1008                 WIPHY_ENTRY
1009                 NETDEV_ENTRY
1010                 MAC_ENTRY(dst)
1011                 MAC_ENTRY(mpp)
1012         ),
1013         TP_fast_assign(
1014                 WIPHY_ASSIGN;
1015                 NETDEV_ASSIGN;
1016                 MAC_ASSIGN(dst, dst);
1017                 MAC_ASSIGN(mpp, mpp);
1018         ),
1019         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", destination: %pM"
1020                   ", mpp: %pM", WIPHY_PR_ARG, NETDEV_PR_ARG,
1021                   __entry->dst, __entry->mpp)
1022 );
1023
1024 TRACE_EVENT(rdev_dump_mpp,
1025         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx,
1026                  u8 *dst, u8 *mpp),
1027         TP_ARGS(wiphy, netdev, _idx, mpp, dst),
1028         TP_STRUCT__entry(
1029                 WIPHY_ENTRY
1030                 NETDEV_ENTRY
1031                 MAC_ENTRY(dst)
1032                 MAC_ENTRY(mpp)
1033                 __field(int, idx)
1034         ),
1035         TP_fast_assign(
1036                 WIPHY_ASSIGN;
1037                 NETDEV_ASSIGN;
1038                 MAC_ASSIGN(dst, dst);
1039                 MAC_ASSIGN(mpp, mpp);
1040                 __entry->idx = _idx;
1041         ),
1042         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d, destination: %pM, mpp: %pM",
1043                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx, __entry->dst,
1044                   __entry->mpp)
1045 );
1046
1047 TRACE_EVENT(rdev_return_int_mpath_info,
1048         TP_PROTO(struct wiphy *wiphy, int ret, struct mpath_info *pinfo),
1049         TP_ARGS(wiphy, ret, pinfo),
1050         TP_STRUCT__entry(
1051                 WIPHY_ENTRY
1052                 __field(int, ret)
1053                 __field(int, generation)
1054                 __field(u32, filled)
1055                 __field(u32, frame_qlen)
1056                 __field(u32, sn)
1057                 __field(u32, metric)
1058                 __field(u32, exptime)
1059                 __field(u32, discovery_timeout)
1060                 __field(u8, discovery_retries)
1061                 __field(u8, flags)
1062         ),
1063         TP_fast_assign(
1064                 WIPHY_ASSIGN;
1065                 __entry->ret = ret;
1066                 __entry->generation = pinfo->generation;
1067                 __entry->filled = pinfo->filled;
1068                 __entry->frame_qlen = pinfo->frame_qlen;
1069                 __entry->sn = pinfo->sn;
1070                 __entry->metric = pinfo->metric;
1071                 __entry->exptime = pinfo->exptime;
1072                 __entry->discovery_timeout = pinfo->discovery_timeout;
1073                 __entry->discovery_retries = pinfo->discovery_retries;
1074                 __entry->flags = pinfo->flags;
1075         ),
1076         TP_printk(WIPHY_PR_FMT ", returned %d. mpath info - generation: %d, "
1077                   "filled: %u, frame qlen: %u, sn: %u, metric: %u, exptime: %u,"
1078                   " discovery timeout: %u, discovery retries: %u, flags: 0x%x",
1079                   WIPHY_PR_ARG, __entry->ret, __entry->generation,
1080                   __entry->filled, __entry->frame_qlen, __entry->sn,
1081                   __entry->metric, __entry->exptime, __entry->discovery_timeout,
1082                   __entry->discovery_retries, __entry->flags)
1083 );
1084
1085 TRACE_EVENT(rdev_return_int_mesh_config,
1086         TP_PROTO(struct wiphy *wiphy, int ret, struct mesh_config *conf),
1087         TP_ARGS(wiphy, ret, conf),
1088         TP_STRUCT__entry(
1089                 WIPHY_ENTRY
1090                 MESH_CFG_ENTRY
1091                 __field(int, ret)
1092         ),
1093         TP_fast_assign(
1094                 WIPHY_ASSIGN;
1095                 MESH_CFG_ASSIGN;
1096                 __entry->ret = ret;
1097         ),
1098         TP_printk(WIPHY_PR_FMT ", returned: %d",
1099                   WIPHY_PR_ARG, __entry->ret)
1100 );
1101
1102 TRACE_EVENT(rdev_update_mesh_config,
1103         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 mask,
1104                  const struct mesh_config *conf),
1105         TP_ARGS(wiphy, netdev, mask, conf),
1106         TP_STRUCT__entry(
1107                 WIPHY_ENTRY
1108                 NETDEV_ENTRY
1109                 MESH_CFG_ENTRY
1110                 __field(u32, mask)
1111         ),
1112         TP_fast_assign(
1113                 WIPHY_ASSIGN;
1114                 NETDEV_ASSIGN;
1115                 MESH_CFG_ASSIGN;
1116                 __entry->mask = mask;
1117         ),
1118         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mask: %u",
1119                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->mask)
1120 );
1121
1122 TRACE_EVENT(rdev_join_mesh,
1123         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1124                  const struct mesh_config *conf,
1125                  const struct mesh_setup *setup),
1126         TP_ARGS(wiphy, netdev, conf, setup),
1127         TP_STRUCT__entry(
1128                 WIPHY_ENTRY
1129                 NETDEV_ENTRY
1130                 MESH_CFG_ENTRY
1131         ),
1132         TP_fast_assign(
1133                 WIPHY_ASSIGN;
1134                 NETDEV_ASSIGN;
1135                 MESH_CFG_ASSIGN;
1136         ),
1137         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
1138                   WIPHY_PR_ARG, NETDEV_PR_ARG)
1139 );
1140
1141 TRACE_EVENT(rdev_change_bss,
1142         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1143                  struct bss_parameters *params),
1144         TP_ARGS(wiphy, netdev, params),
1145         TP_STRUCT__entry(
1146                 WIPHY_ENTRY
1147                 NETDEV_ENTRY
1148                 __field(int, use_cts_prot)
1149                 __field(int, use_short_preamble)
1150                 __field(int, use_short_slot_time)
1151                 __field(int, ap_isolate)
1152                 __field(int, ht_opmode)
1153         ),
1154         TP_fast_assign(
1155                 WIPHY_ASSIGN;
1156                 NETDEV_ASSIGN;
1157                 __entry->use_cts_prot = params->use_cts_prot;
1158                 __entry->use_short_preamble = params->use_short_preamble;
1159                 __entry->use_short_slot_time = params->use_short_slot_time;
1160                 __entry->ap_isolate = params->ap_isolate;
1161                 __entry->ht_opmode = params->ht_opmode;
1162         ),
1163         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", use cts prot: %d, "
1164                   "use short preamble: %d, use short slot time: %d, "
1165                   "ap isolate: %d, ht opmode: %d",
1166                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->use_cts_prot,
1167                   __entry->use_short_preamble, __entry->use_short_slot_time,
1168                   __entry->ap_isolate, __entry->ht_opmode)
1169 );
1170
1171 TRACE_EVENT(rdev_inform_bss,
1172         TP_PROTO(struct wiphy *wiphy, struct cfg80211_bss *bss),
1173         TP_ARGS(wiphy, bss),
1174         TP_STRUCT__entry(
1175                 WIPHY_ENTRY
1176                 MAC_ENTRY(bssid)
1177                 CHAN_ENTRY
1178         ),
1179         TP_fast_assign(
1180                 WIPHY_ASSIGN;
1181                 MAC_ASSIGN(bssid, bss->bssid);
1182                 CHAN_ASSIGN(bss->channel);
1183         ),
1184         TP_printk(WIPHY_PR_FMT ", %pM, " CHAN_PR_FMT,
1185                   WIPHY_PR_ARG, __entry->bssid, CHAN_PR_ARG)
1186 );
1187
1188 TRACE_EVENT(rdev_set_txq_params,
1189         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1190                  struct ieee80211_txq_params *params),
1191         TP_ARGS(wiphy, netdev, params),
1192         TP_STRUCT__entry(
1193                 WIPHY_ENTRY
1194                 NETDEV_ENTRY
1195                 __field(enum nl80211_ac, ac)
1196                 __field(u16, txop)
1197                 __field(u16, cwmin)
1198                 __field(u16, cwmax)
1199                 __field(u8, aifs)
1200         ),
1201         TP_fast_assign(
1202                 WIPHY_ASSIGN;
1203                 NETDEV_ASSIGN;
1204                 __entry->ac = params->ac;
1205                 __entry->txop = params->txop;
1206                 __entry->cwmin = params->cwmin;
1207                 __entry->cwmax = params->cwmax;
1208                 __entry->aifs = params->aifs;
1209         ),
1210         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", ac: %d, txop: %u, cwmin: %u, cwmax: %u, aifs: %u",
1211                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ac, __entry->txop,
1212                   __entry->cwmin, __entry->cwmax, __entry->aifs)
1213 );
1214
1215 TRACE_EVENT(rdev_libertas_set_mesh_channel,
1216         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1217                  struct ieee80211_channel *chan),
1218         TP_ARGS(wiphy, netdev, chan),
1219         TP_STRUCT__entry(
1220                 WIPHY_ENTRY
1221                 NETDEV_ENTRY
1222                 CHAN_ENTRY
1223         ),
1224         TP_fast_assign(
1225                 WIPHY_ASSIGN;
1226                 NETDEV_ASSIGN;
1227                 CHAN_ASSIGN(chan);
1228         ),
1229         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_PR_FMT, WIPHY_PR_ARG,
1230                   NETDEV_PR_ARG, CHAN_PR_ARG)
1231 );
1232
1233 TRACE_EVENT(rdev_set_monitor_channel,
1234         TP_PROTO(struct wiphy *wiphy,
1235                  struct cfg80211_chan_def *chandef),
1236         TP_ARGS(wiphy, chandef),
1237         TP_STRUCT__entry(
1238                 WIPHY_ENTRY
1239                 CHAN_DEF_ENTRY
1240         ),
1241         TP_fast_assign(
1242                 WIPHY_ASSIGN;
1243                 CHAN_DEF_ASSIGN(chandef);
1244         ),
1245         TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
1246                   WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
1247 );
1248
1249 TRACE_EVENT(rdev_auth,
1250         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1251                  struct cfg80211_auth_request *req),
1252         TP_ARGS(wiphy, netdev, req),
1253         TP_STRUCT__entry(
1254                 WIPHY_ENTRY
1255                 NETDEV_ENTRY
1256                 MAC_ENTRY(bssid)
1257                 __field(enum nl80211_auth_type, auth_type)
1258         ),
1259         TP_fast_assign(
1260                 WIPHY_ASSIGN;
1261                 NETDEV_ASSIGN;
1262                 if (req->bss)
1263                         MAC_ASSIGN(bssid, req->bss->bssid);
1264                 else
1265                         eth_zero_addr(__entry->bssid);
1266                 __entry->auth_type = req->auth_type;
1267         ),
1268         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", auth type: %d, bssid: %pM",
1269                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->auth_type,
1270                   __entry->bssid)
1271 );
1272
1273 TRACE_EVENT(rdev_assoc,
1274         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1275                  struct cfg80211_assoc_request *req),
1276         TP_ARGS(wiphy, netdev, req),
1277         TP_STRUCT__entry(
1278                 WIPHY_ENTRY
1279                 NETDEV_ENTRY
1280                 MAC_ENTRY(bssid)
1281                 MAC_ENTRY(prev_bssid)
1282                 __field(bool, use_mfp)
1283                 __field(u32, flags)
1284                 __dynamic_array(u8, elements, req->ie_len)
1285                 __array(u8, ht_capa, sizeof(struct ieee80211_ht_cap))
1286                 __array(u8, ht_capa_mask, sizeof(struct ieee80211_ht_cap))
1287                 __array(u8, vht_capa, sizeof(struct ieee80211_vht_cap))
1288                 __array(u8, vht_capa_mask, sizeof(struct ieee80211_vht_cap))
1289                 __dynamic_array(u8, fils_kek, req->fils_kek_len)
1290                 __dynamic_array(u8, fils_nonces,
1291                                 req->fils_nonces ? 2 * FILS_NONCE_LEN : 0)
1292         ),
1293         TP_fast_assign(
1294                 WIPHY_ASSIGN;
1295                 NETDEV_ASSIGN;
1296                 if (req->bss)
1297                         MAC_ASSIGN(bssid, req->bss->bssid);
1298                 else
1299                         eth_zero_addr(__entry->bssid);
1300                 MAC_ASSIGN(prev_bssid, req->prev_bssid);
1301                 __entry->use_mfp = req->use_mfp;
1302                 __entry->flags = req->flags;
1303                 if (req->ie)
1304                         memcpy(__get_dynamic_array(elements),
1305                                req->ie, req->ie_len);
1306                 memcpy(__entry->ht_capa, &req->ht_capa, sizeof(req->ht_capa));
1307                 memcpy(__entry->ht_capa_mask, &req->ht_capa_mask,
1308                        sizeof(req->ht_capa_mask));
1309                 memcpy(__entry->vht_capa, &req->vht_capa, sizeof(req->vht_capa));
1310                 memcpy(__entry->vht_capa_mask, &req->vht_capa_mask,
1311                        sizeof(req->vht_capa_mask));
1312                 if (req->fils_kek)
1313                         memcpy(__get_dynamic_array(fils_kek),
1314                                req->fils_kek, req->fils_kek_len);
1315                 if (req->fils_nonces)
1316                         memcpy(__get_dynamic_array(fils_nonces),
1317                                req->fils_nonces, 2 * FILS_NONCE_LEN);
1318         ),
1319         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM"
1320                   ", previous bssid: %pM, use mfp: %s, flags: 0x%x",
1321                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid,
1322                   __entry->prev_bssid, BOOL_TO_STR(__entry->use_mfp),
1323                   __entry->flags)
1324 );
1325
1326 TRACE_EVENT(rdev_deauth,
1327         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1328                  struct cfg80211_deauth_request *req),
1329         TP_ARGS(wiphy, netdev, req),
1330         TP_STRUCT__entry(
1331                 WIPHY_ENTRY
1332                 NETDEV_ENTRY
1333                 MAC_ENTRY(bssid)
1334                 __field(u16, reason_code)
1335                 __field(bool, local_state_change)
1336         ),
1337         TP_fast_assign(
1338                 WIPHY_ASSIGN;
1339                 NETDEV_ASSIGN;
1340                 MAC_ASSIGN(bssid, req->bssid);
1341                 __entry->reason_code = req->reason_code;
1342                 __entry->local_state_change = req->local_state_change;
1343         ),
1344         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM, reason: %u, local_state_change:%d",
1345                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid,
1346                   __entry->reason_code, __entry->local_state_change)
1347 );
1348
1349 TRACE_EVENT(rdev_disassoc,
1350         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1351                  struct cfg80211_disassoc_request *req),
1352         TP_ARGS(wiphy, netdev, req),
1353         TP_STRUCT__entry(
1354                 WIPHY_ENTRY
1355                 NETDEV_ENTRY
1356                 MAC_ENTRY(bssid)
1357                 __field(u16, reason_code)
1358                 __field(bool, local_state_change)
1359         ),
1360         TP_fast_assign(
1361                 WIPHY_ASSIGN;
1362                 NETDEV_ASSIGN;
1363                 MAC_ASSIGN(bssid, req->ap_addr);
1364                 __entry->reason_code = req->reason_code;
1365                 __entry->local_state_change = req->local_state_change;
1366         ),
1367         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM"
1368                   ", reason: %u, local state change: %s",
1369                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid,
1370                   __entry->reason_code,
1371                   BOOL_TO_STR(__entry->local_state_change))
1372 );
1373
1374 TRACE_EVENT(rdev_mgmt_tx_cancel_wait,
1375         TP_PROTO(struct wiphy *wiphy,
1376                  struct wireless_dev *wdev, u64 cookie),
1377         TP_ARGS(wiphy, wdev, cookie),
1378         TP_STRUCT__entry(
1379                 WIPHY_ENTRY
1380                 WDEV_ENTRY
1381                 __field(u64, cookie)
1382         ),
1383         TP_fast_assign(
1384                 WIPHY_ASSIGN;
1385                 WDEV_ASSIGN;
1386                 __entry->cookie = cookie;
1387         ),
1388         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu ",
1389                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
1390 );
1391
1392 TRACE_EVENT(rdev_set_power_mgmt,
1393         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1394                  bool enabled, int timeout),
1395         TP_ARGS(wiphy, netdev, enabled, timeout),
1396         TP_STRUCT__entry(
1397                 WIPHY_ENTRY
1398                 NETDEV_ENTRY
1399                 __field(bool, enabled)
1400                 __field(int, timeout)
1401         ),
1402         TP_fast_assign(
1403                 WIPHY_ASSIGN;
1404                 NETDEV_ASSIGN;
1405                 __entry->enabled = enabled;
1406                 __entry->timeout = timeout;
1407         ),
1408         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %senabled, timeout: %d ",
1409                   WIPHY_PR_ARG, NETDEV_PR_ARG,
1410                   __entry->enabled ? "" : "not ", __entry->timeout)
1411 );
1412
1413 TRACE_EVENT(rdev_connect,
1414         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1415                  struct cfg80211_connect_params *sme),
1416         TP_ARGS(wiphy, netdev, sme),
1417         TP_STRUCT__entry(
1418                 WIPHY_ENTRY
1419                 NETDEV_ENTRY
1420                 MAC_ENTRY(bssid)
1421                 __array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
1422                 __field(enum nl80211_auth_type, auth_type)
1423                 __field(bool, privacy)
1424                 __field(u32, wpa_versions)
1425                 __field(u32, flags)
1426                 MAC_ENTRY(prev_bssid)
1427         ),
1428         TP_fast_assign(
1429                 WIPHY_ASSIGN;
1430                 NETDEV_ASSIGN;
1431                 MAC_ASSIGN(bssid, sme->bssid);
1432                 memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
1433                 memcpy(__entry->ssid, sme->ssid, sme->ssid_len);
1434                 __entry->auth_type = sme->auth_type;
1435                 __entry->privacy = sme->privacy;
1436                 __entry->wpa_versions = sme->crypto.wpa_versions;
1437                 __entry->flags = sme->flags;
1438                 MAC_ASSIGN(prev_bssid, sme->prev_bssid);
1439         ),
1440         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM"
1441                   ", ssid: %s, auth type: %d, privacy: %s, wpa versions: %u, "
1442                   "flags: 0x%x, previous bssid: %pM",
1443                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid, __entry->ssid,
1444                   __entry->auth_type, BOOL_TO_STR(__entry->privacy),
1445                   __entry->wpa_versions, __entry->flags, __entry->prev_bssid)
1446 );
1447
1448 TRACE_EVENT(rdev_update_connect_params,
1449         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1450                  struct cfg80211_connect_params *sme, u32 changed),
1451         TP_ARGS(wiphy, netdev, sme, changed),
1452         TP_STRUCT__entry(
1453                 WIPHY_ENTRY
1454                 NETDEV_ENTRY
1455                 __field(u32, changed)
1456         ),
1457         TP_fast_assign(
1458                 WIPHY_ASSIGN;
1459                 NETDEV_ASSIGN;
1460                 __entry->changed = changed;
1461         ),
1462         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", parameters changed: %u",
1463                   WIPHY_PR_ARG, NETDEV_PR_ARG,  __entry->changed)
1464 );
1465
1466 TRACE_EVENT(rdev_set_cqm_rssi_config,
1467         TP_PROTO(struct wiphy *wiphy,
1468                  struct net_device *netdev, s32 rssi_thold,
1469                  u32 rssi_hyst),
1470         TP_ARGS(wiphy, netdev, rssi_thold, rssi_hyst),
1471         TP_STRUCT__entry(
1472                 WIPHY_ENTRY
1473                 NETDEV_ENTRY
1474                 __field(s32, rssi_thold)
1475                 __field(u32, rssi_hyst)
1476         ),
1477         TP_fast_assign(
1478                 WIPHY_ASSIGN;
1479                 NETDEV_ASSIGN;
1480                 __entry->rssi_thold = rssi_thold;
1481                 __entry->rssi_hyst = rssi_hyst;
1482         ),
1483         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
1484                   ", rssi_thold: %d, rssi_hyst: %u ",
1485                   WIPHY_PR_ARG, NETDEV_PR_ARG,
1486                  __entry->rssi_thold, __entry->rssi_hyst)
1487 );
1488
1489 TRACE_EVENT(rdev_set_cqm_rssi_range_config,
1490         TP_PROTO(struct wiphy *wiphy,
1491                  struct net_device *netdev, s32 low, s32 high),
1492         TP_ARGS(wiphy, netdev, low, high),
1493         TP_STRUCT__entry(
1494                 WIPHY_ENTRY
1495                 NETDEV_ENTRY
1496                 __field(s32, rssi_low)
1497                 __field(s32, rssi_high)
1498         ),
1499         TP_fast_assign(
1500                 WIPHY_ASSIGN;
1501                 NETDEV_ASSIGN;
1502                 __entry->rssi_low = low;
1503                 __entry->rssi_high = high;
1504         ),
1505         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
1506                   ", range: %d - %d ",
1507                   WIPHY_PR_ARG, NETDEV_PR_ARG,
1508                   __entry->rssi_low, __entry->rssi_high)
1509 );
1510
1511 TRACE_EVENT(rdev_set_cqm_txe_config,
1512         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u32 rate,
1513                  u32 pkts, u32 intvl),
1514         TP_ARGS(wiphy, netdev, rate, pkts, intvl),
1515         TP_STRUCT__entry(
1516                 WIPHY_ENTRY
1517                 NETDEV_ENTRY
1518                 __field(u32, rate)
1519                 __field(u32, pkts)
1520                 __field(u32, intvl)
1521         ),
1522         TP_fast_assign(
1523                 WIPHY_ASSIGN;
1524                 NETDEV_ASSIGN;
1525                 __entry->rate = rate;
1526                 __entry->pkts = pkts;
1527                 __entry->intvl = intvl;
1528         ),
1529         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", rate: %u, packets: %u, interval: %u",
1530                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->rate, __entry->pkts,
1531                   __entry->intvl)
1532 );
1533
1534 TRACE_EVENT(rdev_disconnect,
1535         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1536                  u16 reason_code),
1537         TP_ARGS(wiphy, netdev, reason_code),
1538         TP_STRUCT__entry(
1539                 WIPHY_ENTRY
1540                 NETDEV_ENTRY
1541                 __field(u16, reason_code)
1542         ),
1543         TP_fast_assign(
1544                 WIPHY_ASSIGN;
1545                 NETDEV_ASSIGN;
1546                 __entry->reason_code = reason_code;
1547         ),
1548         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", reason code: %u", WIPHY_PR_ARG,
1549                   NETDEV_PR_ARG, __entry->reason_code)
1550 );
1551
1552 TRACE_EVENT(rdev_join_ibss,
1553         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1554                  struct cfg80211_ibss_params *params),
1555         TP_ARGS(wiphy, netdev, params),
1556         TP_STRUCT__entry(
1557                 WIPHY_ENTRY
1558                 NETDEV_ENTRY
1559                 MAC_ENTRY(bssid)
1560                 __array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
1561         ),
1562         TP_fast_assign(
1563                 WIPHY_ASSIGN;
1564                 NETDEV_ASSIGN;
1565                 MAC_ASSIGN(bssid, params->bssid);
1566                 memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
1567                 memcpy(__entry->ssid, params->ssid, params->ssid_len);
1568         ),
1569         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM, ssid: %s",
1570                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid, __entry->ssid)
1571 );
1572
1573 TRACE_EVENT(rdev_join_ocb,
1574         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1575                  const struct ocb_setup *setup),
1576         TP_ARGS(wiphy, netdev, setup),
1577         TP_STRUCT__entry(
1578                 WIPHY_ENTRY
1579                 NETDEV_ENTRY
1580         ),
1581         TP_fast_assign(
1582                 WIPHY_ASSIGN;
1583                 NETDEV_ASSIGN;
1584         ),
1585         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
1586                   WIPHY_PR_ARG, NETDEV_PR_ARG)
1587 );
1588
1589 TRACE_EVENT(rdev_set_wiphy_params,
1590         TP_PROTO(struct wiphy *wiphy, u32 changed),
1591         TP_ARGS(wiphy, changed),
1592         TP_STRUCT__entry(
1593                 WIPHY_ENTRY
1594                 __field(u32, changed)
1595         ),
1596         TP_fast_assign(
1597                 WIPHY_ASSIGN;
1598                 __entry->changed = changed;
1599         ),
1600         TP_printk(WIPHY_PR_FMT ", changed: %u",
1601                   WIPHY_PR_ARG, __entry->changed)
1602 );
1603
1604 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_tx_power,
1605         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1606         TP_ARGS(wiphy, wdev)
1607 );
1608
1609 TRACE_EVENT(rdev_set_tx_power,
1610         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1611                  enum nl80211_tx_power_setting type, int mbm),
1612         TP_ARGS(wiphy, wdev, type, mbm),
1613         TP_STRUCT__entry(
1614                 WIPHY_ENTRY
1615                 WDEV_ENTRY
1616                 __field(enum nl80211_tx_power_setting, type)
1617                 __field(int, mbm)
1618         ),
1619         TP_fast_assign(
1620                 WIPHY_ASSIGN;
1621                 WDEV_ASSIGN;
1622                 __entry->type = type;
1623                 __entry->mbm = mbm;
1624         ),
1625         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type: %u, mbm: %d",
1626                   WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
1627 );
1628
1629 TRACE_EVENT(rdev_return_int_int,
1630         TP_PROTO(struct wiphy *wiphy, int func_ret, int func_fill),
1631         TP_ARGS(wiphy, func_ret, func_fill),
1632         TP_STRUCT__entry(
1633                 WIPHY_ENTRY
1634                 __field(int, func_ret)
1635                 __field(int, func_fill)
1636         ),
1637         TP_fast_assign(
1638                 WIPHY_ASSIGN;
1639                 __entry->func_ret = func_ret;
1640                 __entry->func_fill = func_fill;
1641         ),
1642         TP_printk(WIPHY_PR_FMT ", function returns: %d, function filled: %d",
1643                   WIPHY_PR_ARG, __entry->func_ret, __entry->func_fill)
1644 );
1645
1646 #ifdef CONFIG_NL80211_TESTMODE
1647 TRACE_EVENT(rdev_testmode_cmd,
1648         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1649         TP_ARGS(wiphy, wdev),
1650         TP_STRUCT__entry(
1651                 WIPHY_ENTRY
1652                 WDEV_ENTRY
1653         ),
1654         TP_fast_assign(
1655                 WIPHY_ASSIGN;
1656                 WDEV_ASSIGN;
1657         ),
1658         TP_printk(WIPHY_PR_FMT WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
1659 );
1660
1661 TRACE_EVENT(rdev_testmode_dump,
1662         TP_PROTO(struct wiphy *wiphy),
1663         TP_ARGS(wiphy),
1664         TP_STRUCT__entry(
1665                 WIPHY_ENTRY
1666         ),
1667         TP_fast_assign(
1668                 WIPHY_ASSIGN;
1669         ),
1670         TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)
1671 );
1672 #endif /* CONFIG_NL80211_TESTMODE */
1673
1674 TRACE_EVENT(rdev_set_bitrate_mask,
1675         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1676                  unsigned int link_id,
1677                  const u8 *peer, const struct cfg80211_bitrate_mask *mask),
1678         TP_ARGS(wiphy, netdev, link_id, peer, mask),
1679         TP_STRUCT__entry(
1680                 WIPHY_ENTRY
1681                 NETDEV_ENTRY
1682                 __field(unsigned int, link_id)
1683                 MAC_ENTRY(peer)
1684         ),
1685         TP_fast_assign(
1686                 WIPHY_ASSIGN;
1687                 NETDEV_ASSIGN;
1688                 __entry->link_id = link_id;
1689                 MAC_ASSIGN(peer, peer);
1690         ),
1691         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, peer: %pM",
1692                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
1693                   __entry->peer)
1694 );
1695
1696 TRACE_EVENT(rdev_update_mgmt_frame_registrations,
1697         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1698                  struct mgmt_frame_regs *upd),
1699         TP_ARGS(wiphy, wdev, upd),
1700         TP_STRUCT__entry(
1701                 WIPHY_ENTRY
1702                 WDEV_ENTRY
1703                 __field(u16, global_stypes)
1704                 __field(u16, interface_stypes)
1705         ),
1706         TP_fast_assign(
1707                 WIPHY_ASSIGN;
1708                 WDEV_ASSIGN;
1709                 __entry->global_stypes = upd->global_stypes;
1710                 __entry->interface_stypes = upd->interface_stypes;
1711         ),
1712         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", global: 0x%.2x, intf: 0x%.2x",
1713                   WIPHY_PR_ARG, WDEV_PR_ARG,
1714                   __entry->global_stypes, __entry->interface_stypes)
1715 );
1716
1717 TRACE_EVENT(rdev_return_int_tx_rx,
1718         TP_PROTO(struct wiphy *wiphy, int ret, u32 tx, u32 rx),
1719         TP_ARGS(wiphy, ret, tx, rx),
1720         TP_STRUCT__entry(
1721                 WIPHY_ENTRY
1722                 __field(int, ret)
1723                 __field(u32, tx)
1724                 __field(u32, rx)
1725         ),
1726         TP_fast_assign(
1727                 WIPHY_ASSIGN;
1728                 __entry->ret = ret;
1729                 __entry->tx = tx;
1730                 __entry->rx = rx;
1731         ),
1732         TP_printk(WIPHY_PR_FMT ", returned %d, tx: %u, rx: %u",
1733                   WIPHY_PR_ARG, __entry->ret, __entry->tx, __entry->rx)
1734 );
1735
1736 TRACE_EVENT(rdev_return_void_tx_rx,
1737         TP_PROTO(struct wiphy *wiphy, u32 tx, u32 tx_max,
1738                  u32 rx, u32 rx_max),
1739         TP_ARGS(wiphy, tx, tx_max, rx, rx_max),
1740         TP_STRUCT__entry(
1741                 WIPHY_ENTRY
1742                 __field(u32, tx)
1743                 __field(u32, tx_max)
1744                 __field(u32, rx)
1745                 __field(u32, rx_max)
1746         ),
1747         TP_fast_assign(
1748                 WIPHY_ASSIGN;
1749                 __entry->tx = tx;
1750                 __entry->tx_max = tx_max;
1751                 __entry->rx = rx;
1752                 __entry->rx_max = rx_max;
1753         ),
1754         TP_printk(WIPHY_PR_FMT ", tx: %u, tx_max: %u, rx: %u, rx_max: %u ",
1755                   WIPHY_PR_ARG, __entry->tx, __entry->tx_max, __entry->rx,
1756                   __entry->rx_max)
1757 );
1758
1759 DECLARE_EVENT_CLASS(tx_rx_evt,
1760         TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
1761         TP_ARGS(wiphy, rx, tx),
1762         TP_STRUCT__entry(
1763                 WIPHY_ENTRY
1764                 __field(u32, tx)
1765                 __field(u32, rx)
1766         ),
1767         TP_fast_assign(
1768                 WIPHY_ASSIGN;
1769                 __entry->tx = tx;
1770                 __entry->rx = rx;
1771         ),
1772         TP_printk(WIPHY_PR_FMT ", tx: %u, rx: %u ",
1773                   WIPHY_PR_ARG, __entry->tx, __entry->rx)
1774 );
1775
1776 DEFINE_EVENT(tx_rx_evt, rdev_set_antenna,
1777         TP_PROTO(struct wiphy *wiphy, u32 tx, u32 rx),
1778         TP_ARGS(wiphy, rx, tx)
1779 );
1780
1781 DECLARE_EVENT_CLASS(wiphy_netdev_id_evt,
1782         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
1783         TP_ARGS(wiphy, netdev, id),
1784         TP_STRUCT__entry(
1785                 WIPHY_ENTRY
1786                 NETDEV_ENTRY
1787                 __field(u64, id)
1788         ),
1789         TP_fast_assign(
1790                 WIPHY_ASSIGN;
1791                 NETDEV_ASSIGN;
1792                 __entry->id = id;
1793         ),
1794         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", id: %llu",
1795                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->id)
1796 );
1797
1798 DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_start,
1799         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
1800         TP_ARGS(wiphy, netdev, id)
1801 );
1802
1803 DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_stop,
1804         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
1805         TP_ARGS(wiphy, netdev, id)
1806 );
1807
1808 TRACE_EVENT(rdev_tdls_mgmt,
1809         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1810                  u8 *peer, int link_id, u8 action_code, u8 dialog_token,
1811                  u16 status_code, u32 peer_capability,
1812                  bool initiator, const u8 *buf, size_t len),
1813         TP_ARGS(wiphy, netdev, peer, link_id, action_code, dialog_token,
1814                 status_code, peer_capability, initiator, buf, len),
1815         TP_STRUCT__entry(
1816                 WIPHY_ENTRY
1817                 NETDEV_ENTRY
1818                 MAC_ENTRY(peer)
1819                 __field(int, link_id)
1820                 __field(u8, action_code)
1821                 __field(u8, dialog_token)
1822                 __field(u16, status_code)
1823                 __field(u32, peer_capability)
1824                 __field(bool, initiator)
1825                 __dynamic_array(u8, buf, len)
1826         ),
1827         TP_fast_assign(
1828                 WIPHY_ASSIGN;
1829                 NETDEV_ASSIGN;
1830                 MAC_ASSIGN(peer, peer);
1831                 __entry->link_id = link_id;
1832                 __entry->action_code = action_code;
1833                 __entry->dialog_token = dialog_token;
1834                 __entry->status_code = status_code;
1835                 __entry->peer_capability = peer_capability;
1836                 __entry->initiator = initiator;
1837                 memcpy(__get_dynamic_array(buf), buf, len);
1838         ),
1839         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM"
1840                   ", link_id: %d, action_code: %u "
1841                   "dialog_token: %u, status_code: %u, peer_capability: %u "
1842                   "initiator: %s buf: %#.2x ",
1843                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer,
1844                   __entry->link_id, __entry->action_code, __entry->dialog_token,
1845                   __entry->status_code, __entry->peer_capability,
1846                   BOOL_TO_STR(__entry->initiator),
1847                   ((u8 *)__get_dynamic_array(buf))[0])
1848 );
1849
1850 TRACE_EVENT(rdev_dump_survey,
1851         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int _idx),
1852         TP_ARGS(wiphy, netdev, _idx),
1853         TP_STRUCT__entry(
1854                 WIPHY_ENTRY
1855                 NETDEV_ENTRY
1856                 __field(int, idx)
1857         ),
1858         TP_fast_assign(
1859                 WIPHY_ASSIGN;
1860                 NETDEV_ASSIGN;
1861                 __entry->idx = _idx;
1862         ),
1863         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", index: %d",
1864                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->idx)
1865 );
1866
1867 TRACE_EVENT(rdev_return_int_survey_info,
1868         TP_PROTO(struct wiphy *wiphy, int ret, struct survey_info *info),
1869         TP_ARGS(wiphy, ret, info),
1870         TP_STRUCT__entry(
1871                 WIPHY_ENTRY
1872                 CHAN_ENTRY
1873                 __field(int, ret)
1874                 __field(u64, time)
1875                 __field(u64, time_busy)
1876                 __field(u64, time_ext_busy)
1877                 __field(u64, time_rx)
1878                 __field(u64, time_tx)
1879                 __field(u64, time_scan)
1880                 __field(u32, filled)
1881                 __field(s8, noise)
1882         ),
1883         TP_fast_assign(
1884                 WIPHY_ASSIGN;
1885                 CHAN_ASSIGN(info->channel);
1886                 __entry->ret = ret;
1887                 __entry->time = info->time;
1888                 __entry->time_busy = info->time_busy;
1889                 __entry->time_ext_busy = info->time_ext_busy;
1890                 __entry->time_rx = info->time_rx;
1891                 __entry->time_tx = info->time_tx;
1892                 __entry->time_scan = info->time_scan;
1893                 __entry->filled = info->filled;
1894                 __entry->noise = info->noise;
1895         ),
1896         TP_printk(WIPHY_PR_FMT ", returned: %d, " CHAN_PR_FMT
1897                   ", channel time: %llu, channel time busy: %llu, "
1898                   "channel time extension busy: %llu, channel time rx: %llu, "
1899                   "channel time tx: %llu, scan time: %llu, filled: %u, noise: %d",
1900                   WIPHY_PR_ARG, __entry->ret, CHAN_PR_ARG,
1901                   __entry->time, __entry->time_busy,
1902                   __entry->time_ext_busy, __entry->time_rx,
1903                   __entry->time_tx, __entry->time_scan,
1904                   __entry->filled, __entry->noise)
1905 );
1906
1907 TRACE_EVENT(rdev_tdls_oper,
1908         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1909                  u8 *peer, enum nl80211_tdls_operation oper),
1910         TP_ARGS(wiphy, netdev, peer, oper),
1911         TP_STRUCT__entry(
1912                 WIPHY_ENTRY
1913                 NETDEV_ENTRY
1914                 MAC_ENTRY(peer)
1915                 __field(enum nl80211_tdls_operation, oper)
1916         ),
1917         TP_fast_assign(
1918                 WIPHY_ASSIGN;
1919                 NETDEV_ASSIGN;
1920                 MAC_ASSIGN(peer, peer);
1921                 __entry->oper = oper;
1922         ),
1923         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM, oper: %d",
1924                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer, __entry->oper)
1925 );
1926
1927 DECLARE_EVENT_CLASS(rdev_pmksa,
1928         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1929                  struct cfg80211_pmksa *pmksa),
1930         TP_ARGS(wiphy, netdev, pmksa),
1931         TP_STRUCT__entry(
1932                 WIPHY_ENTRY
1933                 NETDEV_ENTRY
1934                 MAC_ENTRY(bssid)
1935         ),
1936         TP_fast_assign(
1937                 WIPHY_ASSIGN;
1938                 NETDEV_ASSIGN;
1939                 MAC_ASSIGN(bssid, pmksa->bssid);
1940         ),
1941         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM",
1942                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid)
1943 );
1944
1945 TRACE_EVENT(rdev_probe_client,
1946         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1947                  const u8 *peer),
1948         TP_ARGS(wiphy, netdev, peer),
1949         TP_STRUCT__entry(
1950                 WIPHY_ENTRY
1951                 NETDEV_ENTRY
1952                 MAC_ENTRY(peer)
1953         ),
1954         TP_fast_assign(
1955                 WIPHY_ASSIGN;
1956                 NETDEV_ASSIGN;
1957                 MAC_ASSIGN(peer, peer);
1958         ),
1959         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM",
1960                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer)
1961 );
1962
1963 DEFINE_EVENT(rdev_pmksa, rdev_set_pmksa,
1964         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1965                  struct cfg80211_pmksa *pmksa),
1966         TP_ARGS(wiphy, netdev, pmksa)
1967 );
1968
1969 DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
1970         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1971                  struct cfg80211_pmksa *pmksa),
1972         TP_ARGS(wiphy, netdev, pmksa)
1973 );
1974
1975 TRACE_EVENT(rdev_remain_on_channel,
1976         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
1977                  struct ieee80211_channel *chan,
1978                  unsigned int duration),
1979         TP_ARGS(wiphy, wdev, chan, duration),
1980         TP_STRUCT__entry(
1981                 WIPHY_ENTRY
1982                 WDEV_ENTRY
1983                 CHAN_ENTRY
1984                 __field(unsigned int, duration)
1985         ),
1986         TP_fast_assign(
1987                 WIPHY_ASSIGN;
1988                 WDEV_ASSIGN;
1989                 CHAN_ASSIGN(chan);
1990                 __entry->duration = duration;
1991         ),
1992         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", duration: %u",
1993                   WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
1994 );
1995
1996 TRACE_EVENT(rdev_return_int_cookie,
1997         TP_PROTO(struct wiphy *wiphy, int ret, u64 cookie),
1998         TP_ARGS(wiphy, ret, cookie),
1999         TP_STRUCT__entry(
2000                 WIPHY_ENTRY
2001                 __field(int, ret)
2002                 __field(u64, cookie)
2003         ),
2004         TP_fast_assign(
2005                 WIPHY_ASSIGN;
2006                 __entry->ret = ret;
2007                 __entry->cookie = cookie;
2008         ),
2009         TP_printk(WIPHY_PR_FMT ", returned %d, cookie: %llu",
2010                   WIPHY_PR_ARG, __entry->ret, __entry->cookie)
2011 );
2012
2013 TRACE_EVENT(rdev_cancel_remain_on_channel,
2014         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
2015         TP_ARGS(wiphy, wdev, cookie),
2016         TP_STRUCT__entry(
2017                 WIPHY_ENTRY
2018                 WDEV_ENTRY
2019                 __field(u64, cookie)
2020         ),
2021         TP_fast_assign(
2022                 WIPHY_ASSIGN;
2023                 WDEV_ASSIGN;
2024                 __entry->cookie = cookie;
2025         ),
2026         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie: %llu",
2027                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
2028 );
2029
2030 TRACE_EVENT(rdev_mgmt_tx,
2031         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2032                  struct cfg80211_mgmt_tx_params *params),
2033         TP_ARGS(wiphy, wdev, params),
2034         TP_STRUCT__entry(
2035                 WIPHY_ENTRY
2036                 WDEV_ENTRY
2037                 CHAN_ENTRY
2038                 __field(bool, offchan)
2039                 __field(unsigned int, wait)
2040                 __field(bool, no_cck)
2041                 __field(bool, dont_wait_for_ack)
2042         ),
2043         TP_fast_assign(
2044                 WIPHY_ASSIGN;
2045                 WDEV_ASSIGN;
2046                 CHAN_ASSIGN(params->chan);
2047                 __entry->offchan = params->offchan;
2048                 __entry->wait = params->wait;
2049                 __entry->no_cck = params->no_cck;
2050                 __entry->dont_wait_for_ack = params->dont_wait_for_ack;
2051         ),
2052         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", " CHAN_PR_FMT ", offchan: %s,"
2053                   " wait: %u, no cck: %s, dont wait for ack: %s",
2054                   WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
2055                   BOOL_TO_STR(__entry->offchan), __entry->wait,
2056                   BOOL_TO_STR(__entry->no_cck),
2057                   BOOL_TO_STR(__entry->dont_wait_for_ack))
2058 );
2059
2060 TRACE_EVENT(rdev_tx_control_port,
2061         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2062                  const u8 *buf, size_t len, const u8 *dest, __be16 proto,
2063                  bool unencrypted, int link_id),
2064         TP_ARGS(wiphy, netdev, buf, len, dest, proto, unencrypted, link_id),
2065         TP_STRUCT__entry(
2066                 WIPHY_ENTRY
2067                 NETDEV_ENTRY
2068                 MAC_ENTRY(dest)
2069                 __field(__be16, proto)
2070                 __field(bool, unencrypted)
2071                 __field(int, link_id)
2072         ),
2073         TP_fast_assign(
2074                 WIPHY_ASSIGN;
2075                 NETDEV_ASSIGN;
2076                 MAC_ASSIGN(dest, dest);
2077                 __entry->proto = proto;
2078                 __entry->unencrypted = unencrypted;
2079                 __entry->link_id = link_id;
2080         ),
2081         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM,"
2082                   " proto: 0x%x, unencrypted: %s, link: %d",
2083                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->dest,
2084                   be16_to_cpu(__entry->proto),
2085                   BOOL_TO_STR(__entry->unencrypted),
2086                   __entry->link_id)
2087 );
2088
2089 TRACE_EVENT(rdev_set_noack_map,
2090         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2091                  u16 noack_map),
2092         TP_ARGS(wiphy, netdev, noack_map),
2093         TP_STRUCT__entry(
2094                 WIPHY_ENTRY
2095                 NETDEV_ENTRY
2096                 __field(u16, noack_map)
2097         ),
2098         TP_fast_assign(
2099                 WIPHY_ASSIGN;
2100                 NETDEV_ASSIGN;
2101                 __entry->noack_map = noack_map;
2102         ),
2103         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", noack_map: %u",
2104                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->noack_map)
2105 );
2106
2107 DECLARE_EVENT_CLASS(wiphy_wdev_link_evt,
2108         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2109                  unsigned int link_id),
2110         TP_ARGS(wiphy, wdev, link_id),
2111         TP_STRUCT__entry(
2112                 WIPHY_ENTRY
2113                 WDEV_ENTRY
2114                 __field(unsigned int, link_id)
2115         ),
2116         TP_fast_assign(
2117                 WIPHY_ASSIGN;
2118                 WDEV_ASSIGN;
2119                 __entry->link_id = link_id;
2120         ),
2121         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %u",
2122                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id)
2123 );
2124
2125 DEFINE_EVENT(wiphy_wdev_link_evt, rdev_get_channel,
2126         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2127                  unsigned int link_id),
2128         TP_ARGS(wiphy, wdev, link_id)
2129 );
2130
2131 TRACE_EVENT(rdev_return_chandef,
2132         TP_PROTO(struct wiphy *wiphy, int ret,
2133                  struct cfg80211_chan_def *chandef),
2134         TP_ARGS(wiphy, ret, chandef),
2135         TP_STRUCT__entry(
2136                 WIPHY_ENTRY
2137                 __field(int, ret)
2138                 CHAN_DEF_ENTRY
2139         ),
2140         TP_fast_assign(
2141                 WIPHY_ASSIGN;
2142                 if (ret == 0)
2143                         CHAN_DEF_ASSIGN(chandef);
2144                 else
2145                         CHAN_DEF_ASSIGN((struct cfg80211_chan_def *)NULL);
2146                 __entry->ret = ret;
2147         ),
2148         TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", ret: %d",
2149                   WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->ret)
2150 );
2151
2152 DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
2153         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2154         TP_ARGS(wiphy, wdev)
2155 );
2156
2157 DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
2158         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2159         TP_ARGS(wiphy, wdev)
2160 );
2161
2162 TRACE_EVENT(rdev_start_nan,
2163         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2164                  struct cfg80211_nan_conf *conf),
2165         TP_ARGS(wiphy, wdev, conf),
2166         TP_STRUCT__entry(
2167                 WIPHY_ENTRY
2168                 WDEV_ENTRY
2169                 __field(u8, master_pref)
2170                 __field(u8, bands)
2171         ),
2172         TP_fast_assign(
2173                 WIPHY_ASSIGN;
2174                 WDEV_ASSIGN;
2175                 __entry->master_pref = conf->master_pref;
2176                 __entry->bands = conf->bands;
2177         ),
2178         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT
2179                   ", master preference: %u, bands: 0x%0x",
2180                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->master_pref,
2181                   __entry->bands)
2182 );
2183
2184 TRACE_EVENT(rdev_nan_change_conf,
2185         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2186                  struct cfg80211_nan_conf *conf, u32 changes),
2187         TP_ARGS(wiphy, wdev, conf, changes),
2188         TP_STRUCT__entry(
2189                 WIPHY_ENTRY
2190                 WDEV_ENTRY
2191                 __field(u8, master_pref)
2192                 __field(u8, bands)
2193                 __field(u32, changes)
2194         ),
2195         TP_fast_assign(
2196                 WIPHY_ASSIGN;
2197                 WDEV_ASSIGN;
2198                 __entry->master_pref = conf->master_pref;
2199                 __entry->bands = conf->bands;
2200                 __entry->changes = changes;
2201         ),
2202         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT
2203                   ", master preference: %u, bands: 0x%0x, changes: %x",
2204                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->master_pref,
2205                   __entry->bands, __entry->changes)
2206 );
2207
2208 DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_nan,
2209         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2210         TP_ARGS(wiphy, wdev)
2211 );
2212
2213 TRACE_EVENT(rdev_add_nan_func,
2214         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2215                  const struct cfg80211_nan_func *func),
2216         TP_ARGS(wiphy, wdev, func),
2217         TP_STRUCT__entry(
2218                 WIPHY_ENTRY
2219                 WDEV_ENTRY
2220                 __field(u8, func_type)
2221                 __field(u64, cookie)
2222         ),
2223         TP_fast_assign(
2224                 WIPHY_ASSIGN;
2225                 WDEV_ASSIGN;
2226                 __entry->func_type = func->type;
2227                 __entry->cookie = func->cookie
2228         ),
2229         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", type=%u, cookie=%llu",
2230                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->func_type,
2231                   __entry->cookie)
2232 );
2233
2234 TRACE_EVENT(rdev_del_nan_func,
2235         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2236                  u64 cookie),
2237         TP_ARGS(wiphy, wdev, cookie),
2238         TP_STRUCT__entry(
2239                 WIPHY_ENTRY
2240                 WDEV_ENTRY
2241                 __field(u64, cookie)
2242         ),
2243         TP_fast_assign(
2244                 WIPHY_ASSIGN;
2245                 WDEV_ASSIGN;
2246                 __entry->cookie = cookie;
2247         ),
2248         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie=%llu",
2249                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->cookie)
2250 );
2251
2252 TRACE_EVENT(rdev_set_mac_acl,
2253         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2254                  struct cfg80211_acl_data *params),
2255         TP_ARGS(wiphy, netdev, params),
2256         TP_STRUCT__entry(
2257                 WIPHY_ENTRY
2258                 NETDEV_ENTRY
2259                 __field(u32, acl_policy)
2260         ),
2261         TP_fast_assign(
2262                 WIPHY_ASSIGN;
2263                 NETDEV_ASSIGN;
2264                 __entry->acl_policy = params->acl_policy;
2265         ),
2266         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", acl policy: %d",
2267                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->acl_policy)
2268 );
2269
2270 TRACE_EVENT(rdev_update_ft_ies,
2271         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2272                  struct cfg80211_update_ft_ies_params *ftie),
2273         TP_ARGS(wiphy, netdev, ftie),
2274         TP_STRUCT__entry(
2275                 WIPHY_ENTRY
2276                 NETDEV_ENTRY
2277                 __field(u16, md)
2278                 __dynamic_array(u8, ie, ftie->ie_len)
2279         ),
2280         TP_fast_assign(
2281                 WIPHY_ASSIGN;
2282                 NETDEV_ASSIGN;
2283                 __entry->md = ftie->md;
2284                 memcpy(__get_dynamic_array(ie), ftie->ie, ftie->ie_len);
2285         ),
2286         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", md: 0x%x",
2287                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->md)
2288 );
2289
2290 TRACE_EVENT(rdev_crit_proto_start,
2291         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2292                  enum nl80211_crit_proto_id protocol, u16 duration),
2293         TP_ARGS(wiphy, wdev, protocol, duration),
2294         TP_STRUCT__entry(
2295                 WIPHY_ENTRY
2296                 WDEV_ENTRY
2297                 __field(u16, proto)
2298                 __field(u16, duration)
2299         ),
2300         TP_fast_assign(
2301                 WIPHY_ASSIGN;
2302                 WDEV_ASSIGN;
2303                 __entry->proto = protocol;
2304                 __entry->duration = duration;
2305         ),
2306         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", proto=%x, duration=%u",
2307                   WIPHY_PR_ARG, WDEV_PR_ARG, __entry->proto, __entry->duration)
2308 );
2309
2310 TRACE_EVENT(rdev_crit_proto_stop,
2311         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2312         TP_ARGS(wiphy, wdev),
2313         TP_STRUCT__entry(
2314                 WIPHY_ENTRY
2315                 WDEV_ENTRY
2316         ),
2317         TP_fast_assign(
2318                 WIPHY_ASSIGN;
2319                 WDEV_ASSIGN;
2320         ),
2321         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
2322                   WIPHY_PR_ARG, WDEV_PR_ARG)
2323 );
2324
2325 TRACE_EVENT(rdev_channel_switch,
2326         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2327                  struct cfg80211_csa_settings *params),
2328         TP_ARGS(wiphy, netdev, params),
2329         TP_STRUCT__entry(
2330                 WIPHY_ENTRY
2331                 NETDEV_ENTRY
2332                 CHAN_DEF_ENTRY
2333                 __field(bool, radar_required)
2334                 __field(bool, block_tx)
2335                 __field(u8, count)
2336                 __dynamic_array(u16, bcn_ofs, params->n_counter_offsets_beacon)
2337                 __dynamic_array(u16, pres_ofs, params->n_counter_offsets_presp)
2338                 __field(u8, link_id)
2339         ),
2340         TP_fast_assign(
2341                 WIPHY_ASSIGN;
2342                 NETDEV_ASSIGN;
2343                 CHAN_DEF_ASSIGN(&params->chandef);
2344                 __entry->radar_required = params->radar_required;
2345                 __entry->block_tx = params->block_tx;
2346                 __entry->count = params->count;
2347                 memcpy(__get_dynamic_array(bcn_ofs),
2348                        params->counter_offsets_beacon,
2349                        params->n_counter_offsets_beacon * sizeof(u16));
2350
2351                 /* probe response offsets are optional */
2352                 if (params->n_counter_offsets_presp)
2353                         memcpy(__get_dynamic_array(pres_ofs),
2354                                params->counter_offsets_presp,
2355                                params->n_counter_offsets_presp * sizeof(u16));
2356                 __entry->link_id = params->link_id;
2357         ),
2358         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
2359                   ", block_tx: %d, count: %u, radar_required: %d, link_id: %d",
2360                   WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2361                   __entry->block_tx, __entry->count, __entry->radar_required,
2362                   __entry->link_id)
2363 );
2364
2365 TRACE_EVENT(rdev_set_qos_map,
2366         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2367                  struct cfg80211_qos_map *qos_map),
2368         TP_ARGS(wiphy, netdev, qos_map),
2369         TP_STRUCT__entry(
2370                 WIPHY_ENTRY
2371                 NETDEV_ENTRY
2372                 QOS_MAP_ENTRY
2373         ),
2374         TP_fast_assign(
2375                 WIPHY_ASSIGN;
2376                 NETDEV_ASSIGN;
2377                 QOS_MAP_ASSIGN(qos_map);
2378         ),
2379         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", num_des: %u",
2380                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->num_des)
2381 );
2382
2383 TRACE_EVENT(rdev_set_ap_chanwidth,
2384         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2385                  unsigned int link_id,
2386                  struct cfg80211_chan_def *chandef),
2387         TP_ARGS(wiphy, netdev, link_id, chandef),
2388         TP_STRUCT__entry(
2389                 WIPHY_ENTRY
2390                 NETDEV_ENTRY
2391                 CHAN_DEF_ENTRY
2392                 __field(unsigned int, link_id)
2393         ),
2394         TP_fast_assign(
2395                 WIPHY_ASSIGN;
2396                 NETDEV_ASSIGN;
2397                 CHAN_DEF_ASSIGN(chandef);
2398                 __entry->link_id = link_id;
2399         ),
2400         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
2401                   WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2402                   __entry->link_id)
2403 );
2404
2405 TRACE_EVENT(rdev_add_tx_ts,
2406         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2407                  u8 tsid, const u8 *peer, u8 user_prio, u16 admitted_time),
2408         TP_ARGS(wiphy, netdev, tsid, peer, user_prio, admitted_time),
2409         TP_STRUCT__entry(
2410                 WIPHY_ENTRY
2411                 NETDEV_ENTRY
2412                 MAC_ENTRY(peer)
2413                 __field(u8, tsid)
2414                 __field(u8, user_prio)
2415                 __field(u16, admitted_time)
2416         ),
2417         TP_fast_assign(
2418                 WIPHY_ASSIGN;
2419                 NETDEV_ASSIGN;
2420                 MAC_ASSIGN(peer, peer);
2421                 __entry->tsid = tsid;
2422                 __entry->user_prio = user_prio;
2423                 __entry->admitted_time = admitted_time;
2424         ),
2425         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM, TSID %d, UP %d, time %d",
2426                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer,
2427                   __entry->tsid, __entry->user_prio, __entry->admitted_time)
2428 );
2429
2430 TRACE_EVENT(rdev_del_tx_ts,
2431         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2432                  u8 tsid, const u8 *peer),
2433         TP_ARGS(wiphy, netdev, tsid, peer),
2434         TP_STRUCT__entry(
2435                 WIPHY_ENTRY
2436                 NETDEV_ENTRY
2437                 MAC_ENTRY(peer)
2438                 __field(u8, tsid)
2439         ),
2440         TP_fast_assign(
2441                 WIPHY_ASSIGN;
2442                 NETDEV_ASSIGN;
2443                 MAC_ASSIGN(peer, peer);
2444                 __entry->tsid = tsid;
2445         ),
2446         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM, TSID %d",
2447                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer, __entry->tsid)
2448 );
2449
2450 TRACE_EVENT(rdev_tdls_channel_switch,
2451         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2452                  const u8 *addr, u8 oper_class,
2453                  struct cfg80211_chan_def *chandef),
2454         TP_ARGS(wiphy, netdev, addr, oper_class, chandef),
2455         TP_STRUCT__entry(
2456                 WIPHY_ENTRY
2457                 NETDEV_ENTRY
2458                 MAC_ENTRY(addr)
2459                 __field(u8, oper_class)
2460                 CHAN_DEF_ENTRY
2461         ),
2462         TP_fast_assign(
2463                 WIPHY_ASSIGN;
2464                 NETDEV_ASSIGN;
2465                 MAC_ASSIGN(addr, addr);
2466                 CHAN_DEF_ASSIGN(chandef);
2467         ),
2468         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM"
2469                   " oper class %d, " CHAN_DEF_PR_FMT,
2470                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->addr,
2471                   __entry->oper_class, CHAN_DEF_PR_ARG)
2472 );
2473
2474 TRACE_EVENT(rdev_tdls_cancel_channel_switch,
2475         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2476                  const u8 *addr),
2477         TP_ARGS(wiphy, netdev, addr),
2478         TP_STRUCT__entry(
2479                 WIPHY_ENTRY
2480                 NETDEV_ENTRY
2481                 MAC_ENTRY(addr)
2482         ),
2483         TP_fast_assign(
2484                 WIPHY_ASSIGN;
2485                 NETDEV_ASSIGN;
2486                 MAC_ASSIGN(addr, addr);
2487         ),
2488         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM",
2489                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->addr)
2490 );
2491
2492 TRACE_EVENT(rdev_set_pmk,
2493         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2494                  struct cfg80211_pmk_conf *pmk_conf),
2495
2496         TP_ARGS(wiphy, netdev, pmk_conf),
2497
2498         TP_STRUCT__entry(
2499                 WIPHY_ENTRY
2500                 NETDEV_ENTRY
2501                 MAC_ENTRY(aa)
2502                 __field(u8, pmk_len)
2503                 __field(u8, pmk_r0_name_len)
2504                 __dynamic_array(u8, pmk, pmk_conf->pmk_len)
2505                 __dynamic_array(u8, pmk_r0_name, WLAN_PMK_NAME_LEN)
2506         ),
2507
2508         TP_fast_assign(
2509                 WIPHY_ASSIGN;
2510                 NETDEV_ASSIGN;
2511                 MAC_ASSIGN(aa, pmk_conf->aa);
2512                 __entry->pmk_len = pmk_conf->pmk_len;
2513                 __entry->pmk_r0_name_len =
2514                 pmk_conf->pmk_r0_name ? WLAN_PMK_NAME_LEN : 0;
2515                 memcpy(__get_dynamic_array(pmk), pmk_conf->pmk,
2516                        pmk_conf->pmk_len);
2517                 memcpy(__get_dynamic_array(pmk_r0_name), pmk_conf->pmk_r0_name,
2518                        pmk_conf->pmk_r0_name ? WLAN_PMK_NAME_LEN : 0);
2519         ),
2520
2521         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM"
2522                   "pmk_len=%u, pmk: %s pmk_r0_name: %s", WIPHY_PR_ARG,
2523                   NETDEV_PR_ARG, __entry->aa, __entry->pmk_len,
2524                   __print_array(__get_dynamic_array(pmk),
2525                                 __get_dynamic_array_len(pmk), 1),
2526                   __entry->pmk_r0_name_len ?
2527                   __print_array(__get_dynamic_array(pmk_r0_name),
2528                                 __get_dynamic_array_len(pmk_r0_name), 1) : "")
2529 );
2530
2531 TRACE_EVENT(rdev_del_pmk,
2532         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *aa),
2533
2534         TP_ARGS(wiphy, netdev, aa),
2535
2536         TP_STRUCT__entry(
2537                 WIPHY_ENTRY
2538                 NETDEV_ENTRY
2539                 MAC_ENTRY(aa)
2540         ),
2541
2542         TP_fast_assign(
2543                 WIPHY_ASSIGN;
2544                 NETDEV_ASSIGN;
2545                 MAC_ASSIGN(aa, aa);
2546         ),
2547
2548         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM",
2549                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->aa)
2550 );
2551
2552 TRACE_EVENT(rdev_external_auth,
2553             TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2554                      struct cfg80211_external_auth_params *params),
2555             TP_ARGS(wiphy, netdev, params),
2556             TP_STRUCT__entry(WIPHY_ENTRY
2557                              NETDEV_ENTRY
2558                              MAC_ENTRY(bssid)
2559                              __array(u8, ssid, IEEE80211_MAX_SSID_LEN + 1)
2560                              __field(u16, status)
2561                              MAC_ENTRY(mld_addr)
2562             ),
2563             TP_fast_assign(WIPHY_ASSIGN;
2564                            NETDEV_ASSIGN;
2565                            MAC_ASSIGN(bssid, params->bssid);
2566                            memset(__entry->ssid, 0, IEEE80211_MAX_SSID_LEN + 1);
2567                            memcpy(__entry->ssid, params->ssid.ssid,
2568                                   params->ssid.ssid_len);
2569                            __entry->status = params->status;
2570                            MAC_ASSIGN(mld_addr, params->mld_addr);
2571             ),
2572             TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: %pM"
2573                       ", ssid: %s, status: %u, mld_addr: %pM",
2574                       WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->bssid,
2575                       __entry->ssid, __entry->status, __entry->mld_addr)
2576 );
2577
2578 TRACE_EVENT(rdev_start_radar_detection,
2579         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2580                  struct cfg80211_chan_def *chandef,
2581                  u32 cac_time_ms),
2582         TP_ARGS(wiphy, netdev, chandef, cac_time_ms),
2583         TP_STRUCT__entry(
2584                 WIPHY_ENTRY
2585                 NETDEV_ENTRY
2586                 CHAN_DEF_ENTRY
2587                 __field(u32, cac_time_ms)
2588         ),
2589         TP_fast_assign(
2590                 WIPHY_ASSIGN;
2591                 NETDEV_ASSIGN;
2592                 CHAN_DEF_ASSIGN(chandef);
2593                 __entry->cac_time_ms = cac_time_ms;
2594         ),
2595         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT
2596                   ", cac_time_ms=%u",
2597                   WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG,
2598                   __entry->cac_time_ms)
2599 );
2600
2601 TRACE_EVENT(rdev_set_mcast_rate,
2602         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2603                  int *mcast_rate),
2604         TP_ARGS(wiphy, netdev, mcast_rate),
2605         TP_STRUCT__entry(
2606                 WIPHY_ENTRY
2607                 NETDEV_ENTRY
2608                 __array(int, mcast_rate, NUM_NL80211_BANDS)
2609         ),
2610         TP_fast_assign(
2611                 WIPHY_ASSIGN;
2612                 NETDEV_ASSIGN;
2613                 memcpy(__entry->mcast_rate, mcast_rate,
2614                        sizeof(int) * NUM_NL80211_BANDS);
2615         ),
2616         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", "
2617                   "mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 6GHz=0x%x, 60GHz=0x%x]",
2618                   WIPHY_PR_ARG, NETDEV_PR_ARG,
2619                   __entry->mcast_rate[NL80211_BAND_2GHZ],
2620                   __entry->mcast_rate[NL80211_BAND_5GHZ],
2621                   __entry->mcast_rate[NL80211_BAND_6GHZ],
2622                   __entry->mcast_rate[NL80211_BAND_60GHZ])
2623 );
2624
2625 TRACE_EVENT(rdev_set_coalesce,
2626         TP_PROTO(struct wiphy *wiphy, struct cfg80211_coalesce *coalesce),
2627         TP_ARGS(wiphy, coalesce),
2628         TP_STRUCT__entry(
2629                 WIPHY_ENTRY
2630                 __field(int, n_rules)
2631         ),
2632         TP_fast_assign(
2633                 WIPHY_ASSIGN;
2634                 __entry->n_rules = coalesce ? coalesce->n_rules : 0;
2635         ),
2636         TP_printk(WIPHY_PR_FMT ", n_rules=%d",
2637                   WIPHY_PR_ARG, __entry->n_rules)
2638 );
2639
2640 DEFINE_EVENT(wiphy_wdev_evt, rdev_abort_scan,
2641         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2642         TP_ARGS(wiphy, wdev)
2643 );
2644
2645 TRACE_EVENT(rdev_set_multicast_to_unicast,
2646         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2647                  const bool enabled),
2648         TP_ARGS(wiphy, netdev, enabled),
2649         TP_STRUCT__entry(
2650                 WIPHY_ENTRY
2651                 NETDEV_ENTRY
2652                 __field(bool, enabled)
2653         ),
2654         TP_fast_assign(
2655                 WIPHY_ASSIGN;
2656                 NETDEV_ASSIGN;
2657                 __entry->enabled = enabled;
2658         ),
2659         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", unicast: %s",
2660                   WIPHY_PR_ARG, NETDEV_PR_ARG,
2661                   BOOL_TO_STR(__entry->enabled))
2662 );
2663
2664 DEFINE_EVENT(wiphy_wdev_evt, rdev_get_txq_stats,
2665         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
2666         TP_ARGS(wiphy, wdev)
2667 );
2668
2669 TRACE_EVENT(rdev_get_ftm_responder_stats,
2670         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2671                  struct cfg80211_ftm_responder_stats *ftm_stats),
2672
2673         TP_ARGS(wiphy, netdev, ftm_stats),
2674
2675         TP_STRUCT__entry(
2676                 WIPHY_ENTRY
2677                 NETDEV_ENTRY
2678                 __field(u64, timestamp)
2679                 __field(u32, success_num)
2680                 __field(u32, partial_num)
2681                 __field(u32, failed_num)
2682                 __field(u32, asap_num)
2683                 __field(u32, non_asap_num)
2684                 __field(u64, duration)
2685                 __field(u32, unknown_triggers)
2686                 __field(u32, reschedule)
2687                 __field(u32, out_of_window)
2688         ),
2689
2690         TP_fast_assign(
2691                 WIPHY_ASSIGN;
2692                 NETDEV_ASSIGN;
2693                 __entry->success_num = ftm_stats->success_num;
2694                 __entry->partial_num = ftm_stats->partial_num;
2695                 __entry->failed_num = ftm_stats->failed_num;
2696                 __entry->asap_num = ftm_stats->asap_num;
2697                 __entry->non_asap_num = ftm_stats->non_asap_num;
2698                 __entry->duration = ftm_stats->total_duration_ms;
2699                 __entry->unknown_triggers = ftm_stats->unknown_triggers_num;
2700                 __entry->reschedule = ftm_stats->reschedule_requests_num;
2701                 __entry->out_of_window = ftm_stats->out_of_window_triggers_num;
2702         ),
2703
2704         TP_printk(WIPHY_PR_FMT "Ftm responder stats: success %u, partial %u, "
2705                 "failed %u, asap %u, non asap %u, total duration %llu, unknown "
2706                 "triggers %u, rescheduled %u, out of window %u", WIPHY_PR_ARG,
2707                 __entry->success_num, __entry->partial_num, __entry->failed_num,
2708                 __entry->asap_num, __entry->non_asap_num, __entry->duration,
2709                 __entry->unknown_triggers, __entry->reschedule,
2710                 __entry->out_of_window)
2711 );
2712
2713 DEFINE_EVENT(wiphy_wdev_cookie_evt, rdev_start_pmsr,
2714         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
2715         TP_ARGS(wiphy, wdev, cookie)
2716 );
2717
2718 DEFINE_EVENT(wiphy_wdev_cookie_evt, rdev_abort_pmsr,
2719         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
2720         TP_ARGS(wiphy, wdev, cookie)
2721 );
2722
2723 TRACE_EVENT(rdev_set_fils_aad,
2724         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2725                  struct cfg80211_fils_aad *fils_aad),
2726         TP_ARGS(wiphy, netdev, fils_aad),
2727         TP_STRUCT__entry(WIPHY_ENTRY
2728                 NETDEV_ENTRY
2729                 __array(u8, macaddr, ETH_ALEN)
2730                 __field(u8, kek_len)
2731         ),
2732         TP_fast_assign(WIPHY_ASSIGN;
2733                 NETDEV_ASSIGN;
2734                 FILS_AAD_ASSIGN(fils_aad);
2735         ),
2736         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " FILS_AAD_PR_FMT,
2737                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->macaddr,
2738                   __entry->kek_len)
2739 );
2740
2741 TRACE_EVENT(rdev_update_owe_info,
2742             TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2743                      struct cfg80211_update_owe_info *owe_info),
2744             TP_ARGS(wiphy, netdev, owe_info),
2745             TP_STRUCT__entry(WIPHY_ENTRY
2746                              NETDEV_ENTRY
2747                              MAC_ENTRY(peer)
2748                              __field(u16, status)
2749                              __dynamic_array(u8, ie, owe_info->ie_len)),
2750             TP_fast_assign(WIPHY_ASSIGN;
2751                            NETDEV_ASSIGN;
2752                            MAC_ASSIGN(peer, owe_info->peer);
2753                            __entry->status = owe_info->status;
2754                            memcpy(__get_dynamic_array(ie),
2755                                   owe_info->ie, owe_info->ie_len);),
2756             TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM"
2757                   " status %d", WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer,
2758                   __entry->status)
2759 );
2760
2761 TRACE_EVENT(rdev_probe_mesh_link,
2762         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2763                  const u8 *dest, const u8 *buf, size_t len),
2764         TP_ARGS(wiphy, netdev, dest, buf, len),
2765         TP_STRUCT__entry(
2766                 WIPHY_ENTRY
2767                 NETDEV_ENTRY
2768                 MAC_ENTRY(dest)
2769         ),
2770         TP_fast_assign(
2771                 WIPHY_ASSIGN;
2772                 NETDEV_ASSIGN;
2773                 MAC_ASSIGN(dest, dest);
2774         ),
2775         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", %pM",
2776                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->dest)
2777 );
2778
2779 TRACE_EVENT(rdev_set_tid_config,
2780         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2781                  struct cfg80211_tid_config *tid_conf),
2782         TP_ARGS(wiphy, netdev, tid_conf),
2783         TP_STRUCT__entry(
2784                 WIPHY_ENTRY
2785                 NETDEV_ENTRY
2786                 MAC_ENTRY(peer)
2787         ),
2788         TP_fast_assign(
2789                 WIPHY_ASSIGN;
2790                 NETDEV_ASSIGN;
2791                 MAC_ASSIGN(peer, tid_conf->peer);
2792         ),
2793         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM",
2794                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer)
2795 );
2796
2797 TRACE_EVENT(rdev_reset_tid_config,
2798         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2799                  const u8 *peer, u8 tids),
2800         TP_ARGS(wiphy, netdev, peer, tids),
2801         TP_STRUCT__entry(
2802                 WIPHY_ENTRY
2803                 NETDEV_ENTRY
2804                 MAC_ENTRY(peer)
2805                 __field(u8, tids)
2806         ),
2807         TP_fast_assign(
2808                 WIPHY_ASSIGN;
2809                 NETDEV_ASSIGN;
2810                 MAC_ASSIGN(peer, peer);
2811                 __entry->tids = tids;
2812         ),
2813         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM, tids: 0x%x",
2814                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer, __entry->tids)
2815 );
2816
2817 TRACE_EVENT(rdev_set_sar_specs,
2818         TP_PROTO(struct wiphy *wiphy, struct cfg80211_sar_specs *sar),
2819         TP_ARGS(wiphy, sar),
2820         TP_STRUCT__entry(
2821                 WIPHY_ENTRY
2822                 __field(u16, type)
2823                 __field(u16, num)
2824         ),
2825         TP_fast_assign(
2826                 WIPHY_ASSIGN;
2827                 __entry->type = sar->type;
2828                 __entry->num = sar->num_sub_specs;
2829
2830         ),
2831         TP_printk(WIPHY_PR_FMT ", Set type:%d, num_specs:%d",
2832                   WIPHY_PR_ARG, __entry->type, __entry->num)
2833 );
2834
2835 TRACE_EVENT(rdev_color_change,
2836         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
2837                  struct cfg80211_color_change_settings *params),
2838         TP_ARGS(wiphy, netdev, params),
2839         TP_STRUCT__entry(
2840                 WIPHY_ENTRY
2841                 NETDEV_ENTRY
2842                 __field(u8, count)
2843                 __field(u16, bcn_ofs)
2844                 __field(u16, pres_ofs)
2845         ),
2846         TP_fast_assign(
2847                 WIPHY_ASSIGN;
2848                 NETDEV_ASSIGN;
2849                 __entry->count = params->count;
2850                 __entry->bcn_ofs = params->counter_offset_beacon;
2851                 __entry->pres_ofs = params->counter_offset_presp;
2852         ),
2853         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT
2854                   ", count: %u",
2855                   WIPHY_PR_ARG, NETDEV_PR_ARG,
2856                   __entry->count)
2857 );
2858
2859 TRACE_EVENT(rdev_set_radar_background,
2860         TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
2861
2862         TP_ARGS(wiphy, chandef),
2863
2864         TP_STRUCT__entry(
2865                 WIPHY_ENTRY
2866                 CHAN_DEF_ENTRY
2867         ),
2868
2869         TP_fast_assign(
2870                 WIPHY_ASSIGN;
2871                 CHAN_DEF_ASSIGN(chandef)
2872         ),
2873
2874         TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
2875                   WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
2876 );
2877
2878 DEFINE_EVENT(wiphy_wdev_link_evt, rdev_add_intf_link,
2879         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2880                  unsigned int link_id),
2881         TP_ARGS(wiphy, wdev, link_id)
2882 );
2883
2884 DEFINE_EVENT(wiphy_wdev_link_evt, rdev_del_intf_link,
2885         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
2886                  unsigned int link_id),
2887         TP_ARGS(wiphy, wdev, link_id)
2888 );
2889
2890 /*************************************************************
2891  *           cfg80211 exported functions traces              *
2892  *************************************************************/
2893
2894 TRACE_EVENT(cfg80211_return_bool,
2895         TP_PROTO(bool ret),
2896         TP_ARGS(ret),
2897         TP_STRUCT__entry(
2898                 __field(bool, ret)
2899         ),
2900         TP_fast_assign(
2901                 __entry->ret = ret;
2902         ),
2903         TP_printk("returned %s", BOOL_TO_STR(__entry->ret))
2904 );
2905
2906 DECLARE_EVENT_CLASS(cfg80211_netdev_mac_evt,
2907         TP_PROTO(struct net_device *netdev, const u8 *macaddr),
2908         TP_ARGS(netdev, macaddr),
2909         TP_STRUCT__entry(
2910                 NETDEV_ENTRY
2911                 MAC_ENTRY(macaddr)
2912         ),
2913         TP_fast_assign(
2914                 NETDEV_ASSIGN;
2915                 MAC_ASSIGN(macaddr, macaddr);
2916         ),
2917         TP_printk(NETDEV_PR_FMT ", mac: %pM",
2918                   NETDEV_PR_ARG, __entry->macaddr)
2919 );
2920
2921 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_notify_new_peer_candidate,
2922         TP_PROTO(struct net_device *netdev, const u8 *macaddr),
2923         TP_ARGS(netdev, macaddr)
2924 );
2925
2926 DECLARE_EVENT_CLASS(netdev_evt_only,
2927         TP_PROTO(struct net_device *netdev),
2928         TP_ARGS(netdev),
2929         TP_STRUCT__entry(
2930                 NETDEV_ENTRY
2931         ),
2932         TP_fast_assign(
2933                 NETDEV_ASSIGN;
2934         ),
2935         TP_printk(NETDEV_PR_FMT , NETDEV_PR_ARG)
2936 );
2937
2938 DEFINE_EVENT(netdev_evt_only, cfg80211_send_rx_auth,
2939         TP_PROTO(struct net_device *netdev),
2940         TP_ARGS(netdev)
2941 );
2942
2943 TRACE_EVENT(cfg80211_send_rx_assoc,
2944         TP_PROTO(struct net_device *netdev,
2945                  const struct cfg80211_rx_assoc_resp_data *data),
2946         TP_ARGS(netdev, data),
2947         TP_STRUCT__entry(
2948                 NETDEV_ENTRY
2949                 MAC_ENTRY(ap_addr)
2950         ),
2951         TP_fast_assign(
2952                 NETDEV_ASSIGN;
2953                 MAC_ASSIGN(ap_addr,
2954                            data->ap_mld_addr ?: data->links[0].bss->bssid);
2955         ),
2956         TP_printk(NETDEV_PR_FMT ", %pM",
2957                   NETDEV_PR_ARG, __entry->ap_addr)
2958 );
2959
2960 DECLARE_EVENT_CLASS(netdev_frame_event,
2961         TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2962         TP_ARGS(netdev, buf, len),
2963         TP_STRUCT__entry(
2964                 NETDEV_ENTRY
2965                 __dynamic_array(u8, frame, len)
2966         ),
2967         TP_fast_assign(
2968                 NETDEV_ASSIGN;
2969                 memcpy(__get_dynamic_array(frame), buf, len);
2970         ),
2971         TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x",
2972                   NETDEV_PR_ARG,
2973                   le16_to_cpup((__le16 *)__get_dynamic_array(frame)))
2974 );
2975
2976 DEFINE_EVENT(netdev_frame_event, cfg80211_rx_unprot_mlme_mgmt,
2977         TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2978         TP_ARGS(netdev, buf, len)
2979 );
2980
2981 DEFINE_EVENT(netdev_frame_event, cfg80211_rx_mlme_mgmt,
2982         TP_PROTO(struct net_device *netdev, const u8 *buf, int len),
2983         TP_ARGS(netdev, buf, len)
2984 );
2985
2986 TRACE_EVENT(cfg80211_tx_mlme_mgmt,
2987         TP_PROTO(struct net_device *netdev, const u8 *buf, int len,
2988                  bool reconnect),
2989         TP_ARGS(netdev, buf, len, reconnect),
2990         TP_STRUCT__entry(
2991                 NETDEV_ENTRY
2992                 __dynamic_array(u8, frame, len)
2993                 __field(int, reconnect)
2994         ),
2995         TP_fast_assign(
2996                 NETDEV_ASSIGN;
2997                 memcpy(__get_dynamic_array(frame), buf, len);
2998                 __entry->reconnect = reconnect;
2999         ),
3000         TP_printk(NETDEV_PR_FMT ", ftype:0x%.2x reconnect:%d",
3001                   NETDEV_PR_ARG,
3002                   le16_to_cpup((__le16 *)__get_dynamic_array(frame)),
3003                   __entry->reconnect)
3004 );
3005
3006 DECLARE_EVENT_CLASS(netdev_mac_evt,
3007         TP_PROTO(struct net_device *netdev, const u8 *mac),
3008         TP_ARGS(netdev, mac),
3009         TP_STRUCT__entry(
3010                 NETDEV_ENTRY
3011                 MAC_ENTRY(mac)
3012         ),
3013         TP_fast_assign(
3014                 NETDEV_ASSIGN;
3015                 MAC_ASSIGN(mac, mac)
3016         ),
3017         TP_printk(NETDEV_PR_FMT ", mac: %pM",
3018                   NETDEV_PR_ARG, __entry->mac)
3019 );
3020
3021 DEFINE_EVENT(netdev_mac_evt, cfg80211_send_auth_timeout,
3022         TP_PROTO(struct net_device *netdev, const u8 *mac),
3023         TP_ARGS(netdev, mac)
3024 );
3025
3026 TRACE_EVENT(cfg80211_send_assoc_failure,
3027         TP_PROTO(struct net_device *netdev,
3028                  struct cfg80211_assoc_failure *data),
3029         TP_ARGS(netdev, data),
3030         TP_STRUCT__entry(
3031                 NETDEV_ENTRY
3032                 MAC_ENTRY(ap_addr)
3033                 __field(bool, timeout)
3034         ),
3035         TP_fast_assign(
3036                 NETDEV_ASSIGN;
3037                 MAC_ASSIGN(ap_addr, data->ap_mld_addr ?: data->bss[0]->bssid);
3038                 __entry->timeout = data->timeout;
3039         ),
3040         TP_printk(NETDEV_PR_FMT ", mac: %pM, timeout: %d",
3041                   NETDEV_PR_ARG, __entry->ap_addr, __entry->timeout)
3042 );
3043
3044 TRACE_EVENT(cfg80211_michael_mic_failure,
3045         TP_PROTO(struct net_device *netdev, const u8 *addr,
3046                  enum nl80211_key_type key_type, int key_id, const u8 *tsc),
3047         TP_ARGS(netdev, addr, key_type, key_id, tsc),
3048         TP_STRUCT__entry(
3049                 NETDEV_ENTRY
3050                 MAC_ENTRY(addr)
3051                 __field(enum nl80211_key_type, key_type)
3052                 __field(int, key_id)
3053                 __array(u8, tsc, 6)
3054         ),
3055         TP_fast_assign(
3056                 NETDEV_ASSIGN;
3057                 MAC_ASSIGN(addr, addr);
3058                 __entry->key_type = key_type;
3059                 __entry->key_id = key_id;
3060                 if (tsc)
3061                         memcpy(__entry->tsc, tsc, 6);
3062         ),
3063         TP_printk(NETDEV_PR_FMT ", %pM, key type: %d, key id: %d, tsc: %pm",
3064                   NETDEV_PR_ARG, __entry->addr, __entry->key_type,
3065                   __entry->key_id, __entry->tsc)
3066 );
3067
3068 TRACE_EVENT(cfg80211_ready_on_channel,
3069         TP_PROTO(struct wireless_dev *wdev, u64 cookie,
3070                  struct ieee80211_channel *chan,
3071                  unsigned int duration),
3072         TP_ARGS(wdev, cookie, chan, duration),
3073         TP_STRUCT__entry(
3074                 WDEV_ENTRY
3075                 __field(u64, cookie)
3076                 CHAN_ENTRY
3077                 __field(unsigned int, duration)
3078         ),
3079         TP_fast_assign(
3080                 WDEV_ASSIGN;
3081                 __entry->cookie = cookie;
3082                 CHAN_ASSIGN(chan);
3083                 __entry->duration = duration;
3084         ),
3085         TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
3086                   WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
3087                   __entry->duration)
3088 );
3089
3090 TRACE_EVENT(cfg80211_ready_on_channel_expired,
3091         TP_PROTO(struct wireless_dev *wdev, u64 cookie,
3092                  struct ieee80211_channel *chan),
3093         TP_ARGS(wdev, cookie, chan),
3094         TP_STRUCT__entry(
3095                 WDEV_ENTRY
3096                 __field(u64, cookie)
3097                 CHAN_ENTRY
3098         ),
3099         TP_fast_assign(
3100                 WDEV_ASSIGN;
3101                 __entry->cookie = cookie;
3102                 CHAN_ASSIGN(chan);
3103         ),
3104         TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
3105                   WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
3106 );
3107
3108 TRACE_EVENT(cfg80211_tx_mgmt_expired,
3109         TP_PROTO(struct wireless_dev *wdev, u64 cookie,
3110                  struct ieee80211_channel *chan),
3111         TP_ARGS(wdev, cookie, chan),
3112         TP_STRUCT__entry(
3113                 WDEV_ENTRY
3114                 __field(u64, cookie)
3115                 CHAN_ENTRY
3116         ),
3117         TP_fast_assign(
3118                 WDEV_ASSIGN;
3119                 __entry->cookie = cookie;
3120                 CHAN_ASSIGN(chan);
3121         ),
3122         TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
3123                   WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
3124 );
3125
3126 TRACE_EVENT(cfg80211_new_sta,
3127         TP_PROTO(struct net_device *netdev, const u8 *mac_addr,
3128                  struct station_info *sinfo),
3129         TP_ARGS(netdev, mac_addr, sinfo),
3130         TP_STRUCT__entry(
3131                 NETDEV_ENTRY
3132                 MAC_ENTRY(mac_addr)
3133                 SINFO_ENTRY
3134         ),
3135         TP_fast_assign(
3136                 NETDEV_ASSIGN;
3137                 MAC_ASSIGN(mac_addr, mac_addr);
3138                 SINFO_ASSIGN;
3139         ),
3140         TP_printk(NETDEV_PR_FMT ", %pM",
3141                   NETDEV_PR_ARG, __entry->mac_addr)
3142 );
3143
3144 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_del_sta,
3145         TP_PROTO(struct net_device *netdev, const u8 *macaddr),
3146         TP_ARGS(netdev, macaddr)
3147 );
3148
3149 TRACE_EVENT(cfg80211_rx_mgmt,
3150         TP_PROTO(struct wireless_dev *wdev, struct cfg80211_rx_info *info),
3151         TP_ARGS(wdev, info),
3152         TP_STRUCT__entry(
3153                 WDEV_ENTRY
3154                 __field(int, freq)
3155                 __field(int, sig_dbm)
3156         ),
3157         TP_fast_assign(
3158                 WDEV_ASSIGN;
3159                 __entry->freq = info->freq;
3160                 __entry->sig_dbm = info->sig_dbm;
3161         ),
3162         TP_printk(WDEV_PR_FMT ", freq: "KHZ_F", sig dbm: %d",
3163                   WDEV_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
3164 );
3165
3166 TRACE_EVENT(cfg80211_mgmt_tx_status,
3167         TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
3168         TP_ARGS(wdev, cookie, ack),
3169         TP_STRUCT__entry(
3170                 WDEV_ENTRY
3171                 __field(u64, cookie)
3172                 __field(bool, ack)
3173         ),
3174         TP_fast_assign(
3175                 WDEV_ASSIGN;
3176                 __entry->cookie = cookie;
3177                 __entry->ack = ack;
3178         ),
3179         TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
3180                   WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
3181 );
3182
3183 TRACE_EVENT(cfg80211_control_port_tx_status,
3184         TP_PROTO(struct wireless_dev *wdev, u64 cookie, bool ack),
3185         TP_ARGS(wdev, cookie, ack),
3186         TP_STRUCT__entry(
3187                 WDEV_ENTRY
3188                 __field(u64, cookie)
3189                 __field(bool, ack)
3190         ),
3191         TP_fast_assign(
3192                 WDEV_ASSIGN;
3193                 __entry->cookie = cookie;
3194                 __entry->ack = ack;
3195         ),
3196         TP_printk(WDEV_PR_FMT", cookie: %llu, ack: %s",
3197                   WDEV_PR_ARG, __entry->cookie, BOOL_TO_STR(__entry->ack))
3198 );
3199
3200 TRACE_EVENT(cfg80211_rx_control_port,
3201         TP_PROTO(struct net_device *netdev, struct sk_buff *skb,
3202                  bool unencrypted, int link_id),
3203         TP_ARGS(netdev, skb, unencrypted, link_id),
3204         TP_STRUCT__entry(
3205                 NETDEV_ENTRY
3206                 __field(int, len)
3207                 MAC_ENTRY(from)
3208                 __field(u16, proto)
3209                 __field(bool, unencrypted)
3210                 __field(int, link_id)
3211         ),
3212         TP_fast_assign(
3213                 NETDEV_ASSIGN;
3214                 __entry->len = skb->len;
3215                 MAC_ASSIGN(from, eth_hdr(skb)->h_source);
3216                 __entry->proto = be16_to_cpu(skb->protocol);
3217                 __entry->unencrypted = unencrypted;
3218                 __entry->link_id = link_id;
3219         ),
3220         TP_printk(NETDEV_PR_FMT ", len=%d, %pM, proto: 0x%x, unencrypted: %s, link: %d",
3221                   NETDEV_PR_ARG, __entry->len, __entry->from,
3222                   __entry->proto, BOOL_TO_STR(__entry->unencrypted),
3223                   __entry->link_id)
3224 );
3225
3226 TRACE_EVENT(cfg80211_cqm_rssi_notify,
3227         TP_PROTO(struct net_device *netdev,
3228                  enum nl80211_cqm_rssi_threshold_event rssi_event,
3229                  s32 rssi_level),
3230         TP_ARGS(netdev, rssi_event, rssi_level),
3231         TP_STRUCT__entry(
3232                 NETDEV_ENTRY
3233                 __field(enum nl80211_cqm_rssi_threshold_event, rssi_event)
3234                 __field(s32, rssi_level)
3235         ),
3236         TP_fast_assign(
3237                 NETDEV_ASSIGN;
3238                 __entry->rssi_event = rssi_event;
3239                 __entry->rssi_level = rssi_level;
3240         ),
3241         TP_printk(NETDEV_PR_FMT ", rssi event: %d, level: %d",
3242                   NETDEV_PR_ARG, __entry->rssi_event, __entry->rssi_level)
3243 );
3244
3245 TRACE_EVENT(cfg80211_reg_can_beacon,
3246         TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
3247                  enum nl80211_iftype iftype, bool check_no_ir),
3248         TP_ARGS(wiphy, chandef, iftype, check_no_ir),
3249         TP_STRUCT__entry(
3250                 WIPHY_ENTRY
3251                 CHAN_DEF_ENTRY
3252                 __field(enum nl80211_iftype, iftype)
3253                 __field(bool, check_no_ir)
3254         ),
3255         TP_fast_assign(
3256                 WIPHY_ASSIGN;
3257                 CHAN_DEF_ASSIGN(chandef);
3258                 __entry->iftype = iftype;
3259                 __entry->check_no_ir = check_no_ir;
3260         ),
3261         TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d check_no_ir=%s",
3262                   WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype,
3263                   BOOL_TO_STR(__entry->check_no_ir))
3264 );
3265
3266 TRACE_EVENT(cfg80211_chandef_dfs_required,
3267         TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
3268         TP_ARGS(wiphy, chandef),
3269         TP_STRUCT__entry(
3270                 WIPHY_ENTRY
3271                 CHAN_DEF_ENTRY
3272         ),
3273         TP_fast_assign(
3274                 WIPHY_ASSIGN;
3275                 CHAN_DEF_ASSIGN(chandef);
3276         ),
3277         TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
3278                   WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
3279 );
3280
3281 TRACE_EVENT(cfg80211_ch_switch_notify,
3282         TP_PROTO(struct net_device *netdev,
3283                  struct cfg80211_chan_def *chandef,
3284                  unsigned int link_id),
3285         TP_ARGS(netdev, chandef, link_id),
3286         TP_STRUCT__entry(
3287                 NETDEV_ENTRY
3288                 CHAN_DEF_ENTRY
3289                 __field(unsigned int, link_id)
3290         ),
3291         TP_fast_assign(
3292                 NETDEV_ASSIGN;
3293                 CHAN_DEF_ASSIGN(chandef);
3294                 __entry->link_id = link_id;
3295         ),
3296         TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
3297                   NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id)
3298 );
3299
3300 TRACE_EVENT(cfg80211_ch_switch_started_notify,
3301         TP_PROTO(struct net_device *netdev,
3302                  struct cfg80211_chan_def *chandef,
3303                  unsigned int link_id),
3304         TP_ARGS(netdev, chandef, link_id),
3305         TP_STRUCT__entry(
3306                 NETDEV_ENTRY
3307                 CHAN_DEF_ENTRY
3308                 __field(unsigned int, link_id)
3309         ),
3310         TP_fast_assign(
3311                 NETDEV_ASSIGN;
3312                 CHAN_DEF_ASSIGN(chandef);
3313                 __entry->link_id = link_id;
3314         ),
3315         TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d",
3316                   NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id)
3317 );
3318
3319 TRACE_EVENT(cfg80211_radar_event,
3320         TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
3321                  bool offchan),
3322         TP_ARGS(wiphy, chandef, offchan),
3323         TP_STRUCT__entry(
3324                 WIPHY_ENTRY
3325                 CHAN_DEF_ENTRY
3326                 __field(bool, offchan)
3327         ),
3328         TP_fast_assign(
3329                 WIPHY_ASSIGN;
3330                 CHAN_DEF_ASSIGN(chandef);
3331                 __entry->offchan = offchan;
3332         ),
3333         TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", offchan %d",
3334                   WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->offchan)
3335 );
3336
3337 TRACE_EVENT(cfg80211_cac_event,
3338         TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt),
3339         TP_ARGS(netdev, evt),
3340         TP_STRUCT__entry(
3341                 NETDEV_ENTRY
3342                 __field(enum nl80211_radar_event, evt)
3343         ),
3344         TP_fast_assign(
3345                 NETDEV_ASSIGN;
3346                 __entry->evt = evt;
3347         ),
3348         TP_printk(NETDEV_PR_FMT ",  event: %d",
3349                   NETDEV_PR_ARG, __entry->evt)
3350 );
3351
3352 DECLARE_EVENT_CLASS(cfg80211_rx_evt,
3353         TP_PROTO(struct net_device *netdev, const u8 *addr),
3354         TP_ARGS(netdev, addr),
3355         TP_STRUCT__entry(
3356                 NETDEV_ENTRY
3357                 MAC_ENTRY(addr)
3358         ),
3359         TP_fast_assign(
3360                 NETDEV_ASSIGN;
3361                 MAC_ASSIGN(addr, addr);
3362         ),
3363         TP_printk(NETDEV_PR_FMT ", %pM", NETDEV_PR_ARG, __entry->addr)
3364 );
3365
3366 DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_spurious_frame,
3367         TP_PROTO(struct net_device *netdev, const u8 *addr),
3368         TP_ARGS(netdev, addr)
3369 );
3370
3371 DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_unexpected_4addr_frame,
3372         TP_PROTO(struct net_device *netdev, const u8 *addr),
3373         TP_ARGS(netdev, addr)
3374 );
3375
3376 TRACE_EVENT(cfg80211_ibss_joined,
3377         TP_PROTO(struct net_device *netdev, const u8 *bssid,
3378                  struct ieee80211_channel *channel),
3379         TP_ARGS(netdev, bssid, channel),
3380         TP_STRUCT__entry(
3381                 NETDEV_ENTRY
3382                 MAC_ENTRY(bssid)
3383                 CHAN_ENTRY
3384         ),
3385         TP_fast_assign(
3386                 NETDEV_ASSIGN;
3387                 MAC_ASSIGN(bssid, bssid);
3388                 CHAN_ASSIGN(channel);
3389         ),
3390         TP_printk(NETDEV_PR_FMT ", bssid: %pM, " CHAN_PR_FMT,
3391                   NETDEV_PR_ARG, __entry->bssid, CHAN_PR_ARG)
3392 );
3393
3394 TRACE_EVENT(cfg80211_probe_status,
3395         TP_PROTO(struct net_device *netdev, const u8 *addr, u64 cookie,
3396                  bool acked),
3397         TP_ARGS(netdev, addr, cookie, acked),
3398         TP_STRUCT__entry(
3399                 NETDEV_ENTRY
3400                 MAC_ENTRY(addr)
3401                 __field(u64, cookie)
3402                 __field(bool, acked)
3403         ),
3404         TP_fast_assign(
3405                 NETDEV_ASSIGN;
3406                 MAC_ASSIGN(addr, addr);
3407                 __entry->cookie = cookie;
3408                 __entry->acked = acked;
3409         ),
3410         TP_printk(NETDEV_PR_FMT " addr:%pM, cookie: %llu, acked: %s",
3411                   NETDEV_PR_ARG, __entry->addr, __entry->cookie,
3412                   BOOL_TO_STR(__entry->acked))
3413 );
3414
3415 TRACE_EVENT(cfg80211_cqm_pktloss_notify,
3416         TP_PROTO(struct net_device *netdev, const u8 *peer, u32 num_packets),
3417         TP_ARGS(netdev, peer, num_packets),
3418         TP_STRUCT__entry(
3419                 NETDEV_ENTRY
3420                 MAC_ENTRY(peer)
3421                 __field(u32, num_packets)
3422         ),
3423         TP_fast_assign(
3424                 NETDEV_ASSIGN;
3425                 MAC_ASSIGN(peer, peer);
3426                 __entry->num_packets = num_packets;
3427         ),
3428         TP_printk(NETDEV_PR_FMT ", peer: %pM, num of lost packets: %u",
3429                   NETDEV_PR_ARG, __entry->peer, __entry->num_packets)
3430 );
3431
3432 DEFINE_EVENT(cfg80211_netdev_mac_evt, cfg80211_gtk_rekey_notify,
3433         TP_PROTO(struct net_device *netdev, const u8 *macaddr),
3434         TP_ARGS(netdev, macaddr)
3435 );
3436
3437 TRACE_EVENT(cfg80211_pmksa_candidate_notify,
3438         TP_PROTO(struct net_device *netdev, int index, const u8 *bssid,
3439                  bool preauth),
3440         TP_ARGS(netdev, index, bssid, preauth),
3441         TP_STRUCT__entry(
3442                 NETDEV_ENTRY
3443                 __field(int, index)
3444                 MAC_ENTRY(bssid)
3445                 __field(bool, preauth)
3446         ),
3447         TP_fast_assign(
3448                 NETDEV_ASSIGN;
3449                 __entry->index = index;
3450                 MAC_ASSIGN(bssid, bssid);
3451                 __entry->preauth = preauth;
3452         ),
3453         TP_printk(NETDEV_PR_FMT ", index:%d, bssid: %pM, pre auth: %s",
3454                   NETDEV_PR_ARG, __entry->index, __entry->bssid,
3455                   BOOL_TO_STR(__entry->preauth))
3456 );
3457
3458 TRACE_EVENT(cfg80211_report_obss_beacon,
3459         TP_PROTO(struct wiphy *wiphy, const u8 *frame, size_t len,
3460                  int freq, int sig_dbm),
3461         TP_ARGS(wiphy, frame, len, freq, sig_dbm),
3462         TP_STRUCT__entry(
3463                 WIPHY_ENTRY
3464                 __field(int, freq)
3465                 __field(int, sig_dbm)
3466         ),
3467         TP_fast_assign(
3468                 WIPHY_ASSIGN;
3469                 __entry->freq = freq;
3470                 __entry->sig_dbm = sig_dbm;
3471         ),
3472         TP_printk(WIPHY_PR_FMT ", freq: "KHZ_F", sig_dbm: %d",
3473                   WIPHY_PR_ARG, PR_KHZ(__entry->freq), __entry->sig_dbm)
3474 );
3475
3476 TRACE_EVENT(cfg80211_tdls_oper_request,
3477         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer,
3478                  enum nl80211_tdls_operation oper, u16 reason_code),
3479         TP_ARGS(wiphy, netdev, peer, oper, reason_code),
3480         TP_STRUCT__entry(
3481                 WIPHY_ENTRY
3482                 NETDEV_ENTRY
3483                 MAC_ENTRY(peer)
3484                 __field(enum nl80211_tdls_operation, oper)
3485                 __field(u16, reason_code)
3486         ),
3487         TP_fast_assign(
3488                 WIPHY_ASSIGN;
3489                 NETDEV_ASSIGN;
3490                 MAC_ASSIGN(peer, peer);
3491                 __entry->oper = oper;
3492                 __entry->reason_code = reason_code;
3493         ),
3494         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM, oper: %d, reason_code %u",
3495                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer, __entry->oper,
3496                   __entry->reason_code)
3497         );
3498
3499 TRACE_EVENT(cfg80211_scan_done,
3500         TP_PROTO(struct cfg80211_scan_request *request,
3501                  struct cfg80211_scan_info *info),
3502         TP_ARGS(request, info),
3503         TP_STRUCT__entry(
3504                 __field(u32, n_channels)
3505                 __dynamic_array(u8, ie, request ? request->ie_len : 0)
3506                 __array(u32, rates, NUM_NL80211_BANDS)
3507                 __field(u32, wdev_id)
3508                 MAC_ENTRY(wiphy_mac)
3509                 __field(bool, no_cck)
3510                 __field(bool, aborted)
3511                 __field(u64, scan_start_tsf)
3512                 MAC_ENTRY(tsf_bssid)
3513         ),
3514         TP_fast_assign(
3515                 if (request) {
3516                         memcpy(__get_dynamic_array(ie), request->ie,
3517                                request->ie_len);
3518                         memcpy(__entry->rates, request->rates,
3519                                NUM_NL80211_BANDS);
3520                         __entry->wdev_id = request->wdev ?
3521                                         request->wdev->identifier : 0;
3522                         if (request->wiphy)
3523                                 MAC_ASSIGN(wiphy_mac,
3524                                            request->wiphy->perm_addr);
3525                         __entry->no_cck = request->no_cck;
3526                 }
3527                 if (info) {
3528                         __entry->aborted = info->aborted;
3529                         __entry->scan_start_tsf = info->scan_start_tsf;
3530                         MAC_ASSIGN(tsf_bssid, info->tsf_bssid);
3531                 }
3532         ),
3533         TP_printk("aborted: %s, scan start (TSF): %llu, tsf_bssid: %pM",
3534                   BOOL_TO_STR(__entry->aborted),
3535                   (unsigned long long)__entry->scan_start_tsf,
3536                   __entry->tsf_bssid)
3537 );
3538
3539 DECLARE_EVENT_CLASS(wiphy_id_evt,
3540         TP_PROTO(struct wiphy *wiphy, u64 id),
3541         TP_ARGS(wiphy, id),
3542         TP_STRUCT__entry(
3543                 WIPHY_ENTRY
3544                 __field(u64, id)
3545         ),
3546         TP_fast_assign(
3547                 WIPHY_ASSIGN;
3548                 __entry->id = id;
3549         ),
3550         TP_printk(WIPHY_PR_FMT ", id: %llu", WIPHY_PR_ARG, __entry->id)
3551 );
3552
3553 DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_stopped,
3554         TP_PROTO(struct wiphy *wiphy, u64 id),
3555         TP_ARGS(wiphy, id)
3556 );
3557
3558 DEFINE_EVENT(wiphy_id_evt, cfg80211_sched_scan_results,
3559         TP_PROTO(struct wiphy *wiphy, u64 id),
3560         TP_ARGS(wiphy, id)
3561 );
3562
3563 TRACE_EVENT(cfg80211_get_bss,
3564         TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
3565                  const u8 *bssid, const u8 *ssid, size_t ssid_len,
3566                  enum ieee80211_bss_type bss_type,
3567                  enum ieee80211_privacy privacy),
3568         TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, bss_type, privacy),
3569         TP_STRUCT__entry(
3570                 WIPHY_ENTRY
3571                 CHAN_ENTRY
3572                 MAC_ENTRY(bssid)
3573                 __dynamic_array(u8, ssid, ssid_len)
3574                 __field(enum ieee80211_bss_type, bss_type)
3575                 __field(enum ieee80211_privacy, privacy)
3576         ),
3577         TP_fast_assign(
3578                 WIPHY_ASSIGN;
3579                 CHAN_ASSIGN(channel);
3580                 MAC_ASSIGN(bssid, bssid);
3581                 memcpy(__get_dynamic_array(ssid), ssid, ssid_len);
3582                 __entry->bss_type = bss_type;
3583                 __entry->privacy = privacy;
3584         ),
3585         TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", %pM"
3586                   ", buf: %#.2x, bss_type: %d, privacy: %d",
3587                   WIPHY_PR_ARG, CHAN_PR_ARG, __entry->bssid,
3588                   ((u8 *)__get_dynamic_array(ssid))[0], __entry->bss_type,
3589                   __entry->privacy)
3590 );
3591
3592 TRACE_EVENT(cfg80211_inform_bss_frame,
3593         TP_PROTO(struct wiphy *wiphy, struct cfg80211_inform_bss *data,
3594                  struct ieee80211_mgmt *mgmt, size_t len),
3595         TP_ARGS(wiphy, data, mgmt, len),
3596         TP_STRUCT__entry(
3597                 WIPHY_ENTRY
3598                 CHAN_ENTRY
3599                 __dynamic_array(u8, mgmt, len)
3600                 __field(s32, signal)
3601                 __field(u64, ts_boottime)
3602                 __field(u64, parent_tsf)
3603                 MAC_ENTRY(parent_bssid)
3604         ),
3605         TP_fast_assign(
3606                 WIPHY_ASSIGN;
3607                 CHAN_ASSIGN(data->chan);
3608                 if (mgmt)
3609                         memcpy(__get_dynamic_array(mgmt), mgmt, len);
3610                 __entry->signal = data->signal;
3611                 __entry->ts_boottime = data->boottime_ns;
3612                 __entry->parent_tsf = data->parent_tsf;
3613                 MAC_ASSIGN(parent_bssid, data->parent_bssid);
3614         ),
3615         TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT
3616                   "signal: %d, tsb:%llu, detect_tsf:%llu, tsf_bssid: %pM",
3617                   WIPHY_PR_ARG, CHAN_PR_ARG,
3618                   __entry->signal, (unsigned long long)__entry->ts_boottime,
3619                   (unsigned long long)__entry->parent_tsf,
3620                   __entry->parent_bssid)
3621 );
3622
3623 DECLARE_EVENT_CLASS(cfg80211_bss_evt,
3624         TP_PROTO(struct cfg80211_bss *pub),
3625         TP_ARGS(pub),
3626         TP_STRUCT__entry(
3627                 MAC_ENTRY(bssid)
3628                 CHAN_ENTRY
3629         ),
3630         TP_fast_assign(
3631                 MAC_ASSIGN(bssid, pub->bssid);
3632                 CHAN_ASSIGN(pub->channel);
3633         ),
3634         TP_printk("%pM, " CHAN_PR_FMT, __entry->bssid, CHAN_PR_ARG)
3635 );
3636
3637 DEFINE_EVENT(cfg80211_bss_evt, cfg80211_return_bss,
3638         TP_PROTO(struct cfg80211_bss *pub),
3639         TP_ARGS(pub)
3640 );
3641
3642 TRACE_EVENT(cfg80211_return_uint,
3643         TP_PROTO(unsigned int ret),
3644         TP_ARGS(ret),
3645         TP_STRUCT__entry(
3646                 __field(unsigned int, ret)
3647         ),
3648         TP_fast_assign(
3649                 __entry->ret = ret;
3650         ),
3651         TP_printk("ret: %d", __entry->ret)
3652 );
3653
3654 TRACE_EVENT(cfg80211_return_u32,
3655         TP_PROTO(u32 ret),
3656         TP_ARGS(ret),
3657         TP_STRUCT__entry(
3658                 __field(u32, ret)
3659         ),
3660         TP_fast_assign(
3661                 __entry->ret = ret;
3662         ),
3663         TP_printk("ret: %u", __entry->ret)
3664 );
3665
3666 TRACE_EVENT(cfg80211_report_wowlan_wakeup,
3667         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
3668                  struct cfg80211_wowlan_wakeup *wakeup),
3669         TP_ARGS(wiphy, wdev, wakeup),
3670         TP_STRUCT__entry(
3671                 WIPHY_ENTRY
3672                 WDEV_ENTRY
3673                 __field(bool, non_wireless)
3674                 __field(bool, disconnect)
3675                 __field(bool, magic_pkt)
3676                 __field(bool, gtk_rekey_failure)
3677                 __field(bool, eap_identity_req)
3678                 __field(bool, four_way_handshake)
3679                 __field(bool, rfkill_release)
3680                 __field(s32, pattern_idx)
3681                 __field(u32, packet_len)
3682                 __dynamic_array(u8, packet,
3683                                 wakeup ? wakeup->packet_present_len : 0)
3684         ),
3685         TP_fast_assign(
3686                 WIPHY_ASSIGN;
3687                 WDEV_ASSIGN;
3688                 __entry->non_wireless = !wakeup;
3689                 __entry->disconnect = wakeup ? wakeup->disconnect : false;
3690                 __entry->magic_pkt = wakeup ? wakeup->magic_pkt : false;
3691                 __entry->gtk_rekey_failure = wakeup ? wakeup->gtk_rekey_failure : false;
3692                 __entry->eap_identity_req = wakeup ? wakeup->eap_identity_req : false;
3693                 __entry->four_way_handshake = wakeup ? wakeup->four_way_handshake : false;
3694                 __entry->rfkill_release = wakeup ? wakeup->rfkill_release : false;
3695                 __entry->pattern_idx = wakeup ? wakeup->pattern_idx : false;
3696                 __entry->packet_len = wakeup ? wakeup->packet_len : false;
3697                 if (wakeup && wakeup->packet && wakeup->packet_present_len)
3698                         memcpy(__get_dynamic_array(packet), wakeup->packet,
3699                                wakeup->packet_present_len);
3700         ),
3701         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT, WIPHY_PR_ARG, WDEV_PR_ARG)
3702 );
3703
3704 TRACE_EVENT(cfg80211_ft_event,
3705         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3706                  struct cfg80211_ft_event_params *ft_event),
3707         TP_ARGS(wiphy, netdev, ft_event),
3708         TP_STRUCT__entry(
3709                 WIPHY_ENTRY
3710                 NETDEV_ENTRY
3711                 __dynamic_array(u8, ies, ft_event->ies_len)
3712                 MAC_ENTRY(target_ap)
3713                 __dynamic_array(u8, ric_ies, ft_event->ric_ies_len)
3714         ),
3715         TP_fast_assign(
3716                 WIPHY_ASSIGN;
3717                 NETDEV_ASSIGN;
3718                 if (ft_event->ies)
3719                         memcpy(__get_dynamic_array(ies), ft_event->ies,
3720                                ft_event->ies_len);
3721                 MAC_ASSIGN(target_ap, ft_event->target_ap);
3722                 if (ft_event->ric_ies)
3723                         memcpy(__get_dynamic_array(ric_ies), ft_event->ric_ies,
3724                                ft_event->ric_ies_len);
3725         ),
3726         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", target_ap: %pM",
3727                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->target_ap)
3728 );
3729
3730 TRACE_EVENT(cfg80211_stop_iface,
3731         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
3732         TP_ARGS(wiphy, wdev),
3733         TP_STRUCT__entry(
3734                 WIPHY_ENTRY
3735                 WDEV_ENTRY
3736         ),
3737         TP_fast_assign(
3738                 WIPHY_ASSIGN;
3739                 WDEV_ASSIGN;
3740         ),
3741         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT,
3742                   WIPHY_PR_ARG, WDEV_PR_ARG)
3743 );
3744
3745 TRACE_EVENT(cfg80211_pmsr_report,
3746         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
3747                  u64 cookie, const u8 *addr),
3748         TP_ARGS(wiphy, wdev, cookie, addr),
3749         TP_STRUCT__entry(
3750                 WIPHY_ENTRY
3751                 WDEV_ENTRY
3752                 __field(u64, cookie)
3753                 MAC_ENTRY(addr)
3754         ),
3755         TP_fast_assign(
3756                 WIPHY_ASSIGN;
3757                 WDEV_ASSIGN;
3758                 __entry->cookie = cookie;
3759                 MAC_ASSIGN(addr, addr);
3760         ),
3761         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie:%lld, %pM",
3762                   WIPHY_PR_ARG, WDEV_PR_ARG,
3763                   (unsigned long long)__entry->cookie,
3764                   __entry->addr)
3765 );
3766
3767 TRACE_EVENT(cfg80211_pmsr_complete,
3768         TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, u64 cookie),
3769         TP_ARGS(wiphy, wdev, cookie),
3770         TP_STRUCT__entry(
3771                 WIPHY_ENTRY
3772                 WDEV_ENTRY
3773                 __field(u64, cookie)
3774         ),
3775         TP_fast_assign(
3776                 WIPHY_ASSIGN;
3777                 WDEV_ASSIGN;
3778                 __entry->cookie = cookie;
3779         ),
3780         TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", cookie:%lld",
3781                   WIPHY_PR_ARG, WDEV_PR_ARG,
3782                   (unsigned long long)__entry->cookie)
3783 );
3784
3785 TRACE_EVENT(cfg80211_update_owe_info_event,
3786         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3787                  struct cfg80211_update_owe_info *owe_info),
3788         TP_ARGS(wiphy, netdev, owe_info),
3789         TP_STRUCT__entry(
3790                 WIPHY_ENTRY
3791                 NETDEV_ENTRY
3792                 MAC_ENTRY(peer)
3793                 __dynamic_array(u8, ie, owe_info->ie_len)
3794                 __field(int, assoc_link_id)
3795                 MAC_ENTRY(peer_mld_addr)
3796         ),
3797         TP_fast_assign(
3798                 WIPHY_ASSIGN;
3799                 NETDEV_ASSIGN;
3800                 MAC_ASSIGN(peer, owe_info->peer);
3801                 memcpy(__get_dynamic_array(ie), owe_info->ie,
3802                        owe_info->ie_len);
3803                 __entry->assoc_link_id = owe_info->assoc_link_id;
3804                 MAC_ASSIGN(peer_mld_addr, owe_info->peer_mld_addr);
3805         ),
3806         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: %pM,"
3807                   " assoc_link_id: %d, peer_mld_addr: %pM",
3808                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->peer,
3809                   __entry->assoc_link_id, __entry->peer_mld_addr)
3810 );
3811
3812 TRACE_EVENT(cfg80211_bss_color_notify,
3813         TP_PROTO(struct net_device *netdev,
3814                  enum nl80211_commands cmd,
3815                  u8 count, u64 color_bitmap),
3816         TP_ARGS(netdev, cmd, count, color_bitmap),
3817         TP_STRUCT__entry(
3818                 NETDEV_ENTRY
3819                 __field(u32, cmd)
3820                 __field(u8, count)
3821                 __field(u64, color_bitmap)
3822         ),
3823         TP_fast_assign(
3824                 NETDEV_ASSIGN;
3825                 __entry->cmd = cmd;
3826                 __entry->count = count;
3827                 __entry->color_bitmap = color_bitmap;
3828         ),
3829         TP_printk(NETDEV_PR_FMT ", cmd: %x, count: %u, bitmap: %llx",
3830                   NETDEV_PR_ARG, __entry->cmd, __entry->count,
3831                   __entry->color_bitmap)
3832 );
3833
3834 TRACE_EVENT(cfg80211_assoc_comeback,
3835         TP_PROTO(struct wireless_dev *wdev, const u8 *ap_addr, u32 timeout),
3836         TP_ARGS(wdev, ap_addr, timeout),
3837         TP_STRUCT__entry(
3838                 WDEV_ENTRY
3839                 MAC_ENTRY(ap_addr)
3840                 __field(u32, timeout)
3841         ),
3842         TP_fast_assign(
3843                 WDEV_ASSIGN;
3844                 MAC_ASSIGN(ap_addr, ap_addr);
3845                 __entry->timeout = timeout;
3846         ),
3847         TP_printk(WDEV_PR_FMT ", %pM, timeout: %u TUs",
3848                   WDEV_PR_ARG, __entry->ap_addr, __entry->timeout)
3849 );
3850
3851 DECLARE_EVENT_CLASS(link_station_add_mod,
3852         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3853                  struct link_station_parameters *params),
3854         TP_ARGS(wiphy, netdev, params),
3855         TP_STRUCT__entry(
3856                 WIPHY_ENTRY
3857                 NETDEV_ENTRY
3858                 __array(u8, mld_mac, 6)
3859                 __array(u8, link_mac, 6)
3860                 __field(u32, link_id)
3861                 __dynamic_array(u8, supported_rates,
3862                                 params->supported_rates_len)
3863                 __array(u8, ht_capa, (int)sizeof(struct ieee80211_ht_cap))
3864                 __array(u8, vht_capa, (int)sizeof(struct ieee80211_vht_cap))
3865                 __field(u8, opmode_notif)
3866                 __field(bool, opmode_notif_used)
3867                 __dynamic_array(u8, he_capa, params->he_capa_len)
3868                 __array(u8, he_6ghz_capa, (int)sizeof(struct ieee80211_he_6ghz_capa))
3869                 __dynamic_array(u8, eht_capa, params->eht_capa_len)
3870         ),
3871         TP_fast_assign(
3872                 WIPHY_ASSIGN;
3873                 NETDEV_ASSIGN;
3874                 memset(__entry->mld_mac, 0, 6);
3875                 memset(__entry->link_mac, 0, 6);
3876                 if (params->mld_mac)
3877                         memcpy(__entry->mld_mac, params->mld_mac, 6);
3878                 if (params->link_mac)
3879                         memcpy(__entry->link_mac, params->link_mac, 6);
3880                 __entry->link_id = params->link_id;
3881                 if (params->supported_rates && params->supported_rates_len)
3882                         memcpy(__get_dynamic_array(supported_rates),
3883                                params->supported_rates,
3884                                params->supported_rates_len);
3885                 memset(__entry->ht_capa, 0, sizeof(struct ieee80211_ht_cap));
3886                 if (params->ht_capa)
3887                         memcpy(__entry->ht_capa, params->ht_capa,
3888                                sizeof(struct ieee80211_ht_cap));
3889                 memset(__entry->vht_capa, 0, sizeof(struct ieee80211_vht_cap));
3890                 if (params->vht_capa)
3891                         memcpy(__entry->vht_capa, params->vht_capa,
3892                                sizeof(struct ieee80211_vht_cap));
3893                 __entry->opmode_notif = params->opmode_notif;
3894                 __entry->opmode_notif_used = params->opmode_notif_used;
3895                 if (params->he_capa && params->he_capa_len)
3896                         memcpy(__get_dynamic_array(he_capa), params->he_capa,
3897                                params->he_capa_len);
3898                 memset(__entry->he_6ghz_capa, 0, sizeof(struct ieee80211_he_6ghz_capa));
3899                 if (params->he_6ghz_capa)
3900                         memcpy(__entry->he_6ghz_capa, params->he_6ghz_capa,
3901                                sizeof(struct ieee80211_he_6ghz_capa));
3902                 if (params->eht_capa && params->eht_capa_len)
3903                         memcpy(__get_dynamic_array(eht_capa), params->eht_capa,
3904                                params->eht_capa_len);
3905         ),
3906         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM"
3907                   ", link mac: %pM, link id: %u",
3908                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->mld_mac,
3909                   __entry->link_mac, __entry->link_id)
3910 );
3911
3912 DEFINE_EVENT(link_station_add_mod, rdev_add_link_station,
3913         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3914                  struct link_station_parameters *params),
3915         TP_ARGS(wiphy, netdev, params)
3916 );
3917
3918 DEFINE_EVENT(link_station_add_mod, rdev_mod_link_station,
3919         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3920                  struct link_station_parameters *params),
3921         TP_ARGS(wiphy, netdev, params)
3922 );
3923
3924 TRACE_EVENT(rdev_del_link_station,
3925         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3926                  struct link_station_del_parameters *params),
3927         TP_ARGS(wiphy, netdev, params),
3928         TP_STRUCT__entry(
3929                 WIPHY_ENTRY
3930                 NETDEV_ENTRY
3931                 __array(u8, mld_mac, 6)
3932                 __field(u32, link_id)
3933         ),
3934         TP_fast_assign(
3935                 WIPHY_ASSIGN;
3936                 NETDEV_ASSIGN;
3937                 memset(__entry->mld_mac, 0, 6);
3938                 if (params->mld_mac)
3939                         memcpy(__entry->mld_mac, params->mld_mac, 6);
3940                 __entry->link_id = params->link_id;
3941         ),
3942         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: %pM"
3943                   ", link id: %u",
3944                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->mld_mac,
3945                   __entry->link_id)
3946 );
3947
3948 TRACE_EVENT(rdev_set_hw_timestamp,
3949         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3950                  struct cfg80211_set_hw_timestamp *hwts),
3951
3952         TP_ARGS(wiphy, netdev, hwts),
3953
3954         TP_STRUCT__entry(
3955                 WIPHY_ENTRY
3956                 NETDEV_ENTRY
3957                 MAC_ENTRY(macaddr)
3958                 __field(bool, enable)
3959         ),
3960
3961         TP_fast_assign(
3962                 WIPHY_ASSIGN;
3963                 NETDEV_ASSIGN;
3964                 MAC_ASSIGN(macaddr, hwts->macaddr);
3965                 __entry->enable = hwts->enable;
3966         ),
3967
3968         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", mac %pM, enable: %u",
3969                   WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->macaddr,
3970                   __entry->enable)
3971 );
3972
3973 TRACE_EVENT(cfg80211_links_removed,
3974         TP_PROTO(struct net_device *netdev, u16 link_mask),
3975         TP_ARGS(netdev, link_mask),
3976         TP_STRUCT__entry(
3977                 NETDEV_ENTRY
3978                 __field(u16, link_mask)
3979         ),
3980         TP_fast_assign(
3981                 NETDEV_ASSIGN;
3982                 __entry->link_mask = link_mask;
3983         ),
3984         TP_printk(NETDEV_PR_FMT ", link_mask:%u", NETDEV_PR_ARG,
3985                   __entry->link_mask)
3986 );
3987
3988 TRACE_EVENT(rdev_set_ttlm,
3989         TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
3990                  struct cfg80211_ttlm_params *params),
3991         TP_ARGS(wiphy, netdev, params),
3992         TP_STRUCT__entry(
3993                 WIPHY_ENTRY
3994                 NETDEV_ENTRY
3995                 __array(u8, dlink, sizeof(u16) * 8)
3996                 __array(u8, ulink, sizeof(u16) * 8)
3997         ),
3998         TP_fast_assign(
3999                 WIPHY_ASSIGN;
4000                 NETDEV_ASSIGN;
4001                 memcpy(__entry->dlink, params->dlink, sizeof(params->dlink));
4002                 memcpy(__entry->ulink, params->ulink, sizeof(params->ulink));
4003         ),
4004         TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT,
4005                   WIPHY_PR_ARG, NETDEV_PR_ARG)
4006 );
4007
4008 #endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
4009
4010 #undef TRACE_INCLUDE_PATH
4011 #define TRACE_INCLUDE_PATH .
4012 #undef TRACE_INCLUDE_FILE
4013 #define TRACE_INCLUDE_FILE trace
4014 #include <trace/define_trace.h>