Vinay Krishna Eranna | d938c42 | 2014-03-10 17:14:21 +0530 | [diff] [blame] | 1 | /* |
Siddharth Bhal | 7bd1993 | 2015-03-03 16:54:36 +0530 | [diff] [blame] | 2 | * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. |
Vinay Krishna Eranna | d938c42 | 2014-03-10 17:14:21 +0530 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /****************************************************************************** |
| 29 | * wlan_logging_sock_svc.h |
| 30 | * |
| 31 | ******************************************************************************/ |
| 32 | |
| 33 | #ifndef WLAN_LOGGING_SOCK_SVC_H |
| 34 | #define WLAN_LOGGING_SOCK_SVC_H |
| 35 | |
| 36 | #include <wlan_nlink_srv.h> |
| 37 | #include <vos_status.h> |
| 38 | #include <wlan_hdd_includes.h> |
| 39 | #include <vos_trace.h> |
| 40 | #include <wlan_nlink_common.h> |
| 41 | |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 42 | |
Vinay Krishna Eranna | 273ec5a | 2014-05-10 18:05:25 +0530 | [diff] [blame] | 43 | int wlan_logging_sock_init_svc(void); |
| 44 | int wlan_logging_sock_deinit_svc(void); |
Siddharth Bhal | 7bd1993 | 2015-03-03 16:54:36 +0530 | [diff] [blame] | 45 | int wlan_logging_flush_pkt_queue(void); |
Vinay Krishna Eranna | d938c42 | 2014-03-10 17:14:21 +0530 | [diff] [blame] | 46 | int wlan_logging_sock_deactivate_svc(void); |
| 47 | int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length); |
Mihir Shete | ccafc0c | 2015-04-17 16:13:15 +0530 | [diff] [blame] | 48 | int wlan_queue_logpkt_for_app(vos_pkt_t *pPacket, uint32 pkt_type); |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 49 | void wlan_process_done_indication(uint8 type, uint32 reason_code); |
Sushant Kaushik | 3320057 | 2015-08-05 16:46:20 +0530 | [diff] [blame] | 50 | int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf, |
| 51 | int pkt_stats_enabled, int pkt_stats_buff); |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 52 | void wlan_init_log_completion(void); |
| 53 | int wlan_set_log_completion(uint32 is_fatal, |
| 54 | uint32 indicator, |
| 55 | uint32 reason_code); |
| 56 | void wlan_get_log_completion(uint32 *is_fatal, |
| 57 | uint32 *indicator, |
| 58 | uint32 *reason_code); |
| 59 | bool wlan_is_log_report_in_progress(void); |
| 60 | void wlan_reset_log_report_in_progress(void); |
| 61 | |
| 62 | void wlan_deinit_log_completion(void); |
| 63 | |
Sushant Kaushik | 215778f | 2015-05-21 14:05:36 +0530 | [diff] [blame] | 64 | void wlan_logging_set_log_level(void); |
| 65 | |
c_manjee | cfd1efb | 2015-09-25 19:32:34 +0530 | [diff] [blame] | 66 | enum FW_MEM_DUMP_STATE{ |
| 67 | FW_MEM_DUMP_IDLE, |
| 68 | FW_MEM_DUMP_READ_IN_PROGRESS, |
| 69 | FW_MEM_DUMP_WRITE_IN_PROGRESS, |
| 70 | FW_MEM_DUMP_WRITE_DONE, |
| 71 | }; |
| 72 | int wlan_fwr_mem_dump_buffer_allocation(void); |
| 73 | bool wlan_fwr_mem_dump_test_and_set_write_allowed_bit(void); |
| 74 | bool wlan_fwr_mem_dump_test_and_set_read_allowed_bit(void); |
| 75 | void wlan_set_fwr_mem_dump_state(enum FW_MEM_DUMP_STATE fw_mem_dump_state); |
| 76 | size_t wlan_fwr_mem_dump_fsread_handler(char __user *buf, size_t count, loff_t *pos); |
| 77 | void wlan_indicate_mem_dump_complete(bool ); |
| 78 | void wlan_store_fwr_mem_dump_size(uint32 dump_size); |
| 79 | void wlan_free_fwr_mem_dump_buffer(void); |
| 80 | |
Abhishek Singh | 880d712 | 2015-08-26 16:23:04 +0530 | [diff] [blame] | 81 | bool wlan_is_logger_thread(int threadId); |
| 82 | void wlan_logging_reset_thread_stuck_count(int threadId); |
Sushant Kaushik | 3320057 | 2015-08-05 16:46:20 +0530 | [diff] [blame] | 83 | int wlan_pkt_stats_to_user(void *perPktStat); |
| 84 | void wlan_disable_and_flush_pkt_stats(void); |
| 85 | void wlan_fillTxStruct(void *pktStat); |
| 86 | bool wlan_isPktStatsEnabled(void); |
Sachin Ahuja | c08f72a | 2015-09-22 15:25:47 +0530 | [diff] [blame^] | 87 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 88 | void wlan_report_log_completion(uint32 is_fatal, |
| 89 | uint32 indicator, |
| 90 | uint32 reason_code); |
| 91 | #else |
| 92 | static inline void wlan_report_log_completion(uint32 is_fatal, |
| 93 | uint32 indicator, |
| 94 | uint32 reason_code) |
| 95 | { |
| 96 | return; |
| 97 | } |
| 98 | |
| 99 | #endif |
| 100 | |
Sushant Kaushik | 3320057 | 2015-08-05 16:46:20 +0530 | [diff] [blame] | 101 | |
Vinay Krishna Eranna | d938c42 | 2014-03-10 17:14:21 +0530 | [diff] [blame] | 102 | #endif /* WLAN_LOGGING_SOCK_SVC_H */ |