Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Jeff Johnson | 5b92ee0 | 2019-01-15 14:40:56 -0800 | [diff] [blame] | 2 | * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 19 | #if !defined(__QDF_TRACE_H) |
| 20 | #define __QDF_TRACE_H |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 21 | |
| 22 | /** |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 23 | * DOC: qdf_trace |
| 24 | * QCA driver framework trace APIs |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 25 | * Trace, logging, and debugging definitions and APIs |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | /* Include Files */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 29 | #include <qdf_types.h> /* For QDF_MODULE_ID... */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 30 | #include <stdarg.h> /* For va_list... */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 31 | #include <qdf_status.h> |
| 32 | #include <qdf_nbuf.h> |
| 33 | #include <i_qdf_types.h> |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 34 | #include <qdf_debugfs.h> |
| 35 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 36 | |
| 37 | /* Type declarations */ |
| 38 | |
Govind Singh | 0b58728 | 2016-04-27 15:38:17 +0530 | [diff] [blame] | 39 | #define FL(x) "%s: %d: " x, __func__, __LINE__ |
Mohit Khanna | 4b3b7e7 | 2018-02-21 18:50:38 -0800 | [diff] [blame] | 40 | |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 41 | #define QDF_TRACE_BUFFER_SIZE (512) |
Govind Singh | 0b58728 | 2016-04-27 15:38:17 +0530 | [diff] [blame] | 42 | |
Ashish Kumar Dhanotiya | 308f575 | 2018-08-02 14:26:53 +0530 | [diff] [blame] | 43 | /* |
| 44 | * Extracts the 8-bit group id from the wmi command id by performing the |
| 45 | * reverse operation of WMI_CMD_GRP_START_ID |
| 46 | */ |
| 47 | #define QDF_WMI_MTRACE_GRP_ID(message_id) (((message_id) >> 12) & 0xFF) |
| 48 | /* |
| 49 | * Number of bits reserved for WMI mtrace command id |
| 50 | */ |
| 51 | #define QDF_WMI_MTRACE_CMD_NUM_BITS 7 |
| 52 | /* |
| 53 | * Extracts the 7-bit group specific command id from the wmi command id |
| 54 | */ |
| 55 | #define QDF_WMI_MTRACE_CMD_ID(message_id) ((message_id) & 0x7F) |
| 56 | |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 57 | #ifdef CONFIG_MCL |
| 58 | #define QDF_DEFAULT_TRACE_LEVEL \ |
| 59 | ((1 << QDF_TRACE_LEVEL_FATAL) | (1 << QDF_TRACE_LEVEL_ERROR)) |
| 60 | #else |
| 61 | #define QDF_DEFAULT_TRACE_LEVEL (1 << QDF_TRACE_LEVEL_INFO) |
| 62 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | |
Sathish Kumar | 470c620 | 2017-05-10 19:56:48 +0530 | [diff] [blame] | 64 | #define QDF_CATEGORY_INFO_U16(val) (((val >> 16) & 0x0000FFFF)) |
| 65 | #define QDF_TRACE_LEVEL_INFO_L16(val) (val & 0x0000FFFF) |
| 66 | |
Dustin Brown | 536064a | 2017-04-03 17:00:07 -0700 | [diff] [blame] | 67 | typedef int (qdf_abstract_print)(void *priv, const char *fmt, ...); |
| 68 | |
Anurag Chouhan | 85bc91a | 2016-03-21 19:18:37 +0530 | [diff] [blame] | 69 | /* |
| 70 | * Log levels |
| 71 | */ |
| 72 | #define QDF_DEBUG_FUNCTRACE 0x01 |
| 73 | #define QDF_DEBUG_LEVEL0 0x02 |
| 74 | #define QDF_DEBUG_LEVEL1 0x04 |
| 75 | #define QDF_DEBUG_LEVEL2 0x08 |
| 76 | #define QDF_DEBUG_LEVEL3 0x10 |
| 77 | #define QDF_DEBUG_ERROR 0x20 |
| 78 | #define QDF_DEBUG_CFG 0x40 |
| 79 | |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 80 | |
| 81 | /* DP Trace Implementation */ |
| 82 | #ifdef CONFIG_DP_TRACE |
| 83 | #define DPTRACE(p) p |
Mohit Khanna | 163c317 | 2018-06-27 01:34:02 -0700 | [diff] [blame] | 84 | #define DPTRACE_PRINT(args...) \ |
| 85 | QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG, args) |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 86 | #else |
| 87 | #define DPTRACE(p) |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 88 | #define DPTRACE_PRINT(args...) |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 89 | #endif |
| 90 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 91 | /* By default Data Path module will have all log levels enabled, except debug |
| 92 | * log level. Debug level will be left up to the framework or user space modules |
| 93 | * to be enabled when issue is detected |
| 94 | */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 95 | #define QDF_DATA_PATH_TRACE_LEVEL \ |
| 96 | ((1 << QDF_TRACE_LEVEL_FATAL) | (1 << QDF_TRACE_LEVEL_ERROR) | \ |
| 97 | (1 << QDF_TRACE_LEVEL_WARN) | (1 << QDF_TRACE_LEVEL_INFO) | \ |
| 98 | (1 << QDF_TRACE_LEVEL_INFO_HIGH) | (1 << QDF_TRACE_LEVEL_INFO_MED) | \ |
| 99 | (1 << QDF_TRACE_LEVEL_INFO_LOW)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 100 | |
| 101 | /* Preprocessor definitions and constants */ |
| 102 | #define ASSERT_BUFFER_SIZE (512) |
| 103 | |
Nirav Shah | 79ec3e9 | 2018-06-01 16:32:28 +0530 | [diff] [blame] | 104 | #ifndef MAX_QDF_TRACE_RECORDS |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 105 | #define MAX_QDF_TRACE_RECORDS 4000 |
Nirav Shah | 79ec3e9 | 2018-06-01 16:32:28 +0530 | [diff] [blame] | 106 | #endif |
| 107 | |
| 108 | #define QDF_TRACE_DEFAULT_PDEV_ID 0xff |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 109 | #define INVALID_QDF_TRACE_ADDR 0xffffffff |
| 110 | #define DEFAULT_QDF_TRACE_DUMP_COUNT 0 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 111 | |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 112 | /* |
| 113 | * first parameter to iwpriv command - dump_dp_trace |
| 114 | * iwpriv wlan0 dump_dp_trace 0 0 -> dump full buffer |
| 115 | * iwpriv wlan0 dump_dp_trace 1 0 -> enable live view mode |
| 116 | * iwpriv wlan0 dump_dp_trace 2 0 -> clear dp trace buffer |
| 117 | * iwpriv wlan0 dump_dp_trace 3 0 -> disable live view mode |
| 118 | */ |
| 119 | #define DUMP_DP_TRACE 0 |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 120 | #define ENABLE_DP_TRACE_LIVE_MODE 1 |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 121 | #define CLEAR_DP_TRACE_BUFFER 2 |
| 122 | #define DISABLE_DP_TRACE_LIVE_MODE 3 |
| 123 | |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 124 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 125 | #ifdef TRACE_RECORD |
| 126 | |
| 127 | #define MTRACE(p) p |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 128 | |
| 129 | #else |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 130 | #define MTRACE(p) do { } while (0) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 131 | |
| 132 | #endif |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 133 | #define NO_SESSION 0xFF |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 134 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 135 | /** |
| 136 | * typedef struct qdf_trace_record_s - keep trace record |
Sreelakshmi Konamki | e2e3135 | 2016-10-27 15:00:57 +0530 | [diff] [blame] | 137 | * @qtime: qtimer ticks |
| 138 | * @time: user timestamp |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 139 | * @module: module name |
| 140 | * @code: hold record of code |
| 141 | * @session: hold record of session |
| 142 | * @data: hold data |
| 143 | * @pid: hold pid of the process |
| 144 | */ |
| 145 | typedef struct qdf_trace_record_s { |
Sreelakshmi Konamki | e2e3135 | 2016-10-27 15:00:57 +0530 | [diff] [blame] | 146 | uint64_t qtime; |
| 147 | char time[18]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 148 | uint8_t module; |
| 149 | uint8_t code; |
| 150 | uint16_t session; |
| 151 | uint32_t data; |
| 152 | uint32_t pid; |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 153 | } qdf_trace_record_t, *tp_qdf_trace_record; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 154 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 155 | /** |
| 156 | * typedef struct s_qdf_trace_data - MTRACE logs are stored in ring buffer |
| 157 | * @head: position of first record |
| 158 | * @tail: position of last record |
| 159 | * @num: count of total record |
| 160 | * @num_since_last_dump: count from last dump |
| 161 | * @enable: config for controlling the trace |
| 162 | * @dump_count: Dump after number of records reach this number |
| 163 | */ |
| 164 | typedef struct s_qdf_trace_data { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 165 | uint32_t head; |
| 166 | uint32_t tail; |
| 167 | uint32_t num; |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 168 | uint16_t num_since_last_dump; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 169 | uint8_t enable; |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 170 | uint16_t dump_count; |
| 171 | } t_qdf_trace_data; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 172 | |
| 173 | #define CASE_RETURN_STRING(str) case ((str)): return (uint8_t *)(# str); |
| 174 | |
Nirav Shah | 79ec3e9 | 2018-06-01 16:32:28 +0530 | [diff] [blame] | 175 | #ifndef MAX_QDF_DP_TRACE_RECORDS |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 176 | #define MAX_QDF_DP_TRACE_RECORDS 2000 |
Nirav Shah | 79ec3e9 | 2018-06-01 16:32:28 +0530 | [diff] [blame] | 177 | #endif |
| 178 | |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 179 | #define QDF_DP_TRACE_RECORD_SIZE 40 |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 180 | #define INVALID_QDF_DP_TRACE_ADDR 0xffffffff |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 181 | #define QDF_DP_TRACE_VERBOSITY_HIGH 4 |
| 182 | #define QDF_DP_TRACE_VERBOSITY_MEDIUM 3 |
| 183 | #define QDF_DP_TRACE_VERBOSITY_LOW 2 |
| 184 | #define QDF_DP_TRACE_VERBOSITY_ULTRA_LOW 1 |
| 185 | #define QDF_DP_TRACE_VERBOSITY_BASE 0 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 186 | |
| 187 | /** |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 188 | * enum QDF_DP_TRACE_ID - Generic ID to identify various events in data path |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 189 | * @QDF_DP_TRACE_INVALID - invalid |
| 190 | * @QDF_DP_TRACE_DROP_PACKET_RECORD - record drop packet |
| 191 | * @QDF_DP_TRACE_EAPOL_PACKET_RECORD - record EAPOL packet |
| 192 | * @QDF_DP_TRACE_DHCP_PACKET_RECORD - record DHCP packet |
| 193 | * @QDF_DP_TRACE_ARP_PACKET_RECORD - record ARP packet |
| 194 | * @QDF_DP_TRACE_MGMT_PACKET_RECORD - record MGMT pacekt |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 195 | * @QDF_DP_TRACE_EVENT_RECORD - record events |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 196 | * @QDF_DP_TRACE_BASE_VERBOSITY - below this are part of base verbosity |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 197 | * @QDF_DP_TRACE_ICMP_PACKET_RECORD - record ICMP packet |
| 198 | * @QDF_DP_TRACE_ICMPv6_PACKET_RECORD - record ICMPv6 packet |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 199 | * @QDF_DP_TRACE_HDD_TX_TIMEOUT - HDD tx timeout |
| 200 | * @QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT- SOFTAP HDD tx timeout |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 201 | * @QDF_DP_TRACE_ULTRA_LOW_VERBOSITY - Below this is not logged for >4PPS |
| 202 | * @QDF_DP_TRACE_TX_PACKET_RECORD - record 32 bytes of tx pkt at any layer |
| 203 | * @QDF_DP_TRACE_RX_PACKET_RECORD - record 32 bytes of rx pkt at any layer |
| 204 | * @QDF_DP_TRACE_HDD_TX_PACKET_RECORD - record 32 bytes of tx pkt at HDD |
| 205 | * @QDF_DP_TRACE_HDD_RX_PACKET_RECORD - record 32 bytes of rx pkt at HDD |
Mohit Khanna | 163c317 | 2018-06-27 01:34:02 -0700 | [diff] [blame] | 206 | * @QDF_DP_TRACE_LI_DP_TX_PACKET_RECORD - record data bytes of tx pkt at LI_DP |
| 207 | * @QDF_DP_TRACE_LI_DP_RX_PACKET_RECORD - record data bytes of rx pkt at LI_DP |
| 208 | * @QDF_DP_TRACE_LI_DP_FREE_PACKET_PTR_RECORD - tx completion ptr record for |
| 209 | * lithium |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 210 | * @QDF_DP_TRACE_FREE_PACKET_PTR_RECORD - tx completion ptr record |
| 211 | * @QDF_DP_TRACE_LOW_VERBOSITY - below this are part of low verbosity |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 212 | * @QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD - HDD layer ptr record |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 213 | * @QDF_DP_TRACE_LI_DP_TX_PACKET_PTR_RECORD - Lithium DP layer ptr record |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 214 | * @QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD - HDD RX record |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 215 | * @QDF_DP_TRACE_CE_PACKET_PTR_RECORD - CE layer ptr record |
| 216 | * @QDF_DP_TRACE_CE_FAST_PACKET_PTR_RECORD- CE fastpath ptr record |
Yun Park | c60a22b | 2017-08-15 12:04:11 -0700 | [diff] [blame] | 217 | * @QDF_DP_TRACE_CE_FAST_PACKET_ERR_RECORD- CE fastpath error record |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 218 | * @QDF_DP_TRACE_RX_HTT_PACKET_PTR_RECORD - HTT RX record |
| 219 | * @QDF_DP_TRACE_RX_OFFLOAD_HTT_PACKET_PTR_RECORD- HTT RX offload record |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 220 | * @QDF_DP_TRACE_RX_LI_DP_PACKET_PTR_RECORD - Lithium DP RX record |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 221 | * @QDF_DP_TRACE_MED_VERBOSITY - below this are part of med verbosity |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 222 | * @QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD -tx queue ptr record |
| 223 | * @QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD - txrx packet ptr record |
| 224 | * @QDF_DP_TRACE_TXRX_FAST_PACKET_PTR_RECORD - txrx fast path record |
| 225 | * @QDF_DP_TRACE_HTT_PACKET_PTR_RECORD - htt packet ptr record |
| 226 | * @QDF_DP_TRACE_HTC_PACKET_PTR_RECORD - htc packet ptr record |
| 227 | * @QDF_DP_TRACE_HIF_PACKET_PTR_RECORD - hif packet ptr record |
| 228 | * @QDF_DP_TRACE_RX_TXRX_PACKET_PTR_RECORD - txrx packet ptr record |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 229 | * @QDF_DP_TRACE_LI_DP_NULL_RX_PACKET_RECORD |
Mohit Khanna | 163c317 | 2018-06-27 01:34:02 -0700 | [diff] [blame] | 230 | * - record data bytes of rx null_queue pkt at LI_DP |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 231 | * @QDF_DP_TRACE_HIGH_VERBOSITY - below this are part of high verbosity |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 232 | */ |
Mohit Khanna | 163c317 | 2018-06-27 01:34:02 -0700 | [diff] [blame] | 233 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 234 | enum QDF_DP_TRACE_ID { |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 235 | QDF_DP_TRACE_INVALID, |
| 236 | QDF_DP_TRACE_DROP_PACKET_RECORD, |
| 237 | QDF_DP_TRACE_EAPOL_PACKET_RECORD, |
| 238 | QDF_DP_TRACE_DHCP_PACKET_RECORD, |
| 239 | QDF_DP_TRACE_ARP_PACKET_RECORD, |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 240 | QDF_DP_TRACE_MGMT_PACKET_RECORD, |
Himanshu Agarwal | c0b7145 | 2016-09-20 15:10:55 +0530 | [diff] [blame] | 241 | QDF_DP_TRACE_EVENT_RECORD, |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 242 | QDF_DP_TRACE_BASE_VERBOSITY, |
| 243 | QDF_DP_TRACE_ICMP_PACKET_RECORD, |
Poddar, Siddarth | bf4231b | 2017-07-10 16:27:01 +0530 | [diff] [blame] | 244 | QDF_DP_TRACE_ICMPv6_PACKET_RECORD, |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 245 | QDF_DP_TRACE_HDD_TX_TIMEOUT, |
| 246 | QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT, |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 247 | QDF_DP_TRACE_ULTRA_LOW_VERBOSITY, |
| 248 | QDF_DP_TRACE_TX_PACKET_RECORD, |
| 249 | QDF_DP_TRACE_RX_PACKET_RECORD, |
| 250 | QDF_DP_TRACE_HDD_TX_PACKET_RECORD, |
| 251 | QDF_DP_TRACE_HDD_RX_PACKET_RECORD, |
Mohit Khanna | 163c317 | 2018-06-27 01:34:02 -0700 | [diff] [blame] | 252 | QDF_DP_TRACE_LI_DP_TX_PACKET_RECORD, |
| 253 | QDF_DP_TRACE_LI_DP_RX_PACKET_RECORD, |
| 254 | QDF_DP_TRACE_LI_DP_FREE_PACKET_PTR_RECORD, |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 255 | QDF_DP_TRACE_FREE_PACKET_PTR_RECORD, |
| 256 | QDF_DP_TRACE_LOW_VERBOSITY, |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 257 | QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD, |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 258 | QDF_DP_TRACE_LI_DP_TX_PACKET_PTR_RECORD, |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 259 | QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD, |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 260 | QDF_DP_TRACE_CE_PACKET_PTR_RECORD, |
| 261 | QDF_DP_TRACE_CE_FAST_PACKET_PTR_RECORD, |
Yun Park | c60a22b | 2017-08-15 12:04:11 -0700 | [diff] [blame] | 262 | QDF_DP_TRACE_CE_FAST_PACKET_ERR_RECORD, |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 263 | QDF_DP_TRACE_RX_HTT_PACKET_PTR_RECORD, |
| 264 | QDF_DP_TRACE_RX_OFFLOAD_HTT_PACKET_PTR_RECORD, |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 265 | QDF_DP_TRACE_RX_LI_DP_PACKET_PTR_RECORD, |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 266 | QDF_DP_TRACE_MED_VERBOSITY, |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 267 | QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD, |
| 268 | QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD, |
| 269 | QDF_DP_TRACE_TXRX_FAST_PACKET_PTR_RECORD, |
| 270 | QDF_DP_TRACE_HTT_PACKET_PTR_RECORD, |
| 271 | QDF_DP_TRACE_HTC_PACKET_PTR_RECORD, |
| 272 | QDF_DP_TRACE_HIF_PACKET_PTR_RECORD, |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 273 | QDF_DP_TRACE_RX_TXRX_PACKET_PTR_RECORD, |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 274 | QDF_DP_TRACE_LI_DP_NULL_RX_PACKET_RECORD, |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 275 | QDF_DP_TRACE_HIGH_VERBOSITY, |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 276 | QDF_DP_TRACE_MAX |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 277 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 278 | |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 279 | /** |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 280 | * qdf_proto_dir - direction |
| 281 | * @QDF_TX: TX direction |
| 282 | * @QDF_RX: RX direction |
| 283 | * @QDF_NA: not applicable |
| 284 | */ |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 285 | enum qdf_proto_dir { |
| 286 | QDF_TX, |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 287 | QDF_RX, |
| 288 | QDF_NA |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 289 | }; |
| 290 | |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 291 | /** |
| 292 | * struct qdf_dp_trace_ptr_buf - pointer record buffer |
| 293 | * @cookie: cookie value |
| 294 | * @msdu_id: msdu_id |
| 295 | * @status: completion status |
| 296 | */ |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 297 | struct qdf_dp_trace_ptr_buf { |
| 298 | uint64_t cookie; |
| 299 | uint16_t msdu_id; |
| 300 | uint16_t status; |
| 301 | }; |
| 302 | |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 303 | /** |
| 304 | * struct qdf_dp_trace_proto_buf - proto packet buffer |
| 305 | * @sa: source address |
| 306 | * @da: destination address |
| 307 | * @vdev_id : vdev id |
| 308 | * @type: packet type |
| 309 | * @subtype: packet subtype |
| 310 | * @dir: direction |
| 311 | */ |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 312 | struct qdf_dp_trace_proto_buf { |
| 313 | struct qdf_mac_addr sa; |
| 314 | struct qdf_mac_addr da; |
| 315 | uint8_t vdev_id; |
| 316 | uint8_t type; |
| 317 | uint8_t subtype; |
| 318 | uint8_t dir; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 319 | }; |
| 320 | |
| 321 | /** |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 322 | * struct qdf_dp_trace_mgmt_buf - mgmt packet buffer |
| 323 | * @vdev_id : vdev id |
| 324 | * @type: packet type |
| 325 | * @subtype: packet subtype |
| 326 | */ |
| 327 | struct qdf_dp_trace_mgmt_buf { |
| 328 | uint8_t vdev_id; |
| 329 | uint8_t type; |
| 330 | uint8_t subtype; |
| 331 | }; |
| 332 | |
| 333 | /** |
Himanshu Agarwal | c0b7145 | 2016-09-20 15:10:55 +0530 | [diff] [blame] | 334 | * struct qdf_dp_trace_event_buf - event buffer |
| 335 | * @vdev_id : vdev id |
| 336 | * @type: packet type |
| 337 | * @subtype: packet subtype |
| 338 | */ |
| 339 | struct qdf_dp_trace_event_buf { |
| 340 | uint8_t vdev_id; |
| 341 | uint8_t type; |
| 342 | uint8_t subtype; |
| 343 | }; |
| 344 | |
| 345 | /** |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 346 | * struct qdf_dp_trace_data_buf - nbuf data buffer |
| 347 | * @msdu_id : msdu id |
| 348 | */ |
| 349 | struct qdf_dp_trace_data_buf { |
| 350 | uint16_t msdu_id; |
| 351 | }; |
| 352 | |
| 353 | /** |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 354 | * struct qdf_dp_trace_record_s - Describes a record in DP trace |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 355 | * @time: time when it got stored |
| 356 | * @code: Describes the particular event |
| 357 | * @data: buffer to store data |
| 358 | * @size: Length of the valid data stored in this record |
| 359 | * @pid : process id which stored the data in this record |
| 360 | */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 361 | struct qdf_dp_trace_record_s { |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 362 | uint64_t time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 363 | uint8_t code; |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 364 | uint8_t data[QDF_DP_TRACE_RECORD_SIZE]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 365 | uint8_t size; |
| 366 | uint32_t pid; |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 367 | uint8_t pdev_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 368 | }; |
| 369 | |
| 370 | /** |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 371 | * struct qdf_dp_trace_data - Parameters to configure/control DP trace |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 372 | * @head: Position of first record |
| 373 | * @tail: Position of last record |
| 374 | * @num: Current index |
| 375 | * @proto_bitmap: defines which protocol to be traced |
| 376 | * @no_of_record: defines every nth packet to be traced |
Rakshith Suresh Patkar | e105ac1 | 2018-12-06 20:40:49 +0530 | [diff] [blame] | 377 | * @num_records_to_dump: defines number of records to be dumped |
| 378 | * @dump_counter: counter to track number of records dumped |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 379 | * @verbosity : defines verbosity level |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 380 | * @ini_conf_verbosity: Configured verbosity from INI |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 381 | * @enable: enable/disable DP trace |
| 382 | * @count: current packet number |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 383 | * @live_mode_config: configuration as received during initialization |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 384 | * @live_mode: current live mode, enabled or disabled, can be throttled based |
| 385 | * on throughput |
| 386 | * @force_live_mode: flag to enable live mode all the time for all packets. |
| 387 | * This can be set/unset from userspace and overrides other |
| 388 | * live mode flags. |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 389 | * @dynamic_verbosity_modify: Dynamic user configured verbosity overrides all |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 390 | * @print_pkt_cnt: count of number of packets printed in live mode |
Mohit Khanna | 90d7ebd | 2017-09-12 21:54:21 -0700 | [diff] [blame] | 391 | * @high_tput_thresh: thresh beyond which live mode is turned off |
| 392 | * @thresh_time_limit: max time, in terms of BW timer intervals to wait, |
| 393 | * for determining if high_tput_thresh has been crossed. ~1s |
| 394 | * @arp_req: stats for arp reqs |
| 395 | * @arp_resp: stats for arp resps |
| 396 | * @icmp_req: stats for icmp reqs |
| 397 | * @icmp_resp: stats for icmp resps |
| 398 | * @dhcp_disc: stats for dhcp discover msgs |
| 399 | * @dhcp_req: stats for dhcp req msgs |
| 400 | * @dhcp_off: stats for dhcp offer msgs |
| 401 | * @dhcp_ack: stats for dhcp ack msgs |
| 402 | * @dhcp_nack: stats for dhcp nack msgs |
| 403 | * @dhcp_others: stats for other dhcp pkts types |
| 404 | * @eapol_m1: stats for eapol m1 |
| 405 | * @eapol_m2: stats for eapol m2 |
| 406 | * @eapol_m3: stats for eapol m3 |
| 407 | * @eapol_m4: stats for eapol m4 |
| 408 | * @eapol_others: stats for other eapol pkt types |
| 409 | * @icmpv6_req: stats for icmpv6 reqs |
| 410 | * @icmpv6_resp: stats for icmpv6 resps |
| 411 | * @icmpv6_ns: stats for icmpv6 nss |
| 412 | * @icmpv6_na: stats for icmpv6 nas |
| 413 | * @icmpv6_rs: stats for icmpv6 rss |
| 414 | * @icmpv6_ra: stats for icmpv6 ras |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 415 | */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 416 | struct s_qdf_dp_trace_data { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | uint32_t head; |
| 418 | uint32_t tail; |
| 419 | uint32_t num; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 420 | uint8_t proto_bitmap; |
| 421 | uint8_t no_of_record; |
Rakshith Suresh Patkar | e105ac1 | 2018-12-06 20:40:49 +0530 | [diff] [blame] | 422 | uint16_t num_records_to_dump; |
| 423 | uint16_t dump_counter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 424 | uint8_t verbosity; |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 425 | uint8_t ini_conf_verbosity; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 426 | bool enable; |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 427 | bool live_mode_config; |
| 428 | bool live_mode; |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 429 | uint32_t curr_pos; |
| 430 | uint32_t saved_tail; |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 431 | bool force_live_mode; |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 432 | bool dynamic_verbosity_modify; |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 433 | uint8_t print_pkt_cnt; |
| 434 | uint8_t high_tput_thresh; |
| 435 | uint16_t thresh_time_limit; |
| 436 | /* Stats */ |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 437 | uint32_t tx_count; |
| 438 | uint32_t rx_count; |
Mohit Khanna | 90d7ebd | 2017-09-12 21:54:21 -0700 | [diff] [blame] | 439 | u16 arp_req; |
| 440 | u16 arp_resp; |
| 441 | u16 dhcp_disc; |
| 442 | u16 dhcp_req; |
| 443 | u16 dhcp_off; |
| 444 | u16 dhcp_ack; |
| 445 | u16 dhcp_nack; |
| 446 | u16 dhcp_others; |
| 447 | u16 eapol_m1; |
| 448 | u16 eapol_m2; |
| 449 | u16 eapol_m3; |
| 450 | u16 eapol_m4; |
| 451 | u16 eapol_others; |
| 452 | u16 icmp_req; |
| 453 | u16 icmp_resp; |
| 454 | u16 icmpv6_req; |
| 455 | u16 icmpv6_resp; |
| 456 | u16 icmpv6_ns; |
| 457 | u16 icmpv6_na; |
| 458 | u16 icmpv6_rs; |
| 459 | u16 icmpv6_ra; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 460 | }; |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 461 | |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 462 | /** |
| 463 | * struct qdf_dpt_debugfs_state - state to control read to debugfs file |
| 464 | * @QDF_DPT_DEBUGFS_STATE_SHOW_STATE_INVALID: invalid state |
| 465 | * @QDF_DPT_DEBUGFS_STATE_SHOW_STATE_INIT: initial state |
| 466 | * @QDF_DPT_DEBUGFS_STATE_SHOW_IN_PROGRESS: read is in progress |
| 467 | * @QDF_DPT_DEBUGFS_STATE_SHOW_COMPLETE: read complete |
| 468 | */ |
| 469 | |
| 470 | enum qdf_dpt_debugfs_state { |
| 471 | QDF_DPT_DEBUGFS_STATE_SHOW_STATE_INVALID, |
| 472 | QDF_DPT_DEBUGFS_STATE_SHOW_STATE_INIT, |
| 473 | QDF_DPT_DEBUGFS_STATE_SHOW_IN_PROGRESS, |
| 474 | QDF_DPT_DEBUGFS_STATE_SHOW_COMPLETE, |
| 475 | }; |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 476 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 477 | typedef void (*tp_qdf_trace_cb)(void *p_mac, tp_qdf_trace_record, uint16_t); |
Padma, Santhosh Kumar | 75394d6 | 2016-08-11 16:33:03 +0530 | [diff] [blame] | 478 | typedef void (*tp_qdf_state_info_cb) (char **buf, uint16_t *size); |
Wen Gong | a5dfb6d | 2018-04-26 16:35:19 +0800 | [diff] [blame] | 479 | #ifdef WLAN_FEATURE_MEMDUMP_ENABLE |
Padma, Santhosh Kumar | 75394d6 | 2016-08-11 16:33:03 +0530 | [diff] [blame] | 480 | void qdf_register_debugcb_init(void); |
| 481 | void qdf_register_debug_callback(QDF_MODULE_ID module_id, |
| 482 | tp_qdf_state_info_cb qdf_state_infocb); |
| 483 | QDF_STATUS qdf_state_info_dump_all(char *buf, uint16_t size, |
| 484 | uint16_t *driver_dump_size); |
Wen Gong | a5dfb6d | 2018-04-26 16:35:19 +0800 | [diff] [blame] | 485 | #else /* WLAN_FEATURE_MEMDUMP_ENABLE */ |
| 486 | static inline void qdf_register_debugcb_init(void) |
| 487 | { |
| 488 | } |
| 489 | #endif /* WLAN_FEATURE_MEMDUMP_ENABLE */ |
| 490 | |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 491 | #ifdef TRACE_RECORD |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 492 | void qdf_trace_register(QDF_MODULE_ID, tp_qdf_trace_cb); |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 493 | void qdf_trace_init(void); |
Rachit Kankane | 371fce2 | 2018-06-26 19:20:05 +0530 | [diff] [blame] | 494 | void qdf_trace_deinit(void); |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 495 | void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data); |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 496 | void qdf_trace_enable(uint32_t, uint8_t enable); |
| 497 | void qdf_trace_dump_all(void *, uint8_t, uint8_t, uint32_t, uint32_t); |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 498 | QDF_STATUS qdf_trace_spin_lock_init(void); |
| 499 | #else |
| 500 | #ifdef CONFIG_MCL |
| 501 | static inline |
| 502 | void qdf_trace_init(void) |
| 503 | { |
| 504 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 505 | |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 506 | static inline |
Rachit Kankane | 371fce2 | 2018-06-26 19:20:05 +0530 | [diff] [blame] | 507 | void qdf_trace_deinit(void) |
| 508 | { |
| 509 | } |
| 510 | |
| 511 | static inline |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 512 | void qdf_trace_enable(uint32_t bitmask_of_module_id, uint8_t enable) |
| 513 | { |
| 514 | } |
Ashish Kumar Dhanotiya | 27bcaf8 | 2018-06-26 16:57:40 +0530 | [diff] [blame] | 515 | |
Rachit Kankane | 9cc217a | 2018-01-19 15:15:14 +0530 | [diff] [blame] | 516 | static inline |
| 517 | void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data) |
| 518 | { |
| 519 | } |
| 520 | |
| 521 | static inline |
| 522 | void qdf_trace_dump_all(void *p_mac, uint8_t code, uint8_t session, |
| 523 | uint32_t count, uint32_t bitmask_of_module) |
| 524 | { |
| 525 | } |
| 526 | |
| 527 | static inline |
| 528 | QDF_STATUS qdf_trace_spin_lock_init(void) |
| 529 | { |
| 530 | return QDF_STATUS_E_INVAL; |
| 531 | } |
| 532 | #endif |
| 533 | #endif |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 534 | |
Ashish Kumar Dhanotiya | 27bcaf8 | 2018-06-26 16:57:40 +0530 | [diff] [blame] | 535 | #ifdef ENABLE_MTRACE_LOG |
| 536 | /** |
| 537 | * qdf_mtrace_log() - Logs a message tracepoint to DIAG |
| 538 | * Infrastructure. |
| 539 | * @src_module: Enum of source module (basically module id) |
| 540 | * from where the message with message_id is posted. |
| 541 | * @dst_module: Enum of destination module (basically module id) |
| 542 | * to which the message with message_id is posted. |
| 543 | * @message_id: Id of the message to be posted |
| 544 | * @vdev_id: Vdev Id |
| 545 | * |
| 546 | * This function logs to the DIAG Infrastructure a tracepoint for a |
| 547 | * message being sent from a source module to a destination module |
| 548 | * with a specific ID for the benefit of a specific vdev. |
| 549 | * For non-vdev messages vdev_id will be NO_SESSION |
| 550 | * Return: None |
| 551 | */ |
| 552 | void qdf_mtrace_log(QDF_MODULE_ID src_module, QDF_MODULE_ID dst_module, |
| 553 | uint16_t message_id, uint8_t vdev_id); |
| 554 | #else |
| 555 | static inline |
| 556 | void qdf_mtrace_log(QDF_MODULE_ID src_module, QDF_MODULE_ID dst_module, |
| 557 | uint16_t message_id, uint8_t vdev_id) |
| 558 | { |
| 559 | } |
| 560 | #endif |
| 561 | |
Ashish Kumar Dhanotiya | 89921da | 2018-09-06 17:41:52 +0530 | [diff] [blame] | 562 | #ifdef TRACE_RECORD |
Ashish Kumar Dhanotiya | 27bcaf8 | 2018-06-26 16:57:40 +0530 | [diff] [blame] | 563 | /** |
| 564 | * qdf_mtrace() - puts the messages in to ring-buffer |
| 565 | * and logs a message tracepoint to DIAG Infrastructure. |
| 566 | * @src_module: Enum of source module (basically module id) |
| 567 | * from where the message with message_id is posted. |
| 568 | * @dst_module: Enum of destination module (basically module id) |
| 569 | * to which the message with message_id is posted. |
| 570 | * @message_id: Id of the message to be posted |
| 571 | * @vdev_id: Vdev Id |
| 572 | * @data: Actual message contents |
| 573 | * |
| 574 | * This function will be called from each module which wants to record the |
| 575 | * messages in circular queue. Before calling this function make sure you |
| 576 | * have registered your module with qdf through qdf_trace_register function. |
| 577 | * In addition of the recording the messages in circular queue this function |
| 578 | * will log the message tracepoint to the DIAG infrastructure. |
| 579 | * these logs will be later used by post processing script. |
| 580 | * |
| 581 | * Return: None |
| 582 | */ |
| 583 | void qdf_mtrace(QDF_MODULE_ID src_module, QDF_MODULE_ID dst_module, |
| 584 | uint16_t message_id, uint8_t vdev_id, uint32_t data); |
Ashish Kumar Dhanotiya | 89921da | 2018-09-06 17:41:52 +0530 | [diff] [blame] | 585 | #else |
| 586 | static inline |
| 587 | void qdf_mtrace(QDF_MODULE_ID src_module, QDF_MODULE_ID dst_module, |
| 588 | uint16_t message_id, uint8_t vdev_id, uint32_t data) |
| 589 | { |
| 590 | } |
| 591 | #endif |
Ashish Kumar Dhanotiya | 27bcaf8 | 2018-06-26 16:57:40 +0530 | [diff] [blame] | 592 | |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 593 | #ifdef CONFIG_DP_TRACE |
| 594 | void qdf_dp_set_proto_bitmap(uint32_t val); |
| 595 | void qdf_dp_trace_set_verbosity(uint32_t val); |
| 596 | void qdf_dp_set_no_of_record(uint32_t val); |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 597 | #define QDF_DP_TRACE_RECORD_INFO_LIVE (0x1) |
| 598 | #define QDF_DP_TRACE_RECORD_INFO_THROTTLED (0x1 << 1) |
| 599 | |
Jeff Johnson | 5b92ee0 | 2019-01-15 14:40:56 -0800 | [diff] [blame] | 600 | /** |
| 601 | * qdf_dp_trace_log_pkt() - log packet type enabled through iwpriv |
| 602 | * @vdev_id: vdev_id |
| 603 | * @skb: skb pointer |
| 604 | * @dir: direction |
| 605 | * @pdev_id: pdev_id |
| 606 | * |
| 607 | * Return: true: some protocol was logged, false: no protocol was logged. |
| 608 | */ |
| 609 | bool qdf_dp_trace_log_pkt(uint8_t vdev_id, struct sk_buff *skb, |
| 610 | enum qdf_proto_dir dir, uint8_t pdev_id); |
| 611 | |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 612 | void qdf_dp_trace_init(bool live_mode_config, uint8_t thresh, |
| 613 | uint16_t time_limit, uint8_t verbosity, |
| 614 | uint8_t proto_bitmap); |
Rachit Kankane | b3ba769 | 2018-06-27 18:42:34 +0530 | [diff] [blame] | 615 | void qdf_dp_trace_deinit(void); |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 616 | void qdf_dp_trace_spin_lock_init(void); |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 617 | void qdf_dp_trace_set_value(uint8_t proto_bitmap, uint8_t no_of_records, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 618 | uint8_t verbosity); |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 619 | void qdf_dp_trace_set_track(qdf_nbuf_t nbuf, enum qdf_proto_dir dir); |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 620 | void qdf_dp_trace(qdf_nbuf_t nbuf, enum QDF_DP_TRACE_ID code, uint8_t pdev_id, |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 621 | uint8_t *data, uint8_t size, enum qdf_proto_dir dir); |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 622 | void qdf_dp_trace_dump_all(uint32_t count, uint8_t pdev_id); |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 623 | |
| 624 | /** |
| 625 | * qdf_dpt_get_curr_pos_debugfs() - get curr position to start read |
| 626 | * @file: debugfs file to read |
| 627 | * @state: state to control read to debugfs file |
| 628 | * |
| 629 | * Return: curr pos |
| 630 | */ |
| 631 | uint32_t qdf_dpt_get_curr_pos_debugfs(qdf_debugfs_file_t file, |
| 632 | enum qdf_dpt_debugfs_state state); |
| 633 | /** |
| 634 | * qdf_dpt_dump_stats_debugfs() - dump DP Trace stats to debugfs file |
| 635 | * @file: debugfs file to read |
| 636 | * @curr_pos: curr position to start read |
| 637 | * |
| 638 | * Return: QDF_STATUS |
| 639 | */ |
| 640 | QDF_STATUS qdf_dpt_dump_stats_debugfs(qdf_debugfs_file_t file, |
| 641 | uint32_t curr_pos); |
| 642 | |
| 643 | /** |
Rakshith Suresh Patkar | e105ac1 | 2018-12-06 20:40:49 +0530 | [diff] [blame] | 644 | * qdf_dpt_set_value_debugfs() - set value of DP Trace debugfs params |
| 645 | * @proto_bitmap: defines which protocol to be traced |
| 646 | * @no_of_record: defines every nth packet to be traced |
| 647 | * @verbosity : defines verbosity level |
| 648 | * @num_records_to_dump: defines number of records to be dumped |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 649 | * |
| 650 | * Return: none |
| 651 | */ |
| 652 | void qdf_dpt_set_value_debugfs(uint8_t proto_bitmap, uint8_t no_of_record, |
Rakshith Suresh Patkar | e105ac1 | 2018-12-06 20:40:49 +0530 | [diff] [blame] | 653 | uint8_t verbosity, uint16_t num_records_to_dump); |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 654 | |
| 655 | |
Mohit Khanna | 90d7ebd | 2017-09-12 21:54:21 -0700 | [diff] [blame] | 656 | /** |
| 657 | * qdf_dp_trace_dump_stats() - dump DP Trace stats |
| 658 | * |
| 659 | * Return: none |
| 660 | */ |
| 661 | void qdf_dp_trace_dump_stats(void); |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 662 | typedef void (*tp_qdf_dp_trace_cb)(struct qdf_dp_trace_record_s*, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 663 | uint16_t, uint8_t, uint8_t info); |
| 664 | /** |
| 665 | * qdf_dp_display_record() - Displays a record in DP trace |
| 666 | * @record: pointer to a record in DP trace |
| 667 | * @index: record index |
| 668 | * @pdev_id: pdev id for the mgmt pkt |
| 669 | * @info: info used to display pkt (live mode, throttling) |
| 670 | * |
| 671 | * Return: None |
| 672 | */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 673 | void qdf_dp_display_record(struct qdf_dp_trace_record_s *record, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 674 | uint16_t index, uint8_t pdev_id, |
| 675 | uint8_t info); |
| 676 | |
| 677 | /** |
| 678 | * qdf_dp_display_ptr_record() - display record |
| 679 | * @record: dptrace record |
| 680 | * @rec_index: index |
| 681 | * @pdev_id: pdev id for the mgmt pkt |
| 682 | * @info: info used to display pkt (live mode, throttling) |
| 683 | * |
| 684 | * Return: none |
| 685 | */ |
| 686 | void qdf_dp_display_ptr_record(struct qdf_dp_trace_record_s *record, |
| 687 | uint16_t rec_index, uint8_t pdev_id, |
| 688 | uint8_t info); |
| 689 | |
| 690 | /** |
Srinivas Girigowda | 22953dc | 2019-02-06 13:48:43 -0800 | [diff] [blame] | 691 | * qdf_dp_display_proto_pkt_debug() - display proto packet only |
| 692 | * for debug. |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 693 | * @record: dptrace record |
| 694 | * @index: index |
| 695 | * @pdev_id: pdev id for the mgmt pkt |
| 696 | * @info: info used to display pkt (live mode, throttling) |
| 697 | * |
| 698 | * Return: none |
| 699 | */ |
Srinivas Girigowda | 22953dc | 2019-02-06 13:48:43 -0800 | [diff] [blame] | 700 | void qdf_dp_display_proto_pkt_debug(struct qdf_dp_trace_record_s *record, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 701 | uint16_t index, uint8_t pdev_id, |
| 702 | uint8_t info); |
Srinivas Girigowda | 22953dc | 2019-02-06 13:48:43 -0800 | [diff] [blame] | 703 | |
| 704 | /** |
| 705 | * qdf_dp_display_proto_pkt_always() - display proto packets all |
| 706 | * the time. |
| 707 | * @record: dptrace record |
| 708 | * @index: index |
| 709 | * @pdev_id: pdev id for the mgmt pkt |
| 710 | * @info: info used to display pkt (live mode, throttling) |
| 711 | * |
| 712 | * Return: none |
| 713 | */ |
| 714 | void qdf_dp_display_proto_pkt_always(struct qdf_dp_trace_record_s *record, |
| 715 | uint16_t index, uint8_t pdev_id, |
| 716 | uint8_t info); |
| 717 | |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 718 | /** |
| 719 | * qdf_dp_display_data_pkt_record() - Displays a data packet in DP trace |
| 720 | * @record: pointer to a record in DP trace |
| 721 | * @rec_index: record index |
| 722 | * @pdev_id: pdev id |
| 723 | * @info: display info regarding record |
| 724 | * |
| 725 | * Return: None |
| 726 | */ |
| 727 | void |
| 728 | qdf_dp_display_data_pkt_record(struct qdf_dp_trace_record_s *record, |
| 729 | uint16_t rec_index, uint8_t pdev_id, |
| 730 | uint8_t info); |
| 731 | |
| 732 | void qdf_dp_trace_ptr(qdf_nbuf_t nbuf, enum QDF_DP_TRACE_ID code, |
| 733 | uint8_t pdev_id, uint8_t *data, uint8_t size, |
| 734 | uint16_t msdu_id, uint16_t status); |
| 735 | void qdf_dp_trace_throttle_live_mode(bool high_bw_request); |
| 736 | |
| 737 | /** |
Manjunathappa Prakash | cf4286b | 2018-06-05 20:46:20 -0700 | [diff] [blame] | 738 | * qdf_dp_trace_tput_policy() - Change verbosity based on the TPUT |
| 739 | * @is_data_traffic: Is traffic more than low TPUT threashould |
| 740 | * |
| 741 | * Return: None |
| 742 | */ |
| 743 | void qdf_dp_trace_apply_tput_policy(bool is_data_traffic); |
| 744 | |
| 745 | /** |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 746 | * qdf_dp_trace_data_pkt() - trace data packet |
| 747 | * @nbuf: nbuf which needs to be traced |
| 748 | * @pdev_id: pdev_id |
| 749 | * @code: QDF_DP_TRACE_ID for the packet (TX or RX) |
| 750 | * @msdu_id: tx desc id for the nbuf (Only applies to TX packets) |
| 751 | * @dir: TX or RX packet direction |
| 752 | * |
| 753 | * Return: None |
| 754 | */ |
| 755 | void qdf_dp_trace_data_pkt(qdf_nbuf_t nbuf, uint8_t pdev_id, |
| 756 | enum QDF_DP_TRACE_ID code, uint16_t msdu_id, |
| 757 | enum qdf_proto_dir dir); |
| 758 | |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 759 | uint8_t qdf_dp_get_proto_bitmap(void); |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 760 | uint8_t qdf_dp_get_verbosity(void); |
| 761 | uint8_t qdf_dp_get_no_of_record(void); |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 762 | |
| 763 | /** |
| 764 | * qdf_dp_trace_proto_pkt() - record proto packet |
| 765 | * @code: dptrace code |
| 766 | * @vdev_id: vdev id |
| 767 | * @sa: source mac address |
| 768 | * @da: destination mac address |
| 769 | * @type: proto type |
| 770 | * @subtype: proto subtype |
| 771 | * @dir: direction |
| 772 | * @pdev_id: pdev id |
| 773 | * @print: to print this proto pkt or not |
| 774 | * |
| 775 | * Return: none |
| 776 | */ |
Nirav Shah | eaa20d8 | 2016-04-25 18:01:05 +0530 | [diff] [blame] | 777 | void |
| 778 | qdf_dp_trace_proto_pkt(enum QDF_DP_TRACE_ID code, uint8_t vdev_id, |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 779 | uint8_t *sa, uint8_t *da, enum qdf_proto_type type, |
| 780 | enum qdf_proto_subtype subtype, enum qdf_proto_dir dir, |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 781 | uint8_t pdev_id, bool print); |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 782 | |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 783 | void qdf_dp_trace_disable_live_mode(void); |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 784 | void qdf_dp_trace_enable_live_mode(void); |
Nirav Shah | cede289 | 2016-05-19 12:41:15 +0530 | [diff] [blame] | 785 | void qdf_dp_trace_clear_buffer(void); |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 786 | /** |
| 787 | * qdf_dp_trace_mgmt_pkt() - record mgmt packet |
| 788 | * @code: dptrace code |
| 789 | * @vdev_id: vdev id |
| 790 | * @pdev_id: pdev_id |
| 791 | * @type: proto type |
| 792 | * @subtype: proto subtype |
| 793 | * |
| 794 | * Return: none |
| 795 | */ |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 796 | void qdf_dp_trace_mgmt_pkt(enum QDF_DP_TRACE_ID code, uint8_t vdev_id, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 797 | uint8_t pdev_id, enum qdf_proto_type type, |
| 798 | enum qdf_proto_subtype subtype); |
| 799 | |
| 800 | /** |
| 801 | * qdf_dp_display_mgmt_pkt() - display proto packet |
| 802 | * @record: dptrace record |
| 803 | * @index: index |
| 804 | * @pdev_id: pdev id for the mgmt pkt |
| 805 | * @info: info used to display pkt (live mode, throttling) |
| 806 | * |
| 807 | * Return: none |
| 808 | */ |
Nirav Shah | 31d694b | 2016-05-03 20:18:22 +0530 | [diff] [blame] | 809 | void qdf_dp_display_mgmt_pkt(struct qdf_dp_trace_record_s *record, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 810 | uint16_t index, uint8_t pdev_id, uint8_t info); |
| 811 | |
| 812 | /** |
| 813 | * qdf_dp_display_event_record() - display event records |
| 814 | * @record: dptrace record |
| 815 | * @index: index |
| 816 | * @pdev_id: pdev id for the mgmt pkt |
| 817 | * @info: info used to display pkt (live mode, throttling) |
| 818 | * |
| 819 | * Return: none |
| 820 | */ |
Himanshu Agarwal | c0b7145 | 2016-09-20 15:10:55 +0530 | [diff] [blame] | 821 | void qdf_dp_display_event_record(struct qdf_dp_trace_record_s *record, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 822 | uint16_t index, uint8_t pdev_id, uint8_t info); |
| 823 | |
Himanshu Agarwal | c0b7145 | 2016-09-20 15:10:55 +0530 | [diff] [blame] | 824 | void qdf_dp_trace_record_event(enum QDF_DP_TRACE_ID code, uint8_t vdev_id, |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 825 | uint8_t pdev_id, enum qdf_proto_type type, |
| 826 | enum qdf_proto_subtype subtype); |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 827 | #else |
| 828 | static inline |
Jeff Johnson | 5b92ee0 | 2019-01-15 14:40:56 -0800 | [diff] [blame] | 829 | bool qdf_dp_trace_log_pkt(uint8_t vdev_id, struct sk_buff *skb, |
| 830 | enum qdf_proto_dir dir, uint8_t pdev_id) |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 831 | { |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 832 | return false; |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 833 | } |
| 834 | static inline |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 835 | void qdf_dp_trace_init(bool live_mode_config, uint8_t thresh, |
| 836 | uint16_t time_limit, uint8_t verbosity, |
| 837 | uint8_t proto_bitmap) |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 838 | { |
| 839 | } |
Rachit Kankane | b3ba769 | 2018-06-27 18:42:34 +0530 | [diff] [blame] | 840 | |
| 841 | static inline |
| 842 | void qdf_dp_trace_deinit(void) |
| 843 | { |
| 844 | } |
| 845 | |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 846 | static inline |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 847 | void qdf_dp_trace_set_track(qdf_nbuf_t nbuf, enum qdf_proto_dir dir) |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 848 | { |
| 849 | } |
| 850 | static inline |
| 851 | void qdf_dp_trace_set_value(uint8_t proto_bitmap, uint8_t no_of_records, |
| 852 | uint8_t verbosity) |
| 853 | { |
| 854 | } |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 855 | |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 856 | static inline |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 857 | void qdf_dp_trace_dump_all(uint32_t count, uint8_t pdev_id) |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 858 | { |
| 859 | } |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 860 | |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 861 | static inline |
| 862 | uint32_t qdf_dpt_get_curr_pos_debugfs(qdf_debugfs_file_t file, |
| 863 | enum qdf_dpt_debugfs_state state) |
| 864 | { |
Nirav Shah | 9106902 | 2018-04-19 17:25:10 +0530 | [diff] [blame] | 865 | return 0; |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 866 | } |
| 867 | |
| 868 | static inline |
| 869 | QDF_STATUS qdf_dpt_dump_stats_debugfs(qdf_debugfs_file_t file, |
| 870 | uint32_t curr_pos) |
| 871 | { |
Nirav Shah | 9106902 | 2018-04-19 17:25:10 +0530 | [diff] [blame] | 872 | return QDF_STATUS_SUCCESS; |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 873 | } |
| 874 | |
| 875 | static inline |
| 876 | void qdf_dpt_set_value_debugfs(uint8_t proto_bitmap, uint8_t no_of_record, |
Rakshith Suresh Patkar | e105ac1 | 2018-12-06 20:40:49 +0530 | [diff] [blame] | 877 | uint8_t verbosity, uint16_t num_records_to_dump) |
Rakshith Suresh Patkar | dcd0733 | 2018-04-20 12:52:08 +0530 | [diff] [blame] | 878 | { |
| 879 | } |
| 880 | |
Mohit Khanna | 90d7ebd | 2017-09-12 21:54:21 -0700 | [diff] [blame] | 881 | static inline void qdf_dp_trace_dump_stats(void) |
| 882 | { |
| 883 | } |
| 884 | |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 885 | static inline |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 886 | void qdf_dp_trace_disable_live_mode(void) |
| 887 | { |
| 888 | } |
| 889 | |
| 890 | static inline |
Nirav Shah | 29beae0 | 2016-04-26 22:58:54 +0530 | [diff] [blame] | 891 | void qdf_dp_trace_enable_live_mode(void) |
| 892 | { |
| 893 | } |
| 894 | |
Nirav Shah | cede289 | 2016-05-19 12:41:15 +0530 | [diff] [blame] | 895 | static inline |
Mohit Khanna | 7750a17 | 2017-05-15 15:53:33 -0700 | [diff] [blame] | 896 | void qdf_dp_trace_throttle_live_mode(bool high_bw_request) |
| 897 | { |
| 898 | } |
| 899 | |
| 900 | static inline |
Nirav Shah | cede289 | 2016-05-19 12:41:15 +0530 | [diff] [blame] | 901 | void qdf_dp_trace_clear_buffer(void) |
| 902 | { |
| 903 | } |
| 904 | |
Nirav Shah | 9106902 | 2018-04-19 17:25:10 +0530 | [diff] [blame] | 905 | static inline |
Lin Bai | 0577a01 | 2019-04-15 13:46:23 +0800 | [diff] [blame] | 906 | void qdf_dp_trace_apply_tput_policy(bool is_data_traffic) |
| 907 | { |
| 908 | } |
| 909 | |
| 910 | static inline |
Mohit Khanna | 0425280 | 2017-08-27 09:43:43 -0700 | [diff] [blame] | 911 | void qdf_dp_trace_data_pkt(qdf_nbuf_t nbuf, uint8_t pdev_id, |
| 912 | enum QDF_DP_TRACE_ID code, uint16_t msdu_id, |
| 913 | enum qdf_proto_dir dir) |
| 914 | { |
| 915 | } |
Nirav Shah | ae6a0b3 | 2016-04-26 11:44:42 +0530 | [diff] [blame] | 916 | #endif |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 917 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 918 | void qdf_trace_display(void); |
| 919 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 920 | void __printf(3, 4) qdf_snprintf(char *str_buffer, unsigned int size, |
Anurag Chouhan | 85bc91a | 2016-03-21 19:18:37 +0530 | [diff] [blame] | 921 | char *str_format, ...); |
| 922 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 923 | #define QDF_SNPRINTF qdf_snprintf |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 924 | |
| 925 | #ifdef TSOSEG_DEBUG |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 926 | |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 927 | static inline void qdf_tso_seg_dbg_bug(char *msg) |
| 928 | { |
Manjunathappa Prakash | 2c3dba2 | 2018-04-17 10:55:25 -0700 | [diff] [blame] | 929 | qdf_print("%s", msg); |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 930 | QDF_BUG(0); |
| 931 | }; |
| 932 | |
Orhan K AKYILDIZ | c6b4a7b | 2017-12-19 20:30:12 -0800 | [diff] [blame] | 933 | /** |
| 934 | * qdf_tso_seg_dbg_init - initialize TSO segment debug structure |
| 935 | * @tsoseg : structure to initialize |
| 936 | * |
| 937 | * TSO segment dbg structures are attached to qdf_tso_seg_elem_t |
| 938 | * structures and are allocated only of TSOSEG_DEBUG is defined. |
| 939 | * When allocated, at the time of the tso_seg_pool initialization, |
| 940 | * which goes with tx_desc initialization (1:1), each structure holds |
| 941 | * a number of (currently 16) history entries, basically describing |
| 942 | * what operation has been performed on this particular tso_seg_elem. |
| 943 | * This history buffer is a circular buffer and the current index is |
| 944 | * held in an atomic variable called cur. It is incremented every |
| 945 | * operation. Each of these operations are added with the function |
| 946 | * qdf_tso_seg_dbg_record. |
| 947 | * For each segment, this initialization function MUST be called PRIOR |
| 948 | * TO any _dbg_record() function calls. |
| 949 | * On free, qdf_tso_seg_elem structure is cleared (using qdf_tso_seg_dbg_zero) |
| 950 | * which clears the tso_desc, BUT DOES NOT CLEAR THE HISTORY element. |
| 951 | * |
| 952 | * Return: |
| 953 | * None |
| 954 | */ |
| 955 | static inline |
| 956 | void qdf_tso_seg_dbg_init(struct qdf_tso_seg_elem_t *tsoseg) |
| 957 | { |
| 958 | tsoseg->dbg.txdesc = NULL; |
| 959 | qdf_atomic_init(&tsoseg->dbg.cur); /* history empty */ |
| 960 | } |
| 961 | |
| 962 | /** |
| 963 | * qdf_tso_seg_dbg_record - add a history entry to TSO debug structure |
| 964 | * @tsoseg : structure to initialize |
| 965 | * @id : operation ID (identifies the caller) |
| 966 | * |
| 967 | * Adds a history entry to the history circular buffer. Each entry |
| 968 | * contains an operation id (caller, as currently each ID is used only |
| 969 | * once in the source, so it directly identifies the src line that invoked |
| 970 | * the recording. |
| 971 | * |
| 972 | * qdf_tso_seg_dbg_record CAN ONLY BE CALLED AFTER the entry is initialized |
| 973 | * by qdf_tso_seg_dbg_init. |
| 974 | * |
| 975 | * The entry to be added is written at the location pointed by the atomic |
| 976 | * variable called cur. Cur is an ever increasing atomic variable. It is |
| 977 | * masked so that only the lower 4 bits are used (16 history entries). |
| 978 | * |
| 979 | * Return: |
| 980 | * int: the entry this record was recorded at |
| 981 | */ |
| 982 | static inline |
| 983 | int qdf_tso_seg_dbg_record(struct qdf_tso_seg_elem_t *tsoseg, short id) |
| 984 | { |
| 985 | int rc = -1; |
| 986 | unsigned int c; |
| 987 | |
| 988 | qdf_assert(tsoseg); |
| 989 | |
| 990 | if (id == TSOSEG_LOC_ALLOC) { |
| 991 | c = qdf_atomic_read(&tsoseg->dbg.cur); |
| 992 | /* dont crash on the very first alloc on the segment */ |
| 993 | c &= 0x0f; |
| 994 | /* allow only INIT and FREE ops before ALLOC */ |
| 995 | if (tsoseg->dbg.h[c].id >= id) |
| 996 | qdf_tso_seg_dbg_bug("Rogue TSO seg alloc"); |
| 997 | } |
| 998 | c = qdf_atomic_inc_return(&tsoseg->dbg.cur); |
| 999 | |
| 1000 | c &= 0x0f; |
| 1001 | tsoseg->dbg.h[c].ts = qdf_get_log_timestamp(); |
| 1002 | tsoseg->dbg.h[c].id = id; |
| 1003 | rc = c; |
| 1004 | |
| 1005 | return rc; |
| 1006 | }; |
| 1007 | |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 1008 | static inline void |
| 1009 | qdf_tso_seg_dbg_setowner(struct qdf_tso_seg_elem_t *tsoseg, void *owner) |
| 1010 | { |
Orhan K AKYILDIZ | c6b4a7b | 2017-12-19 20:30:12 -0800 | [diff] [blame] | 1011 | if (tsoseg) |
| 1012 | tsoseg->dbg.txdesc = owner; |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 1013 | }; |
| 1014 | |
| 1015 | static inline void |
| 1016 | qdf_tso_seg_dbg_zero(struct qdf_tso_seg_elem_t *tsoseg) |
| 1017 | { |
| 1018 | memset(tsoseg, 0, offsetof(struct qdf_tso_seg_elem_t, dbg)); |
| 1019 | return; |
| 1020 | }; |
| 1021 | |
| 1022 | #else |
| 1023 | static inline |
Orhan K AKYILDIZ | c6b4a7b | 2017-12-19 20:30:12 -0800 | [diff] [blame] | 1024 | void qdf_tso_seg_dbg_init(struct qdf_tso_seg_elem_t *tsoseg) |
| 1025 | { |
| 1026 | }; |
| 1027 | static inline |
| 1028 | int qdf_tso_seg_dbg_record(struct qdf_tso_seg_elem_t *tsoseg, short id) |
Orhan K AKYILDIZ | c59be52 | 2017-04-19 21:21:45 -0700 | [diff] [blame] | 1029 | { |
| 1030 | return 0; |
| 1031 | }; |
| 1032 | static inline void qdf_tso_seg_dbg_bug(char *msg) |
| 1033 | { |
| 1034 | }; |
| 1035 | static inline void |
| 1036 | qdf_tso_seg_dbg_setowner(struct qdf_tso_seg_elem_t *tsoseg, void *owner) |
| 1037 | { |
| 1038 | }; |
| 1039 | static inline int |
| 1040 | qdf_tso_seg_dbg_zero(struct qdf_tso_seg_elem_t *tsoseg) |
| 1041 | { |
| 1042 | memset(tsoseg, 0, sizeof(struct qdf_tso_seg_elem_t)); |
| 1043 | return 0; |
| 1044 | }; |
| 1045 | |
| 1046 | #endif /* TSOSEG_DEBUG */ |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 1047 | |
Nandha Kishore Easwaran | e43583f | 2017-05-15 21:01:13 +0530 | [diff] [blame] | 1048 | void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level, |
| 1049 | void *data, int buf_len); |
| 1050 | |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 1051 | #define ERROR_CODE -1 |
| 1052 | #define QDF_MAX_NAME_SIZE 32 |
| 1053 | #define MAX_PRINT_CONFIG_SUPPORTED 32 |
| 1054 | |
| 1055 | #define MAX_SUPPORTED_CATEGORY QDF_MODULE_ID_MAX |
| 1056 | |
Sathish Kumar | 470c620 | 2017-05-10 19:56:48 +0530 | [diff] [blame] | 1057 | /** |
| 1058 | * qdf_set_pidx() - Sets the global qdf_pidx. |
| 1059 | * @pidx : Index of print control object assigned to the module |
| 1060 | * |
| 1061 | */ |
| 1062 | void qdf_set_pidx(int pidx); |
| 1063 | |
| 1064 | /** |
| 1065 | * qdf_get_pidx() - Returns the global qdf_pidx. |
| 1066 | * |
| 1067 | * Return : Current qdf print index. |
| 1068 | */ |
| 1069 | int qdf_get_pidx(void); |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 1070 | /* |
| 1071 | * Shared print control index |
| 1072 | * for converged debug framework |
| 1073 | */ |
Sathish Kumar | 470c620 | 2017-05-10 19:56:48 +0530 | [diff] [blame] | 1074 | |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 1075 | #define QDF_PRINT_IDX_SHARED -1 |
| 1076 | |
| 1077 | /** |
| 1078 | * QDF_PRINT_INFO() - Generic wrapper API for logging |
| 1079 | * @idx : Index of print control object |
| 1080 | * @module : Module identifier. A member of QDF_MODULE_ID enumeration that |
| 1081 | * identifies the module issuing the trace message |
| 1082 | * @level : Trace level. A member of QDF_TRACE_LEVEL enumeration indicating |
| 1083 | * the severity of the condition causing the trace message to be |
| 1084 | * issued. |
| 1085 | * @str_format : Format string that contains the message to be logged. |
| 1086 | * |
| 1087 | * |
| 1088 | * This wrapper will be used for any generic logging messages. Wrapper will |
| 1089 | * compile a call to converged QDF trace message API. |
| 1090 | * |
| 1091 | * Return : Nothing |
| 1092 | * |
| 1093 | */ |
| 1094 | void QDF_PRINT_INFO(unsigned int idx, QDF_MODULE_ID module, |
| 1095 | QDF_TRACE_LEVEL level, |
| 1096 | char *str_format, ...); |
| 1097 | |
| 1098 | /** |
| 1099 | * struct category_info : Category information structure |
| 1100 | * @category_verbose_mask: Embeds information about category's verbose level |
| 1101 | */ |
| 1102 | struct category_info { |
| 1103 | uint16_t category_verbose_mask; |
| 1104 | }; |
| 1105 | |
| 1106 | /** |
| 1107 | * struct category_name_info : Category name information structure |
| 1108 | * @category_name_str: Embeds information about category name |
| 1109 | */ |
| 1110 | struct category_name_info { |
| 1111 | unsigned char category_name_str[QDF_MAX_NAME_SIZE]; |
| 1112 | }; |
| 1113 | |
| 1114 | /** |
| 1115 | * qdf_trace_msg_cmn()- Converged logging API |
| 1116 | * @idx: Index of print control object assigned to the module |
| 1117 | * @category: Category identifier. A member of the QDF_MODULE_ID enumeration |
| 1118 | * that identifies the category issuing the trace message. |
| 1119 | * @verbose: Verbose level. A member of the QDF_TRACE_LEVEL enumeration |
| 1120 | * indicating the severity of the condition causing the trace |
| 1121 | * message to be issued. More severe conditions are more likely |
| 1122 | * to be logged. |
| 1123 | * @str_format: Format string. The message to be logged. This format string |
| 1124 | * contains printf-like replacement parameters, which follow this |
| 1125 | * parameter in the variable argument list. |
| 1126 | * @val: Variable argument list part of the log message |
| 1127 | * |
| 1128 | * Return: nothing |
| 1129 | * |
| 1130 | */ |
| 1131 | void qdf_trace_msg_cmn(unsigned int idx, |
| 1132 | QDF_MODULE_ID category, |
| 1133 | QDF_TRACE_LEVEL verbose, |
| 1134 | const char *str_format, |
| 1135 | va_list val); |
| 1136 | |
| 1137 | /** |
| 1138 | * struct qdf_print_ctrl: QDF Print Control structure |
| 1139 | * Statically allocated objects of print control |
| 1140 | * structure are declared that will support maximum of |
| 1141 | * 32 print control objects. Any module that needs to |
| 1142 | * register to the print control framework needs to |
| 1143 | * obtain a print control object using |
| 1144 | * qdf_print_ctrl_register API. It will have to pass |
| 1145 | * pointer to category info structure, name and |
| 1146 | * custom print function to be used if required. |
| 1147 | * @name : Optional name for the control object |
| 1148 | * @cat_info : Array of category_info struct |
| 1149 | * @custom_print : Custom print handler |
| 1150 | * @custom_ctxt : Custom print context |
| 1151 | * @dbglvlmac_on : Flag to enable/disable MAC level filtering |
| 1152 | * @in_use : Boolean to indicate if control object is in use |
| 1153 | */ |
| 1154 | struct qdf_print_ctrl { |
| 1155 | char name[QDF_MAX_NAME_SIZE]; |
| 1156 | struct category_info cat_info[MAX_SUPPORTED_CATEGORY]; |
| 1157 | void (*custom_print)(void *ctxt, const char *fmt, va_list args); |
| 1158 | void *custom_ctxt; |
| 1159 | #ifdef DBG_LVL_MAC_FILTERING |
| 1160 | unsigned char dbglvlmac_on; |
| 1161 | #endif |
| 1162 | bool in_use; |
| 1163 | }; |
| 1164 | |
| 1165 | /** |
| 1166 | * qdf_print_ctrl_register() - Allocate QDF print control object, assign |
| 1167 | * pointer to category info or print control |
| 1168 | * structure and return the index to the callee |
| 1169 | * @cinfo : Pointer to array of category info structure |
| 1170 | * @custom_print_handler : Pointer to custom print handler |
| 1171 | * @custom_ctx : Pointer to custom context |
| 1172 | * @pctrl_name : Pointer to print control object name |
| 1173 | * |
| 1174 | * Return : Index of qdf_print_ctrl structure |
| 1175 | * |
| 1176 | */ |
| 1177 | int qdf_print_ctrl_register(const struct category_info *cinfo, |
| 1178 | void *custom_print_handler, |
| 1179 | void *custom_ctx, |
| 1180 | const char *pctrl_name); |
| 1181 | |
| 1182 | /** |
Adil Saeed Musthafa | 3318807 | 2017-03-13 12:13:47 -0700 | [diff] [blame] | 1183 | * qdf_shared_print_ctrl_init() - Initialize the shared print ctrl obj with |
| 1184 | * all categories set to the default level |
| 1185 | * |
| 1186 | * Return : void |
| 1187 | * |
| 1188 | */ |
| 1189 | void qdf_shared_print_ctrl_init(void); |
| 1190 | |
| 1191 | /** |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 1192 | * qdf_print_setup() - Setup default values to all the print control objects |
| 1193 | * |
| 1194 | * Register new print control object for the callee |
| 1195 | * |
| 1196 | * Return : QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE |
| 1197 | * on failure |
| 1198 | */ |
| 1199 | QDF_STATUS qdf_print_setup(void); |
| 1200 | |
| 1201 | /** |
| 1202 | * qdf_print_ctrl_cleanup() - Clean up a print control object |
| 1203 | * |
| 1204 | * Cleanup the print control object for the callee |
| 1205 | * |
| 1206 | * @pctrl : Index of print control object |
| 1207 | * |
| 1208 | * Return : QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE on failure |
| 1209 | */ |
| 1210 | QDF_STATUS qdf_print_ctrl_cleanup(unsigned int idx); |
| 1211 | |
| 1212 | /** |
Adil Saeed Musthafa | 3318807 | 2017-03-13 12:13:47 -0700 | [diff] [blame] | 1213 | * qdf_print_ctrl_shared_cleanup() - Clean up of the shared object |
| 1214 | * |
| 1215 | * Cleanup the shared print-ctrl-object |
| 1216 | * |
| 1217 | * Return : void |
| 1218 | */ |
| 1219 | void qdf_shared_print_ctrl_cleanup(void); |
| 1220 | |
| 1221 | /** |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 1222 | * qdf_print_set_category_verbose() - Enable/Disable category for a |
| 1223 | * print control object with |
| 1224 | * user provided verbose level |
| 1225 | * |
| 1226 | * @idx : Index of the print control object assigned to callee |
| 1227 | * @category : Category information |
| 1228 | * @verbose: Verbose information |
| 1229 | * @is_set: Flag indicating if verbose level needs to be enabled or disabled |
| 1230 | * |
| 1231 | * Return : QDF_STATUS_SUCCESS for success and QDF_STATUS_E_FAILURE for failure |
| 1232 | */ |
| 1233 | QDF_STATUS qdf_print_set_category_verbose(unsigned int idx, |
| 1234 | QDF_MODULE_ID category, |
| 1235 | QDF_TRACE_LEVEL verbose, |
| 1236 | bool is_set); |
| 1237 | |
| 1238 | /** |
Adil Saeed Musthafa | 12205b5 | 2018-08-07 09:39:20 -0700 | [diff] [blame] | 1239 | * qdf_log_dump_at_kernel_level() - Enable/Disable printk call |
| 1240 | * @enable: Indicates whether printk is enabled in QDF_TRACE |
| 1241 | * |
| 1242 | * Return: void |
| 1243 | */ |
| 1244 | void qdf_log_dump_at_kernel_level(bool enable); |
| 1245 | |
| 1246 | /** |
| 1247 | * qdf_logging_set_flush_timer() - Set the time period in which host logs |
| 1248 | * should be flushed out to user-space |
| 1249 | * @milliseconds: milliseconds after which the logs should be flushed out to |
| 1250 | * user-space |
| 1251 | * |
| 1252 | * Return: QDF_STATUS_SUCCESS for success and QDF_STATUS_E_FAILURE for failure |
| 1253 | */ |
| 1254 | int qdf_logging_set_flush_timer(uint32_t milliseconds); |
| 1255 | |
| 1256 | /** |
| 1257 | * qdf_logging_flush_logs() - Flush out the logs to user-space one time |
| 1258 | * |
| 1259 | * Return: void |
| 1260 | */ |
| 1261 | void qdf_logging_flush_logs(void); |
| 1262 | |
| 1263 | /** |
Sathish Kumar | fc93b2d | 2017-01-10 12:19:19 +0530 | [diff] [blame] | 1264 | * qdf_print_is_category_enabled() - Get category information for the |
| 1265 | * print control object |
| 1266 | * |
| 1267 | * @idx : Index of print control object |
| 1268 | * @category : Category information |
| 1269 | * |
| 1270 | * Return : Verbose enabled(true) or disabled(false) or invalid input (false) |
| 1271 | */ |
| 1272 | bool qdf_print_is_category_enabled(unsigned int idx, |
| 1273 | QDF_MODULE_ID category); |
| 1274 | |
| 1275 | /** |
| 1276 | * qdf_print_is_verbose_enabled() - Get verbose information of a category for |
| 1277 | * the print control object |
| 1278 | * |
| 1279 | * @idx : Index of print control object |
| 1280 | * @category : Category information |
| 1281 | * @verbose : Verbose information |
| 1282 | * |
| 1283 | * Return : Verbose enabled(true) or disabled(false) or invalid input (false) |
| 1284 | */ |
| 1285 | bool qdf_print_is_verbose_enabled(unsigned int idx, |
| 1286 | QDF_MODULE_ID category, |
| 1287 | QDF_TRACE_LEVEL verbose); |
| 1288 | |
| 1289 | /** |
| 1290 | * qdf_print_clean_node_flag() - Clean up node flag for print control object |
| 1291 | * |
| 1292 | * @idx : Index of print control object |
| 1293 | * |
| 1294 | * Return : None |
| 1295 | */ |
| 1296 | void qdf_print_clean_node_flag(unsigned int idx); |
| 1297 | |
| 1298 | #ifdef DBG_LVL_MAC_FILTERING |
| 1299 | |
| 1300 | /** |
| 1301 | * qdf_print_set_node_flag() - Set flag to enable MAC level filtering |
| 1302 | * |
| 1303 | * @idx : Index of print control object |
| 1304 | * @enable : Enable/Disable bit sent by callee |
| 1305 | * |
| 1306 | * Return : QDF_STATUS_SUCCESS on Success and QDF_STATUS_E_FAILURE on Failure |
| 1307 | */ |
| 1308 | QDF_STATUS qdf_print_set_node_flag(unsigned int idx, |
| 1309 | uint8_t enable); |
| 1310 | |
| 1311 | /** |
| 1312 | * qdf_print_get_node_flag() - Get flag that controls MAC level filtering |
| 1313 | * |
| 1314 | * @idx : Index of print control object |
| 1315 | * |
| 1316 | * Return : Flag that indicates enable(1) or disable(0) or invalid(-1) |
| 1317 | */ |
| 1318 | bool qdf_print_get_node_flag(unsigned int idx); |
| 1319 | |
| 1320 | #endif |
Adil Saeed Musthafa | bcf62ed | 2017-02-20 16:22:39 -0800 | [diff] [blame] | 1321 | |
| 1322 | /** |
| 1323 | * qdf_logging_init() - Initialize msg logging functionality |
| 1324 | * |
| 1325 | * |
| 1326 | * Return : void |
| 1327 | */ |
| 1328 | void qdf_logging_init(void); |
| 1329 | |
| 1330 | /** |
| 1331 | * qdf_logging_exit() - Cleanup msg logging functionality |
| 1332 | * |
| 1333 | * |
| 1334 | * Return : void |
| 1335 | */ |
| 1336 | void qdf_logging_exit(void); |
| 1337 | |
Dustin Brown | e226ceb | 2017-04-21 13:22:14 -0700 | [diff] [blame] | 1338 | #define QDF_SYMBOL_LEN __QDF_SYMBOL_LEN |
| 1339 | |
| 1340 | /** |
| 1341 | * qdf_sprint_symbol() - prints the name of a symbol into a string buffer |
| 1342 | * @buffer: the string buffer to print into |
| 1343 | * @addr: address of the symbol to lookup and print |
| 1344 | * |
| 1345 | * Return: number of characters printed |
| 1346 | */ |
| 1347 | int qdf_sprint_symbol(char *buffer, void *addr); |
| 1348 | |
Karunakar Dasineni | 23d22c6 | 2019-04-29 15:08:34 -0700 | [diff] [blame] | 1349 | /** |
| 1350 | * qdf_minidump_log() - Log memory address to be included in minidump |
| 1351 | * @start_addr: Start address of the memory to be dumped |
| 1352 | * @size: Size in bytes |
| 1353 | * @name: String to identify this entry |
| 1354 | */ |
| 1355 | static inline |
| 1356 | void qdf_minidump_log(void *start_addr, size_t size, const char *name) |
| 1357 | { |
| 1358 | __qdf_minidump_log(start_addr, size, name); |
| 1359 | } |
| 1360 | |
Chouhan, Anurag | 5776318 | 2016-03-03 18:57:27 +0530 | [diff] [blame] | 1361 | #endif /* __QDF_TRACE_H */ |