1 /* 2 * Copyright (c) 2014-2018 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_WAKE_LOCK 587 ------------------------------------------------------------------------*/ 588 /** 589 * struct host_event_wlan_wake_lock - Structure holding the wakelock information 590 * @status: Whether the wakelock is taken/released 591 * @reason: Reason for taking this wakelock 592 * @timeout: Timeout value in case of timed wakelocks 593 * @name_len: Length of the name of the wakelock that will follow 594 * @name: Name of the wakelock 595 * 596 * This structure will hold the wakelock information 597 */ 598 struct host_event_wlan_wake_lock { 599 uint32_t status; 600 uint32_t reason; 601 uint32_t timeout; 602 uint32_t name_len; 603 char name[WAKE_LOCK_NAME_LEN]; 604 }; 605 606 /*------------------------------------------------------------------------- 607 Event ID: EVENT_WLAN_LOG_COMPLETE 608 ------------------------------------------------------------------------*/ 609 /** 610 * struct host_event_wlan_log_complete - Holds log completion details 611 * @is_fatal: Indicates if the event is fatal or not 612 * @indicator: Source of the bug report - Framework/Host/Firmware 613 * @reason_code: Reason for triggering bug report 614 * @reserved: Reserved field 615 * 616 * This structure holds the log completion related information 617 */ 618 struct host_event_wlan_log_complete { 619 uint32_t is_fatal; 620 uint32_t indicator; 621 uint32_t reason_code; 622 uint32_t reserved; 623 }; 624 625 /*------------------------------------------------------------------------- 626 Event ID: EVENT_WLAN_STA_KICKOUT 627 ------------------------------------------------------------------------*/ 628 /** 629 * struct host_event_wlan_kickout - Holds diag event details 630 * @reasoncode: Indicates the reasoncode of event 631 * @peer_macaddr: Indicates the peer macaddr 632 * @vdev_id: Indicate unique id for identifying the VDEV 633 * 634 * This structure holds the diag event related information 635 */ 636 637 struct host_event_wlan_kickout { 638 uint32_t reasoncode; 639 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 640 uint8_t vdev_id; 641 }; 642 643 /*------------------------------------------------------------------------- 644 Event ID: EVENT_WLAN_SOFTAP_DATASTALL/EVENT_WLAN_STA_DATASTALL 645 ------------------------------------------------------------------------*/ 646 /** 647 * struct host_event_wlan_softap_datastall - Holds diag event details 648 * @reason: Indicates the reason of event 649 * 650 *This structure holds the host diag event related information 651 */ 652 653 struct host_event_wlan_datastall { 654 uint32_t reason; 655 }; 656 657 /*------------------------------------------------------------------------- 658 Event ID: EVENT_WLAN_SSR_REINIT_SUBSYSTEM 659 ------------------------------------------------------------------------*/ 660 /** 661 * struct host_event_wlan_ssr_reinit - Holds diag event details 662 * @status: Indicates the status of event 663 * 664 *This structure holds the host diag event related information 665 */ 666 667 struct host_event_wlan_ssr_reinit { 668 uint32_t status; 669 }; 670 671 /*------------------------------------------------------------------------- 672 Event ID: EVENT_WLAN_SSR_SHUTDOWN_SUBSYSTEM 673 ------------------------------------------------------------------------*/ 674 /** 675 * struct host_event_wlan_ssr_shutdown - Holds diag event details 676 * @status: Indicates the status of event 677 * 678 *This structure holds the host diag event related information 679 */ 680 681 struct host_event_wlan_ssr_shutdown { 682 uint32_t status; 683 }; 684 685 686 /*------------------------------------------------------------------------- 687 Function declarations and documenation 688 ------------------------------------------------------------------------*/ 689 /** 690 * enum host_sta_kickout_events - Enum containing sta kickout subtype 691 * @HOST_STA_KICKOUT_REASON_BMISS: Indicate sta got disconnected reason 692 * beacon miss 693 * @HOST_STA_KICKOUT_REASON_XRETRY: Indicate sta got disconnected reason xretry 694 * @HOST_STA_KICKOUT_REASON_UNSPECIFIED: Indicate sta disconnection 695 * reason unspecified 696 * @HOST_STA_KICKOUT_REASON_KEEP_ALIVE: Indicate sta is disconnected 697 * because of keep alive 698 * @HOST_STA_KICKOUT_REASON_BTM: BTM request from AP with disassoc imminent 699 * reason 700 * 701 * This enum contains the event subtype 702 */ 703 enum host_sta_kickout_events { 704 HOST_STA_KICKOUT_REASON_BMISS, 705 HOST_STA_KICKOUT_REASON_XRETRY, 706 HOST_STA_KICKOUT_REASON_UNSPECIFIED, 707 HOST_STA_KICKOUT_REASON_KEEP_ALIVE, 708 HOST_STA_KICKOUT_REASON_BTM, 709 }; 710 711 /*------------------------------------------------------------------------- 712 Function declarations and documenation 713 ------------------------------------------------------------------------*/ 714 /** 715 * enum host_datastall_events - Enum containing datastall subtype 716 * @DATA_STALL_NONE: Indicate no data stall 717 * @FW_VDEV_PAUSE: Indicate FW vdev Pause 718 * @HWSCHED_CMD_FILTER:Indicate HW sched command filter 719 * @HWSCHED_CMD_FLUSH: Indicate HW sched command flush 720 * @FW_RX_REFILL_FAILED:Indicate FW rx refill failed 721 * @FW_RX_FCS_LEN_ERROR:Indicate FW fcs len error 722 * @FW_WDOG_ERRORS:Indicate watchdog error 723 * @FW_BB_WDOG_ERROR:Indicate BB watchdog error 724 * @STA_TX_TIMEOUT: Indicate sta tx timeout 725 * @SOFTAP_TX_TIMEOUT:Indicate softap tx timeout 726 * @NUD_FAILURE: Indicare NUD Failure 727 * 728 * This enum contains the event subtype 729 */ 730 enum host_datastall_events { 731 DATA_STALL_NONE, 732 FW_VDEV_PAUSE, 733 HWSCHED_CMD_FILTER, 734 HWSCHED_CMD_FLUSH, 735 FW_RX_REFILL_FAILED, 736 FW_RX_FCS_LEN_ERROR, 737 FW_WDOG_ERRORS, 738 FW_BB_WDOG_ERROR, 739 STA_TX_TIMEOUT, 740 SOFTAP_TX_TIMEOUT, 741 NUD_FAILURE, 742 }; 743 744 /*------------------------------------------------------------------------- 745 Function declarations and documenation 746 ------------------------------------------------------------------------*/ 747 /** 748 * enum host_ssr_events - Enum containing ssr subtype 749 * @SSR_SUB_SYSTEM_REINIT: Indicate ssr reinit state 750 * @SSR_SUB_SYSTEM_SHUTDOWN: Indicate ssr shutdown state 751 * 752 * This enum contains the event subtype 753 */ 754 enum host_ssr_events { 755 SSR_SUB_SYSTEM_REINIT, 756 SSR_SUB_SYSTEM_SHUTDOWN, 757 }; 758 759 /** 760 * struct host_event_tdls_teardown - tdls teardown diag event 761 * @reason: reason for tear down 762 * @peer_mac: peer mac 763 * 764 * This structure contains tdls teardown diag event info 765 */ 766 struct host_event_tdls_teardown { 767 uint32_t reason; 768 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 769 }; 770 771 /** 772 * struct host_event_tdls_enable_link - tdls enable link event 773 * @peer_mac: peer mac 774 * @is_off_chan_supported: if off channel supported 775 * @is_off_chan_configured: if off channel configured 776 * @is_off_chan_established: if off channel established 777 * 778 * This structure contain tdls enable link diag event info 779 */ 780 struct host_event_tdls_enable_link { 781 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 782 uint8_t is_off_chan_supported; 783 uint8_t is_off_chan_configured; 784 uint8_t is_off_chan_established; 785 }; 786 787 /** 788 * struct host_event_suspend - suspend/resume state 789 * @state: suspend/resume state 790 * 791 * This structure contains suspend resume diag event info 792 */ 793 struct host_event_suspend { 794 uint8_t state; 795 }; 796 797 /** 798 * struct host_event_offload_req - offload state 799 * @offload_type: offload type 800 * @state: enabled or disabled state 801 * 802 * This structure contains offload diag event info 803 */ 804 struct host_event_offload_req { 805 uint8_t offload_type; 806 uint8_t state; 807 }; 808 809 /** 810 * struct host_event_tdls_scan_rejected - scan 811 * rejected due to tdls 812 * @status: rejected status 813 * 814 * This structure contains scan rejected due to 815 * tdls event info 816 */ 817 struct host_event_tdls_scan_rejected { 818 uint8_t status; 819 }; 820 821 /** 822 * struct host_event_tdls_tx_rx_mgmt - for TX RX management frame 823 * @event_id: event ID 824 * @tx_rx: tx or rx 825 * @type: type of frame 826 * @action_sub_type: action frame type 827 * @peer_mac: peer mac 828 * 829 * This structure contains tdls TX RX management frame info 830 */ 831 struct host_event_tdls_tx_rx_mgmt { 832 uint8_t event_id; 833 uint8_t tx_rx; 834 uint8_t type; 835 uint8_t action_sub_type; 836 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 837 }; 838 839 /*------------------------------------------------------------------------- 840 Function declarations and documenation 841 ------------------------------------------------------------------------*/ 842 /** 843 * enum wifi_connectivity_events - Enum containing EAPOL sub type 844 * @WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED: EAPOL transmitted 845 * @WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED: EAPOL received 846 * 847 * This enum contains the EAPOL subtype 848 */ 849 enum wifi_connectivity_events { 850 WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED, 851 WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED, 852 }; 853 854 /** 855 * enum wake_lock_reason - Reason for taking/releasing wakelock 856 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT: Driver initialization 857 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT: Driver re-initialization 858 * @WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT: Driver shutdown 859 * @WIFI_POWER_EVENT_WAKELOCK_SCAN: Scan request/response handling 860 * @WIFI_POWER_EVENT_WAKELOCK_EXT_SCAN: Extended scan request/response handling 861 * @WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN: Driver resume 862 * @WIFI_POWER_EVENT_WAKELOCK_ROC: Remain on channel request/response handling 863 * @WIFI_POWER_EVENT_WAKELOCK_AUTO_SUSPEND: Auto suspend related handling 864 * @WIFI_POWER_EVENT_WAKELOCK_IPA: IPA related handling 865 * @WIFI_POWER_EVENT_WAKELOCK_ADD_STA: Addition of STA 866 * @WIFI_POWER_EVENT_WAKELOCK_HOLD_RX: Wakelocks taken for receive 867 * @WIFI_POWER_EVENT_WAKELOCK_SAP: SoftAP related wakelocks 868 * @WIFI_POWER_EVENT_WAKELOCK_WOW: WoW feature related 869 * @WIFI_POWER_EVENT_WAKELOCK_PNO: PNO feature related 870 * @WIFI_POWER_EVENT_WAKELOCK_DEL_STA: Deletion of a station 871 * @WIFI_POWER_EVENT_WAKELOCK_DFS: DFS related wakelocks 872 * @WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP: Firmware response 873 * @WIFI_POWER_EVENT_WAKELOCK_MISC: Miscellaneous wakelocks 874 * @WIFI_POWER_EVENT_WAKELOCK_DHCP: DHCP negotiation under way 875 * @WIFI_POWER_EVENT_WAKELOCK_CONNECT: connection in progress 876 * @WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER: iface change timer running 877 * @WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE: Montitor mode wakelock 878 * 879 * Indicates the reason for which the wakelock was taken/released 880 */ 881 enum wake_lock_reason { 882 WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT, 883 WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT, 884 WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT, 885 WIFI_POWER_EVENT_WAKELOCK_SCAN, 886 WIFI_POWER_EVENT_WAKELOCK_EXT_SCAN, 887 WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN, 888 WIFI_POWER_EVENT_WAKELOCK_ROC, 889 WIFI_POWER_EVENT_WAKELOCK_AUTO_SUSPEND, 890 WIFI_POWER_EVENT_WAKELOCK_IPA, 891 WIFI_POWER_EVENT_WAKELOCK_ADD_STA, 892 WIFI_POWER_EVENT_WAKELOCK_HOLD_RX, 893 WIFI_POWER_EVENT_WAKELOCK_SAP, 894 WIFI_POWER_EVENT_WAKELOCK_WOW, 895 WIFI_POWER_EVENT_WAKELOCK_PNO, 896 WIFI_POWER_EVENT_WAKELOCK_DEL_STA, 897 WIFI_POWER_EVENT_WAKELOCK_DFS, 898 WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP, 899 WIFI_POWER_EVENT_WAKELOCK_MISC, 900 WIFI_POWER_EVENT_WAKELOCK_DHCP, 901 WIFI_POWER_EVENT_WAKELOCK_CONNECT, 902 WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER, 903 WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE, 904 }; 905 906 /* The length of interface name should >= IFNAMSIZ */ 907 #define HOST_EVENT_INTF_STR_LEN 16 908 #define HOST_EVENT_HW_MODE_STR_LEN 12 909 910 /** 911 * struct host_event_wlan_acs_req - payload for ACS diag event 912 * @intf: network interface name for WLAN 913 * @hw_mode: hw mode configured by hostapd 914 * @bw: channel bandwidth(MHz) 915 * @ht: a flag indicating whether HT phy mode is enabled 916 * @vht: a flag indicating whether VHT phy mode is enabled 917 * @chan_start: starting channel number for ACS scan 918 * @chan_end: ending channel number for ACS scan 919 * 920 * This structure includes all the payload related to ACS request parameters 921 */ 922 struct host_event_wlan_acs_req { 923 uint8_t intf[HOST_EVENT_INTF_STR_LEN]; 924 uint8_t hw_mode[HOST_EVENT_HW_MODE_STR_LEN]; 925 uint16_t bw; 926 uint8_t ht; 927 uint8_t vht; 928 uint16_t chan_start; 929 uint16_t chan_end; 930 }; 931 932 /** 933 * struct host_event_wlan_acs_scan_start - payload for ACS scan request 934 * @scan_id: scan request ID 935 * @vdev_id: vdev/session ID 936 * 937 * This structure includes all the payload related to ACS scan request 938 * parameters 939 */ 940 struct host_event_wlan_acs_scan_start { 941 uint32_t scan_id; 942 uint8_t vdev_id; 943 }; 944 945 #define HOST_EVENT_STATUS_STR_LEN 24 946 947 /** 948 * struct host_event_wlan_acs_scan_done - payload for ACS scan done event 949 * @status: indicating whether ACS scan is successful 950 * @vdev_id: vdev/session ID 951 * @scan_id: scan request ID 952 * 953 * This structure includes all the payload related to ACS scan done event 954 */ 955 struct host_event_wlan_acs_scan_done { 956 uint8_t status[HOST_EVENT_STATUS_STR_LEN]; 957 uint32_t scan_id; 958 uint8_t vdev_id; 959 }; 960 961 /** 962 * struct host_event_wlan_acs_chan_spectral_weight - payload for spectral 963 * weight event indication 964 * @chan: channel number 965 * @weight: channel weight 966 * @rssi: RSSI value obtained after scanning 967 * @bss_count: number of BSS detected on this channel 968 * 969 * This structure includes all the payload related to a channel's weight 970 * evaluation result 971 */ 972 struct host_event_wlan_acs_chan_spectral_weight { 973 uint16_t chan; 974 uint16_t weight; 975 int32_t rssi; 976 uint16_t bss_count; 977 }; 978 979 /** 980 * struct host_event_wlan_acs_best_chan - payload for ACS best channel event 981 * @chan: channel number 982 * @weight: channel weight 983 * 984 * This structure includes all the payload related to the best channel 985 * selected after ACS procedure 986 */ 987 struct host_event_wlan_acs_best_chan { 988 uint16_t chan; 989 uint16_t weight; 990 }; 991 992 #ifdef __cplusplus 993 } 994 #endif /* __cplusplus */ 995 #endif /* __HOST_DIAG_CORE_EVENT_H */ 996