1 /* Based on net/wireless/trace.h */
4 #define TRACE_SYSTEM cfg802154
6 #if !defined(__RDEV_CFG802154_OPS_TRACE) || defined(TRACE_HEADER_MULTI_READ)
7 #define __RDEV_CFG802154_OPS_TRACE
9 #include <linux/tracepoint.h>
11 #include <net/cfg802154.h>
14 #define WPAN_PHY_ENTRY __array(char, wpan_phy_name, MAXNAME)
15 #define WPAN_PHY_ASSIGN strlcpy(__entry->wpan_phy_name, \
16 wpan_phy_name(wpan_phy), \
18 #define WPAN_PHY_PR_FMT "%s"
19 #define WPAN_PHY_PR_ARG __entry->wpan_phy_name
21 #define WPAN_DEV_ENTRY __field(u32, identifier)
22 #define WPAN_DEV_ASSIGN (__entry->identifier) = (!IS_ERR_OR_NULL(wpan_dev) \
23 ? wpan_dev->identifier : 0)
24 #define WPAN_DEV_PR_FMT "wpan_dev(%u)"
25 #define WPAN_DEV_PR_ARG (__entry->identifier)
27 #define WPAN_CCA_ENTRY __field(enum nl802154_cca_modes, cca_mode) \
28 __field(enum nl802154_cca_opts, cca_opt)
29 #define WPAN_CCA_ASSIGN \
31 (__entry->cca_mode) = cca->mode; \
32 (__entry->cca_opt) = cca->opt; \
34 #define WPAN_CCA_PR_FMT "cca_mode: %d, cca_opt: %d"
35 #define WPAN_CCA_PR_ARG __entry->cca_mode, __entry->cca_opt
37 #define BOOL_TO_STR(bo) (bo) ? "true" : "false"
39 /*************************************************************
41 *************************************************************/
43 TRACE_EVENT(802154_rdev_add_virtual_intf
,
44 TP_PROTO(struct wpan_phy
*wpan_phy
, char *name
,
45 enum nl802154_iftype type
, __le64 extended_addr
),
46 TP_ARGS(wpan_phy
, name
, type
, extended_addr
),
49 __string(vir_intf_name
, name
? name
: "<noname>")
50 __field(enum nl802154_iftype
, type
)
51 __field(__le64
, extended_addr
)
55 __assign_str(vir_intf_name
, name
? name
: "<noname>");
57 __entry
->extended_addr
= extended_addr
;
59 TP_printk(WPAN_PHY_PR_FMT
", virtual intf name: %s, type: %d, extended addr: 0x%llx",
60 WPAN_PHY_PR_ARG
, __get_str(vir_intf_name
), __entry
->type
,
61 __le64_to_cpu(__entry
->extended_addr
))
64 TRACE_EVENT(802154_rdev_del_virtual_intf
,
65 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
),
66 TP_ARGS(wpan_phy
, wpan_dev
),
75 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
, WPAN_PHY_PR_ARG
,
79 TRACE_EVENT(802154_rdev_set_channel
,
80 TP_PROTO(struct wpan_phy
*wpan_phy
, u8 page
, u8 channel
),
81 TP_ARGS(wpan_phy
, page
, channel
),
90 __entry
->channel
= channel
;
92 TP_printk(WPAN_PHY_PR_FMT
", page: %d, channel: %d", WPAN_PHY_PR_ARG
,
93 __entry
->page
, __entry
->channel
)
96 TRACE_EVENT(802154_rdev_set_tx_power
,
97 TP_PROTO(struct wpan_phy
*wpan_phy
, s32 power
),
98 TP_ARGS(wpan_phy
, power
),
105 __entry
->power
= power
;
107 TP_printk(WPAN_PHY_PR_FMT
", mbm: %d", WPAN_PHY_PR_ARG
,
111 TRACE_EVENT(802154_rdev_set_cca_mode
,
112 TP_PROTO(struct wpan_phy
*wpan_phy
, const struct wpan_phy_cca
*cca
),
113 TP_ARGS(wpan_phy
, cca
),
122 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_CCA_PR_FMT
, WPAN_PHY_PR_ARG
,
126 TRACE_EVENT(802154_rdev_set_cca_ed_level
,
127 TP_PROTO(struct wpan_phy
*wpan_phy
, s32 ed_level
),
128 TP_ARGS(wpan_phy
, ed_level
),
131 __field(s32
, ed_level
)
135 __entry
->ed_level
= ed_level
;
137 TP_printk(WPAN_PHY_PR_FMT
", ed level: %d", WPAN_PHY_PR_ARG
,
141 DECLARE_EVENT_CLASS(802154_le16_template
,
142 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
144 TP_ARGS(wpan_phy
, wpan_dev
, le16arg
),
148 __field(__le16
, le16arg
)
153 __entry
->le16arg
= le16arg
;
155 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
", pan id: 0x%04x",
156 WPAN_PHY_PR_ARG
, WPAN_DEV_PR_ARG
,
157 __le16_to_cpu(__entry
->le16arg
))
160 DEFINE_EVENT(802154_le16_template
, 802154_rdev_set_pan_id
,
161 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
163 TP_ARGS(wpan_phy
, wpan_dev
, le16arg
)
166 DEFINE_EVENT_PRINT(802154_le16_template
, 802154_rdev_set_short_addr
,
167 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
169 TP_ARGS(wpan_phy
, wpan_dev
, le16arg
),
170 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
", short addr: 0x%04x",
171 WPAN_PHY_PR_ARG
, WPAN_DEV_PR_ARG
,
172 __le16_to_cpu(__entry
->le16arg
))
175 TRACE_EVENT(802154_rdev_set_backoff_exponent
,
176 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
177 u8 min_be
, u8 max_be
),
178 TP_ARGS(wpan_phy
, wpan_dev
, min_be
, max_be
),
188 __entry
->min_be
= min_be
;
189 __entry
->max_be
= max_be
;
192 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
193 ", min be: %d, max be: %d", WPAN_PHY_PR_ARG
,
194 WPAN_DEV_PR_ARG
, __entry
->min_be
, __entry
->max_be
)
197 TRACE_EVENT(802154_rdev_set_csma_backoffs
,
198 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
199 u8 max_csma_backoffs
),
200 TP_ARGS(wpan_phy
, wpan_dev
, max_csma_backoffs
),
204 __field(u8
, max_csma_backoffs
)
209 __entry
->max_csma_backoffs
= max_csma_backoffs
;
212 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
213 ", max csma backoffs: %d", WPAN_PHY_PR_ARG
,
214 WPAN_DEV_PR_ARG
, __entry
->max_csma_backoffs
)
217 TRACE_EVENT(802154_rdev_set_max_frame_retries
,
218 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
219 s8 max_frame_retries
),
220 TP_ARGS(wpan_phy
, wpan_dev
, max_frame_retries
),
224 __field(s8
, max_frame_retries
)
229 __entry
->max_frame_retries
= max_frame_retries
;
232 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
233 ", max frame retries: %d", WPAN_PHY_PR_ARG
,
234 WPAN_DEV_PR_ARG
, __entry
->max_frame_retries
)
237 TRACE_EVENT(802154_rdev_set_lbt_mode
,
238 TP_PROTO(struct wpan_phy
*wpan_phy
, struct wpan_dev
*wpan_dev
,
240 TP_ARGS(wpan_phy
, wpan_dev
, mode
),
249 __entry
->mode
= mode
;
251 TP_printk(WPAN_PHY_PR_FMT
", " WPAN_DEV_PR_FMT
252 ", lbt mode: %s", WPAN_PHY_PR_ARG
,
253 WPAN_DEV_PR_ARG
, BOOL_TO_STR(__entry
->mode
))
256 TRACE_EVENT(802154_rdev_return_int
,
257 TP_PROTO(struct wpan_phy
*wpan_phy
, int ret
),
258 TP_ARGS(wpan_phy
, ret
),
267 TP_printk(WPAN_PHY_PR_FMT
", returned: %d", WPAN_PHY_PR_ARG
,
271 #endif /* !__RDEV_CFG802154_OPS_TRACE || TRACE_HEADER_MULTI_READ */
273 #undef TRACE_INCLUDE_PATH
274 #define TRACE_INCLUDE_PATH .
275 #undef TRACE_INCLUDE_FILE
276 #define TRACE_INCLUDE_FILE trace
277 #include <trace/define_trace.h>