Path: blob/main/sys/contrib/dev/athk/ath11k/coredump.c
96339 views
// SPDX-License-Identifier: BSD-3-Clause-Clear1/*2* Copyright (c) 2020 The Linux Foundation. All rights reserved.3* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.4* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.5*/6#include <linux/devcoredump.h>7#include <linux/export.h>8#include "hif.h"9#include "coredump.h"10#include "debug.h"1112enum13ath11k_fw_crash_dump_type ath11k_coredump_get_dump_type(int type)14{15enum ath11k_fw_crash_dump_type dump_type;1617switch (type) {18case HOST_DDR_REGION_TYPE:19dump_type = FW_CRASH_DUMP_REMOTE_MEM_DATA;20break;21case M3_DUMP_REGION_TYPE:22dump_type = FW_CRASH_DUMP_M3_DUMP;23break;24case PAGEABLE_MEM_REGION_TYPE:25dump_type = FW_CRASH_DUMP_PAGEABLE_DATA;26break;27case BDF_MEM_REGION_TYPE:28case CALDB_MEM_REGION_TYPE:29dump_type = FW_CRASH_DUMP_NONE;30break;31default:32dump_type = FW_CRASH_DUMP_TYPE_MAX;33break;34}3536return dump_type;37}38EXPORT_SYMBOL(ath11k_coredump_get_dump_type);3940void ath11k_coredump_upload(struct work_struct *work)41{42struct ath11k_base *ab = container_of(work, struct ath11k_base, dump_work);4344ath11k_info(ab, "Uploading coredump\n");45/* dev_coredumpv() takes ownership of the buffer */46dev_coredumpv(ab->dev, ab->dump_data, ab->ath11k_coredump_len, GFP_KERNEL);47ab->dump_data = NULL;48}4950void ath11k_coredump_collect(struct ath11k_base *ab)51{52ath11k_hif_coredump_download(ab);53}545556