1 /*
2  * Copyright (c) 2011 Broadcom Corporation
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #if !defined(__TRACE_BRCMSMAC_TX_H) || defined(TRACE_HEADER_MULTI_READ)
18 #define __TRACE_BRCMSMAC_TX_H
19 
20 #include <linux/tracepoint.h>
21 
22 #undef TRACE_SYSTEM
23 #define TRACE_SYSTEM brcmsmac_tx
24 
25 TRACE_EVENT(brcms_txdesc,
26 	TP_PROTO(const struct device *dev,
27 		 void *txh, size_t txh_len),
28 	TP_ARGS(dev, txh, txh_len),
29 	TP_STRUCT__entry(
30 		__string(dev, dev_name(dev))
31 		__dynamic_array(u8, txh, txh_len)
32 	),
33 	TP_fast_assign(
34 		__assign_str(dev);
35 		memcpy(__get_dynamic_array(txh), txh, txh_len);
36 	),
37 	TP_printk("[%s] txdesc", __get_str(dev))
38 );
39 
40 TRACE_EVENT(brcms_txstatus,
41 	TP_PROTO(const struct device *dev, u16 framelen, u16 frameid,
42 		 u16 status, u16 lasttxtime, u16 sequence, u16 phyerr,
43 		 u16 ackphyrxsh),
44 	TP_ARGS(dev, framelen, frameid, status, lasttxtime, sequence, phyerr,
45 		ackphyrxsh),
46 	TP_STRUCT__entry(
47 		__string(dev, dev_name(dev))
48 		__field(u16, framelen)
49 		__field(u16, frameid)
50 		__field(u16, status)
51 		__field(u16, lasttxtime)
52 		__field(u16, sequence)
53 		__field(u16, phyerr)
54 		__field(u16, ackphyrxsh)
55 	),
56 	TP_fast_assign(
57 		__assign_str(dev);
58 		__entry->framelen = framelen;
59 		__entry->frameid = frameid;
60 		__entry->status = status;
61 		__entry->lasttxtime = lasttxtime;
62 		__entry->sequence = sequence;
63 		__entry->phyerr = phyerr;
64 		__entry->ackphyrxsh = ackphyrxsh;
65 	),
66 	TP_printk("[%s] FrameId %#04x TxStatus %#04x LastTxTime %#04x "
67 		  "Seq %#04x PHYTxStatus %#04x RxAck %#04x",
68 		  __get_str(dev), __entry->frameid, __entry->status,
69 		  __entry->lasttxtime, __entry->sequence, __entry->phyerr,
70 		  __entry->ackphyrxsh)
71 );
72 
73 TRACE_EVENT(brcms_ampdu_session,
74 	TP_PROTO(const struct device *dev, unsigned max_ampdu_len,
75 		 u16 max_ampdu_frames, u16 ampdu_len, u16 ampdu_frames,
76 		 u16 dma_len),
77 	TP_ARGS(dev, max_ampdu_len, max_ampdu_frames, ampdu_len, ampdu_frames,
78 		dma_len),
79 	TP_STRUCT__entry(
80 		__string(dev, dev_name(dev))
81 		__field(unsigned, max_ampdu_len)
82 		__field(u16, max_ampdu_frames)
83 		__field(u16, ampdu_len)
84 		__field(u16, ampdu_frames)
85 		__field(u16, dma_len)
86 	),
87 	TP_fast_assign(
88 		__assign_str(dev);
89 		__entry->max_ampdu_len = max_ampdu_len;
90 		__entry->max_ampdu_frames = max_ampdu_frames;
91 		__entry->ampdu_len = ampdu_len;
92 		__entry->ampdu_frames = ampdu_frames;
93 		__entry->dma_len = dma_len;
94 	),
95 	TP_printk("[%s] ampdu session max_len=%u max_frames=%u len=%u frames=%u dma_len=%u",
96 		  __get_str(dev), __entry->max_ampdu_len,
97 		  __entry->max_ampdu_frames, __entry->ampdu_len,
98 		  __entry->ampdu_frames, __entry->dma_len)
99 );
100 #endif /* __TRACE_BRCMSMAC_TX_H */
101 
102 #ifdef CONFIG_BRCM_TRACING
103 
104 #undef TRACE_INCLUDE_PATH
105 #define TRACE_INCLUDE_PATH .
106 #undef TRACE_INCLUDE_FILE
107 #define TRACE_INCLUDE_FILE brcms_trace_brcmsmac_tx
108 #include <trace/define_trace.h>
109 
110 #endif /* CONFIG_BRCM_TRACING */
111