1 /******************************************************************************
3 * Copyright(c) 2009 - 2011 Intel Corporation. All rights reserved.
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.
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
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
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25 *****************************************************************************/
27 #if !defined(__IWLWIFI_LEGACY_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ)
28 #define __IWLWIFI_LEGACY_DEVICE_TRACE
30 #include <linux/tracepoint.h>
32 #if !defined(CONFIG_IWLWIFI_LEGACY_DEVICE_TRACING) || defined(__CHECKER__)
34 #define TRACE_EVENT(name, proto, ...) \
35 static inline void trace_ ## name(proto) {}
39 #define PRIV_ENTRY __field(struct iwl_priv *, priv)
40 #define PRIV_ASSIGN (__entry->priv = priv)
43 #define TRACE_SYSTEM iwlwifi_legacy_io
45 TRACE_EVENT(iwlwifi_legacy_dev_ioread32
,
46 TP_PROTO(struct iwl_priv
*priv
, u32 offs
, u32 val
),
47 TP_ARGS(priv
, offs
, val
),
58 TP_printk("[%p] read io[%#x] = %#x", __entry
->priv
,
59 __entry
->offs
, __entry
->val
)
62 TRACE_EVENT(iwlwifi_legacy_dev_iowrite8
,
63 TP_PROTO(struct iwl_priv
*priv
, u32 offs
, u8 val
),
64 TP_ARGS(priv
, offs
, val
),
75 TP_printk("[%p] write io[%#x] = %#x)", __entry
->priv
,
76 __entry
->offs
, __entry
->val
)
79 TRACE_EVENT(iwlwifi_legacy_dev_iowrite32
,
80 TP_PROTO(struct iwl_priv
*priv
, u32 offs
, u32 val
),
81 TP_ARGS(priv
, offs
, val
),
92 TP_printk("[%p] write io[%#x] = %#x)", __entry
->priv
,
93 __entry
->offs
, __entry
->val
)
97 #define TRACE_SYSTEM iwlwifi_legacy_ucode
100 #define TRACE_SYSTEM iwlwifi
102 TRACE_EVENT(iwlwifi_legacy_dev_hcmd
,
103 TP_PROTO(struct iwl_priv
*priv
, void *hcmd
, size_t len
, u32 flags
),
104 TP_ARGS(priv
, hcmd
, len
, flags
),
107 __dynamic_array(u8
, hcmd
, len
)
112 memcpy(__get_dynamic_array(hcmd
), hcmd
, len
);
113 __entry
->flags
= flags
;
115 TP_printk("[%p] hcmd %#.2x (%ssync)",
116 __entry
->priv
, ((u8
*)__get_dynamic_array(hcmd
))[0],
117 __entry
->flags
& CMD_ASYNC
? "a" : "")
120 TRACE_EVENT(iwlwifi_legacy_dev_rx
,
121 TP_PROTO(struct iwl_priv
*priv
, void *rxbuf
, size_t len
),
122 TP_ARGS(priv
, rxbuf
, len
),
125 __dynamic_array(u8
, rxbuf
, len
)
129 memcpy(__get_dynamic_array(rxbuf
), rxbuf
, len
);
131 TP_printk("[%p] RX cmd %#.2x",
132 __entry
->priv
, ((u8
*)__get_dynamic_array(rxbuf
))[4])
135 TRACE_EVENT(iwlwifi_legacy_dev_tx
,
136 TP_PROTO(struct iwl_priv
*priv
, void *tfd
, size_t tfdlen
,
137 void *buf0
, size_t buf0_len
,
138 void *buf1
, size_t buf1_len
),
139 TP_ARGS(priv
, tfd
, tfdlen
, buf0
, buf0_len
, buf1
, buf1_len
),
143 __field(size_t, framelen
)
144 __dynamic_array(u8
, tfd
, tfdlen
)
147 * Do not insert between or below these items,
148 * we want to keep the frame together (except
149 * for the possible padding).
151 __dynamic_array(u8
, buf0
, buf0_len
)
152 __dynamic_array(u8
, buf1
, buf1_len
)
156 __entry
->framelen
= buf0_len
+ buf1_len
;
157 memcpy(__get_dynamic_array(tfd
), tfd
, tfdlen
);
158 memcpy(__get_dynamic_array(buf0
), buf0
, buf0_len
);
159 memcpy(__get_dynamic_array(buf1
), buf1
, buf1_len
);
161 TP_printk("[%p] TX %.2x (%zu bytes)",
163 ((u8
*)__get_dynamic_array(buf0
))[0],
167 TRACE_EVENT(iwlwifi_legacy_dev_ucode_error
,
168 TP_PROTO(struct iwl_priv
*priv
, u32 desc
, u32 time
,
169 u32 data1
, u32 data2
, u32 line
, u32 blink1
,
170 u32 blink2
, u32 ilink1
, u32 ilink2
),
171 TP_ARGS(priv
, desc
, time
, data1
, data2
, line
,
172 blink1
, blink2
, ilink1
, ilink2
),
187 __entry
->desc
= desc
;
188 __entry
->time
= time
;
189 __entry
->data1
= data1
;
190 __entry
->data2
= data2
;
191 __entry
->line
= line
;
192 __entry
->blink1
= blink1
;
193 __entry
->blink2
= blink2
;
194 __entry
->ilink1
= ilink1
;
195 __entry
->ilink2
= ilink2
;
197 TP_printk("[%p] #%02d %010u data 0x%08X 0x%08X line %u, "
198 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X",
199 __entry
->priv
, __entry
->desc
, __entry
->time
, __entry
->data1
,
200 __entry
->data2
, __entry
->line
, __entry
->blink1
,
201 __entry
->blink2
, __entry
->ilink1
, __entry
->ilink2
)
204 #endif /* __IWLWIFI_DEVICE_TRACE */
206 #undef TRACE_INCLUDE_PATH
207 #define TRACE_INCLUDE_PATH .
208 #undef TRACE_INCLUDE_FILE
209 #define TRACE_INCLUDE_FILE iwl-devtrace
210 #include <trace/define_trace.h>