blob: 7962dda35245d3354bc0fa371921ed9025c73fc7 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
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#if !defined( __HOST_DIAG_CORE_EVENT_H )
29#define __HOST_DIAG_CORE_EVENT_H
30
31/**=========================================================================
32
33 \file host_diag_core_event.h
34
35 \brief WLAN UTIL host DIAG Events
36
37 Definitions for DIAG Events
38
39 ========================================================================*/
40
41/* $Header$ */
42
43/*--------------------------------------------------------------------------
44 Include Files
45 ------------------------------------------------------------------------*/
46#include "cdf_types.h"
47#include "cds_pack_align.h"
48#include "i_host_diag_core_event.h"
49
50/*--------------------------------------------------------------------------
51 Preprocessor definitions and constants
52 ------------------------------------------------------------------------*/
53#ifdef __cplusplus
54extern "C" {
55#endif /* __cplusplus */
56
57#define WAKE_LOCK_NAME_LEN 80
58
59/*-------------------------------------------------------------------------
60 Event ID: EVENT_WLAN_SECURITY
61 ------------------------------------------------------------------------*/
62typedef struct {
63 uint8_t eventId;
64 uint8_t authMode;
65 uint8_t encryptionModeUnicast;
66 uint8_t encryptionModeMulticast;
67 uint8_t pmkIDMatch;
68 uint8_t bssid[6];
69 uint8_t keyId;
70 uint8_t status;
71} host_event_wlan_security_payload_type;
72
73/*-------------------------------------------------------------------------
74 Event ID: EVENT_WLAN_STATUS
75 ------------------------------------------------------------------------*/
76typedef struct {
77 uint8_t eventId;
78 uint8_t ssid[6];
79 uint8_t bssType;
80 uint8_t rssi;
81 uint8_t channel;
82 uint8_t qosCapability;
83 uint8_t authType;
84 uint8_t encryptionType;
85 uint8_t reason;
86 uint8_t reasonDisconnect;
87} host_event_wlan_status_payload_type;
88
89/*-------------------------------------------------------------------------
90 Event ID: EVENT_WLAN_HANDOFF
91 ------------------------------------------------------------------------*/
92typedef struct {
93 uint8_t eventId;
94 uint8_t currentApBssid[6];
95 uint8_t currentApRssi;
96 uint8_t candidateApBssid[6];
97 uint8_t candidateApRssi;
98} host_event_wlan_handoff_payload_type;
99
100/*-------------------------------------------------------------------------
101 Event ID: EVENT_WLAN_VCC
102 ------------------------------------------------------------------------*/
103typedef struct {
104 uint8_t eventId;
105 uint8_t rssi;
106 uint8_t txPer;
107 uint8_t rxPer;
108 int linkQuality;
109} host_event_wlan_vcc_payload_type;
110
111/*-------------------------------------------------------------------------
112 Event ID: EVENT_WLAN_QOS
113 ------------------------------------------------------------------------*/
114typedef struct {
115 uint8_t eventId;
116 uint8_t reasonCode;
117} host_event_wlan_qos_payload_type;
118
119/*-------------------------------------------------------------------------
120 Event ID: EVENT_WLAN_PE
121 ------------------------------------------------------------------------*/
122typedef struct {
123 char bssid[6];
124 uint16_t event_type;
125 uint16_t sme_state;
126 uint16_t mlm_state;
127 uint16_t status;
128 uint16_t reason_code;
129} host_event_wlan_pe_payload_type;
130
131/*-------------------------------------------------------------------------
132 Event ID: EVENT_WLAN_ADD_BLOCK_ACK_SUCCESS
133 ------------------------------------------------------------------------*/
134typedef struct {
135 char ucBaPeerMac[6];
136 uint8_t ucBaTid;
137 uint8_t ucBaBufferSize;
138 uint16_t usBaSSN;
139 uint8_t fInitiator;
140} host_event_wlan_add_block_ack_success_payload_type;
141
142/*-------------------------------------------------------------------------
143 Event ID: EVENT_WLAN_ADD_BLOCK_ACK_FAILED
144 ------------------------------------------------------------------------*/
145typedef struct {
146 char ucBaPeerMac[6];
147 uint8_t ucBaTid;
148 uint8_t ucReasonCode;
149 uint8_t fInitiator;
150} host_event_wlan_add_block_ack_failed_payload_type;
151
152/*-------------------------------------------------------------------------
153 Event ID: EVENT_WLAN_DELETE_BLOCK_ACK_SUCCESS
154 ------------------------------------------------------------------------*/
155typedef struct {
156 char ucBaPeerMac[6];
157 uint8_t ucBaTid;
158 uint8_t ucDeleteReasonCode;
159} host_event_wlan_add_block_ack_deleted_payload_type;
160
161/*-------------------------------------------------------------------------
162 Event ID: EVENT_WLAN_DELETE_BLOCK_ACK_FAILED
163 ------------------------------------------------------------------------*/
164typedef struct {
165 char ucBaPeerMac[6];
166 uint8_t ucBaTid;
167 uint8_t ucDeleteReasonCode;
168 uint8_t ucFailReasonCode;
169} host_event_wlan_add_block_ack_delete_failed_payload_type;
170
171/*-------------------------------------------------------------------------
172 Event ID: EVENT_WLAN_BSS_PROTECTION
173 ------------------------------------------------------------------------*/
174typedef struct {
175 uint8_t event_type;
176 uint8_t prot_type;
177} host_event_wlan_bss_prot_payload_type;
178
179/*-------------------------------------------------------------------------
180 Event ID: EVENT_WLAN_BRINGUP_STATUS
181 ------------------------------------------------------------------------*/
182typedef struct {
183 uint16_t wlanStatus;
184 char driverVersion[10];
185} host_event_wlan_bringup_status_payload_type;
186
187CDS_PACK_START
188/*-------------------------------------------------------------------------
189 Event ID: EVENT_WLAN_POWERSAVE_GENERIC
190 ------------------------------------------------------------------------*/
191typedef CDS_PACK_PRE struct {
192 uint8_t event_subtype;
193 uint8_t full_power_request_reason;
194 uint8_t pmc_current_state;
195 uint8_t enable_disable_powersave_mode;
196 uint8_t winmob_d_power_state;
197 uint8_t dtim_period;
198 uint16_t final_listen_intv;
199 uint16_t bmps_auto_timer_duration;
200 uint16_t bmps_period;
201} CDS_PACK_POST host_event_wlan_powersave_payload_type;
202
203CDS_PACK_END
204/*-------------------------------------------------------------------------
205 Event ID: EVENT_WLAN_POWERSAVE_WOW
206 ------------------------------------------------------------------------*/
207typedef struct {
208 uint8_t event_subtype;
209 uint8_t wow_type;
210 uint8_t wow_magic_pattern[6];
211 uint8_t wow_del_ptrn_id;
212 uint8_t wow_wakeup_cause;
213 uint8_t wow_wakeup_cause_pbm_ptrn_id;
214} host_event_wlan_powersave_wow_payload_type;
215
216/*-------------------------------------------------------------------------
217 Event ID: EVENT_WLAN_BTC
218 ------------------------------------------------------------------------*/
219typedef struct {
220 uint8_t eventId;
221 uint8_t btAddr[6];
222 uint16_t connHandle;
223 uint8_t connStatus;
224 uint8_t linkType;
225 uint8_t scoInterval;
226 uint8_t scoWindow;
227 uint8_t retransWindow;
228 uint8_t mode;
229} host_event_wlan_btc_type;
230
231/*-------------------------------------------------------------------------
232 Event ID: EVENT_WLAN_EAPOL
233 ------------------------------------------------------------------------*/
234/**
235 * struct host_event_wlan_eapol - Structure holding the eapol information
236 * @event_sub_type: 0-Transmitted, 1-Received
237 * @eapol_packet_type: 0 - EAP Start, 1 - EAPOL Start, 2 - EAPOL Logoff
238 3 - EAPOL Key, 4 - EAPOL Encapsulated Alert
239 * @eapol_key_info: This field from the driver is in big endian format.
240 * So, the masks .0x8013. can be used to extract the
241 * message type. After masking, the values corresponding
242 * to messages 1/2/3/4 are given below:
243 * Msg. 1 0x8000
244 * Msg. 2 0x0001
245 * Msg. 3 0x8013
246 * Msg. 4 0x0003
247 * @eapol_rate: Rate at which the frame is received
248 * @dest_addr: Destination address
249 * @src_addr: Source address
250 *
251 * This structure contains the EAPOL information related to logging
252 */
253struct host_event_wlan_eapol {
254 uint8_t event_sub_type;
255 uint8_t eapol_packet_type;
256 uint16_t eapol_key_info;
257 uint16_t eapol_rate;
258 uint8_t dest_addr[6];
259 uint8_t src_addr[6];
260};
261
262/*-------------------------------------------------------------------------
263 Event ID: EVENT_WLAN_WAKE_LOCK
264 ------------------------------------------------------------------------*/
265/**
266 * struct host_event_wlan_wake_lock - Structure holding the wakelock information
267 * @status: Whether the wakelock is taken/released
268 * @reason: Reason for taking this wakelock
269 * @timeout: Timeout value in case of timed wakelocks
270 * @name_len: Length of the name of the wakelock that will follow
271 * @name: Name of the wakelock
272 *
273 * This structure will hold the wakelock information
274 */
275struct host_event_wlan_wake_lock {
276 uint32_t status;
277 uint32_t reason;
278 uint32_t timeout;
279 uint32_t name_len;
280 char name[WAKE_LOCK_NAME_LEN];
281};
282
283/*-------------------------------------------------------------------------
284 Event ID: EVENT_WLAN_LOG_COMPLETE
285 ------------------------------------------------------------------------*/
286/**
287 * struct host_event_wlan_log_complete - Holds log completion details
288 * @is_fatal: Indicates if the event is fatal or not
289 * @indicator: Source of the bug report - Framework/Host/Firmware
290 * @reason_code: Reason for triggering bug report
291 * @reserved: Reserved field
292 *
293 * This structure holds the log completion related information
294 */
295struct host_event_wlan_log_complete {
296 uint32_t is_fatal;
297 uint32_t indicator;
298 uint32_t reason_code;
299 uint32_t reserved;
300};
301
302/*-------------------------------------------------------------------------
303 Function declarations and documenation
304 ------------------------------------------------------------------------*/
305/**
306 * enum wifi_connectivity_events - Enum containing EAPOL sub type
307 * @WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED: EAPOL transmitted
308 * @WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED: EAPOL received
309 *
310 * This enum contains the EAPOL subtype
311 */
312enum wifi_connectivity_events {
313 WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED,
314 WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED,
315};
316
317/**
318 * enum wake_lock_reason - Reason for taking/releasing wakelock
319 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT: Driver initialization
320 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT: Driver re-initialization
321 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT: Driver shutdown
322 * @WIFI_POWER_EVENT_WAKELOCK_SCAN: Scan request/response handling
323 * @WIFI_POWER_EVENT_WAKELOCK_EXT_SCAN: Extended scan request/response handling
324 * @WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN: Driver resume
325 * @WIFI_POWER_EVENT_WAKELOCK_ROC: Remain on channel request/response handling
326 * @WIFI_POWER_EVENT_WAKELOCK_AUTO_SUSPEND: Auto suspend related handling
327 * @WIFI_POWER_EVENT_WAKELOCK_IPA: IPA related handling
328 * @WIFI_POWER_EVENT_WAKELOCK_ADD_STA: Addition of STA
329 * @WIFI_POWER_EVENT_WAKELOCK_HOLD_RX: Wakelocks taken for receive
330 * @WIFI_POWER_EVENT_WAKELOCK_SAP: SoftAP related wakelocks
331 * @WIFI_POWER_EVENT_WAKELOCK_WOW: WoW feature related
332 * @WIFI_POWER_EVENT_WAKELOCK_PNO: PNO feature related
333 * @WIFI_POWER_EVENT_WAKELOCK_DEL_STA: Deletion of a station
334 * @WIFI_POWER_EVENT_WAKELOCK_DFS: DFS related wakelocks
335 * @WIFI_POWER_EVENT_WAKELOCK_MISC: Miscellaneous wakelocks
336 *
337 * Indicates the reason for which the wakelock was taken/released
338 */
339enum wake_lock_reason {
340 WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT,
341 WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT,
342 WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT,
343 WIFI_POWER_EVENT_WAKELOCK_SCAN,
344 WIFI_POWER_EVENT_WAKELOCK_EXT_SCAN,
345 WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN,
346 WIFI_POWER_EVENT_WAKELOCK_ROC,
347 WIFI_POWER_EVENT_WAKELOCK_AUTO_SUSPEND,
348 WIFI_POWER_EVENT_WAKELOCK_IPA,
349 WIFI_POWER_EVENT_WAKELOCK_ADD_STA,
350 WIFI_POWER_EVENT_WAKELOCK_HOLD_RX,
351 WIFI_POWER_EVENT_WAKELOCK_SAP,
352 WIFI_POWER_EVENT_WAKELOCK_WOW,
353 WIFI_POWER_EVENT_WAKELOCK_PNO,
354 WIFI_POWER_EVENT_WAKELOCK_DEL_STA,
355 WIFI_POWER_EVENT_WAKELOCK_DFS,
356 WIFI_POWER_EVENT_WAKELOCK_MISC,
357};
358
359#ifdef __cplusplus
360}
361#endif /* __cplusplus */
362#endif /* __HOST_DIAG_CORE_EVENT_H */