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