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