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