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