Merge branch 'akpm'
[linux-2.6/next.git] / drivers / net / wireless / iwlwifi / iwl-devtrace.h
blob2c84ba95afca77f70cbdc9171552dacfa7853fcc
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
12 * more details.
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_DEVICE_TRACE) || defined(TRACE_HEADER_MULTI_READ)
28 #define __IWLWIFI_DEVICE_TRACE
30 #include <linux/tracepoint.h>
32 #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__)
33 #undef TRACE_EVENT
34 #define TRACE_EVENT(name, proto, ...) \
35 static inline void trace_ ## name(proto) {}
36 #endif
38 #define PRIV_ENTRY __field(struct iwl_priv *, priv)
39 #define PRIV_ASSIGN __entry->priv = priv
41 #undef TRACE_SYSTEM
42 #define TRACE_SYSTEM iwlwifi_io
44 TRACE_EVENT(iwlwifi_dev_ioread32,
45 TP_PROTO(struct iwl_priv *priv, u32 offs, u32 val),
46 TP_ARGS(priv, offs, val),
47 TP_STRUCT__entry(
48 PRIV_ENTRY
49 __field(u32, offs)
50 __field(u32, val)
52 TP_fast_assign(
53 PRIV_ASSIGN;
54 __entry->offs = offs;
55 __entry->val = val;
57 TP_printk("[%p] read io[%#x] = %#x", __entry->priv, __entry->offs, __entry->val)
60 TRACE_EVENT(iwlwifi_dev_iowrite8,
61 TP_PROTO(struct iwl_priv *priv, u32 offs, u8 val),
62 TP_ARGS(priv, offs, val),
63 TP_STRUCT__entry(
64 PRIV_ENTRY
65 __field(u32, offs)
66 __field(u8, val)
68 TP_fast_assign(
69 PRIV_ASSIGN;
70 __entry->offs = offs;
71 __entry->val = val;
73 TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val)
76 TRACE_EVENT(iwlwifi_dev_iowrite32,
77 TP_PROTO(struct iwl_priv *priv, u32 offs, u32 val),
78 TP_ARGS(priv, offs, val),
79 TP_STRUCT__entry(
80 PRIV_ENTRY
81 __field(u32, offs)
82 __field(u32, val)
84 TP_fast_assign(
85 PRIV_ASSIGN;
86 __entry->offs = offs;
87 __entry->val = val;
89 TP_printk("[%p] write io[%#x] = %#x)", __entry->priv, __entry->offs, __entry->val)
92 #undef TRACE_SYSTEM
93 #define TRACE_SYSTEM iwlwifi_ucode
95 TRACE_EVENT(iwlwifi_dev_ucode_cont_event,
96 TP_PROTO(struct iwl_priv *priv, u32 time, u32 data, u32 ev),
97 TP_ARGS(priv, time, data, ev),
98 TP_STRUCT__entry(
99 PRIV_ENTRY
101 __field(u32, time)
102 __field(u32, data)
103 __field(u32, ev)
105 TP_fast_assign(
106 PRIV_ASSIGN;
107 __entry->time = time;
108 __entry->data = data;
109 __entry->ev = ev;
111 TP_printk("[%p] EVT_LOGT:%010u:0x%08x:%04u",
112 __entry->priv, __entry->time, __entry->data, __entry->ev)
115 TRACE_EVENT(iwlwifi_dev_ucode_wrap_event,
116 TP_PROTO(struct iwl_priv *priv, u32 wraps, u32 n_entry, u32 p_entry),
117 TP_ARGS(priv, wraps, n_entry, p_entry),
118 TP_STRUCT__entry(
119 PRIV_ENTRY
121 __field(u32, wraps)
122 __field(u32, n_entry)
123 __field(u32, p_entry)
125 TP_fast_assign(
126 PRIV_ASSIGN;
127 __entry->wraps = wraps;
128 __entry->n_entry = n_entry;
129 __entry->p_entry = p_entry;
131 TP_printk("[%p] wraps=#%02d n=0x%X p=0x%X",
132 __entry->priv, __entry->wraps, __entry->n_entry,
133 __entry->p_entry)
136 #undef TRACE_SYSTEM
137 #define TRACE_SYSTEM iwlwifi
139 TRACE_EVENT(iwlwifi_dev_hcmd,
140 TP_PROTO(struct iwl_priv *priv, u32 flags,
141 const void *hcmd0, size_t len0,
142 const void *hcmd1, size_t len1,
143 const void *hcmd2, size_t len2),
144 TP_ARGS(priv, flags, hcmd0, len0, hcmd1, len1, hcmd2, len2),
145 TP_STRUCT__entry(
146 PRIV_ENTRY
147 __dynamic_array(u8, hcmd0, len0)
148 __dynamic_array(u8, hcmd1, len1)
149 __dynamic_array(u8, hcmd2, len2)
150 __field(u32, flags)
152 TP_fast_assign(
153 PRIV_ASSIGN;
154 memcpy(__get_dynamic_array(hcmd0), hcmd0, len0);
155 memcpy(__get_dynamic_array(hcmd1), hcmd1, len1);
156 memcpy(__get_dynamic_array(hcmd2), hcmd2, len2);
157 __entry->flags = flags;
159 TP_printk("[%p] hcmd %#.2x (%ssync)",
160 __entry->priv, ((u8 *)__get_dynamic_array(hcmd0))[0],
161 __entry->flags & CMD_ASYNC ? "a" : "")
164 TRACE_EVENT(iwlwifi_dev_rx,
165 TP_PROTO(struct iwl_priv *priv, void *rxbuf, size_t len),
166 TP_ARGS(priv, rxbuf, len),
167 TP_STRUCT__entry(
168 PRIV_ENTRY
169 __dynamic_array(u8, rxbuf, len)
171 TP_fast_assign(
172 PRIV_ASSIGN;
173 memcpy(__get_dynamic_array(rxbuf), rxbuf, len);
175 TP_printk("[%p] RX cmd %#.2x",
176 __entry->priv, ((u8 *)__get_dynamic_array(rxbuf))[4])
179 TRACE_EVENT(iwlwifi_dev_tx,
180 TP_PROTO(struct iwl_priv *priv, void *tfd, size_t tfdlen,
181 void *buf0, size_t buf0_len,
182 void *buf1, size_t buf1_len),
183 TP_ARGS(priv, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
184 TP_STRUCT__entry(
185 PRIV_ENTRY
187 __field(size_t, framelen)
188 __dynamic_array(u8, tfd, tfdlen)
191 * Do not insert between or below these items,
192 * we want to keep the frame together (except
193 * for the possible padding).
195 __dynamic_array(u8, buf0, buf0_len)
196 __dynamic_array(u8, buf1, buf1_len)
198 TP_fast_assign(
199 PRIV_ASSIGN;
200 __entry->framelen = buf0_len + buf1_len;
201 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
202 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
203 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
205 TP_printk("[%p] TX %.2x (%zu bytes)",
206 __entry->priv,
207 ((u8 *)__get_dynamic_array(buf0))[0],
208 __entry->framelen)
211 TRACE_EVENT(iwlwifi_dev_ucode_error,
212 TP_PROTO(struct iwl_priv *priv, u32 desc, u32 tsf_low,
213 u32 data1, u32 data2, u32 line, u32 blink1,
214 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
215 u32 gp1, u32 gp2, u32 gp3, u32 ucode_ver, u32 hw_ver,
216 u32 brd_ver),
217 TP_ARGS(priv, desc, tsf_low, data1, data2, line,
218 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
219 gp3, ucode_ver, hw_ver, brd_ver),
220 TP_STRUCT__entry(
221 PRIV_ENTRY
222 __field(u32, desc)
223 __field(u32, tsf_low)
224 __field(u32, data1)
225 __field(u32, data2)
226 __field(u32, line)
227 __field(u32, blink1)
228 __field(u32, blink2)
229 __field(u32, ilink1)
230 __field(u32, ilink2)
231 __field(u32, bcon_time)
232 __field(u32, gp1)
233 __field(u32, gp2)
234 __field(u32, gp3)
235 __field(u32, ucode_ver)
236 __field(u32, hw_ver)
237 __field(u32, brd_ver)
239 TP_fast_assign(
240 PRIV_ASSIGN;
241 __entry->desc = desc;
242 __entry->tsf_low = tsf_low;
243 __entry->data1 = data1;
244 __entry->data2 = data2;
245 __entry->line = line;
246 __entry->blink1 = blink1;
247 __entry->blink2 = blink2;
248 __entry->ilink1 = ilink1;
249 __entry->ilink2 = ilink2;
250 __entry->bcon_time = bcon_time;
251 __entry->gp1 = gp1;
252 __entry->gp2 = gp2;
253 __entry->gp3 = gp3;
254 __entry->ucode_ver = ucode_ver;
255 __entry->hw_ver = hw_ver;
256 __entry->brd_ver = brd_ver;
258 TP_printk("[%p] #%02d %010u data 0x%08X 0x%08X line %u, "
259 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
260 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X uCode 0x%08X "
261 "hw 0x%08X brd 0x%08X",
262 __entry->priv, __entry->desc, __entry->tsf_low,
263 __entry->data1,
264 __entry->data2, __entry->line, __entry->blink1,
265 __entry->blink2, __entry->ilink1, __entry->ilink2,
266 __entry->bcon_time, __entry->gp1, __entry->gp2,
267 __entry->gp3, __entry->ucode_ver, __entry->hw_ver,
268 __entry->brd_ver)
271 TRACE_EVENT(iwlwifi_dev_ucode_event,
272 TP_PROTO(struct iwl_priv *priv, u32 time, u32 data, u32 ev),
273 TP_ARGS(priv, time, data, ev),
274 TP_STRUCT__entry(
275 PRIV_ENTRY
277 __field(u32, time)
278 __field(u32, data)
279 __field(u32, ev)
281 TP_fast_assign(
282 PRIV_ASSIGN;
283 __entry->time = time;
284 __entry->data = data;
285 __entry->ev = ev;
287 TP_printk("[%p] EVT_LOGT:%010u:0x%08x:%04u",
288 __entry->priv, __entry->time, __entry->data, __entry->ev)
290 #endif /* __IWLWIFI_DEVICE_TRACE */
292 #undef TRACE_INCLUDE_PATH
293 #define TRACE_INCLUDE_PATH .
294 #undef TRACE_INCLUDE_FILE
295 #define TRACE_INCLUDE_FILE iwl-devtrace
296 #include <trace/define_trace.h>