Linux 4.4.145
[linux/fpc-iii.git] / drivers / net / wireless / iwlwifi / iwl-devtrace-iwlwifi.h
blobeb4b99a1c8cd432e3cd3a3febf0b4b58f8af26ef
1 /******************************************************************************
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(c) 2015 Intel Mobile Communications GmbH
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 * The full GNU General Public License is included in this distribution in the
20 * file called LICENSE.
22 * Contact Information:
23 * Intel Linux Wireless <ilw@linux.intel.com>
24 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 *****************************************************************************/
28 #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ)
29 #define __IWLWIFI_DEVICE_TRACE_IWLWIFI
31 #include <linux/tracepoint.h>
33 #undef TRACE_SYSTEM
34 #define TRACE_SYSTEM iwlwifi
36 TRACE_EVENT(iwlwifi_dev_hcmd,
37 TP_PROTO(const struct device *dev,
38 struct iwl_host_cmd *cmd, u16 total_size,
39 struct iwl_cmd_header_wide *hdr),
40 TP_ARGS(dev, cmd, total_size, hdr),
41 TP_STRUCT__entry(
42 DEV_ENTRY
43 __dynamic_array(u8, hcmd, total_size)
44 __field(u32, flags)
46 TP_fast_assign(
47 int i, offset = sizeof(struct iwl_cmd_header);
49 if (hdr->group_id)
50 offset = sizeof(struct iwl_cmd_header_wide);
52 DEV_ASSIGN;
53 __entry->flags = cmd->flags;
54 memcpy(__get_dynamic_array(hcmd), hdr, offset);
56 for (i = 0; i < IWL_MAX_CMD_TBS_PER_TFD; i++) {
57 if (!cmd->len[i])
58 continue;
59 memcpy((u8 *)__get_dynamic_array(hcmd) + offset,
60 cmd->data[i], cmd->len[i]);
61 offset += cmd->len[i];
64 TP_printk("[%s] hcmd %#.2x.%#.2x (%ssync)",
65 __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[1],
66 ((u8 *)__get_dynamic_array(hcmd))[0],
67 __entry->flags & CMD_ASYNC ? "a" : "")
70 TRACE_EVENT(iwlwifi_dev_rx,
71 TP_PROTO(const struct device *dev, const struct iwl_trans *trans,
72 struct iwl_rx_packet *pkt, size_t len),
73 TP_ARGS(dev, trans, pkt, len),
74 TP_STRUCT__entry(
75 DEV_ENTRY
76 __field(u8, cmd)
77 __dynamic_array(u8, rxbuf, iwl_rx_trace_len(trans, pkt, len))
79 TP_fast_assign(
80 DEV_ASSIGN;
81 __entry->cmd = pkt->hdr.cmd;
82 memcpy(__get_dynamic_array(rxbuf), pkt,
83 iwl_rx_trace_len(trans, pkt, len));
85 TP_printk("[%s] RX cmd %#.2x",
86 __get_str(dev), __entry->cmd)
89 TRACE_EVENT(iwlwifi_dev_tx,
90 TP_PROTO(const struct device *dev, struct sk_buff *skb,
91 void *tfd, size_t tfdlen,
92 void *buf0, size_t buf0_len,
93 void *buf1, size_t buf1_len),
94 TP_ARGS(dev, skb, tfd, tfdlen, buf0, buf0_len, buf1, buf1_len),
95 TP_STRUCT__entry(
96 DEV_ENTRY
98 __field(size_t, framelen)
99 __dynamic_array(u8, tfd, tfdlen)
102 * Do not insert between or below these items,
103 * we want to keep the frame together (except
104 * for the possible padding).
106 __dynamic_array(u8, buf0, buf0_len)
107 __dynamic_array(u8, buf1, iwl_trace_data(skb) ? 0 : buf1_len)
109 TP_fast_assign(
110 DEV_ASSIGN;
111 __entry->framelen = buf0_len + buf1_len;
112 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
113 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
114 if (!iwl_trace_data(skb))
115 memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
117 TP_printk("[%s] TX %.2x (%zu bytes)",
118 __get_str(dev), ((u8 *)__get_dynamic_array(buf0))[0],
119 __entry->framelen)
122 TRACE_EVENT(iwlwifi_dev_ucode_error,
123 TP_PROTO(const struct device *dev, u32 desc, u32 tsf_low,
124 u32 data1, u32 data2, u32 line, u32 blink1,
125 u32 blink2, u32 ilink1, u32 ilink2, u32 bcon_time,
126 u32 gp1, u32 gp2, u32 gp3, u32 major, u32 minor, u32 hw_ver,
127 u32 brd_ver),
128 TP_ARGS(dev, desc, tsf_low, data1, data2, line,
129 blink1, blink2, ilink1, ilink2, bcon_time, gp1, gp2,
130 gp3, major, minor, hw_ver, brd_ver),
131 TP_STRUCT__entry(
132 DEV_ENTRY
133 __field(u32, desc)
134 __field(u32, tsf_low)
135 __field(u32, data1)
136 __field(u32, data2)
137 __field(u32, line)
138 __field(u32, blink1)
139 __field(u32, blink2)
140 __field(u32, ilink1)
141 __field(u32, ilink2)
142 __field(u32, bcon_time)
143 __field(u32, gp1)
144 __field(u32, gp2)
145 __field(u32, gp3)
146 __field(u32, major)
147 __field(u32, minor)
148 __field(u32, hw_ver)
149 __field(u32, brd_ver)
151 TP_fast_assign(
152 DEV_ASSIGN;
153 __entry->desc = desc;
154 __entry->tsf_low = tsf_low;
155 __entry->data1 = data1;
156 __entry->data2 = data2;
157 __entry->line = line;
158 __entry->blink1 = blink1;
159 __entry->blink2 = blink2;
160 __entry->ilink1 = ilink1;
161 __entry->ilink2 = ilink2;
162 __entry->bcon_time = bcon_time;
163 __entry->gp1 = gp1;
164 __entry->gp2 = gp2;
165 __entry->gp3 = gp3;
166 __entry->major = major;
167 __entry->minor = minor;
168 __entry->hw_ver = hw_ver;
169 __entry->brd_ver = brd_ver;
171 TP_printk("[%s] #%02d %010u data 0x%08X 0x%08X line %u, "
172 "blink 0x%05X 0x%05X ilink 0x%05X 0x%05X "
173 "bcon_tm %010u gp 0x%08X 0x%08X 0x%08X major 0x%08X "
174 "minor 0x%08X hw 0x%08X brd 0x%08X",
175 __get_str(dev), __entry->desc, __entry->tsf_low,
176 __entry->data1,
177 __entry->data2, __entry->line, __entry->blink1,
178 __entry->blink2, __entry->ilink1, __entry->ilink2,
179 __entry->bcon_time, __entry->gp1, __entry->gp2,
180 __entry->gp3, __entry->major, __entry->minor,
181 __entry->hw_ver, __entry->brd_ver)
184 TRACE_EVENT(iwlwifi_dev_ucode_event,
185 TP_PROTO(const struct device *dev, u32 time, u32 data, u32 ev),
186 TP_ARGS(dev, time, data, ev),
187 TP_STRUCT__entry(
188 DEV_ENTRY
190 __field(u32, time)
191 __field(u32, data)
192 __field(u32, ev)
194 TP_fast_assign(
195 DEV_ASSIGN;
196 __entry->time = time;
197 __entry->data = data;
198 __entry->ev = ev;
200 TP_printk("[%s] EVT_LOGT:%010u:0x%08x:%04u",
201 __get_str(dev), __entry->time, __entry->data, __entry->ev)
203 #endif /* __IWLWIFI_DEVICE_TRACE_IWLWIFI */
205 #undef TRACE_INCLUDE_PATH
206 #define TRACE_INCLUDE_PATH .
207 #undef TRACE_INCLUDE_FILE
208 #define TRACE_INCLUDE_FILE iwl-devtrace-iwlwifi
209 #include <trace/define_trace.h>