1 /* SPDX-License-Identifier: ISC */
2 /*
3  * Copyright (C) 2019 Lorenzo Bianconi <lorenzo@kernel.org>
4  */
5 
6 #if !defined(__MT7615_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define __MT7615_TRACE_H
8 
9 #include <linux/tracepoint.h>
10 #include "mt7615.h"
11 
12 #undef TRACE_SYSTEM
13 #define TRACE_SYSTEM mt7615
14 
15 #define MAXNAME		32
16 #define DEV_ENTRY	__array(char, wiphy_name, 32)
17 #define DEV_ASSIGN	strlcpy(__entry->wiphy_name,	\
18 				wiphy_name(mt76_hw(dev)->wiphy), MAXNAME)
19 #define DEV_PR_FMT	"%s"
20 #define DEV_PR_ARG	__entry->wiphy_name
21 
22 #define TOKEN_ENTRY	__field(u16, token)
23 #define TOKEN_ASSIGN	__entry->token = token
24 #define TOKEN_PR_FMT	" %d"
25 #define TOKEN_PR_ARG	__entry->token
26 
27 DECLARE_EVENT_CLASS(dev_token,
28 	TP_PROTO(struct mt7615_dev *dev, u16 token),
29 	TP_ARGS(dev, token),
30 	TP_STRUCT__entry(
31 		DEV_ENTRY
32 		TOKEN_ENTRY
33 	),
34 	TP_fast_assign(
35 		DEV_ASSIGN;
36 		TOKEN_ASSIGN;
37 	),
38 	TP_printk(
39 		DEV_PR_FMT TOKEN_PR_FMT,
40 		DEV_PR_ARG, TOKEN_PR_ARG
41 	)
42 );
43 
44 DEFINE_EVENT(dev_token, mac_tx_free,
45 	TP_PROTO(struct mt7615_dev *dev, u16 token),
46 	TP_ARGS(dev, token)
47 );
48 
49 #endif
50 
51 #undef TRACE_INCLUDE_PATH
52 #define TRACE_INCLUDE_PATH .
53 #undef TRACE_INCLUDE_FILE
54 #define TRACE_INCLUDE_FILE mt7615_trace
55 
56 #include <trace/define_trace.h>
57