1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */ 2 /* 3 * Copyright (c) 2020 The Linux Foundation. All rights reserved. 4 * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. 5 */ 6 #ifndef _ATH12K_COREDUMP_H_ 7 #define _ATH12K_COREDUMP_H_ 8 9 #define ATH12K_FW_CRASH_DUMP_V2 2 10 11 enum ath12k_fw_crash_dump_type { 12 FW_CRASH_DUMP_PAGING_DATA, 13 FW_CRASH_DUMP_RDDM_DATA, 14 FW_CRASH_DUMP_REMOTE_MEM_DATA, 15 FW_CRASH_DUMP_PAGEABLE_DATA, 16 FW_CRASH_DUMP_M3_DUMP, 17 FW_CRASH_DUMP_NONE, 18 19 /* keep last */ 20 FW_CRASH_DUMP_TYPE_MAX, 21 }; 22 23 #define COREDUMP_TLV_HDR_SIZE 8 24 25 struct ath12k_tlv_dump_data { 26 /* see ath11k_fw_crash_dump_type above */ 27 __le32 type; 28 29 /* in bytes */ 30 __le32 tlv_len; 31 32 /* pad to 32-bit boundaries as needed */ 33 u8 tlv_data[]; 34 } __packed; 35 36 struct ath12k_dump_file_data { 37 /* "ATH12K-FW-DUMP" */ 38 char df_magic[16]; 39 /* total dump len in bytes */ 40 __le32 len; 41 /* file dump version */ 42 __le32 version; 43 /* pci device id */ 44 __le32 chip_id; 45 /* qrtr instance id */ 46 __le32 qrtr_id; 47 /* pci domain id */ 48 __le32 bus_id; 49 guid_t guid; 50 /* time-of-day stamp */ 51 __le64 tv_sec; 52 /* time-of-day stamp, nano-seconds */ 53 __le64 tv_nsec; 54 /* room for growth w/out changing binary format */ 55 u8 unused[128]; 56 u8 data[]; 57 } __packed; 58 59 #ifdef CONFIG_ATH12K_COREDUMP 60 enum ath12k_fw_crash_dump_type ath12k_coredump_get_dump_type 61 (enum ath12k_qmi_target_mem type); 62 void ath12k_coredump_upload(struct work_struct *work); 63 void ath12k_coredump_collect(struct ath12k_base *ab); 64 #else 65 static inline enum ath12k_fw_crash_dump_type ath12k_coredump_get_dump_type 66 (enum ath12k_qmi_target_mem type) 67 { 68 return FW_CRASH_DUMP_TYPE_MAX; 69 } 70 71 static inline void ath12k_coredump_upload(struct work_struct *work) 72 { 73 } 74 75 static inline void ath12k_coredump_collect(struct ath12k_base *ab) 76 { 77 } 78 #endif 79 80 #endif 81