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); |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 52 | void wlan_flush_host_logs_for_fatal(void); |
| 53 | |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 54 | void wlan_init_log_completion(void); |
| 55 | int wlan_set_log_completion(uint32 is_fatal, |
| 56 | uint32 indicator, |
| 57 | uint32 reason_code); |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 58 | void wlan_get_log_and_reset_completion(uint32 *is_fatal, |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 59 | uint32 *indicator, |
Abhishek Singh | 837adf2 | 2015-10-01 17:37:37 +0530 | [diff] [blame] | 60 | uint32 *reason_code, |
| 61 | bool reset); |
Sachin Ahuja | 715aafc | 2015-07-21 23:35:10 +0530 | [diff] [blame] | 62 | bool wlan_is_log_report_in_progress(void); |
| 63 | void wlan_reset_log_report_in_progress(void); |
| 64 | |
| 65 | void wlan_deinit_log_completion(void); |
| 66 | |
Sushant Kaushik | 215778f | 2015-05-21 14:05:36 +0530 | [diff] [blame] | 67 | void wlan_logging_set_log_level(void); |
| 68 | |
c_manjee | f149564 | 2015-10-13 18:35:01 +0530 | [diff] [blame] | 69 | #define FW_MEM_DUMP_MAGIC 0x3C3A2D44 |
| 70 | |
c_manjee | cfd1efb | 2015-09-25 19:32:34 +0530 | [diff] [blame] | 71 | enum FW_MEM_DUMP_STATE{ |
| 72 | FW_MEM_DUMP_IDLE, |
| 73 | FW_MEM_DUMP_READ_IN_PROGRESS, |
| 74 | FW_MEM_DUMP_WRITE_IN_PROGRESS, |
| 75 | FW_MEM_DUMP_WRITE_DONE, |
| 76 | }; |
| 77 | int wlan_fwr_mem_dump_buffer_allocation(void); |
| 78 | bool wlan_fwr_mem_dump_test_and_set_write_allowed_bit(void); |
| 79 | bool wlan_fwr_mem_dump_test_and_set_read_allowed_bit(void); |
| 80 | void wlan_set_fwr_mem_dump_state(enum FW_MEM_DUMP_STATE fw_mem_dump_state); |
c_manjee | f149564 | 2015-10-13 18:35:01 +0530 | [diff] [blame] | 81 | void wlan_set_svc_fw_mem_dump_req_cb(void*,void*); |
| 82 | size_t wlan_fwr_mem_dump_fsread_handler(char __user *buf, size_t count, loff_t *pos,loff_t* bytes_left); |
c_manjee | cfd1efb | 2015-09-25 19:32:34 +0530 | [diff] [blame] | 83 | void wlan_indicate_mem_dump_complete(bool ); |
| 84 | void wlan_store_fwr_mem_dump_size(uint32 dump_size); |
| 85 | void wlan_free_fwr_mem_dump_buffer(void); |
| 86 | |
Abhishek Singh | 880d712 | 2015-08-26 16:23:04 +0530 | [diff] [blame] | 87 | bool wlan_is_logger_thread(int threadId); |
Sushant Kaushik | 3320057 | 2015-08-05 16:46:20 +0530 | [diff] [blame] | 88 | int wlan_pkt_stats_to_user(void *perPktStat); |
| 89 | void wlan_disable_and_flush_pkt_stats(void); |
| 90 | void wlan_fillTxStruct(void *pktStat); |
| 91 | bool wlan_isPktStatsEnabled(void); |
Sachin Ahuja | c08f72a | 2015-09-22 15:25:47 +0530 | [diff] [blame] | 92 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 93 | void wlan_report_log_completion(uint32 is_fatal, |
| 94 | uint32 indicator, |
| 95 | uint32 reason_code); |
| 96 | #else |
| 97 | static inline void wlan_report_log_completion(uint32 is_fatal, |
| 98 | uint32 indicator, |
| 99 | uint32 reason_code) |
| 100 | { |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | #endif |
| 105 | |
Sushant Kaushik | 3320057 | 2015-08-05 16:46:20 +0530 | [diff] [blame] | 106 | |
Vinay Krishna Eranna | d938c42 | 2014-03-10 17:14:21 +0530 | [diff] [blame] | 107 | #endif /* WLAN_LOGGING_SOCK_SVC_H */ |