diff options
author | Varka Bhadram <varkabhadram@gmail.com> | 2015-06-01 04:52:26 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-06-02 13:21:09 -0400 |
commit | 0ecc4e688b6e33f8314c2b074335e134e0b2c4ae (patch) | |
tree | 728d3f68106b1eacf89010869da2a013fdd9e0f9 | |
parent | 1caf6f476e90f592c2502a82bdef423cf950d011 (diff) |
mac802154: add trace functionality for driver ops
This patch adds trace events for driver operations.
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/mac802154/Makefile | 4 | ||||
-rw-r--r-- | net/mac802154/driver-ops.h | 92 | ||||
-rw-r--r-- | net/mac802154/trace.c | 9 | ||||
-rw-r--r-- | net/mac802154/trace.h | 272 |
4 files changed, 362 insertions, 15 deletions
diff --git a/net/mac802154/Makefile b/net/mac802154/Makefile index 702d8b466317..17a51e8389e2 100644 --- a/net/mac802154/Makefile +++ b/net/mac802154/Makefile | |||
@@ -1,5 +1,7 @@ | |||
1 | obj-$(CONFIG_MAC802154) += mac802154.o | 1 | obj-$(CONFIG_MAC802154) += mac802154.o |
2 | mac802154-objs := main.o rx.o tx.o mac_cmd.o mib.o \ | 2 | mac802154-objs := main.o rx.o tx.o mac_cmd.o mib.o \ |
3 | iface.o llsec.o util.o cfg.o | 3 | iface.o llsec.o util.o cfg.o trace.o |
4 | |||
5 | CFLAGS_trace.o := -I$(src) | ||
4 | 6 | ||
5 | ccflags-y += -D__CHECK_ENDIAN__ | 7 | ccflags-y += -D__CHECK_ENDIAN__ |
diff --git a/net/mac802154/driver-ops.h b/net/mac802154/driver-ops.h index caecd5f43aa7..0550f3365e33 100644 --- a/net/mac802154/driver-ops.h +++ b/net/mac802154/driver-ops.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <net/mac802154.h> | 7 | #include <net/mac802154.h> |
8 | 8 | ||
9 | #include "ieee802154_i.h" | 9 | #include "ieee802154_i.h" |
10 | #include "trace.h" | ||
10 | 11 | ||
11 | static inline int | 12 | static inline int |
12 | drv_xmit_async(struct ieee802154_local *local, struct sk_buff *skb) | 13 | drv_xmit_async(struct ieee802154_local *local, struct sk_buff *skb) |
@@ -27,19 +28,25 @@ drv_xmit_sync(struct ieee802154_local *local, struct sk_buff *skb) | |||
27 | 28 | ||
28 | static inline int drv_start(struct ieee802154_local *local) | 29 | static inline int drv_start(struct ieee802154_local *local) |
29 | { | 30 | { |
31 | int ret; | ||
32 | |||
30 | might_sleep(); | 33 | might_sleep(); |
31 | 34 | ||
35 | trace_802154_drv_start(local); | ||
32 | local->started = true; | 36 | local->started = true; |
33 | smp_mb(); | 37 | smp_mb(); |
34 | 38 | ret = local->ops->start(&local->hw); | |
35 | return local->ops->start(&local->hw); | 39 | trace_802154_drv_return_int(local, ret); |
40 | return ret; | ||
36 | } | 41 | } |
37 | 42 | ||
38 | static inline void drv_stop(struct ieee802154_local *local) | 43 | static inline void drv_stop(struct ieee802154_local *local) |
39 | { | 44 | { |
40 | might_sleep(); | 45 | might_sleep(); |
41 | 46 | ||
47 | trace_802154_drv_stop(local); | ||
42 | local->ops->stop(&local->hw); | 48 | local->ops->stop(&local->hw); |
49 | trace_802154_drv_return_void(local); | ||
43 | 50 | ||
44 | /* sync away all work on the tasklet before clearing started */ | 51 | /* sync away all work on the tasklet before clearing started */ |
45 | tasklet_disable(&local->tasklet); | 52 | tasklet_disable(&local->tasklet); |
@@ -53,13 +60,20 @@ static inline void drv_stop(struct ieee802154_local *local) | |||
53 | static inline int | 60 | static inline int |
54 | drv_set_channel(struct ieee802154_local *local, u8 page, u8 channel) | 61 | drv_set_channel(struct ieee802154_local *local, u8 page, u8 channel) |
55 | { | 62 | { |
63 | int ret; | ||
64 | |||
56 | might_sleep(); | 65 | might_sleep(); |
57 | 66 | ||
58 | return local->ops->set_channel(&local->hw, page, channel); | 67 | trace_802154_drv_set_channel(local, page, channel); |
68 | ret = local->ops->set_channel(&local->hw, page, channel); | ||
69 | trace_802154_drv_return_int(local, ret); | ||
70 | return ret; | ||
59 | } | 71 | } |
60 | 72 | ||
61 | static inline int drv_set_tx_power(struct ieee802154_local *local, s32 mbm) | 73 | static inline int drv_set_tx_power(struct ieee802154_local *local, s32 mbm) |
62 | { | 74 | { |
75 | int ret; | ||
76 | |||
63 | might_sleep(); | 77 | might_sleep(); |
64 | 78 | ||
65 | if (!local->ops->set_txpower) { | 79 | if (!local->ops->set_txpower) { |
@@ -67,12 +81,17 @@ static inline int drv_set_tx_power(struct ieee802154_local *local, s32 mbm) | |||
67 | return -EOPNOTSUPP; | 81 | return -EOPNOTSUPP; |
68 | } | 82 | } |
69 | 83 | ||
70 | return local->ops->set_txpower(&local->hw, mbm); | 84 | trace_802154_drv_set_tx_power(local, mbm); |
85 | ret = local->ops->set_txpower(&local->hw, mbm); | ||
86 | trace_802154_drv_return_int(local, ret); | ||
87 | return ret; | ||
71 | } | 88 | } |
72 | 89 | ||
73 | static inline int drv_set_cca_mode(struct ieee802154_local *local, | 90 | static inline int drv_set_cca_mode(struct ieee802154_local *local, |
74 | const struct wpan_phy_cca *cca) | 91 | const struct wpan_phy_cca *cca) |
75 | { | 92 | { |
93 | int ret; | ||
94 | |||
76 | might_sleep(); | 95 | might_sleep(); |
77 | 96 | ||
78 | if (!local->ops->set_cca_mode) { | 97 | if (!local->ops->set_cca_mode) { |
@@ -80,11 +99,16 @@ static inline int drv_set_cca_mode(struct ieee802154_local *local, | |||
80 | return -EOPNOTSUPP; | 99 | return -EOPNOTSUPP; |
81 | } | 100 | } |
82 | 101 | ||
83 | return local->ops->set_cca_mode(&local->hw, cca); | 102 | trace_802154_drv_set_cca_mode(local, cca); |
103 | ret = local->ops->set_cca_mode(&local->hw, cca); | ||
104 | trace_802154_drv_return_int(local, ret); | ||
105 | return ret; | ||
84 | } | 106 | } |
85 | 107 | ||
86 | static inline int drv_set_lbt_mode(struct ieee802154_local *local, bool mode) | 108 | static inline int drv_set_lbt_mode(struct ieee802154_local *local, bool mode) |
87 | { | 109 | { |
110 | int ret; | ||
111 | |||
88 | might_sleep(); | 112 | might_sleep(); |
89 | 113 | ||
90 | if (!local->ops->set_lbt) { | 114 | if (!local->ops->set_lbt) { |
@@ -92,12 +116,17 @@ static inline int drv_set_lbt_mode(struct ieee802154_local *local, bool mode) | |||
92 | return -EOPNOTSUPP; | 116 | return -EOPNOTSUPP; |
93 | } | 117 | } |
94 | 118 | ||
95 | return local->ops->set_lbt(&local->hw, mode); | 119 | trace_802154_drv_set_lbt_mode(local, mode); |
120 | ret = local->ops->set_lbt(&local->hw, mode); | ||
121 | trace_802154_drv_return_int(local, ret); | ||
122 | return ret; | ||
96 | } | 123 | } |
97 | 124 | ||
98 | static inline int | 125 | static inline int |
99 | drv_set_cca_ed_level(struct ieee802154_local *local, s32 mbm) | 126 | drv_set_cca_ed_level(struct ieee802154_local *local, s32 mbm) |
100 | { | 127 | { |
128 | int ret; | ||
129 | |||
101 | might_sleep(); | 130 | might_sleep(); |
102 | 131 | ||
103 | if (!local->ops->set_cca_ed_level) { | 132 | if (!local->ops->set_cca_ed_level) { |
@@ -105,12 +134,16 @@ drv_set_cca_ed_level(struct ieee802154_local *local, s32 mbm) | |||
105 | return -EOPNOTSUPP; | 134 | return -EOPNOTSUPP; |
106 | } | 135 | } |
107 | 136 | ||
108 | return local->ops->set_cca_ed_level(&local->hw, mbm); | 137 | trace_802154_drv_set_cca_ed_level(local, mbm); |
138 | ret = local->ops->set_cca_ed_level(&local->hw, mbm); | ||
139 | trace_802154_drv_return_int(local, ret); | ||
140 | return ret; | ||
109 | } | 141 | } |
110 | 142 | ||
111 | static inline int drv_set_pan_id(struct ieee802154_local *local, __le16 pan_id) | 143 | static inline int drv_set_pan_id(struct ieee802154_local *local, __le16 pan_id) |
112 | { | 144 | { |
113 | struct ieee802154_hw_addr_filt filt; | 145 | struct ieee802154_hw_addr_filt filt; |
146 | int ret; | ||
114 | 147 | ||
115 | might_sleep(); | 148 | might_sleep(); |
116 | 149 | ||
@@ -121,14 +154,18 @@ static inline int drv_set_pan_id(struct ieee802154_local *local, __le16 pan_id) | |||
121 | 154 | ||
122 | filt.pan_id = pan_id; | 155 | filt.pan_id = pan_id; |
123 | 156 | ||
124 | return local->ops->set_hw_addr_filt(&local->hw, &filt, | 157 | trace_802154_drv_set_pan_id(local, pan_id); |
158 | ret = local->ops->set_hw_addr_filt(&local->hw, &filt, | ||
125 | IEEE802154_AFILT_PANID_CHANGED); | 159 | IEEE802154_AFILT_PANID_CHANGED); |
160 | trace_802154_drv_return_int(local, ret); | ||
161 | return ret; | ||
126 | } | 162 | } |
127 | 163 | ||
128 | static inline int | 164 | static inline int |
129 | drv_set_extended_addr(struct ieee802154_local *local, __le64 extended_addr) | 165 | drv_set_extended_addr(struct ieee802154_local *local, __le64 extended_addr) |
130 | { | 166 | { |
131 | struct ieee802154_hw_addr_filt filt; | 167 | struct ieee802154_hw_addr_filt filt; |
168 | int ret; | ||
132 | 169 | ||
133 | might_sleep(); | 170 | might_sleep(); |
134 | 171 | ||
@@ -139,14 +176,18 @@ drv_set_extended_addr(struct ieee802154_local *local, __le64 extended_addr) | |||
139 | 176 | ||
140 | filt.ieee_addr = extended_addr; | 177 | filt.ieee_addr = extended_addr; |
141 | 178 | ||
142 | return local->ops->set_hw_addr_filt(&local->hw, &filt, | 179 | trace_802154_drv_set_extended_addr(local, extended_addr); |
180 | ret = local->ops->set_hw_addr_filt(&local->hw, &filt, | ||
143 | IEEE802154_AFILT_IEEEADDR_CHANGED); | 181 | IEEE802154_AFILT_IEEEADDR_CHANGED); |
182 | trace_802154_drv_return_int(local, ret); | ||
183 | return ret; | ||
144 | } | 184 | } |
145 | 185 | ||
146 | static inline int | 186 | static inline int |
147 | drv_set_short_addr(struct ieee802154_local *local, __le16 short_addr) | 187 | drv_set_short_addr(struct ieee802154_local *local, __le16 short_addr) |
148 | { | 188 | { |
149 | struct ieee802154_hw_addr_filt filt; | 189 | struct ieee802154_hw_addr_filt filt; |
190 | int ret; | ||
150 | 191 | ||
151 | might_sleep(); | 192 | might_sleep(); |
152 | 193 | ||
@@ -157,14 +198,18 @@ drv_set_short_addr(struct ieee802154_local *local, __le16 short_addr) | |||
157 | 198 | ||
158 | filt.short_addr = short_addr; | 199 | filt.short_addr = short_addr; |
159 | 200 | ||
160 | return local->ops->set_hw_addr_filt(&local->hw, &filt, | 201 | trace_802154_drv_set_short_addr(local, short_addr); |
202 | ret = local->ops->set_hw_addr_filt(&local->hw, &filt, | ||
161 | IEEE802154_AFILT_SADDR_CHANGED); | 203 | IEEE802154_AFILT_SADDR_CHANGED); |
204 | trace_802154_drv_return_int(local, ret); | ||
205 | return ret; | ||
162 | } | 206 | } |
163 | 207 | ||
164 | static inline int | 208 | static inline int |
165 | drv_set_pan_coord(struct ieee802154_local *local, bool is_coord) | 209 | drv_set_pan_coord(struct ieee802154_local *local, bool is_coord) |
166 | { | 210 | { |
167 | struct ieee802154_hw_addr_filt filt; | 211 | struct ieee802154_hw_addr_filt filt; |
212 | int ret; | ||
168 | 213 | ||
169 | might_sleep(); | 214 | might_sleep(); |
170 | 215 | ||
@@ -175,14 +220,19 @@ drv_set_pan_coord(struct ieee802154_local *local, bool is_coord) | |||
175 | 220 | ||
176 | filt.pan_coord = is_coord; | 221 | filt.pan_coord = is_coord; |
177 | 222 | ||
178 | return local->ops->set_hw_addr_filt(&local->hw, &filt, | 223 | trace_802154_drv_set_pan_coord(local, is_coord); |
224 | ret = local->ops->set_hw_addr_filt(&local->hw, &filt, | ||
179 | IEEE802154_AFILT_PANC_CHANGED); | 225 | IEEE802154_AFILT_PANC_CHANGED); |
226 | trace_802154_drv_return_int(local, ret); | ||
227 | return ret; | ||
180 | } | 228 | } |
181 | 229 | ||
182 | static inline int | 230 | static inline int |
183 | drv_set_csma_params(struct ieee802154_local *local, u8 min_be, u8 max_be, | 231 | drv_set_csma_params(struct ieee802154_local *local, u8 min_be, u8 max_be, |
184 | u8 max_csma_backoffs) | 232 | u8 max_csma_backoffs) |
185 | { | 233 | { |
234 | int ret; | ||
235 | |||
186 | might_sleep(); | 236 | might_sleep(); |
187 | 237 | ||
188 | if (!local->ops->set_csma_params) { | 238 | if (!local->ops->set_csma_params) { |
@@ -190,13 +240,19 @@ drv_set_csma_params(struct ieee802154_local *local, u8 min_be, u8 max_be, | |||
190 | return -EOPNOTSUPP; | 240 | return -EOPNOTSUPP; |
191 | } | 241 | } |
192 | 242 | ||
193 | return local->ops->set_csma_params(&local->hw, min_be, max_be, | 243 | trace_802154_drv_set_csma_params(local, min_be, max_be, |
244 | max_csma_backoffs); | ||
245 | ret = local->ops->set_csma_params(&local->hw, min_be, max_be, | ||
194 | max_csma_backoffs); | 246 | max_csma_backoffs); |
247 | trace_802154_drv_return_int(local, ret); | ||
248 | return ret; | ||
195 | } | 249 | } |
196 | 250 | ||
197 | static inline int | 251 | static inline int |
198 | drv_set_max_frame_retries(struct ieee802154_local *local, s8 max_frame_retries) | 252 | drv_set_max_frame_retries(struct ieee802154_local *local, s8 max_frame_retries) |
199 | { | 253 | { |
254 | int ret; | ||
255 | |||
200 | might_sleep(); | 256 | might_sleep(); |
201 | 257 | ||
202 | if (!local->ops->set_frame_retries) { | 258 | if (!local->ops->set_frame_retries) { |
@@ -204,12 +260,17 @@ drv_set_max_frame_retries(struct ieee802154_local *local, s8 max_frame_retries) | |||
204 | return -EOPNOTSUPP; | 260 | return -EOPNOTSUPP; |
205 | } | 261 | } |
206 | 262 | ||
207 | return local->ops->set_frame_retries(&local->hw, max_frame_retries); | 263 | trace_802154_drv_set_max_frame_retries(local, max_frame_retries); |
264 | ret = local->ops->set_frame_retries(&local->hw, max_frame_retries); | ||
265 | trace_802154_drv_return_int(local, ret); | ||
266 | return ret; | ||
208 | } | 267 | } |
209 | 268 | ||
210 | static inline int | 269 | static inline int |
211 | drv_set_promiscuous_mode(struct ieee802154_local *local, bool on) | 270 | drv_set_promiscuous_mode(struct ieee802154_local *local, bool on) |
212 | { | 271 | { |
272 | int ret; | ||
273 | |||
213 | might_sleep(); | 274 | might_sleep(); |
214 | 275 | ||
215 | if (!local->ops->set_promiscuous_mode) { | 276 | if (!local->ops->set_promiscuous_mode) { |
@@ -217,7 +278,10 @@ drv_set_promiscuous_mode(struct ieee802154_local *local, bool on) | |||
217 | return -EOPNOTSUPP; | 278 | return -EOPNOTSUPP; |
218 | } | 279 | } |
219 | 280 | ||
220 | return local->ops->set_promiscuous_mode(&local->hw, on); | 281 | trace_802154_drv_set_promiscuous_mode(local, on); |
282 | ret = local->ops->set_promiscuous_mode(&local->hw, on); | ||
283 | trace_802154_drv_return_int(local, ret); | ||
284 | return ret; | ||
221 | } | 285 | } |
222 | 286 | ||
223 | #endif /* __MAC802154_DRIVER_OPS */ | 287 | #endif /* __MAC802154_DRIVER_OPS */ |
diff --git a/net/mac802154/trace.c b/net/mac802154/trace.c new file mode 100644 index 000000000000..863e5e6b983d --- /dev/null +++ b/net/mac802154/trace.c | |||
@@ -0,0 +1,9 @@ | |||
1 | #include <linux/module.h> | ||
2 | |||
3 | #ifndef __CHECKER__ | ||
4 | #include <net/cfg802154.h> | ||
5 | #include "driver-ops.h" | ||
6 | #define CREATE_TRACE_POINTS | ||
7 | #include "trace.h" | ||
8 | |||
9 | #endif | ||
diff --git a/net/mac802154/trace.h b/net/mac802154/trace.h new file mode 100644 index 000000000000..6f30e0c93a16 --- /dev/null +++ b/net/mac802154/trace.h | |||
@@ -0,0 +1,272 @@ | |||
1 | /* Based on net/mac80211/trace.h */ | ||
2 | |||
3 | #undef TRACE_SYSTEM | ||
4 | #define TRACE_SYSTEM mac802154 | ||
5 | |||
6 | #if !defined(__MAC802154_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ) | ||
7 | #define __MAC802154_DRIVER_TRACE | ||
8 | |||
9 | #include <linux/tracepoint.h> | ||
10 | |||
11 | #include <net/mac802154.h> | ||
12 | #include "ieee802154_i.h" | ||
13 | |||
14 | #define MAXNAME 32 | ||
15 | #define LOCAL_ENTRY __array(char, wpan_phy_name, MAXNAME) | ||
16 | #define LOCAL_ASSIGN strlcpy(__entry->wpan_phy_name, \ | ||
17 | wpan_phy_name(local->hw.phy), MAXNAME) | ||
18 | #define LOCAL_PR_FMT "%s" | ||
19 | #define LOCAL_PR_ARG __entry->wpan_phy_name | ||
20 | |||
21 | #define CCA_ENTRY __field(enum nl802154_cca_modes, cca_mode) \ | ||
22 | __field(enum nl802154_cca_opts, cca_opt) | ||
23 | #define CCA_ASSIGN \ | ||
24 | do { \ | ||
25 | (__entry->cca_mode) = cca->mode; \ | ||
26 | (__entry->cca_opt) = cca->opt; \ | ||
27 | } while (0) | ||
28 | #define CCA_PR_FMT "cca_mode: %d, cca_opt: %d" | ||
29 | #define CCA_PR_ARG __entry->cca_mode, __entry->cca_opt | ||
30 | |||
31 | #define BOOL_TO_STR(bo) (bo) ? "true" : "false" | ||
32 | |||
33 | /* Tracing for driver callbacks */ | ||
34 | |||
35 | DECLARE_EVENT_CLASS(local_only_evt, | ||
36 | TP_PROTO(struct ieee802154_local *local), | ||
37 | TP_ARGS(local), | ||
38 | TP_STRUCT__entry( | ||
39 | LOCAL_ENTRY | ||
40 | ), | ||
41 | TP_fast_assign( | ||
42 | LOCAL_ASSIGN; | ||
43 | ), | ||
44 | TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG) | ||
45 | ); | ||
46 | |||
47 | DEFINE_EVENT(local_only_evt, 802154_drv_return_void, | ||
48 | TP_PROTO(struct ieee802154_local *local), | ||
49 | TP_ARGS(local) | ||
50 | ); | ||
51 | |||
52 | TRACE_EVENT(802154_drv_return_int, | ||
53 | TP_PROTO(struct ieee802154_local *local, int ret), | ||
54 | TP_ARGS(local, ret), | ||
55 | TP_STRUCT__entry( | ||
56 | LOCAL_ENTRY | ||
57 | __field(int, ret) | ||
58 | ), | ||
59 | TP_fast_assign( | ||
60 | LOCAL_ASSIGN; | ||
61 | __entry->ret = ret; | ||
62 | ), | ||
63 | TP_printk(LOCAL_PR_FMT ", returned: %d", LOCAL_PR_ARG, | ||
64 | __entry->ret) | ||
65 | ); | ||
66 | |||
67 | DEFINE_EVENT(local_only_evt, 802154_drv_start, | ||
68 | TP_PROTO(struct ieee802154_local *local), | ||
69 | TP_ARGS(local) | ||
70 | ); | ||
71 | |||
72 | DEFINE_EVENT(local_only_evt, 802154_drv_stop, | ||
73 | TP_PROTO(struct ieee802154_local *local), | ||
74 | TP_ARGS(local) | ||
75 | ); | ||
76 | |||
77 | TRACE_EVENT(802154_drv_set_channel, | ||
78 | TP_PROTO(struct ieee802154_local *local, u8 page, u8 channel), | ||
79 | TP_ARGS(local, page, channel), | ||
80 | TP_STRUCT__entry( | ||
81 | LOCAL_ENTRY | ||
82 | __field(u8, page) | ||
83 | __field(u8, channel) | ||
84 | ), | ||
85 | TP_fast_assign( | ||
86 | LOCAL_ASSIGN; | ||
87 | __entry->page = page; | ||
88 | __entry->channel = channel; | ||
89 | ), | ||
90 | TP_printk(LOCAL_PR_FMT ", page: %d, channel: %d", LOCAL_PR_ARG, | ||
91 | __entry->page, __entry->channel) | ||
92 | ); | ||
93 | |||
94 | TRACE_EVENT(802154_drv_set_cca_mode, | ||
95 | TP_PROTO(struct ieee802154_local *local, | ||
96 | const struct wpan_phy_cca *cca), | ||
97 | TP_ARGS(local, cca), | ||
98 | TP_STRUCT__entry( | ||
99 | LOCAL_ENTRY | ||
100 | CCA_ENTRY | ||
101 | ), | ||
102 | TP_fast_assign( | ||
103 | LOCAL_ASSIGN; | ||
104 | CCA_ASSIGN; | ||
105 | ), | ||
106 | TP_printk(LOCAL_PR_FMT ", " CCA_PR_FMT, LOCAL_PR_ARG, | ||
107 | CCA_PR_ARG) | ||
108 | ); | ||
109 | |||
110 | TRACE_EVENT(802154_drv_set_cca_ed_level, | ||
111 | TP_PROTO(struct ieee802154_local *local, s32 mbm), | ||
112 | TP_ARGS(local, mbm), | ||
113 | TP_STRUCT__entry( | ||
114 | LOCAL_ENTRY | ||
115 | __field(s32, mbm) | ||
116 | ), | ||
117 | TP_fast_assign( | ||
118 | LOCAL_ASSIGN; | ||
119 | __entry->mbm = mbm; | ||
120 | ), | ||
121 | TP_printk(LOCAL_PR_FMT ", ed level: %d", LOCAL_PR_ARG, | ||
122 | __entry->mbm) | ||
123 | ); | ||
124 | |||
125 | TRACE_EVENT(802154_drv_set_tx_power, | ||
126 | TP_PROTO(struct ieee802154_local *local, s32 power), | ||
127 | TP_ARGS(local, power), | ||
128 | TP_STRUCT__entry( | ||
129 | LOCAL_ENTRY | ||
130 | __field(s32, power) | ||
131 | ), | ||
132 | TP_fast_assign( | ||
133 | LOCAL_ASSIGN; | ||
134 | __entry->power = power; | ||
135 | ), | ||
136 | TP_printk(LOCAL_PR_FMT ", mbm: %d", LOCAL_PR_ARG, | ||
137 | __entry->power) | ||
138 | ); | ||
139 | |||
140 | TRACE_EVENT(802154_drv_set_lbt_mode, | ||
141 | TP_PROTO(struct ieee802154_local *local, bool mode), | ||
142 | TP_ARGS(local, mode), | ||
143 | TP_STRUCT__entry( | ||
144 | LOCAL_ENTRY | ||
145 | __field(bool, mode) | ||
146 | ), | ||
147 | TP_fast_assign( | ||
148 | LOCAL_ASSIGN; | ||
149 | __entry->mode = mode; | ||
150 | ), | ||
151 | TP_printk(LOCAL_PR_FMT ", lbt mode: %s", LOCAL_PR_ARG, | ||
152 | BOOL_TO_STR(__entry->mode)) | ||
153 | ); | ||
154 | |||
155 | TRACE_EVENT(802154_drv_set_short_addr, | ||
156 | TP_PROTO(struct ieee802154_local *local, __le16 short_addr), | ||
157 | TP_ARGS(local, short_addr), | ||
158 | TP_STRUCT__entry( | ||
159 | LOCAL_ENTRY | ||
160 | __field(__le16, short_addr) | ||
161 | ), | ||
162 | TP_fast_assign( | ||
163 | LOCAL_ASSIGN; | ||
164 | __entry->short_addr = short_addr; | ||
165 | ), | ||
166 | TP_printk(LOCAL_PR_FMT ", short addr: 0x%04x", LOCAL_PR_ARG, | ||
167 | le16_to_cpu(__entry->short_addr)) | ||
168 | ); | ||
169 | |||
170 | TRACE_EVENT(802154_drv_set_pan_id, | ||
171 | TP_PROTO(struct ieee802154_local *local, __le16 pan_id), | ||
172 | TP_ARGS(local, pan_id), | ||
173 | TP_STRUCT__entry( | ||
174 | LOCAL_ENTRY | ||
175 | __field(__le16, pan_id) | ||
176 | ), | ||
177 | TP_fast_assign( | ||
178 | LOCAL_ASSIGN; | ||
179 | __entry->pan_id = pan_id; | ||
180 | ), | ||
181 | TP_printk(LOCAL_PR_FMT ", pan id: 0x%04x", LOCAL_PR_ARG, | ||
182 | le16_to_cpu(__entry->pan_id)) | ||
183 | ); | ||
184 | |||
185 | TRACE_EVENT(802154_drv_set_extended_addr, | ||
186 | TP_PROTO(struct ieee802154_local *local, __le64 extended_addr), | ||
187 | TP_ARGS(local, extended_addr), | ||
188 | TP_STRUCT__entry( | ||
189 | LOCAL_ENTRY | ||
190 | __field(__le64, extended_addr) | ||
191 | ), | ||
192 | TP_fast_assign( | ||
193 | LOCAL_ASSIGN; | ||
194 | __entry->extended_addr = extended_addr; | ||
195 | ), | ||
196 | TP_printk(LOCAL_PR_FMT ", extended addr: 0x%llx", LOCAL_PR_ARG, | ||
197 | le64_to_cpu(__entry->extended_addr)) | ||
198 | ); | ||
199 | |||
200 | TRACE_EVENT(802154_drv_set_pan_coord, | ||
201 | TP_PROTO(struct ieee802154_local *local, bool is_coord), | ||
202 | TP_ARGS(local, is_coord), | ||
203 | TP_STRUCT__entry( | ||
204 | LOCAL_ENTRY | ||
205 | __field(bool, is_coord) | ||
206 | ), | ||
207 | TP_fast_assign( | ||
208 | LOCAL_ASSIGN; | ||
209 | __entry->is_coord = is_coord; | ||
210 | ), | ||
211 | TP_printk(LOCAL_PR_FMT ", is_coord: %s", LOCAL_PR_ARG, | ||
212 | BOOL_TO_STR(__entry->is_coord)) | ||
213 | ); | ||
214 | |||
215 | TRACE_EVENT(802154_drv_set_csma_params, | ||
216 | TP_PROTO(struct ieee802154_local *local, u8 min_be, u8 max_be, | ||
217 | u8 max_csma_backoffs), | ||
218 | TP_ARGS(local, min_be, max_be, max_csma_backoffs), | ||
219 | TP_STRUCT__entry( | ||
220 | LOCAL_ENTRY | ||
221 | __field(u8, min_be) | ||
222 | __field(u8, max_be) | ||
223 | __field(u8, max_csma_backoffs) | ||
224 | ), | ||
225 | TP_fast_assign( | ||
226 | LOCAL_ASSIGN, | ||
227 | __entry->min_be = min_be; | ||
228 | __entry->max_be = max_be; | ||
229 | __entry->max_csma_backoffs = max_csma_backoffs; | ||
230 | ), | ||
231 | TP_printk(LOCAL_PR_FMT ", min be: %d, max be: %d, max csma backoffs: %d", | ||
232 | LOCAL_PR_ARG, __entry->min_be, __entry->max_be, | ||
233 | __entry->max_csma_backoffs) | ||
234 | ); | ||
235 | |||
236 | TRACE_EVENT(802154_drv_set_max_frame_retries, | ||
237 | TP_PROTO(struct ieee802154_local *local, s8 max_frame_retries), | ||
238 | TP_ARGS(local, max_frame_retries), | ||
239 | TP_STRUCT__entry( | ||
240 | LOCAL_ENTRY | ||
241 | __field(s8, max_frame_retries) | ||
242 | ), | ||
243 | TP_fast_assign( | ||
244 | LOCAL_ASSIGN; | ||
245 | __entry->max_frame_retries = max_frame_retries; | ||
246 | ), | ||
247 | TP_printk(LOCAL_PR_FMT ", max frame retries: %d", LOCAL_PR_ARG, | ||
248 | __entry->max_frame_retries) | ||
249 | ); | ||
250 | |||
251 | TRACE_EVENT(802154_drv_set_promiscuous_mode, | ||
252 | TP_PROTO(struct ieee802154_local *local, bool on), | ||
253 | TP_ARGS(local, on), | ||
254 | TP_STRUCT__entry( | ||
255 | LOCAL_ENTRY | ||
256 | __field(bool, on) | ||
257 | ), | ||
258 | TP_fast_assign( | ||
259 | LOCAL_ASSIGN; | ||
260 | __entry->on = on; | ||
261 | ), | ||
262 | TP_printk(LOCAL_PR_FMT ", promiscuous mode: %s", LOCAL_PR_ARG, | ||
263 | BOOL_TO_STR(__entry->on)) | ||
264 | ); | ||
265 | |||
266 | #endif /* !__MAC802154_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ | ||
267 | |||
268 | #undef TRACE_INCLUDE_PATH | ||
269 | #define TRACE_INCLUDE_PATH . | ||
270 | #undef TRACE_INCLUDE_FILE | ||
271 | #define TRACE_INCLUDE_FILE trace | ||
272 | #include <trace/define_trace.h> | ||