blob: b3fde5f7b9bc00e69aa80928dafc2f35dd9a136c [file] [log] [blame]
Reinette Chatrebb5d2db2010-01-15 13:42:59 -08001/******************************************************************************
2 *
Wey-Yi Guyfb4961d2012-01-06 13:16:33 -08003 * Copyright(c) 2009 - 2012 Intel Corporation. All rights reserved.
Reinette Chatrebb5d2db2010-01-15 13:42:59 -08004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
Johannes Bergbe1a71a2009-10-02 13:44:02 -070027#if !defined(__IWLWIFI_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ)
Johannes Bergf042c2e2012-09-05 22:34:44 +020028#include <linux/skbuff.h>
29#include <linux/ieee80211.h>
30#include <net/cfg80211.h>
31#include "iwl-trans.h"
32#if !defined(__IWLWIFI_DEVICE_TRACE)
33static inline bool iwl_trace_data(struct sk_buff *skb)
34{
35 struct ieee80211_hdr *hdr = (void *)skb->data;
36
37 if (ieee80211_is_data(hdr->frame_control))
38 return skb->protocol != cpu_to_be16(ETH_P_PAE);
39 return false;
40}
41
42static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans,
43 void *rxbuf, size_t len)
44{
45 struct iwl_cmd_header *cmd = (void *)((u8 *)rxbuf + sizeof(__le32));
46 struct ieee80211_hdr *hdr;
47
48 if (cmd->cmd != trans->rx_mpdu_cmd)
49 return len;
50
51 hdr = (void *)((u8 *)cmd + sizeof(struct iwl_cmd_header) +
52 trans->rx_mpdu_cmd_hdr_size);
53 if (!ieee80211_is_data(hdr->frame_control))
54 return len;
55 /* maybe try to identify EAPOL frames? */
56 return sizeof(__le32) + sizeof(*cmd) + trans->rx_mpdu_cmd_hdr_size +
57 ieee80211_hdrlen(hdr->frame_control);
58}
59#endif
60
Johannes Bergbe1a71a2009-10-02 13:44:02 -070061#define __IWLWIFI_DEVICE_TRACE
62
63#include <linux/tracepoint.h>
Johannes Berg1023fdc2012-05-15 12:16:34 +020064#include <linux/device.h>
Johannes Berg45eab7c2012-09-05 00:33:53 +020065#include "iwl-trans.h"
Johannes Bergbe1a71a2009-10-02 13:44:02 -070066
Emmanuel Grumbach83ed9012011-08-25 23:11:14 -070067
Johannes Bergbe1a71a2009-10-02 13:44:02 -070068#if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__)
69#undef TRACE_EVENT
70#define TRACE_EVENT(name, proto, ...) \
71static inline void trace_ ## name(proto) {}
Johannes Berg2655e312012-01-31 21:08:37 -080072#undef DECLARE_EVENT_CLASS
73#define DECLARE_EVENT_CLASS(...)
74#undef DEFINE_EVENT
75#define DEFINE_EVENT(evt_class, name, proto, ...) \
76static inline void trace_ ## name(proto) {}
Johannes Bergbe1a71a2009-10-02 13:44:02 -070077#endif
78
Johannes Berg6c1011e2012-03-06 13:30:48 -080079#define DEV_ENTRY __string(dev, dev_name(dev))
80#define DEV_ASSIGN __assign_str(dev, dev_name(dev))
Johannes Bergbe1a71a2009-10-02 13:44:02 -070081
82#undef TRACE_SYSTEM
Johannes Berg0fd95af2009-11-20 12:05:02 -080083#define TRACE_SYSTEM iwlwifi_io
Johannes Bergbe1a71a2009-10-02 13:44:02 -070084
85TRACE_EVENT(iwlwifi_dev_ioread32,
Johannes Berg6c1011e2012-03-06 13:30:48 -080086 TP_PROTO(const struct device *dev, u32 offs, u32 val),
87 TP_ARGS(dev, offs, val),
Johannes Bergbe1a71a2009-10-02 13:44:02 -070088 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -080089 DEV_ENTRY
Johannes Bergbe1a71a2009-10-02 13:44:02 -070090 __field(u32, offs)
91 __field(u32, val)
92 ),
93 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -080094 DEV_ASSIGN;
Johannes Bergbe1a71a2009-10-02 13:44:02 -070095 __entry->offs = offs;
96 __entry->val = val;
97 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -080098 TP_printk("[%s] read io[%#x] = %#x",
99 __get_str(dev), __entry->offs, __entry->val)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700100);
101
Ben Cahill4e031852009-11-20 12:04:52 -0800102TRACE_EVENT(iwlwifi_dev_iowrite8,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800103 TP_PROTO(const struct device *dev, u32 offs, u8 val),
104 TP_ARGS(dev, offs, val),
Ben Cahill4e031852009-11-20 12:04:52 -0800105 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800106 DEV_ENTRY
Ben Cahill4e031852009-11-20 12:04:52 -0800107 __field(u32, offs)
108 __field(u8, val)
109 ),
110 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800111 DEV_ASSIGN;
Ben Cahill4e031852009-11-20 12:04:52 -0800112 __entry->offs = offs;
113 __entry->val = val;
114 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800115 TP_printk("[%s] write io[%#x] = %#x)",
116 __get_str(dev), __entry->offs, __entry->val)
Ben Cahill4e031852009-11-20 12:04:52 -0800117);
118
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700119TRACE_EVENT(iwlwifi_dev_iowrite32,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800120 TP_PROTO(const struct device *dev, u32 offs, u32 val),
121 TP_ARGS(dev, offs, val),
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700122 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800123 DEV_ENTRY
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700124 __field(u32, offs)
125 __field(u32, val)
126 ),
127 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800128 DEV_ASSIGN;
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700129 __entry->offs = offs;
130 __entry->val = val;
131 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800132 TP_printk("[%s] write io[%#x] = %#x)",
133 __get_str(dev), __entry->offs, __entry->val)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700134);
135
Johannes Bergb80667e2011-12-09 07:26:13 -0800136TRACE_EVENT(iwlwifi_dev_irq,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800137 TP_PROTO(const struct device *dev),
138 TP_ARGS(dev),
Johannes Bergb80667e2011-12-09 07:26:13 -0800139 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800140 DEV_ENTRY
Johannes Bergb80667e2011-12-09 07:26:13 -0800141 ),
142 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800143 DEV_ASSIGN;
Johannes Bergb80667e2011-12-09 07:26:13 -0800144 ),
145 /* TP_printk("") doesn't compile */
146 TP_printk("%d", 0)
147);
148
149TRACE_EVENT(iwlwifi_dev_ict_read,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800150 TP_PROTO(const struct device *dev, u32 index, u32 value),
151 TP_ARGS(dev, index, value),
Johannes Bergb80667e2011-12-09 07:26:13 -0800152 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800153 DEV_ENTRY
Johannes Bergb80667e2011-12-09 07:26:13 -0800154 __field(u32, index)
155 __field(u32, value)
156 ),
157 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800158 DEV_ASSIGN;
Johannes Bergb80667e2011-12-09 07:26:13 -0800159 __entry->index = index;
160 __entry->value = value;
161 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800162 TP_printk("[%s] read ict[%d] = %#.8x",
163 __get_str(dev), __entry->index, __entry->value)
Johannes Bergb80667e2011-12-09 07:26:13 -0800164);
165
Johannes Berg0fd95af2009-11-20 12:05:02 -0800166#undef TRACE_SYSTEM
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800167#define TRACE_SYSTEM iwlwifi_ucode
168
169TRACE_EVENT(iwlwifi_dev_ucode_cont_event,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800170 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
171 TP_ARGS(dev, time, data, ev),
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800172 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800173 DEV_ENTRY
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800174
175 __field(u32, time)
176 __field(u32, data)
177 __field(u32, ev)
178 ),
179 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800180 DEV_ASSIGN;
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800181 __entry->time = time;
182 __entry->data = data;
183 __entry->ev = ev;
184 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800185 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
186 __get_str(dev), __entry->time, __entry->data, __entry->ev)
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800187);
188
189TRACE_EVENT(iwlwifi_dev_ucode_wrap_event,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800190 TP_PROTO(const struct device *dev, u32 wraps, u32 n_entry, u32 p_entry),
191 TP_ARGS(dev, wraps, n_entry, p_entry),
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800192 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800193 DEV_ENTRY
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800194
195 __field(u32, wraps)
196 __field(u32, n_entry)
197 __field(u32, p_entry)
198 ),
199 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800200 DEV_ASSIGN;
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800201 __entry->wraps = wraps;
202 __entry->n_entry = n_entry;
203 __entry->p_entry = p_entry;
204 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800205 TP_printk("[%s] wraps=#%02d n=0x%X p=0x%X",
206 __get_str(dev), __entry->wraps, __entry->n_entry,
Wey-Yi Guya9e1cb62009-12-10 14:37:26 -0800207 __entry->p_entry)
208);
209
210#undef TRACE_SYSTEM
Johannes Berg2655e312012-01-31 21:08:37 -0800211#define TRACE_SYSTEM iwlwifi_msg
212
Johannes Bergeecf21a2012-06-22 15:21:02 +0200213#define MAX_MSG_LEN 110
Johannes Berg2655e312012-01-31 21:08:37 -0800214
215DECLARE_EVENT_CLASS(iwlwifi_msg_event,
216 TP_PROTO(struct va_format *vaf),
217 TP_ARGS(vaf),
218 TP_STRUCT__entry(
219 __dynamic_array(char, msg, MAX_MSG_LEN)
220 ),
221 TP_fast_assign(
222 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
223 MAX_MSG_LEN, vaf->fmt,
224 *vaf->va) >= MAX_MSG_LEN);
225 ),
Johannes Berg94bfa4a2012-06-22 19:39:23 +0200226 TP_printk("%s", __get_str(msg))
Johannes Berg2655e312012-01-31 21:08:37 -0800227);
228
229DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
230 TP_PROTO(struct va_format *vaf),
231 TP_ARGS(vaf)
232);
233
234DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
235 TP_PROTO(struct va_format *vaf),
236 TP_ARGS(vaf)
237);
238
239DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
240 TP_PROTO(struct va_format *vaf),
241 TP_ARGS(vaf)
242);
243
244DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
245 TP_PROTO(struct va_format *vaf),
246 TP_ARGS(vaf)
247);
248
249TRACE_EVENT(iwlwifi_dbg,
250 TP_PROTO(u32 level, bool in_interrupt, const char *function,
251 struct va_format *vaf),
252 TP_ARGS(level, in_interrupt, function, vaf),
253 TP_STRUCT__entry(
254 __field(u32, level)
255 __field(u8, in_interrupt)
256 __string(function, function)
257 __dynamic_array(char, msg, MAX_MSG_LEN)
258 ),
259 TP_fast_assign(
260 __entry->level = level;
261 __entry->in_interrupt = in_interrupt;
262 __assign_str(function, function);
263 WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
264 MAX_MSG_LEN, vaf->fmt,
265 *vaf->va) >= MAX_MSG_LEN);
266 ),
267 TP_printk("%s", (char *)__get_dynamic_array(msg))
268);
269
270#undef TRACE_SYSTEM
Johannes Bergf042c2e2012-09-05 22:34:44 +0200271#define TRACE_SYSTEM iwlwifi_data
272
273TRACE_EVENT(iwlwifi_dev_tx_data,
274 TP_PROTO(const struct device *dev,
275 struct sk_buff *skb,
276 void *data, size_t data_len),
277 TP_ARGS(dev, skb, data, data_len),
278 TP_STRUCT__entry(
279 DEV_ENTRY
280
281 __dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0)
282 ),
283 TP_fast_assign(
284 DEV_ASSIGN;
285 if (iwl_trace_data(skb))
286 memcpy(__get_dynamic_array(data), data, data_len);
287 ),
288 TP_printk("[%s] TX frame data", __get_str(dev))
289);
290
291TRACE_EVENT(iwlwifi_dev_rx_data,
292 TP_PROTO(const struct device *dev,
293 const struct iwl_trans *trans,
294 void *rxbuf, size_t len),
295 TP_ARGS(dev, trans, rxbuf, len),
296 TP_STRUCT__entry(
297 DEV_ENTRY
298
299 __dynamic_array(u8, data,
300 len - iwl_rx_trace_len(trans, rxbuf, len))
301 ),
302 TP_fast_assign(
303 size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
304 DEV_ASSIGN;
305 if (offs < len)
306 memcpy(__get_dynamic_array(data),
307 ((u8 *)rxbuf) + offs, len - offs);
308 ),
Johannes Berg2e6e6b12012-11-06 12:37:21 +0100309 TP_printk("[%s] RX frame data", __get_str(dev))
Johannes Bergf042c2e2012-09-05 22:34:44 +0200310);
311
312#undef TRACE_SYSTEM
Johannes Berg0fd95af2009-11-20 12:05:02 -0800313#define TRACE_SYSTEM iwlwifi
314
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700315TRACE_EVENT(iwlwifi_dev_hcmd,
Johannes Berg45eab7c2012-09-05 00:33:53 +0200316 TP_PROTO(const struct device *dev,
317 struct iwl_host_cmd *cmd, u16 total_size,
318 const void *hdr, size_t hdr_len),
319 TP_ARGS(dev, cmd, total_size, hdr, hdr_len),
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700320 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800321 DEV_ENTRY
Johannes Berg45eab7c2012-09-05 00:33:53 +0200322 __dynamic_array(u8, hcmd, total_size)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700323 __field(u32, flags)
324 ),
325 TP_fast_assign(
Johannes Berg45eab7c2012-09-05 00:33:53 +0200326 int i, offset = hdr_len;
327
Johannes Berg6c1011e2012-03-06 13:30:48 -0800328 DEV_ASSIGN;
Johannes Berg45eab7c2012-09-05 00:33:53 +0200329 __entry->flags = cmd->flags;
330 memcpy(__get_dynamic_array(hcmd), hdr, hdr_len);
331
332 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) {
333 if (!cmd->len[i])
334 continue;
335 if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY))
336 continue;
337 memcpy((u8 *)__get_dynamic_array(hcmd) + offset,
338 cmd->data[i], cmd->len[i]);
339 offset += cmd->len[i];
340 }
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700341 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800342 TP_printk("[%s] hcmd %#.2x (%ssync)",
Johannes Berg45eab7c2012-09-05 00:33:53 +0200343 __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0],
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700344 __entry->flags & CMD_ASYNC ? "a" : "")
345);
346
347TRACE_EVENT(iwlwifi_dev_rx,
Johannes Bergf042c2e2012-09-05 22:34:44 +0200348 TP_PROTO(const struct device *dev, const struct iwl_trans *trans,
349 void *rxbuf, size_t len),
350 TP_ARGS(dev, trans, rxbuf, len),
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700351 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800352 DEV_ENTRY
Johannes Bergf042c2e2012-09-05 22:34:44 +0200353 __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, rxbuf, len))
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700354 ),
355 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800356 DEV_ASSIGN;
Johannes Bergf042c2e2012-09-05 22:34:44 +0200357 memcpy(__get_dynamic_array(rxbuf), rxbuf,
358 iwl_rx_trace_len(trans, rxbuf, len));
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700359 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800360 TP_printk("[%s] RX cmd %#.2x",
361 __get_str(dev), ((u8 *)__get_dynamic_array(rxbuf))[4])
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700362);
363
364TRACE_EVENT(iwlwifi_dev_tx,
Johannes Bergf042c2e2012-09-05 22:34:44 +0200365 TP_PROTO(const struct device *dev, struct sk_buff *skb,
366 void *tfd, size_t tfdlen,
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700367 void *buf0, size_t buf0_len,
368 void *buf1, size_t buf1_len),
Johannes Bergf042c2e2012-09-05 22:34:44 +0200369 TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700370 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800371 DEV_ENTRY
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700372
373 __field(size_t, framelen)
374 __dynamic_array(u8, tfd, tfdlen)
375
376 /*
377 * Do not insert between or below these items,
378 * we want to keep the frame together (except
379 * for the possible padding).
380 */
381 __dynamic_array(u8, buf0, buf0_len)
Johannes Bergf042c2e2012-09-05 22:34:44 +0200382 __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700383 ),
384 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800385 DEV_ASSIGN;
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700386 __entry->framelen = buf0_len + buf1_len;
387 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
388 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
Johannes Bergf042c2e2012-09-05 22:34:44 +0200389 if (!iwl_trace_data(skb))
390 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700391 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800392 TP_printk("[%s] TX %.2x (%zu bytes)",
393 __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0],
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700394 __entry->framelen)
395);
396
397TRACE_EVENT(iwlwifi_dev_ucode_error,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800398 TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low,
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700399 u32 data1, u32 data2, u32 line, u32 blink1,
Wey-Yi Guy50650542011-05-04 16:56:52 -0700400 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
401 u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver,
402 u32 brd_ver),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800403 TP_ARGS(dev, desc, tsf_low, data1, data2, line,
Wey-Yi Guy50650542011-05-04 16:56:52 -0700404 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
405 gp3, ucode_ver, hw_ver, brd_ver),
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700406 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800407 DEV_ENTRY
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700408 __field(u32, desc)
Wey-Yi Guy50650542011-05-04 16:56:52 -0700409 __field(u32, tsf_low)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700410 __field(u32, data1)
411 __field(u32, data2)
412 __field(u32, line)
413 __field(u32, blink1)
414 __field(u32, blink2)
415 __field(u32, ilink1)
416 __field(u32, ilink2)
Wey-Yi Guy50650542011-05-04 16:56:52 -0700417 __field(u32, bcon_time)
418 __field(u32, gp1)
419 __field(u32, gp2)
420 __field(u32, gp3)
421 __field(u32, ucode_ver)
422 __field(u32, hw_ver)
423 __field(u32, brd_ver)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700424 ),
425 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800426 DEV_ASSIGN;
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700427 __entry->desc = desc;
Wey-Yi Guy50650542011-05-04 16:56:52 -0700428 __entry->tsf_low = tsf_low;
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700429 __entry->data1 = data1;
430 __entry->data2 = data2;
431 __entry->line = line;
432 __entry->blink1 = blink1;
433 __entry->blink2 = blink2;
434 __entry->ilink1 = ilink1;
435 __entry->ilink2 = ilink2;
Wey-Yi Guy50650542011-05-04 16:56:52 -0700436 __entry->bcon_time = bcon_time;
437 __entry->gp1 = gp1;
438 __entry->gp2 = gp2;
439 __entry->gp3 = gp3;
440 __entry->ucode_ver = ucode_ver;
441 __entry->hw_ver = hw_ver;
442 __entry->brd_ver = brd_ver;
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700443 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800444 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
Wey-Yi Guy50650542011-05-04 16:56:52 -0700445 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
446 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X "
447 "hw 0x%08X brd 0x%08X",
Johannes Berg6c1011e2012-03-06 13:30:48 -0800448 __get_str(dev), __entry->desc, __entry->tsf_low,
Wey-Yi Guy50650542011-05-04 16:56:52 -0700449 __entry->data1,
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700450 __entry->data2, __entry->line, __entry->blink1,
Wey-Yi Guy50650542011-05-04 16:56:52 -0700451 __entry->blink2, __entry->ilink1, __entry->ilink2,
452 __entry->bcon_time, __entry->gp1, __entry->gp2,
453 __entry->gp3, __entry->ucode_ver, __entry->hw_ver,
454 __entry->brd_ver)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700455);
456
457TRACE_EVENT(iwlwifi_dev_ucode_event,
Johannes Berg6c1011e2012-03-06 13:30:48 -0800458 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
459 TP_ARGS(dev, time, data, ev),
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700460 TP_STRUCT__entry(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800461 DEV_ENTRY
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700462
463 __field(u32, time)
464 __field(u32, data)
465 __field(u32, ev)
466 ),
467 TP_fast_assign(
Johannes Berg6c1011e2012-03-06 13:30:48 -0800468 DEV_ASSIGN;
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700469 __entry->time = time;
470 __entry->data = data;
471 __entry->ev = ev;
472 ),
Johannes Berg6c1011e2012-03-06 13:30:48 -0800473 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
474 __get_str(dev), __entry->time, __entry->data, __entry->ev)
Johannes Bergbe1a71a2009-10-02 13:44:02 -0700475);
476#endif /* __IWLWIFI_DEVICE_TRACE */
477
478#undef TRACE_INCLUDE_PATH
479#define TRACE_INCLUDE_PATH .
480#undef TRACE_INCLUDE_FILE
481#define TRACE_INCLUDE_FILE iwl-devtrace
482#include <trace/define_trace.h>