blob: 95f278d9fa94456eb09ec734d210fa523b4c4b51 [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);
Sachin Ahuja715aafc2015-07-21 23:35:10 +053052void wlan_init_log_completion(void);
53int wlan_set_log_completion(uint32 is_fatal,
54 uint32 indicator,
55 uint32 reason_code);
56void wlan_get_log_completion(uint32 *is_fatal,
57 uint32 *indicator,
58 uint32 *reason_code);
59bool wlan_is_log_report_in_progress(void);
60void wlan_reset_log_report_in_progress(void);
61
62void wlan_deinit_log_completion(void);
63
Sushant Kaushik215778f2015-05-21 14:05:36 +053064void wlan_logging_set_log_level(void);
65
c_manjeecfd1efb2015-09-25 19:32:34 +053066enum 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};
72int wlan_fwr_mem_dump_buffer_allocation(void);
73bool wlan_fwr_mem_dump_test_and_set_write_allowed_bit(void);
74bool wlan_fwr_mem_dump_test_and_set_read_allowed_bit(void);
75void wlan_set_fwr_mem_dump_state(enum FW_MEM_DUMP_STATE fw_mem_dump_state);
76size_t wlan_fwr_mem_dump_fsread_handler(char __user *buf, size_t count, loff_t *pos);
77void wlan_indicate_mem_dump_complete(bool );
78void wlan_store_fwr_mem_dump_size(uint32 dump_size);
79void wlan_free_fwr_mem_dump_buffer(void);
80
Abhishek Singh880d7122015-08-26 16:23:04 +053081bool wlan_is_logger_thread(int threadId);
82void wlan_logging_reset_thread_stuck_count(int threadId);
Sushant Kaushik33200572015-08-05 16:46:20 +053083int wlan_pkt_stats_to_user(void *perPktStat);
84void wlan_disable_and_flush_pkt_stats(void);
85 void wlan_fillTxStruct(void *pktStat);
86 bool wlan_isPktStatsEnabled(void);
87
Vinay Krishna Erannad938c422014-03-10 17:14:21 +053088#endif /* WLAN_LOGGING_SOCK_SVC_H */