1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
6 #include <linux/devcoredump.h>
12 ath12k_fw_crash_dump_type
ath12k_coredump_get_dump_type(enum ath12k_qmi_target_mem type
)
14 enum ath12k_fw_crash_dump_type dump_type
;
17 case HOST_DDR_REGION_TYPE
:
18 dump_type
= FW_CRASH_DUMP_REMOTE_MEM_DATA
;
20 case M3_DUMP_REGION_TYPE
:
21 dump_type
= FW_CRASH_DUMP_M3_DUMP
;
23 case PAGEABLE_MEM_REGION_TYPE
:
24 dump_type
= FW_CRASH_DUMP_PAGEABLE_DATA
;
26 case BDF_MEM_REGION_TYPE
:
27 case CALDB_MEM_REGION_TYPE
:
28 dump_type
= FW_CRASH_DUMP_NONE
;
31 dump_type
= FW_CRASH_DUMP_TYPE_MAX
;
38 void ath12k_coredump_upload(struct work_struct
*work
)
40 struct ath12k_base
*ab
= container_of(work
, struct ath12k_base
, dump_work
);
42 ath12k_info(ab
, "Uploading coredump\n");
43 /* dev_coredumpv() takes ownership of the buffer */
44 dev_coredumpv(ab
->dev
, ab
->dump_data
, ab
->ath12k_coredump_len
, GFP_KERNEL
);
48 void ath12k_coredump_collect(struct ath12k_base
*ab
)
50 ath12k_hif_coredump_download(ab
);