diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-03-18 07:42:20 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2013-03-18 07:42:20 -0400 |
commit | 416cf0b49e67254676b4762d1bab88df5130f909 (patch) | |
tree | f278a3edc3582b4b5b43882574142163a93b1ede | |
parent | 44af34428dfdce0472cb229b013c72710285d2db (diff) |
ath6kl: add tracing support and tracing points for wmi packets
Add basic tracing infrastructure support to ath6kl and which can be
enabled with CONFIG_ATH6KL_TRACING.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/Kconfig | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/Makefile | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/trace.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/trace.h | 87 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/txrx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 3 |
6 files changed, 125 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/Kconfig b/drivers/net/wireless/ath/ath6kl/Kconfig index 26c4b7220859..6971b7a395fe 100644 --- a/drivers/net/wireless/ath/ath6kl/Kconfig +++ b/drivers/net/wireless/ath/ath6kl/Kconfig | |||
@@ -31,6 +31,15 @@ config ATH6KL_DEBUG | |||
31 | ---help--- | 31 | ---help--- |
32 | Enables debug support | 32 | Enables debug support |
33 | 33 | ||
34 | config ATH6KL_TRACING | ||
35 | bool "Atheros ath6kl tracing support" | ||
36 | depends on ATH6KL | ||
37 | depends on EVENT_TRACING | ||
38 | ---help--- | ||
39 | Select this to ath6kl use tracing infrastructure. | ||
40 | |||
41 | If unsure, say Y to make it easier to debug problems. | ||
42 | |||
34 | config ATH6KL_REGDOMAIN | 43 | config ATH6KL_REGDOMAIN |
35 | bool "Atheros ath6kl regdomain support" | 44 | bool "Atheros ath6kl regdomain support" |
36 | depends on ATH6KL | 45 | depends on ATH6KL |
diff --git a/drivers/net/wireless/ath/ath6kl/Makefile b/drivers/net/wireless/ath/ath6kl/Makefile index cab0ec0d5380..dc2b3b46781e 100644 --- a/drivers/net/wireless/ath/ath6kl/Makefile +++ b/drivers/net/wireless/ath/ath6kl/Makefile | |||
@@ -35,10 +35,15 @@ ath6kl_core-y += txrx.o | |||
35 | ath6kl_core-y += wmi.o | 35 | ath6kl_core-y += wmi.o |
36 | ath6kl_core-y += core.o | 36 | ath6kl_core-y += core.o |
37 | ath6kl_core-y += recovery.o | 37 | ath6kl_core-y += recovery.o |
38 | |||
38 | ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o | 39 | ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o |
40 | ath6kl_core-$(CONFIG_ATH6KL_TRACING) += trace.o | ||
39 | 41 | ||
40 | obj-$(CONFIG_ATH6KL_SDIO) += ath6kl_sdio.o | 42 | obj-$(CONFIG_ATH6KL_SDIO) += ath6kl_sdio.o |
41 | ath6kl_sdio-y += sdio.o | 43 | ath6kl_sdio-y += sdio.o |
42 | 44 | ||
43 | obj-$(CONFIG_ATH6KL_USB) += ath6kl_usb.o | 45 | obj-$(CONFIG_ATH6KL_USB) += ath6kl_usb.o |
44 | ath6kl_usb-y += usb.o | 46 | ath6kl_usb-y += usb.o |
47 | |||
48 | # for tracing framework to find trace.h | ||
49 | CFLAGS_trace.o := -I$(src) | ||
diff --git a/drivers/net/wireless/ath/ath6kl/trace.c b/drivers/net/wireless/ath/ath6kl/trace.c new file mode 100644 index 000000000000..4118a29500c1 --- /dev/null +++ b/drivers/net/wireless/ath/ath6kl/trace.c | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012 Qualcomm Atheros, Inc. | ||
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 | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #define CREATE_TRACE_POINTS | ||
18 | #include "trace.h" | ||
diff --git a/drivers/net/wireless/ath/ath6kl/trace.h b/drivers/net/wireless/ath/ath6kl/trace.h new file mode 100644 index 000000000000..07876190ce05 --- /dev/null +++ b/drivers/net/wireless/ath/ath6kl/trace.h | |||
@@ -0,0 +1,87 @@ | |||
1 | #if !defined(_ATH6KL_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | |||
3 | #include <net/cfg80211.h> | ||
4 | #include <linux/skbuff.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | #include "wmi.h" | ||
7 | |||
8 | #if !defined(_ATH6KL_TRACE_H) | ||
9 | static inline unsigned int ath6kl_get_wmi_id(void *buf, size_t buf_len) | ||
10 | { | ||
11 | struct wmi_cmd_hdr *hdr = buf; | ||
12 | |||
13 | if (buf_len < sizeof(*hdr)) | ||
14 | return 0; | ||
15 | |||
16 | return le16_to_cpu(hdr->cmd_id); | ||
17 | } | ||
18 | #endif /* __ATH6KL_TRACE_H */ | ||
19 | |||
20 | #define _ATH6KL_TRACE_H | ||
21 | |||
22 | /* create empty functions when tracing is disabled */ | ||
23 | #if !defined(CONFIG_ATH6KL_TRACING) | ||
24 | #undef TRACE_EVENT | ||
25 | #define TRACE_EVENT(name, proto, ...) \ | ||
26 | static inline void trace_ ## name(proto) {} | ||
27 | #endif /* !CONFIG_ATH6KL_TRACING || __CHECKER__ */ | ||
28 | |||
29 | #undef TRACE_SYSTEM | ||
30 | #define TRACE_SYSTEM ath6kl | ||
31 | |||
32 | TRACE_EVENT(ath6kl_wmi_cmd, | ||
33 | TP_PROTO(void *buf, size_t buf_len), | ||
34 | |||
35 | TP_ARGS(buf, buf_len), | ||
36 | |||
37 | TP_STRUCT__entry( | ||
38 | __field(unsigned int, id) | ||
39 | __field(size_t, buf_len) | ||
40 | __dynamic_array(u8, buf, buf_len) | ||
41 | ), | ||
42 | |||
43 | TP_fast_assign( | ||
44 | __entry->id = ath6kl_get_wmi_id(buf, buf_len); | ||
45 | __entry->buf_len = buf_len; | ||
46 | memcpy(__get_dynamic_array(buf), buf, buf_len); | ||
47 | ), | ||
48 | |||
49 | TP_printk( | ||
50 | "id %d len %d", | ||
51 | __entry->id, __entry->buf_len | ||
52 | ) | ||
53 | ); | ||
54 | |||
55 | TRACE_EVENT(ath6kl_wmi_event, | ||
56 | TP_PROTO(void *buf, size_t buf_len), | ||
57 | |||
58 | TP_ARGS(buf, buf_len), | ||
59 | |||
60 | TP_STRUCT__entry( | ||
61 | __field(unsigned int, id) | ||
62 | __field(size_t, buf_len) | ||
63 | __dynamic_array(u8, buf, buf_len) | ||
64 | ), | ||
65 | |||
66 | TP_fast_assign( | ||
67 | __entry->id = ath6kl_get_wmi_id(buf, buf_len); | ||
68 | __entry->buf_len = buf_len; | ||
69 | memcpy(__get_dynamic_array(buf), buf, buf_len); | ||
70 | ), | ||
71 | |||
72 | TP_printk( | ||
73 | "id %d len %d", | ||
74 | __entry->id, __entry->buf_len | ||
75 | ) | ||
76 | ); | ||
77 | |||
78 | #endif /* _ ATH6KL_TRACE_H || TRACE_HEADER_MULTI_READ*/ | ||
79 | |||
80 | /* we don't want to use include/trace/events */ | ||
81 | #undef TRACE_INCLUDE_PATH | ||
82 | #define TRACE_INCLUDE_PATH . | ||
83 | #undef TRACE_INCLUDE_FILE | ||
84 | #define TRACE_INCLUDE_FILE trace | ||
85 | |||
86 | /* This part must be outside protection */ | ||
87 | #include <trace/define_trace.h> | ||
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index 78b369286579..43dbdaadf577 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "core.h" | 20 | #include "core.h" |
21 | #include "debug.h" | 21 | #include "debug.h" |
22 | #include "htc-ops.h" | 22 | #include "htc-ops.h" |
23 | #include "trace.h" | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * tid - tid_mux0..tid_mux3 | 26 | * tid - tid_mux0..tid_mux3 |
@@ -288,6 +289,8 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb, | |||
288 | int status = 0; | 289 | int status = 0; |
289 | struct ath6kl_cookie *cookie = NULL; | 290 | struct ath6kl_cookie *cookie = NULL; |
290 | 291 | ||
292 | trace_ath6kl_wmi_cmd(skb->data, skb->len); | ||
293 | |||
291 | if (WARN_ON_ONCE(ar->state == ATH6KL_STATE_WOW)) { | 294 | if (WARN_ON_ONCE(ar->state == ATH6KL_STATE_WOW)) { |
292 | dev_kfree_skb(skb); | 295 | dev_kfree_skb(skb); |
293 | return -EACCES; | 296 | return -EACCES; |
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index d76b5bd81a0d..31a308103f4c 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "core.h" | 20 | #include "core.h" |
21 | #include "debug.h" | 21 | #include "debug.h" |
22 | #include "testmode.h" | 22 | #include "testmode.h" |
23 | #include "trace.h" | ||
23 | #include "../regd.h" | 24 | #include "../regd.h" |
24 | #include "../regd_common.h" | 25 | #include "../regd_common.h" |
25 | 26 | ||
@@ -4086,6 +4087,8 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) | |||
4086 | return -EINVAL; | 4087 | return -EINVAL; |
4087 | } | 4088 | } |
4088 | 4089 | ||
4090 | trace_ath6kl_wmi_event(skb->data, skb->len); | ||
4091 | |||
4089 | return ath6kl_wmi_proc_events(wmi, skb); | 4092 | return ath6kl_wmi_proc_events(wmi, skb); |
4090 | } | 4093 | } |
4091 | 4094 | ||