1/******************************************************************************
2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 *
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
27#if !defined(__IWLWIFI_DEVICE_TRACE_DATA) || defined(TRACE_HEADER_MULTI_READ)
28#define __IWLWIFI_DEVICE_TRACE_DATA
29
30#include <linux/tracepoint.h>
31
32#undef TRACE_SYSTEM
33#define TRACE_SYSTEM iwlwifi_data
34
35TRACE_EVENT(iwlwifi_dev_tx_data,
36	TP_PROTO(const struct device *dev,
37		 struct sk_buff *skb,
38		 void *data, size_t data_len),
39	TP_ARGS(dev, skb, data, data_len),
40	TP_STRUCT__entry(
41		DEV_ENTRY
42
43		__dynamic_array(u8, data, iwl_trace_data(skb) ? data_len : 0)
44	),
45	TP_fast_assign(
46		DEV_ASSIGN;
47		if (iwl_trace_data(skb))
48			memcpy(__get_dynamic_array(data), data, data_len);
49	),
50	TP_printk("[%s] TX frame data", __get_str(dev))
51);
52
53TRACE_EVENT(iwlwifi_dev_rx_data,
54	TP_PROTO(const struct device *dev,
55		 const struct iwl_trans *trans,
56		 void *rxbuf, size_t len),
57	TP_ARGS(dev, trans, rxbuf, len),
58	TP_STRUCT__entry(
59		DEV_ENTRY
60
61		__dynamic_array(u8, data,
62				len - iwl_rx_trace_len(trans, rxbuf, len))
63	),
64	TP_fast_assign(
65		size_t offs = iwl_rx_trace_len(trans, rxbuf, len);
66		DEV_ASSIGN;
67		if (offs < len)
68			memcpy(__get_dynamic_array(data),
69			       ((u8 *)rxbuf) + offs, len - offs);
70	),
71	TP_printk("[%s] RX frame data", __get_str(dev))
72);
73#endif /* __IWLWIFI_DEVICE_TRACE_DATA */
74
75#undef TRACE_INCLUDE_PATH
76#define TRACE_INCLUDE_PATH .
77#undef TRACE_INCLUDE_FILE
78#define TRACE_INCLUDE_FILE iwl-devtrace-data
79#include <trace/define_trace.h>
80