Loading...
Note: File does not exist in v6.8.
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#include <linux/devcoredump.h>
7#include "hif.h"
8#include "coredump.h"
9#include "debug.h"
10
11enum
12ath12k_fw_crash_dump_type ath12k_coredump_get_dump_type(enum ath12k_qmi_target_mem type)
13{
14 enum ath12k_fw_crash_dump_type dump_type;
15
16 switch (type) {
17 case HOST_DDR_REGION_TYPE:
18 dump_type = FW_CRASH_DUMP_REMOTE_MEM_DATA;
19 break;
20 case M3_DUMP_REGION_TYPE:
21 dump_type = FW_CRASH_DUMP_M3_DUMP;
22 break;
23 case PAGEABLE_MEM_REGION_TYPE:
24 dump_type = FW_CRASH_DUMP_PAGEABLE_DATA;
25 break;
26 case BDF_MEM_REGION_TYPE:
27 case CALDB_MEM_REGION_TYPE:
28 dump_type = FW_CRASH_DUMP_NONE;
29 break;
30 default:
31 dump_type = FW_CRASH_DUMP_TYPE_MAX;
32 break;
33 }
34
35 return dump_type;
36}
37
38void ath12k_coredump_upload(struct work_struct *work)
39{
40 struct ath12k_base *ab = container_of(work, struct ath12k_base, dump_work);
41
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);
45 ab->dump_data = NULL;
46}
47
48void ath12k_coredump_collect(struct ath12k_base *ab)
49{
50 ath12k_hif_coredump_download(ab);
51}