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