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