xref: /wlan-dirver/qca-wifi-host-cmn/utils/host_diag_log/inc/host_diag_core_event.h (revision 92d87f51612f6c3b2285266215edee8911647c2f)
1 /*
2  * Copyright (c) 2014-2018 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(__HOST_DIAG_CORE_EVENT_H)
20 #define __HOST_DIAG_CORE_EVENT_H
21 
22 /**=========================================================================
23 
24    \file  host_diag_core_event.h
25 
26    \brief WLAN UTIL host DIAG Events
27 
28    Definitions for DIAG Events
29 
30    ========================================================================*/
31 
32 /* $Header$ */
33 
34 /*--------------------------------------------------------------------------
35    Include Files
36    ------------------------------------------------------------------------*/
37 #include "qdf_types.h"
38 #include "i_host_diag_core_event.h"
39 
40 /*--------------------------------------------------------------------------
41    Preprocessor definitions and constants
42    ------------------------------------------------------------------------*/
43 #ifdef __cplusplus
44 extern "C" {
45 #endif /* __cplusplus */
46 
47 #define WAKE_LOCK_NAME_LEN 80
48 
49 /**
50  * enum wifi_frm_type: type of frame
51  *
52  * @MGMT: Indicates management frames
53  * @CTRL: Indicates control frames
54  * @DATA: Inidcates data frames
55  */
56 enum wifi_frm_type {
57 	MGMT = 0x00,
58 	CTRL = 0x01,
59 	DATA = 0x02,
60 };
61 
62 /*
63  * enum mgmt_frm_subtype: sub types of mgmt frames
64  *
65  * @ASSOC_REQ:       association request frame
66  * @ASSOC_RESP:      association response frame
67  * @REASSOC_REQ:     reassociation request frame
68  * @REASSOC_RESP:    reassociation response frame
69  * @PROBE_REQ:       probe request frame
70  * @PROBE_RESP:      probe response frame
71  * @BEACON:          beacon frame
72  * @ATIM:            ATIM frame
73  * @DISASSOC:        disassociation frame
74  * @AUTH:            authentication frame
75  * @DEAUTH:          deauthentication frame
76  * @ACTION:          action frame
77  * @ACTION_NO_ACK:   action no ack frame
78  */
79 enum mgmt_frm_subtype {
80 	ASSOC_REQ = 0x00,
81 	ASSOC_RESP = 0x10,
82 	REASSOC_REQ = 0x20,
83 	REASSOC_RESP = 0x30,
84 	PROBE_REQ = 0x40,
85 	PROBE_RESP = 0x50,
86 	BEACON = 0x80,
87 	ATIM = 0x90,
88 	DISASSOC = 0xa0,
89 	AUTH = 0xb0,
90 	DEAUTH = 0xc0,
91 	ACTION = 0xd0,
92 	ACTION_NO_ACK = 0xe0,
93 };
94 
95 /**
96  * enum mgmt_auth_type: type of authentication
97  *
98  * @AUTH_OPEN: no security applied
99  * @AUTH_SHARED: WEP type of auth
100  * @AUTH_WPA_EAP: WPA1 EAP based auth
101  * @AUTH_WPA_PSK: WPA1 PSK based auth
102  * @AUTH_WPA2_EAP: WPA2 EAP based auth
103  * @AUTH_WPA2_PSK: WPA2 PSK based auth
104  * @AUTH_WAPI_CERT: WAPI CERT based auth
105  * @AUTH_WAPI_PSK: WAPI PSK based auth
106  */
107 enum mgmt_auth_type {
108 	AUTH_OPEN = 0x00,
109 	AUTH_SHARED = 0x01,
110 	AUTH_WPA_EAP = 0x02,
111 	AUTH_WPA_PSK = 0x03,
112 	AUTH_WPA2_EAP = 0x04,
113 	AUTH_WPA2_PSK = 0x05,
114 	AUTH_WAPI_CERT = 0x06,
115 	AUTH_WAPI_PSK = 0x07,
116 	AUTH_MAX = 0xff,
117 };
118 
119 /**
120  * enum mgmt_encrypt_type: type of encryption
121  *
122  * @ENC_MODE_OPEN: no encryption applied
123  * @ENC_MODE_WEP40: WEP 40 bits encryption
124  * @ENC_MODE_WEP104: WEP 104 bits encryption
125  * @ENC_MODE_TKIP: TKIP based encryption
126  * @ENC_MODE_AES: AES based encryption
127  * @ENC_MODE_AES_GCMP: AES with GCMP encryption
128  * @ENC_MODE_AES_GCMP_256: AES with 256 bit GCMP encryption
129  * @ENC_MODE_SMS4: WAPI based SMS4 encryption
130  */
131 enum mgmt_encrypt_type {
132 	ENC_MODE_OPEN = 0x00,
133 	ENC_MODE_WEP40 = 0x01,
134 	ENC_MODE_WEP104 = 0x02,
135 	ENC_MODE_TKIP = 0x03,
136 	ENC_MODE_AES = 0x04,
137 	ENC_MODE_AES_GCMP = 0x05,
138 	ENC_MODE_AES_GCMP_256 = 0x06,
139 	ENC_MODE_SMS4 = 0x07,
140 	ENC_MODE_MAX = 0x0f,
141 };
142 
143 /**
144  * enum mgmt_ch_width: channel width of connection
145  *
146  * @BW_20MHZ: 20 MHz of channel bonding
147  * @BW_40MHZ: 40 MHz of channel bonding
148  * @BW_80MHZ: 80 MHz of channel bonding
149  * @BW_160MHZ: 160 MHz of channel bonding
150  * @BW_80P80MHZ: 80 + 80 MHz of channel bonding
151  * @BW_5MHZ: 5 MHz of channel bonding
152  * @BW_10MHZ: 10 MHz of channel bonding
153  */
154 enum mgmt_ch_width {
155 	BW_20MHZ = 0x00,
156 	BW_40MHZ = 0x01,
157 	BW_80MHZ = 0x02,
158 	BW_160MHZ = 0x03,
159 	BW_80P80MHZ = 0x04,
160 	BW_5MHZ = 0x05,
161 	BW_10MHZ = 0x06,
162 	BW_MAX = 0xff,
163 };
164 
165 /**
166  * enum mgmt_dot11_mode: 80211 mode of operation
167  *
168  * @DOT11_MODE_ABG: 802.11-ABG mix mode
169  * @DOT11_MODE_11A: 802.11-A mode
170  * @DOT11_MODE_11B: 802.11-B mode
171  * @DOT11_MODE_11G: 802.11-G mode
172  * @DOT11_MODE_11N: 802.11-N mode
173  * @DOT11_MODE_11AC: 802.11-AC mode
174  * @DOT11_MODE_11G_ONLY: 802.11-G only mode
175  * @DOT11_MODE_11N_ONLY: 802.11-N only mode
176  * @DOT11_MODE_11AC_ONLY: 802.11-AC only mode
177  * @DOT11_MODE_AUTO: 802.11 auto mode
178  * @DOT11_MODE_11AX: 802.11-AX mode
179  * @DOT11_MODE_11AX_ONLY: 802.11-AX only mode
180  */
181 enum mgmt_dot11_mode {
182 	DOT11_MODE_ABG = 0x00,
183 	DOT11_MODE_11A = 0x01,
184 	DOT11_MODE_11B = 0x02,
185 	DOT11_MODE_11G = 0x03,
186 	DOT11_MODE_11N = 0x04,
187 	DOT11_MODE_11AC = 0x05,
188 	DOT11_MODE_11G_ONLY = 0x06,
189 	DOT11_MODE_11N_ONLY = 0x07,
190 	DOT11_MODE_11AC_ONLY = 0x08,
191 	DOT11_MODE_AUTO = 0x09,
192 	DOT11_MODE_11AX = 0x0a,
193 	DOT11_MODE_11AX_ONLY = 0x0b,
194 	DOT11_MODE_MAX = 0xff,
195 };
196 
197 /**
198  * enum mgmt_bss_type: persona type
199  *
200  * @STA_PERSONA: STA mode
201  * @SAP_PERSONA: SAP mode
202  * @P2P_CLIENT_PERSONA: P2P cli mode
203  * @P2P_GO_PERSONA: P2P go mode
204  * @FTM_PERSONA: FTM mode
205  * @IBSS_PERSONA: IBSS mode
206  * @MONITOR_PERSONA: monitor mode
207  * @P2P_DEVICE_PERSONA: P2P device mode
208  * @OCB_PERSONA: OCB mode
209  * @EPPING_PERSONA: epping mode
210  * @QVIT_PERSONA: QVIT mode
211  * @NDI_PERSONA: NDI mode
212  * @WDS_PERSONA: WDS mode
213  * @BTAMP_PERSONA: BT amp mode
214  * @AHDEMO_PERSONA: AH demo mode
215  */
216 enum mgmt_bss_type {
217 	STA_PERSONA = 0x00,
218 	SAP_PERSONA = 0x01,
219 	P2P_CLIENT_PERSONA = 0x02,
220 	P2P_GO_PERSONA = 0x03,
221 	FTM_PERSONA = 0x04,
222 	IBSS_PERSONA = 0x05,
223 	MONITOR_PERSONA = 0x06,
224 	P2P_DEVICE_PERSONA = 0x07,
225 	OCB_PERSONA = 0x08,
226 	EPPING_PERSONA = 0x09,
227 	QVIT_PERSONA = 0x0a,
228 	NDI_PERSONA = 0x0b,
229 	WDS_PERSONA = 0x0c,
230 	BTAMP_PERSONA = 0x0d,
231 	AHDEMO_PERSONA = 0x0e,
232 	MAX_PERSONA = 0xff,
233 };
234 
235 /*-------------------------------------------------------------------------
236    Event ID: EVENT_WLAN_SECURITY
237    ------------------------------------------------------------------------*/
238 typedef struct {
239 	uint8_t eventId;
240 	uint8_t authMode;
241 	uint8_t encryptionModeUnicast;
242 	uint8_t encryptionModeMulticast;
243 	uint8_t pmkIDMatch;
244 	uint8_t bssid[6];
245 	uint8_t keyId;
246 	uint8_t status;
247 } host_event_wlan_security_payload_type;
248 
249 /*-------------------------------------------------------------------------
250    Event ID: EVENT_WLAN_STATUS_V2
251    ------------------------------------------------------------------------*/
252 typedef struct {
253 	uint8_t eventId;
254 	uint8_t ssid[32];
255 	uint8_t bssType;
256 	uint8_t rssi;
257 	uint8_t channel;
258 	uint8_t qosCapability;
259 	uint8_t authType;
260 	uint8_t encryptionType;
261 	uint8_t reason;
262 	uint8_t reasonDisconnect;
263 } host_event_wlan_status_payload_type;
264 
265 /*-------------------------------------------------------------------------
266    Event ID: EVENT_WLAN_HANDOFF
267    ------------------------------------------------------------------------*/
268 typedef struct {
269 	uint8_t eventId;
270 	uint8_t currentApBssid[6];
271 	uint8_t currentApRssi;
272 	uint8_t candidateApBssid[6];
273 	uint8_t candidateApRssi;
274 } host_event_wlan_handoff_payload_type;
275 
276 /*-------------------------------------------------------------------------
277    Event ID: EVENT_WLAN_VCC
278    ------------------------------------------------------------------------*/
279 typedef struct {
280 	uint8_t eventId;
281 	uint8_t rssi;
282 	uint8_t txPer;
283 	uint8_t rxPer;
284 	int linkQuality;
285 } host_event_wlan_vcc_payload_type;
286 
287 /*-------------------------------------------------------------------------
288    Event ID: EVENT_WLAN_QOS
289    ------------------------------------------------------------------------*/
290 typedef struct {
291 	uint8_t eventId;
292 	uint8_t reasonCode;
293 } host_event_wlan_qos_payload_type;
294 
295 /**
296  * host_event_wlan_connection_stats: to capture connection details
297  *
298  * @rssi: RSSI signal strength of connected AP, units in dbM
299  * @ssid_len: length of SSID
300  * @ssid: SSID of AP where STA is connected
301  * @bssid: bssid of AP where STA is connected
302  * @operating_channel: channel on which AP is connected
303  * @qos_capability: QoS is enabled or no
304  * @chnl_bw: channel BW of connection, units in MHz
305  *		Range: enum mgmt_ch_width
306  * @dot11mode: 802.11 mode of current connection
307  *		Range: enum mgmt_dot11_mode
308  * @bss_type: type of the BSS whether AP/IBSS/P2PGO
309  *		Range: enum mgmt_bss_type bss_type
310  * @auth_type: type of authentication for connected AP
311  *		Range: enum mgmt_auth_type
312  * @encryption_type: type of encryption applied
313  *		Range: enum mgmt_encrypt_type
314  * @reserved1: reserved for future use
315  * @est_link_speed: link speed of connection, units in Mbps
316  * @result_code: result code of connection success or failure
317  * @reason_code: if failed then what is the reason
318  */
319 struct host_event_wlan_connection_stats {
320 	int8_t rssi;
321 	uint8_t ssid_len;
322 	char ssid[32];
323 	uint8_t bssid[6];
324 	uint8_t operating_channel;
325 	uint8_t qos_capability;
326 	uint8_t chnl_bw;
327 	uint8_t dot11mode;
328 	uint8_t bss_type;
329 	uint8_t auth_type;
330 	uint8_t encryption_type;
331 	uint8_t reserved1;
332 	uint32_t est_link_speed;
333 	uint16_t result_code;
334 	uint16_t reason_code;
335 } qdf_packed;
336 
337 /*-------------------------------------------------------------------------
338    Event ID: EVENT_WLAN_PE
339    ------------------------------------------------------------------------*/
340 typedef struct {
341 	char bssid[6];
342 	uint16_t event_type;
343 	uint16_t sme_state;
344 	uint16_t mlm_state;
345 	uint16_t status;
346 	uint16_t reason_code;
347 } host_event_wlan_pe_payload_type;
348 
349 /**
350  * host_event_wlan_mgmt_payload_type: To capture TX/RX mgmt frames' payload
351  *
352  * @mgmt_type: type of frames, value: enum wifi_frm_type
353  * @mgmt_subtype: subtype of mgmt frame, value: enum mgmt_frm_subtype
354  * @operating_channel: operating channel of AP
355  * @ssid_len: length of SSID, max 32 bytes long as per standard
356  * @ssid: SSID of connected AP
357  * @self_mac_addr: mac address of self interface
358  * @bssid: BSSID for which frame is received
359  * @result_code: result code TX/RX OTA delivery
360  * @reason_code: reason code given in TX/RX frame
361  */
362 struct host_event_wlan_mgmt_payload_type {
363 	uint8_t mgmt_type;
364 	uint8_t mgmt_subtype;
365 	uint8_t operating_channel;
366 	uint8_t ssid_len;
367 	char ssid[32];
368 	char self_mac_addr[6];
369 	char bssid[6];
370 	uint16_t result_code;
371 	uint16_t reason_code;
372 } qdf_packed;
373 
374 /*-------------------------------------------------------------------------
375    Event ID: EVENT_WLAN_ADD_BLOCK_ACK_SUCCESS
376    ------------------------------------------------------------------------*/
377 typedef struct {
378 	char ucBaPeerMac[6];
379 	uint8_t ucBaTid;
380 	uint8_t ucBaBufferSize;
381 	uint16_t usBaSSN;
382 	uint8_t fInitiator;
383 } host_event_wlan_add_block_ack_success_payload_type;
384 
385 /*-------------------------------------------------------------------------
386    Event ID: EVENT_WLAN_ADD_BLOCK_ACK_FAILED
387    ------------------------------------------------------------------------*/
388 typedef struct {
389 	char ucBaPeerMac[6];
390 	uint8_t ucBaTid;
391 	uint8_t ucReasonCode;
392 	uint8_t fInitiator;
393 } host_event_wlan_add_block_ack_failed_payload_type;
394 
395 /*-------------------------------------------------------------------------
396    Event ID: EVENT_WLAN_DELETE_BLOCK_ACK_SUCCESS
397    ------------------------------------------------------------------------*/
398 typedef struct {
399 	char ucBaPeerMac[6];
400 	uint8_t ucBaTid;
401 	uint8_t ucDeleteReasonCode;
402 } host_event_wlan_add_block_ack_deleted_payload_type;
403 
404 /*-------------------------------------------------------------------------
405    Event ID: EVENT_WLAN_DELETE_BLOCK_ACK_FAILED
406    ------------------------------------------------------------------------*/
407 typedef struct {
408 	char ucBaPeerMac[6];
409 	uint8_t ucBaTid;
410 	uint8_t ucDeleteReasonCode;
411 	uint8_t ucFailReasonCode;
412 } host_event_wlan_add_block_ack_delete_failed_payload_type;
413 
414 /*-------------------------------------------------------------------------
415    Event ID: EVENT_WLAN_BSS_PROTECTION
416    ------------------------------------------------------------------------*/
417 typedef struct {
418 	uint8_t event_type;
419 	uint8_t prot_type;
420 } host_event_wlan_bss_prot_payload_type;
421 
422 /*-------------------------------------------------------------------------
423    Event ID: EVENT_WLAN_BRINGUP_STATUS
424    ------------------------------------------------------------------------*/
425 typedef struct {
426 	uint16_t wlanStatus;
427 	char driverVersion[10];
428 } host_event_wlan_bringup_status_payload_type;
429 
430 /*-------------------------------------------------------------------------
431    Event ID: EVENT_WLAN_POWERSAVE_WOW
432    ------------------------------------------------------------------------*/
433 typedef struct {
434 	uint8_t event_subtype;
435 	uint8_t wow_type;
436 	uint8_t wow_magic_pattern[6];
437 	uint8_t wow_del_ptrn_id;
438 	uint8_t wow_wakeup_cause;
439 	uint8_t wow_wakeup_cause_pbm_ptrn_id;
440 } host_event_wlan_powersave_wow_payload_type;
441 
442 /*-------------------------------------------------------------------------
443   Event ID: EVENT_WLAN_POWERSAVE_WOW_STATS
444   ------------------------------------------------------------------------*/
445 /**
446  * host_event_wlan_powersave_wow_stats - Structure holding wow stats information
447  * @wow_ucast_wake_up_count: wow unicast packet wakeup count
448  * @wow_bcast_wake_up_count: wow broadcast packet wakeup count
449  * @wow_ipv4_mcast_wake_up_count: wow ipv4 multicast packet wakeup count
450  * @wow_ipv6_mcast_wake_up_count: wow ipv6 multicast packet wakeup count
451  * @wow_ipv6_mcast_ra_stats: wow ipv6 multicast router advertisement
452  *                           packet wakeup count
453  * @wow_ipv6_mcast_ns_stats: wow ipv6 multicast Neighbor Solicitation
454  *                           packet wakeup count
455  * @wow_ipv6_mcast_na_stats: wow ipv6 multicast address space
456  *                           packet wakeup count
457  * @wow_pno_match_wake_up_count: wow preferred network offload match
458  *                           packet wakeup count
459  * @wow_pno_complete_wake_up_count: wow preferred network offload complete
460  *                                  packet wakeup count
461  * @wow_gscan_wake_up_count: wow external scan packet wakeup count
462  * @wow_low_rssi_wake_up_count: wow low rssi packet wakeup count
463  * @wow_rssi_breach_wake_up_count: wow rssi breach packet wakeup count
464  * @wow_icmpv4_count: wow icmpv4 packet count
465  * @wow_icmpv6_count: wow icmpv6 packet count
466  * @wow_oem_response_wake_up_count: wow  oem response packet wakeup count
467  *
468  * This structure contains the wow stats information related to diag event
469  */
470 struct host_event_wlan_powersave_wow_stats {
471 	uint32_t    wow_ucast_wake_up_count;
472 	uint32_t    wow_bcast_wake_up_count;
473 	uint32_t    wow_ipv4_mcast_wake_up_count;
474 	uint32_t    wow_ipv6_mcast_wake_up_count;
475 	uint32_t    wow_ipv6_mcast_ra_stats;
476 	uint32_t    wow_ipv6_mcast_ns_stats;
477 	uint32_t    wow_ipv6_mcast_na_stats;
478 	uint32_t    wow_pno_match_wake_up_count;
479 	uint32_t    wow_pno_complete_wake_up_count;
480 	uint32_t    wow_gscan_wake_up_count;
481 	uint32_t    wow_low_rssi_wake_up_count;
482 	uint32_t    wow_rssi_breach_wake_up_count;
483 	uint32_t    wow_icmpv4_count;
484 	uint32_t    wow_icmpv6_count;
485 	uint32_t    wow_oem_response_wake_up_count;
486 	uint32_t    Reserved_1;
487 	uint32_t    Reserved_2;
488 	uint32_t    Reserved_3;
489 	uint32_t    Reserved_4;
490 };
491 
492 /*-------------------------------------------------------------------------
493    Event ID: EVENT_WLAN_BTC
494    ------------------------------------------------------------------------*/
495 typedef struct {
496 	uint8_t eventId;
497 	uint8_t btAddr[6];
498 	uint16_t connHandle;
499 	uint8_t connStatus;
500 	uint8_t linkType;
501 	uint8_t scoInterval;
502 	uint8_t scoWindow;
503 	uint8_t retransWindow;
504 	uint8_t mode;
505 } host_event_wlan_btc_type;
506 
507 /*-------------------------------------------------------------------------
508   Event ID: EVENT_WLAN_EAPOL
509   ------------------------------------------------------------------------*/
510 /**
511  * struct host_event_wlan_eapol - Structure holding the eapol information
512  * @event_sub_type:	0-Transmitted, 1-Received
513  * @eapol_packet_type:	0 - EAP Start, 1 - EAPOL Start, 2 - EAPOL Logoff
514 			3 - EAPOL Key, 4 - EAPOL Encapsulated Alert
515  * @eapol_key_info:	This field from the driver is in big endian format.
516  *			So, the masks .0x8013. can be used to extract the
517  *			message type. After masking, the values corresponding
518  *			to messages 1/2/3/4 are given below:
519  *			Msg. 1	0x8000
520  *			Msg. 2	0x0001
521  *			Msg. 3	0x8013
522  *			Msg. 4	0x0003
523  * @eapol_rate:		Rate at which the frame is received
524  * @dest_addr:		Destination address
525  * @src_addr:		Source address
526  *
527  * This structure contains the EAPOL information related to logging
528  */
529 struct host_event_wlan_eapol {
530 	uint8_t   event_sub_type;
531 	uint8_t   eapol_packet_type;
532 	uint16_t  eapol_key_info;
533 	uint16_t  eapol_rate;
534 	uint8_t   dest_addr[6];
535 	uint8_t   src_addr[6];
536 };
537 
538 /*-------------------------------------------------------------------------
539   Event ID: EVENT_WLAN_LOW_RESOURCE_FAILURE
540   ------------------------------------------------------------------------*/
541 /**
542  * struct host_event_wlan_low_resource_failure - Structure holding the
543  * low resource failure information
544  * @event_sub_type: Gives further information about reason for
545  * low resource condition
546  *
547  * This structure will hold the low resource failure information
548  */
549 struct host_event_wlan_low_resource_failure {
550 	uint8_t event_sub_type;
551 };
552 
553 /**
554  * enum resource_failure_type - Reason for low resource failure condition
555  * @WIFI_EVENT_MEMORY_FAILURE: Memory failure
556  *
557  * This enum has the reason codes why the low resource situation is observed
558  */
559 enum resource_failure_type {
560 	WIFI_EVENT_MEMORY_FAILURE,
561 };
562 
563 /*-------------------------------------------------------------------------
564   Event ID: EVENT_WLAN_WAKE_LOCK
565   ------------------------------------------------------------------------*/
566 /**
567  * struct host_event_wlan_wake_lock - Structure holding the wakelock information
568  * @status: Whether the wakelock is taken/released
569  * @reason: Reason for taking this wakelock
570  * @timeout: Timeout value in case of timed wakelocks
571  * @name_len: Length of the name of the wakelock that will follow
572  * @name: Name of the wakelock
573  *
574  * This structure will hold the wakelock information
575  */
576 struct host_event_wlan_wake_lock {
577 	uint32_t status;
578 	uint32_t reason;
579 	uint32_t timeout;
580 	uint32_t name_len;
581 	char     name[WAKE_LOCK_NAME_LEN];
582 };
583 
584 /*-------------------------------------------------------------------------
585   Event ID: EVENT_WLAN_LOG_COMPLETE
586   ------------------------------------------------------------------------*/
587 /**
588  * struct host_event_wlan_log_complete - Holds log completion details
589  * @is_fatal: Indicates if the event is fatal or not
590  * @indicator: Source of the bug report - Framework/Host/Firmware
591  * @reason_code: Reason for triggering bug report
592  * @reserved: Reserved field
593  *
594  * This structure holds the log completion related information
595  */
596 struct host_event_wlan_log_complete {
597 	uint32_t is_fatal;
598 	uint32_t indicator;
599 	uint32_t reason_code;
600 	uint32_t reserved;
601 };
602 
603 /*-------------------------------------------------------------------------
604   Event ID: EVENT_WLAN_STA_KICKOUT
605   ------------------------------------------------------------------------*/
606 /**
607  * struct host_event_wlan_kickout - Holds diag event details
608  * @reasoncode: Indicates the reasoncode of event
609  * @peer_macaddr: Indicates the peer macaddr
610  * @vdev_id: Indicate unique id for identifying the VDEV
611  *
612  * This structure holds the diag event related information
613  */
614 
615 struct host_event_wlan_kickout {
616 	uint32_t reasoncode;
617 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
618 	uint8_t vdev_id;
619 };
620 
621 /*-------------------------------------------------------------------------
622   Event ID: EVENT_WLAN_SOFTAP_DATASTALL/EVENT_WLAN_STA_DATASTALL
623   ------------------------------------------------------------------------*/
624 /**
625  * struct host_event_wlan_softap_datastall - Holds diag event details
626  * @reason: Indicates the reason of event
627  *
628  *This structure holds the host diag event related information
629  */
630 
631 struct host_event_wlan_datastall {
632 	uint32_t reason;
633 };
634 
635 /*-------------------------------------------------------------------------
636   Event ID: EVENT_WLAN_SSR_REINIT_SUBSYSTEM
637   ------------------------------------------------------------------------*/
638 /**
639  * struct host_event_wlan_ssr_reinit - Holds diag event details
640  * @status: Indicates the status of event
641  *
642  *This structure holds the host diag event related information
643  */
644 
645 struct host_event_wlan_ssr_reinit {
646 	uint32_t status;
647 };
648 
649 /*-------------------------------------------------------------------------
650   Event ID: EVENT_WLAN_SSR_SHUTDOWN_SUBSYSTEM
651   ------------------------------------------------------------------------*/
652 /**
653  * struct host_event_wlan_ssr_shutdown - Holds diag event details
654  * @status: Indicates the status of event
655  *
656  *This structure holds the host diag event related information
657  */
658 
659 struct host_event_wlan_ssr_shutdown {
660 	uint32_t status;
661 };
662 
663 
664 /*-------------------------------------------------------------------------
665    Function declarations and documenation
666    ------------------------------------------------------------------------*/
667 /**
668  * enum host_sta_kickout_events - Enum containing sta kickout subtype
669  * @HOST_STA_KICKOUT_REASON_BMISS: Indicate sta got disconnected reason
670  * beacon miss
671  * @HOST_STA_KICKOUT_REASON_XRETRY: Indicate sta got disconnected reason xretry
672  * @HOST_STA_KICKOUT_REASON_UNSPECIFIED: Indicate sta disconnection
673  * reason unspecified
674  * @HOST_STA_KICKOUT_REASON_KEEP_ALIVE: Indicate sta is disconnected
675  * because of keep alive
676  * @HOST_STA_KICKOUT_REASON_BTM: BTM request from AP with disassoc imminent
677  * reason
678  *
679  * This enum contains the event subtype
680  */
681 enum host_sta_kickout_events {
682 	HOST_STA_KICKOUT_REASON_BMISS,
683 	HOST_STA_KICKOUT_REASON_XRETRY,
684 	HOST_STA_KICKOUT_REASON_UNSPECIFIED,
685 	HOST_STA_KICKOUT_REASON_KEEP_ALIVE,
686 	HOST_STA_KICKOUT_REASON_BTM,
687 };
688 
689 /*-------------------------------------------------------------------------
690    Function declarations and documenation
691    ------------------------------------------------------------------------*/
692 /**
693  * enum host_datastall_events - Enum containing datastall subtype
694  * @DATA_STALL_NONE: Indicate no data stall
695  * @FW_VDEV_PAUSE: Indicate FW vdev Pause
696  * @HWSCHED_CMD_FILTER:Indicate HW sched command filter
697  * @HWSCHED_CMD_FLUSH: Indicate HW sched command flush
698  * @FW_RX_REFILL_FAILED:Indicate FW rx refill failed
699  * @FW_RX_FCS_LEN_ERROR:Indicate FW fcs len error
700  * @FW_WDOG_ERRORS:Indicate watchdog error
701  * @FW_BB_WDOG_ERROR:Indicate BB watchdog error
702  * @STA_TX_TIMEOUT: Indicate sta tx timeout
703  * @SOFTAP_TX_TIMEOUT:Indicate softap tx timeout
704  * @NUD_FAILURE: Indicare NUD Failure
705  *
706  * This enum contains the event subtype
707  */
708 enum host_datastall_events {
709 	DATA_STALL_NONE,
710 	FW_VDEV_PAUSE,
711 	HWSCHED_CMD_FILTER,
712 	HWSCHED_CMD_FLUSH,
713 	FW_RX_REFILL_FAILED,
714 	FW_RX_FCS_LEN_ERROR,
715 	FW_WDOG_ERRORS,
716 	FW_BB_WDOG_ERROR,
717 	STA_TX_TIMEOUT,
718 	SOFTAP_TX_TIMEOUT,
719 	NUD_FAILURE,
720 };
721 
722 /*-------------------------------------------------------------------------
723   Function declarations and documenation
724   ------------------------------------------------------------------------*/
725 /**
726  * enum host_ssr_events - Enum containing ssr subtype
727  * @SSR_SUB_SYSTEM_REINIT: Indicate ssr reinit state
728  * @SSR_SUB_SYSTEM_SHUTDOWN: Indicate ssr shutdown state
729  *
730  * This enum contains the event subtype
731  */
732 enum host_ssr_events {
733 	SSR_SUB_SYSTEM_REINIT,
734 	SSR_SUB_SYSTEM_SHUTDOWN,
735 };
736 
737 /**
738  * struct host_event_tdls_teardown - tdls teardown diag event
739  * @reason: reason for tear down
740  * @peer_mac: peer mac
741  *
742  * This structure contains tdls teardown diag event info
743  */
744 struct host_event_tdls_teardown {
745 	uint32_t reason;
746 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
747 };
748 
749 /**
750  * struct host_event_tdls_enable_link - tdls enable link event
751  * @peer_mac: peer mac
752  * @is_off_chan_supported: if off channel supported
753  * @is_off_chan_configured: if off channel configured
754  * @is_off_chan_established: if off channel established
755  *
756  * This structure contain tdls enable link diag event info
757  */
758 struct host_event_tdls_enable_link {
759 	uint8_t   peer_mac[QDF_MAC_ADDR_SIZE];
760 	uint8_t   is_off_chan_supported;
761 	uint8_t   is_off_chan_configured;
762 	uint8_t   is_off_chan_established;
763 };
764 
765 /**
766  * struct host_event_suspend - suspend/resume state
767  * @state: suspend/resume state
768  *
769  * This structure contains suspend resume diag event info
770  */
771 struct host_event_suspend {
772 	uint8_t state;
773 };
774 
775 /**
776  * struct host_event_offload_req - offload state
777  * @offload_type: offload type
778  * @state: enabled or disabled state
779  *
780  * This structure contains offload diag event info
781  */
782 struct host_event_offload_req {
783 	uint8_t offload_type;
784 	uint8_t state;
785 };
786 
787 /**
788  * struct host_event_tdls_scan_rejected - scan
789  * rejected due to tdls
790  * @status: rejected status
791  *
792  * This structure contains scan rejected due to
793  * tdls event info
794  */
795 struct host_event_tdls_scan_rejected {
796 	uint8_t status;
797 };
798 
799 /**
800  * struct host_event_tdls_tx_rx_mgmt - for TX RX management frame
801  * @event_id: event ID
802  * @tx_rx: tx or rx
803  * @type: type of frame
804  * @action_sub_type: action frame type
805  * @peer_mac: peer mac
806  *
807  * This structure contains tdls TX RX management frame info
808  */
809 struct host_event_tdls_tx_rx_mgmt {
810 	uint8_t event_id;
811 	uint8_t tx_rx;
812 	uint8_t type;
813 	uint8_t action_sub_type;
814 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
815 };
816 
817 /*-------------------------------------------------------------------------
818    Function declarations and documenation
819    ------------------------------------------------------------------------*/
820 /**
821  * enum wifi_connectivity_events - Enum containing EAPOL sub type
822  * @WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED:	EAPOL transmitted
823  * @WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED:		EAPOL received
824  *
825  * This enum contains the EAPOL subtype
826  */
827 enum wifi_connectivity_events {
828 	WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED,
829 	WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED,
830 };
831 
832 /**
833  * enum wake_lock_reason - Reason for taking/releasing wakelock
834  * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT: Driver initialization
835  * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT: Driver re-initialization
836  * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT: Driver shutdown
837  * @WIFI_POWER_EVENT_WAKELOCK_SCAN: Scan request/response handling
838  * @WIFI_POWER_EVENT_WAKELOCK_EXT_SCAN: Extended scan request/response handling
839  * @WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN: Driver resume
840  * @WIFI_POWER_EVENT_WAKELOCK_ROC: Remain on channel request/response handling
841  * @WIFI_POWER_EVENT_WAKELOCK_AUTO_SUSPEND: Auto suspend related handling
842  * @WIFI_POWER_EVENT_WAKELOCK_IPA: IPA related handling
843  * @WIFI_POWER_EVENT_WAKELOCK_ADD_STA: Addition of STA
844  * @WIFI_POWER_EVENT_WAKELOCK_HOLD_RX: Wakelocks taken for receive
845  * @WIFI_POWER_EVENT_WAKELOCK_SAP: SoftAP related wakelocks
846  * @WIFI_POWER_EVENT_WAKELOCK_WOW: WoW feature related
847  * @WIFI_POWER_EVENT_WAKELOCK_PNO: PNO feature related
848  * @WIFI_POWER_EVENT_WAKELOCK_DEL_STA: Deletion of a station
849  * @WIFI_POWER_EVENT_WAKELOCK_DFS: DFS related wakelocks
850  * @WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP: Firmware response
851  * @WIFI_POWER_EVENT_WAKELOCK_MISC: Miscellaneous wakelocks
852  * @WIFI_POWER_EVENT_WAKELOCK_DHCP: DHCP negotiation under way
853  * @WIFI_POWER_EVENT_WAKELOCK_CONNECT: connection in progress
854  * @WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER: iface change timer running
855  * @WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE: Montitor mode wakelock
856  *
857  * Indicates the reason for which the wakelock was taken/released
858  */
859 enum wake_lock_reason {
860 	WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT,
861 	WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT,
862 	WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT,
863 	WIFI_POWER_EVENT_WAKELOCK_SCAN,
864 	WIFI_POWER_EVENT_WAKELOCK_EXT_SCAN,
865 	WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN,
866 	WIFI_POWER_EVENT_WAKELOCK_ROC,
867 	WIFI_POWER_EVENT_WAKELOCK_AUTO_SUSPEND,
868 	WIFI_POWER_EVENT_WAKELOCK_IPA,
869 	WIFI_POWER_EVENT_WAKELOCK_ADD_STA,
870 	WIFI_POWER_EVENT_WAKELOCK_HOLD_RX,
871 	WIFI_POWER_EVENT_WAKELOCK_SAP,
872 	WIFI_POWER_EVENT_WAKELOCK_WOW,
873 	WIFI_POWER_EVENT_WAKELOCK_PNO,
874 	WIFI_POWER_EVENT_WAKELOCK_DEL_STA,
875 	WIFI_POWER_EVENT_WAKELOCK_DFS,
876 	WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP,
877 	WIFI_POWER_EVENT_WAKELOCK_MISC,
878 	WIFI_POWER_EVENT_WAKELOCK_DHCP,
879 	WIFI_POWER_EVENT_WAKELOCK_CONNECT,
880 	WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER,
881 	WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE,
882 };
883 
884 /* The length of interface name should >= IFNAMSIZ */
885 #define HOST_EVENT_INTF_STR_LEN 16
886 #define HOST_EVENT_HW_MODE_STR_LEN 12
887 
888 /**
889  * struct host_event_wlan_acs_req - payload for ACS diag event
890  * @intf: network interface name for WLAN
891  * @hw_mode: hw mode configured by hostapd
892  * @bw: channel bandwidth(MHz)
893  * @ht: a flag indicating whether HT phy mode is enabled
894  * @vht: a flag indicating whether VHT phy mode is enabled
895  * @chan_start: starting channel number for ACS scan
896  * @chan_end: ending channel number for ACS scan
897  *
898  * This structure includes all the payload related to ACS request parameters
899  */
900 struct host_event_wlan_acs_req {
901 	uint8_t intf[HOST_EVENT_INTF_STR_LEN];
902 	uint8_t hw_mode[HOST_EVENT_HW_MODE_STR_LEN];
903 	uint16_t bw;
904 	uint8_t ht;
905 	uint8_t vht;
906 	uint16_t chan_start;
907 	uint16_t chan_end;
908 };
909 
910 /**
911  * struct host_event_wlan_acs_scan_start - payload for ACS scan request
912  * @scan_id: scan request ID
913  * @vdev_id: vdev/session ID
914  *
915  * This structure includes all the payload related to ACS scan request
916  * parameters
917  */
918 struct host_event_wlan_acs_scan_start {
919 	uint32_t scan_id;
920 	uint8_t vdev_id;
921 };
922 
923 #define HOST_EVENT_STATUS_STR_LEN 24
924 
925 /**
926  * struct host_event_wlan_acs_scan_done - payload for ACS scan done event
927  * @status: indicating whether ACS scan is successful
928  * @vdev_id: vdev/session ID
929  * @scan_id: scan request ID
930  *
931  * This structure includes all the payload related to ACS scan done event
932  */
933 struct host_event_wlan_acs_scan_done {
934 	uint8_t status[HOST_EVENT_STATUS_STR_LEN];
935 	uint32_t scan_id;
936 	uint8_t vdev_id;
937 };
938 
939 /**
940  * struct host_event_wlan_acs_chan_spectral_weight - payload for spectral
941  * weight event indication
942  * @chan: channel number
943  * @weight: channel weight
944  * @rssi: RSSI value obtained after scanning
945  * @bss_count: number of BSS detected on this channel
946  *
947  * This structure includes all the payload related to a channel's weight
948  * evaluation result
949  */
950 struct host_event_wlan_acs_chan_spectral_weight {
951 	uint16_t chan;
952 	uint16_t weight;
953 	int32_t rssi;
954 	uint16_t bss_count;
955 };
956 
957 /**
958  * struct host_event_wlan_acs_best_chan - payload for ACS best channel event
959  * @chan: channel number
960  * @weight: channel weight
961  *
962  * This structure includes all the payload related to the best channel
963  * selected after ACS procedure
964  */
965 struct host_event_wlan_acs_best_chan {
966 	uint16_t chan;
967 	uint16_t weight;
968 };
969 
970 #ifdef __cplusplus
971 }
972 #endif /* __cplusplus */
973 #endif /* __HOST_DIAG_CORE_EVENT_H */
974