aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2013-03-18 07:42:21 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2013-03-18 07:42:21 -0400
commit4771979aab5ef964ef12803793fbb7884829944d (patch)
tree0e5ffab40c9b5a923abc489e3ada50cb5cb8eb2f
parentd57f093aababe358c9c9248fffb554722c15e837 (diff)
ath6kl: adding tracing points for htc_mbox
Add tracing points for htc layer, just dumping the packets to user space. I wasn't really sure what to do with the status value, it might not always be accurate, but I included it anyway. I skipped htc_pipe (and usb) implementation for now. Need to add those tracepoints later. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/htc_mbox.c21
-rw-r--r--drivers/net/wireless/ath/ath6kl/trace.h56
2 files changed, 76 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
index fbb78dfe078f..65e5b719093d 100644
--- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c
+++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c
@@ -19,6 +19,8 @@
19#include "hif.h" 19#include "hif.h"
20#include "debug.h" 20#include "debug.h"
21#include "hif-ops.h" 21#include "hif-ops.h"
22#include "trace.h"
23
22#include <asm/unaligned.h> 24#include <asm/unaligned.h>
23 25
24#define CALC_TXRX_PADDED_LEN(dev, len) (__ALIGN_MASK((len), (dev)->block_mask)) 26#define CALC_TXRX_PADDED_LEN(dev, len) (__ALIGN_MASK((len), (dev)->block_mask))
@@ -537,6 +539,8 @@ static int ath6kl_htc_tx_issue(struct htc_target *target,
537 packet->buf, padded_len, 539 packet->buf, padded_len,
538 HIF_WR_ASYNC_BLOCK_INC, packet); 540 HIF_WR_ASYNC_BLOCK_INC, packet);
539 541
542 trace_ath6kl_htc_tx(status, packet->endpoint, packet->buf, send_len);
543
540 return status; 544 return status;
541} 545}
542 546
@@ -757,7 +761,8 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
757{ 761{
758 struct htc_target *target = endpoint->target; 762 struct htc_target *target = endpoint->target;
759 struct hif_scatter_req *scat_req = NULL; 763 struct hif_scatter_req *scat_req = NULL;
760 int n_scat, n_sent_bundle = 0, tot_pkts_bundle = 0; 764 int n_scat, n_sent_bundle = 0, tot_pkts_bundle = 0, i;
765 struct htc_packet *packet;
761 int status; 766 int status;
762 u32 txb_mask; 767 u32 txb_mask;
763 u8 ac = WMM_NUM_AC; 768 u8 ac = WMM_NUM_AC;
@@ -832,6 +837,13 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
832 ath6kl_dbg(ATH6KL_DBG_HTC, 837 ath6kl_dbg(ATH6KL_DBG_HTC,
833 "htc tx scatter bytes %d entries %d\n", 838 "htc tx scatter bytes %d entries %d\n",
834 scat_req->len, scat_req->scat_entries); 839 scat_req->len, scat_req->scat_entries);
840
841 for (i = 0; i < scat_req->scat_entries; i++) {
842 packet = scat_req->scat_list[i].packet;
843 trace_ath6kl_htc_tx(packet->status, packet->endpoint,
844 packet->buf, packet->act_len);
845 }
846
835 ath6kl_hif_submit_scat_req(target->dev, scat_req, false); 847 ath6kl_hif_submit_scat_req(target->dev, scat_req, false);
836 848
837 if (status) 849 if (status)
@@ -1903,6 +1915,7 @@ static void ath6kl_htc_rx_complete(struct htc_endpoint *endpoint,
1903 ath6kl_dbg(ATH6KL_DBG_HTC, 1915 ath6kl_dbg(ATH6KL_DBG_HTC,
1904 "htc rx complete ep %d packet 0x%p\n", 1916 "htc rx complete ep %d packet 0x%p\n",
1905 endpoint->eid, packet); 1917 endpoint->eid, packet);
1918
1906 endpoint->ep_cb.rx(endpoint->target, packet); 1919 endpoint->ep_cb.rx(endpoint->target, packet);
1907} 1920}
1908 1921
@@ -2011,6 +2024,9 @@ static int ath6kl_htc_rx_process_packets(struct htc_target *target,
2011 list_for_each_entry_safe(packet, tmp_pkt, comp_pktq, list) { 2024 list_for_each_entry_safe(packet, tmp_pkt, comp_pktq, list) {
2012 ep = &target->endpoint[packet->endpoint]; 2025 ep = &target->endpoint[packet->endpoint];
2013 2026
2027 trace_ath6kl_htc_rx(packet->status, packet->endpoint,
2028 packet->buf, packet->act_len);
2029
2014 /* process header for each of the recv packet */ 2030 /* process header for each of the recv packet */
2015 status = ath6kl_htc_rx_process_hdr(target, packet, lk_ahds, 2031 status = ath6kl_htc_rx_process_hdr(target, packet, lk_ahds,
2016 n_lk_ahd); 2032 n_lk_ahd);
@@ -2291,6 +2307,9 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
2291 if (ath6kl_htc_rx_packet(target, packet, packet->act_len)) 2307 if (ath6kl_htc_rx_packet(target, packet, packet->act_len))
2292 goto fail_ctrl_rx; 2308 goto fail_ctrl_rx;
2293 2309
2310 trace_ath6kl_htc_rx(packet->status, packet->endpoint,
2311 packet->buf, packet->act_len);
2312
2294 /* process receive header */ 2313 /* process receive header */
2295 packet->status = ath6kl_htc_rx_process_hdr(target, packet, NULL, NULL); 2314 packet->status = ath6kl_htc_rx_process_hdr(target, packet, NULL, NULL);
2296 2315
diff --git a/drivers/net/wireless/ath/ath6kl/trace.h b/drivers/net/wireless/ath/ath6kl/trace.h
index 541729b3d4c3..306d58d89cc8 100644
--- a/drivers/net/wireless/ath/ath6kl/trace.h
+++ b/drivers/net/wireless/ath/ath6kl/trace.h
@@ -185,6 +185,62 @@ TRACE_EVENT(ath6kl_sdio_irq,
185 ) 185 )
186); 186);
187 187
188TRACE_EVENT(ath6kl_htc_rx,
189 TP_PROTO(int status, int endpoint, void *buf,
190 size_t buf_len),
191
192 TP_ARGS(status, endpoint, buf, buf_len),
193
194 TP_STRUCT__entry(
195 __field(int, status)
196 __field(int, endpoint)
197 __field(size_t, buf_len)
198 __dynamic_array(u8, buf, buf_len)
199 ),
200
201 TP_fast_assign(
202 __entry->status = status;
203 __entry->endpoint = endpoint;
204 __entry->buf_len = buf_len;
205 memcpy(__get_dynamic_array(buf), buf, buf_len);
206 ),
207
208 TP_printk(
209 "status %d endpoint %d len %d\n",
210 __entry->status,
211 __entry->endpoint,
212 __entry->buf_len
213 )
214);
215
216TRACE_EVENT(ath6kl_htc_tx,
217 TP_PROTO(int status, int endpoint, void *buf,
218 size_t buf_len),
219
220 TP_ARGS(status, endpoint, buf, buf_len),
221
222 TP_STRUCT__entry(
223 __field(int, status)
224 __field(int, endpoint)
225 __field(size_t, buf_len)
226 __dynamic_array(u8, buf, buf_len)
227 ),
228
229 TP_fast_assign(
230 __entry->status = status;
231 __entry->endpoint = endpoint;
232 __entry->buf_len = buf_len;
233 memcpy(__get_dynamic_array(buf), buf, buf_len);
234 ),
235
236 TP_printk(
237 "status %d endpoint %d len %d\n",
238 __entry->status,
239 __entry->endpoint,
240 __entry->buf_len
241 )
242);
243
188#endif /* _ ATH6KL_TRACE_H || TRACE_HEADER_MULTI_READ*/ 244#endif /* _ ATH6KL_TRACE_H || TRACE_HEADER_MULTI_READ*/
189 245
190/* we don't want to use include/trace/events */ 246/* we don't want to use include/trace/events */