blob: 8e5470344b19327be21a9f14acd76e5bf380efa6 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Nirav Shahd2310422016-01-21 18:58:06 +05302 * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29 * @file ol_txrx_dbg.h
30 * @brief Functions provided for visibility and debugging.
31 */
32#ifndef _OL_TXRX_DBG__H_
33#define _OL_TXRX_DBG__H_
34
35#include <athdefs.h> /* A_STATUS, uint64_t */
Anurag Chouhana37b5b72016-02-21 14:53:42 +053036#include <qdf_lock.h> /* qdf_semaphore_t */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080037#include <htt.h> /* htt_dbg_stats_type */
38#include <ol_txrx_stats.h> /* ol_txrx_stats */
39
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080040#ifndef TXRX_DEBUG_LEVEL
41#define TXRX_DEBUG_LEVEL 0 /* no debug info */
42#endif
43
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080044enum {
45 TXRX_DBG_MASK_OBJS = 0x01,
46 TXRX_DBG_MASK_STATS = 0x02,
47 TXRX_DBG_MASK_PROT_ANALYZE = 0x04,
48 TXRX_DBG_MASK_RX_REORDER_TRACE = 0x08,
49 TXRX_DBG_MASK_RX_PN_TRACE = 0x10
50};
51
52/*--- txrx printouts ---*/
53
54/*
55 * Uncomment this to enable txrx printouts with dynamically adjustable
56 * verbosity. These printouts should not impact performance.
57 */
58#define TXRX_PRINT_ENABLE 1
59/* uncomment this for verbose txrx printouts (may impact performance) */
60/* #define TXRX_PRINT_VERBOSE_ENABLE 1 */
61
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080062/*--- txrx object (pdev, vdev, peer) display debug functions ---*/
63
64#if TXRX_DEBUG_LEVEL > 5
65void ol_txrx_pdev_display(ol_txrx_pdev_handle pdev, int indent);
66void ol_txrx_vdev_display(ol_txrx_vdev_handle vdev, int indent);
67void ol_txrx_peer_display(ol_txrx_peer_handle peer, int indent);
68#else
69#define ol_txrx_pdev_display(pdev, indent)
70#define ol_txrx_vdev_display(vdev, indent)
71#define ol_txrx_peer_display(peer, indent)
72#endif
73
74/*--- txrx stats display debug functions ---*/
75
76
77void ol_txrx_stats_display(ol_txrx_pdev_handle pdev);
78
79void ol_txrx_stats_clear(ol_txrx_pdev_handle pdev);
80
81
82/*--- txrx protocol analyzer debug feature ---*/
83
84/* uncomment this to enable the protocol analzyer feature */
85/* #define ENABLE_TXRX_PROT_ANALYZE 1 */
86
87#if defined(ENABLE_TXRX_PROT_ANALYZE)
88
89void ol_txrx_prot_ans_display(ol_txrx_pdev_handle pdev);
90
91#else
92
93#define ol_txrx_prot_ans_display(pdev)
94
95#endif /* ENABLE_TXRX_PROT_ANALYZE */
96
97/*--- txrx sequence number trace debug feature ---*/
98
99/* uncomment this to enable the rx reorder trace feature */
100/* #define ENABLE_RX_REORDER_TRACE 1 */
101
102#define ol_txrx_seq_num_trace_display(pdev) \
103 ol_rx_reorder_trace_display(pdev, 0, 0)
104
105#if defined(ENABLE_RX_REORDER_TRACE)
106
107void
108ol_rx_reorder_trace_display(ol_txrx_pdev_handle pdev, int just_once, int limit);
109
110#else
111
112#define ol_rx_reorder_trace_display(pdev, just_once, limit)
113
114#endif /* ENABLE_RX_REORDER_TRACE */
115
116/*--- txrx packet number trace debug feature ---*/
117
118/* uncomment this to enable the rx PN trace feature */
119/* #define ENABLE_RX_PN_TRACE 1 */
120
121#define ol_txrx_pn_trace_display(pdev) ol_rx_pn_trace_display(pdev, 0)
122
123#if defined(ENABLE_RX_PN_TRACE)
124
125void ol_rx_pn_trace_display(ol_txrx_pdev_handle pdev, int just_once);
126
127#else
128
129#define ol_rx_pn_trace_display(pdev, just_once)
130
131#endif /* ENABLE_RX_PN_TRACE */
132
133/*--- tx queue log debug feature ---*/
134/* uncomment this to enable the tx queue log feature */
135/* #define ENABLE_TX_QUEUE_LOG 1 */
136
Siddarth Poddarb2011f62016-04-27 20:45:42 +0530137#if defined(DEBUG_HL_LOGGING) && defined(CONFIG_HL_SUPPORT)
138
139void
140ol_tx_queue_log_display(ol_txrx_pdev_handle pdev);
141void ol_tx_queue_log_clear(ol_txrx_pdev_handle pdev);
142#else
143
144static inline void
145ol_tx_queue_log_display(ol_txrx_pdev_handle pdev)
146{
147 return;
148}
149
150static inline
151void ol_tx_queue_log_clear(ol_txrx_pdev_handle pdev)
152{
153 return;
154}
155#endif /* defined(DEBUG_HL_LOGGING) && defined(CONFIG_HL_SUPPORT) */
156
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800157
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800158/*----------------------------------------*/
159
160#endif /* _OL_TXRX_DBG__H_ */