1 /* SPDX-License-Identifier: ISC */
3 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
6 #if !defined(__MT76_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
9 #include <linux/tracepoint.h>
13 #define TRACE_SYSTEM mt76
16 #define DEV_ENTRY __array(char, wiphy_name, 32)
17 #define DEVICE_ASSIGN strlcpy(__entry->wiphy_name, \
18 wiphy_name(dev->hw->wiphy), MAXNAME)
19 #define DEV_PR_FMT "%s"
20 #define DEV_PR_ARG __entry->wiphy_name
22 #define REG_ENTRY __field(u32, reg) __field(u32, val)
23 #define REG_ASSIGN __entry->reg = reg; __entry->val = val
24 #define REG_PR_FMT " %04x=%08x"
25 #define REG_PR_ARG __entry->reg, __entry->val
27 #define TXID_ENTRY __field(u8, wcid) __field(u8, pktid)
28 #define TXID_ASSIGN __entry->wcid = wcid; __entry->pktid = pktid
29 #define TXID_PR_FMT " [%d:%d]"
30 #define TXID_PR_ARG __entry->wcid, __entry->pktid
32 DECLARE_EVENT_CLASS(dev_reg_evt
,
33 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
34 TP_ARGS(dev
, reg
, val
),
44 DEV_PR_FMT REG_PR_FMT
,
45 DEV_PR_ARG
, REG_PR_ARG
49 DEFINE_EVENT(dev_reg_evt
, reg_rr
,
50 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
51 TP_ARGS(dev
, reg
, val
)
54 DEFINE_EVENT(dev_reg_evt
, reg_wr
,
55 TP_PROTO(struct mt76_dev
*dev
, u32 reg
, u32 val
),
56 TP_ARGS(dev
, reg
, val
)
60 TP_PROTO(struct mt76_dev
*dev
, u32 val
, u32 mask
),
62 TP_ARGS(dev
, val
, mask
),
77 DEV_PR_FMT
" %08x & %08x",
78 DEV_PR_ARG
, __entry
->val
, __entry
->mask
82 DECLARE_EVENT_CLASS(dev_txid_evt
,
83 TP_PROTO(struct mt76_dev
*dev
, u8 wcid
, u8 pktid
),
84 TP_ARGS(dev
, wcid
, pktid
),
94 DEV_PR_FMT TXID_PR_FMT
,
95 DEV_PR_ARG
, TXID_PR_ARG
99 DEFINE_EVENT(dev_txid_evt
, mac_txdone
,
100 TP_PROTO(struct mt76_dev
*dev
, u8 wcid
, u8 pktid
),
101 TP_ARGS(dev
, wcid
, pktid
)
106 #undef TRACE_INCLUDE_PATH
107 #define TRACE_INCLUDE_PATH .
108 #undef TRACE_INCLUDE_FILE
109 #define TRACE_INCLUDE_FILE trace
111 #include <trace/define_trace.h>