xref: /wlan-dirver/qca-wifi-host-cmn/utils/host_diag_log/src/i_host_diag_core_event.h (revision 4865edfd190c086bbe2c69aae12a8226f877b91e)
1 /*
2  * Copyright (c) 2014-2017 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(__I_HOST_DIAG_CORE_EVENT_H)
20 #define __I_HOST_DIAG_CORE_EVENT_H
21 
22 /**=========================================================================
23 
24    \file  i_host_diag_core_event.h
25 
26    \brief Android specific definitions for WLAN UTIL DIAG events
27 
28    ========================================================================*/
29 
30 /* $Header$ */
31 
32 /*--------------------------------------------------------------------------
33    Include Files
34    ------------------------------------------------------------------------*/
35 #include <qdf_types.h>
36 #ifdef FEATURE_WLAN_DIAG_SUPPORT
37 #include <host_diag_event_defs.h>
38 #endif
39 
40 /*--------------------------------------------------------------------------
41    Preprocessor definitions and constants
42    ------------------------------------------------------------------------*/
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif /* __cplusplus */
47 
48 #ifdef FEATURE_WLAN_DIAG_SUPPORT
49 
50 void host_diag_event_report_payload(uint16_t event_Id, uint16_t length,
51 				    void *pPayload);
52 /*---------------------------------------------------------------------------
53    Allocate an event payload holder
54    ---------------------------------------------------------------------------*/
55 #define WLAN_HOST_DIAG_EVENT_DEF(payload_name, payload_type) \
56 	payload_type(payload_name)
57 
58 /*---------------------------------------------------------------------------
59    Report the event
60    ---------------------------------------------------------------------------*/
61 #define WLAN_HOST_DIAG_EVENT_REPORT(payload_ptr, ev_id) \
62 	do {							\
63 		host_diag_event_report_payload(ev_id,		\
64 						sizeof(*(payload_ptr)),			\
65 						(void *)(payload_ptr));			\
66 	} while (0)
67 
68 #else                           /* FEATURE_WLAN_DIAG_SUPPORT */
69 
70 #define WLAN_HOST_DIAG_EVENT_DEF(payload_name, payload_type)
71 #define WLAN_HOST_DIAG_EVENT_REPORT(payload_ptr, ev_id)
72 
73 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
74 
75 /**
76  * enum auth_timeout_type - authentication timeout type
77  * @AUTH_FAILURE_TIMEOUT: auth failure timeout
78  * @AUTH_RESPONSE_TIMEOUT: auth response timeout
79  */
80 enum auth_timeout_type {
81 	AUTH_FAILURE_TIMEOUT,
82 	AUTH_RESPONSE_TIMEOUT,
83 };
84 
85 /*-------------------------------------------------------------------------
86    Function declarations and documenation
87    ------------------------------------------------------------------------*/
88 #ifdef FEATURE_WLAN_DIAG_SUPPORT
89 void host_diag_log_wlock(uint32_t reason, const char *wake_lock_name,
90 		uint32_t timeout, uint32_t status);
91 #else
92 static inline void host_diag_log_wlock(uint32_t reason,
93 		const char *wake_lock_name,
94 		uint32_t timeout, uint32_t status)
95 {
96 
97 }
98 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
99 
100 #ifdef FEATURE_WLAN_DIAG_SUPPORT
101 void host_log_low_resource_failure(uint8_t event_sub_type);
102 #else
103 static inline void host_log_low_resource_failure(uint8_t event_sub_type)
104 {
105 
106 }
107 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
108 
109 #ifdef FEATURE_WLAN_DIAG_SUPPORT
110 void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause);
111 #else
112 static inline void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause)
113 {
114 	return;
115 }
116 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
117 #ifdef __cplusplus
118 }
119 #endif /* __cplusplus */
120 #endif /* __I_HOST_DIAG_CORE_EVENT_H */
121