Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/contrib/dev/athk/ath11k/coredump.c
96339 views
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
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
6
*/
7
#include <linux/devcoredump.h>
8
#include <linux/export.h>
9
#include "hif.h"
10
#include "coredump.h"
11
#include "debug.h"
12
13
enum
14
ath11k_fw_crash_dump_type ath11k_coredump_get_dump_type(int type)
15
{
16
enum ath11k_fw_crash_dump_type dump_type;
17
18
switch (type) {
19
case HOST_DDR_REGION_TYPE:
20
dump_type = FW_CRASH_DUMP_REMOTE_MEM_DATA;
21
break;
22
case M3_DUMP_REGION_TYPE:
23
dump_type = FW_CRASH_DUMP_M3_DUMP;
24
break;
25
case PAGEABLE_MEM_REGION_TYPE:
26
dump_type = FW_CRASH_DUMP_PAGEABLE_DATA;
27
break;
28
case BDF_MEM_REGION_TYPE:
29
case CALDB_MEM_REGION_TYPE:
30
dump_type = FW_CRASH_DUMP_NONE;
31
break;
32
default:
33
dump_type = FW_CRASH_DUMP_TYPE_MAX;
34
break;
35
}
36
37
return dump_type;
38
}
39
EXPORT_SYMBOL(ath11k_coredump_get_dump_type);
40
41
void ath11k_coredump_upload(struct work_struct *work)
42
{
43
struct ath11k_base *ab = container_of(work, struct ath11k_base, dump_work);
44
45
ath11k_info(ab, "Uploading coredump\n");
46
/* dev_coredumpv() takes ownership of the buffer */
47
dev_coredumpv(ab->dev, ab->dump_data, ab->ath11k_coredump_len, GFP_KERNEL);
48
ab->dump_data = NULL;
49
}
50
51
void ath11k_coredump_collect(struct ath11k_base *ab)
52
{
53
ath11k_hif_coredump_download(ab);
54
}
55
56