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