blob: 4ddd24b1f57c89b165e69f6d966b64896816b8a5 [file] [log] [blame]
Vinay Krishna Erannad938c422014-03-10 17:14:21 +05301/*
Siddharth Bhal7bd19932015-03-03 16:54:36 +05302* Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
Vinay Krishna Erannad938c422014-03-10 17:14:21 +05303*
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 Ahuja715aafc2015-07-21 23:35:10 +053042
Vinay Krishna Eranna273ec5a2014-05-10 18:05:25 +053043int wlan_logging_sock_init_svc(void);
44int wlan_logging_sock_deinit_svc(void);
Siddharth Bhal7bd19932015-03-03 16:54:36 +053045int wlan_logging_flush_pkt_queue(void);
Vinay Krishna Erannad938c422014-03-10 17:14:21 +053046int wlan_logging_sock_deactivate_svc(void);
47int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length);
Mihir Sheteccafc0c2015-04-17 16:13:15 +053048int wlan_queue_logpkt_for_app(vos_pkt_t *pPacket, uint32 pkt_type);
Sachin Ahuja715aafc2015-07-21 23:35:10 +053049void wlan_process_done_indication(uint8 type, uint32 reason_code);
Sushant Kaushik33200572015-08-05 16:46:20 +053050int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf,
51 int pkt_stats_enabled, int pkt_stats_buff);
Abhishek Singh837adf22015-10-01 17:37:37 +053052void wlan_flush_host_logs_for_fatal(void);
53
Sachin Ahuja715aafc2015-07-21 23:35:10 +053054void wlan_init_log_completion(void);
55int wlan_set_log_completion(uint32 is_fatal,
56 uint32 indicator,
57 uint32 reason_code);
Abhishek Singh837adf22015-10-01 17:37:37 +053058void wlan_get_log_and_reset_completion(uint32 *is_fatal,
Sachin Ahuja715aafc2015-07-21 23:35:10 +053059 uint32 *indicator,
Abhishek Singh837adf22015-10-01 17:37:37 +053060 uint32 *reason_code,
61 bool reset);
Sachin Ahuja715aafc2015-07-21 23:35:10 +053062bool wlan_is_log_report_in_progress(void);
63void wlan_reset_log_report_in_progress(void);
64
65void wlan_deinit_log_completion(void);
66
Sushant Kaushik215778f2015-05-21 14:05:36 +053067void wlan_logging_set_log_level(void);
68
c_manjeef1495642015-10-13 18:35:01 +053069#define FW_MEM_DUMP_MAGIC 0x3C3A2D44
70
c_manjeecfd1efb2015-09-25 19:32:34 +053071enum 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};
77int wlan_fwr_mem_dump_buffer_allocation(void);
78bool wlan_fwr_mem_dump_test_and_set_write_allowed_bit(void);
79bool wlan_fwr_mem_dump_test_and_set_read_allowed_bit(void);
80void wlan_set_fwr_mem_dump_state(enum FW_MEM_DUMP_STATE fw_mem_dump_state);
c_manjeef1495642015-10-13 18:35:01 +053081void wlan_set_svc_fw_mem_dump_req_cb(void*,void*);
82size_t wlan_fwr_mem_dump_fsread_handler(char __user *buf, size_t count, loff_t *pos,loff_t* bytes_left);
c_manjeecfd1efb2015-09-25 19:32:34 +053083void wlan_indicate_mem_dump_complete(bool );
84void wlan_store_fwr_mem_dump_size(uint32 dump_size);
85void wlan_free_fwr_mem_dump_buffer(void);
86
Abhishek Singh880d7122015-08-26 16:23:04 +053087bool wlan_is_logger_thread(int threadId);
Sushant Kaushik33200572015-08-05 16:46:20 +053088int wlan_pkt_stats_to_user(void *perPktStat);
89void wlan_disable_and_flush_pkt_stats(void);
90 void wlan_fillTxStruct(void *pktStat);
91 bool wlan_isPktStatsEnabled(void);
Sachin Ahujac08f72a2015-09-22 15:25:47 +053092#ifdef FEATURE_WLAN_DIAG_SUPPORT
93void wlan_report_log_completion(uint32 is_fatal,
94 uint32 indicator,
95 uint32 reason_code);
96#else
97static 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 Kaushik33200572015-08-05 16:46:20 +0530106
Vinay Krishna Erannad938c422014-03-10 17:14:21 +0530107#endif /* WLAN_LOGGING_SOCK_SVC_H */