blob: bd43635d4424af5a2791c5287c7709fe53ef30f4 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Abhishek Singh96568922016-01-05 15:28:12 +05302 * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
Kiet Lam1ed83fc2014-02-19 01:15:45 -08003 *
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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam1ed83fc2014-02-19 01:15:45 -080021
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
Jeff Johnson295189b2012-06-20 16:38:30 -070028#if !defined( __VOS_DIAG_CORE_EVENT_H )
29#define __VOS_DIAG_CORE_EVENT_H
30
31/**=========================================================================
32
33 \file vos_event.h
34
35 \brief virtual Operating System Services (vOSS) DIAG Events
36
37 Definitions for vOSS Events
38
Jeff Johnson295189b2012-06-20 16:38:30 -070039
40 ========================================================================*/
41
42/* $Header$ */
43
44/*--------------------------------------------------------------------------
45 Include Files
46 ------------------------------------------------------------------------*/
47#include "vos_types.h"
48#include "vos_pack_align.h"
49#include "i_vos_diag_core_event.h"
50
51/*--------------------------------------------------------------------------
52 Preprocessor definitions and constants
53 ------------------------------------------------------------------------*/
54#ifdef __cplusplus
55extern "C" {
56#endif /* __cplusplus */
57
Sushant Kaushik83392fa2015-05-05 17:44:40 +053058#define WAKE_LOCK_NAME_LEN 80
59
60
Jeff Johnson295189b2012-06-20 16:38:30 -070061/*-------------------------------------------------------------------------
62 Event ID: EVENT_WLAN_SECURITY
63 ------------------------------------------------------------------------*/
64typedef struct
65{
66 v_U8_t eventId;
67 v_U8_t authMode;
68 v_U8_t encryptionModeUnicast;
69 v_U8_t encryptionModeMulticast;
70 v_U8_t pmkIDMatch;
71 v_U8_t bssid[6];
72 v_U8_t keyId;
73 v_U8_t status;
74} vos_event_wlan_security_payload_type;
75
76/*-------------------------------------------------------------------------
77 Event ID: EVENT_WLAN_STATUS
78 ------------------------------------------------------------------------*/
79typedef struct
80{
81 v_U8_t eventId;
82 v_U8_t ssid[6];
83 v_U8_t bssType;
84 v_U8_t rssi;
85 v_U8_t channel;
86 v_U8_t qosCapability;
87 v_U8_t authType;
88 v_U8_t encryptionType;
89 v_U8_t reason;
90 v_U8_t reasonDisconnect;
91} vos_event_wlan_status_payload_type;
92
93/*-------------------------------------------------------------------------
94 Event ID: EVENT_WLAN_HANDOFF
95 ------------------------------------------------------------------------*/
96typedef struct
97{
98 v_U8_t eventId;
99 v_U8_t currentApBssid[6];
100 v_U8_t currentApRssi;
101 v_U8_t candidateApBssid[6];
102 v_U8_t candidateApRssi;
103} vos_event_wlan_handoff_payload_type;
104
105/*-------------------------------------------------------------------------
106 Event ID: EVENT_WLAN_VCC
107 ------------------------------------------------------------------------*/
108typedef struct
109{
110 v_U8_t eventId;
111 v_U8_t rssi;
112 v_U8_t txPer;
113 v_U8_t rxPer;
114 int linkQuality;
115} vos_event_wlan_vcc_payload_type;
116
117/*-------------------------------------------------------------------------
118 Event ID: EVENT_WLAN_QOS
119 ------------------------------------------------------------------------*/
120typedef struct
121{
122 v_U8_t eventId;
123 v_U8_t reasonCode;
124} vos_event_wlan_qos_payload_type;
125
126/*-------------------------------------------------------------------------
127 Event ID: EVENT_WLAN_PE
128 ------------------------------------------------------------------------*/
129typedef struct
130{
131 char bssid[6];
132 v_U16_t event_type;
133 v_U16_t sme_state;
134 v_U16_t mlm_state;
135 v_U16_t status;
136 v_U16_t reason_code;
137} vos_event_wlan_pe_payload_type;
138
139/*-------------------------------------------------------------------------
140 Event ID: EVENT_WLAN_ADD_BLOCK_ACK_SUCCESS
141 ------------------------------------------------------------------------*/
142typedef struct
143{
144 char ucBaPeerMac[6];
145 v_U8_t ucBaTid;
146 v_U8_t ucBaBufferSize;
147 v_U16_t usBaSSN;
148 v_U8_t fInitiator;
149} vos_event_wlan_add_block_ack_success_payload_type;
150
151/*-------------------------------------------------------------------------
152 Event ID: EVENT_WLAN_ADD_BLOCK_ACK_FAILED
153 ------------------------------------------------------------------------*/
154typedef struct
155{
156 char ucBaPeerMac[6];
157 v_U8_t ucBaTid;
158 v_U8_t ucReasonCode;
159 v_U8_t fInitiator;
160} vos_event_wlan_add_block_ack_failed_payload_type;
161
162/*-------------------------------------------------------------------------
163 Event ID: EVENT_WLAN_DELETE_BLOCK_ACK_SUCCESS
164 ------------------------------------------------------------------------*/
165typedef struct
166{
167 char ucBaPeerMac[6];
168 v_U8_t ucBaTid;
169 v_U8_t ucDeleteReasonCode;
170} vos_event_wlan_add_block_ack_deleted_payload_type;
171
172/*-------------------------------------------------------------------------
173 Event ID: EVENT_WLAN_DELETE_BLOCK_ACK_FAILED
174 ------------------------------------------------------------------------*/
175typedef struct
176{
177 char ucBaPeerMac[6];
178 v_U8_t ucBaTid;
179 v_U8_t ucDeleteReasonCode;
180 v_U8_t ucFailReasonCode;
181} vos_event_wlan_add_block_ack_delete_failed_payload_type;
182
183/*-------------------------------------------------------------------------
184 Event ID: EVENT_WLAN_BSS_PROTECTION
185 ------------------------------------------------------------------------*/
186typedef struct
187{
188 v_U8_t event_type;
189 v_U8_t prot_type;
190} vos_event_wlan_bss_prot_payload_type;
191
192/*-------------------------------------------------------------------------
193 Event ID: EVENT_WLAN_BRINGUP_STATUS
194 ------------------------------------------------------------------------*/
195typedef struct
196{
197 v_U16_t wlanStatus;
198 char driverVersion[10];
199} vos_event_wlan_bringup_status_payload_type;
200
201VOS_PACK_START
202
203/*-------------------------------------------------------------------------
204 Event ID: EVENT_WLAN_POWERSAVE_GENERIC
205 ------------------------------------------------------------------------*/
206typedef VOS_PACK_PRE struct
207{
208 v_U8_t event_subtype;
209 v_U32_t imps_period;
210 v_U8_t full_power_request_reason;
211 v_U8_t pmc_current_state;
212 v_U8_t enable_disable_powersave_mode;
213 v_U8_t winmob_d_power_state;
214 v_U8_t dtim_period;
215 v_U16_t final_listen_intv;
216 v_U16_t bmps_auto_timer_duration;
217 v_U16_t bmps_period;
218} VOS_PACK_POST vos_event_wlan_powersave_payload_type;
219
220VOS_PACK_END
221
222/*-------------------------------------------------------------------------
223 Event ID: EVENT_WLAN_POWERSAVE_WOW
224 ------------------------------------------------------------------------*/
225typedef struct
226{
227 v_U8_t event_subtype;
228 v_U8_t wow_type;
229 v_U8_t wow_magic_pattern[6];
230 v_U8_t wow_del_ptrn_id;
231 v_U8_t wow_wakeup_cause;
232 v_U8_t wow_wakeup_cause_pbm_ptrn_id;
233} vos_event_wlan_powersave_wow_payload_type;
234
235/*-------------------------------------------------------------------------
236 Event ID: EVENT_WLAN_BTC
237 ------------------------------------------------------------------------*/
238typedef struct
239{
240 v_U8_t eventId;
241 v_U8_t btAddr[6];
242 v_U16_t connHandle;
243 v_U8_t connStatus;
244 v_U8_t linkType;
245 v_U8_t scoInterval;
246 v_U8_t scoWindow;
247 v_U8_t retransWindow;
248 v_U8_t mode;
249} vos_event_wlan_btc_type;
250
Sushant Kaushika8073312015-05-04 17:33:52 +0530251/*-------------------------------------------------------------------------
252 Event ID: EVENT_WLAN_EAPOL
253 ------------------------------------------------------------------------*/
254struct vos_event_wlan_eapol
255{
256 uint8_t event_sub_type;
257 uint8_t eapol_packet_type;
258 uint16_t eapol_key_info;
259 uint16_t eapol_rate;
260 uint8_t dest_addr[6];
261 uint8_t src_addr[6];
262};
Sushant Kaushik83392fa2015-05-05 17:44:40 +0530263/*-------------------------------------------------------------------------
264 Event ID: EVENT_WLAN_WAKE_LOCK
265 ------------------------------------------------------------------------*/
266/*
267 * struct vos_event_wlan_wake_lock - Structure holding the wakelock information
268 * @status: Whether the wakelock is taken/released
269 * @reason: Reason for taking this wakelock
270 * @timeout: Timeout value in case of timed wakelocks
271 * @name_len: Length of the name of the wakelock that will follow
272 * @name: Name of the wakelock
273 *
274 * This structure will hold the wakelock informations
275 */
276struct vos_event_wlan_wake_lock
277{
278 uint32_t status;
279 uint32_t reason;
280 uint32_t timeout;
281 uint32_t name_len;
282 char name[WAKE_LOCK_NAME_LEN];
283};
284
Abhishek Singh96568922016-01-05 15:28:12 +0530285/**
286 * struct vos_event_tdls_teardown - tdls teardown diag event
287 * @reason: reason for tear down
288 * @peer_mac: peer mac
289 *
290 * This structure contain tdls teardown diag event info
291 */
292
293struct vos_event_tdls_teardown {
294 uint32_t reason;
295 uint8_t peer_mac[6];
296};
Sushant Kaushik83392fa2015-05-05 17:44:40 +0530297
Abhishek Singh5f544022016-01-05 15:57:19 +0530298/**
299 * struct vos_event_tdls_enable_link - tdls enable link event
300 * @peer_mac: peer mac
301 * @is_off_chan_supported: if off channel supported
302 * @is_off_chan_configured: if off channel configured
303 * @is_off_chan_established: if off channel established
304 *
305 * This structure contain tdls enable link diag event info
306 */
307struct vos_event_tdls_enable_link {
308 uint8_t peer_mac[6];
309 uint8_t is_off_chan_supported;
310 uint8_t is_off_chan_configured;
311 uint8_t is_off_chan_established;
312};
313
Sachin Ahujac08f72a2015-09-22 15:25:47 +0530314/*-------------------------------------------------------------------------
315 Event ID: EVENT_WLAN_LOG_COMPLETE
316 ------------------------------------------------------------------------*/
317/**
318 * struct vos_event_wlan_log_complete - Holds log completion details
319 * @is_fatal: Indicates if the event is fatal or not
320 * @indicator: Source of the bug report - Framework/Host/Firmware
321 * @reason_code: Reason for triggering bug report
322 * @reserved: Reserved field
323 *
324 * This structure holds the log completion related information
325 */
326struct vos_event_wlan_log_complete {
327 uint32_t is_fatal;
328 uint32_t indicator;
329 uint32_t reason_code;
330 uint32_t reserved;
331};
Sushant Kaushika8073312015-05-04 17:33:52 +0530332
Jeff Johnson295189b2012-06-20 16:38:30 -0700333
334/*-------------------------------------------------------------------------
335 Function declarations and documenation
336 ------------------------------------------------------------------------*/
Sushant Kaushika8073312015-05-04 17:33:52 +0530337enum wifi_connectivity_events {
338 WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED,
339 WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED,
340};
Sushant Kaushik83392fa2015-05-05 17:44:40 +0530341
342/*
343 * enum wake_lock_reason - Reason for taking wakelock
344* @WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT: Driver initialization
345 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT: Driver re-initialization
346 * @WIFI_POWER_EVENT_WAKELOCK_SCAN: Scan request/response handling
347 * @WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN: Driver resume
348 * @WIFI_POWER_EVENT_WAKELOCK_ROC: Remain on channel request/response handling
349 * @WIFI_POWER_EVENT_WAKELOCK_HOLD_RX: Wakelocks taken for receive
350 * @WIFI_POWER_EVENT_WAKELOCK_SAP: SoftAP related wakelocks
351 * This enum has the reason codes why the wakelocks were taken/released
352 */
353enum wake_lock_reason {
354 WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT,
355 WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT,
356 WIFI_POWER_EVENT_WAKELOCK_SCAN,
357 WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN,
358 WIFI_POWER_EVENT_WAKELOCK_ROC,
359 WIFI_POWER_EVENT_WAKELOCK_HOLD_RX,
360 WIFI_POWER_EVENT_WAKELOCK_SAP,
361};
362
Jeff Johnson295189b2012-06-20 16:38:30 -0700363#ifdef __cplusplus
364}
365#endif /* __cplusplus */
366
367#endif // __VOS_DIAG_CORE_EVENT_H