drivers/net/wireless/ath/ath10k/coredump.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/coredump.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/coredump.c- Extension
.c- Size
- 35593 bytes
- Lines
- 1666
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
coredump.hlinux/devcoredump.hlinux/export.hlinux/kernel.hlinux/types.hlinux/utsname.hdebug.hhw.h
Detected Declarations
function ath10k_coredump_get_ramdump_sizefunction ath10k_coredump_submitfunction ath10k_coredump_createfunction ath10k_coredump_registerfunction ath10k_coredump_unregisterfunction ath10k_coredump_destroyexport ath10k_coredump_get_mem_layoutexport ath10k_coredump_new
Annotated Snippet
if (crash_data->ramdump_buf_len) {
memcpy(dump_tlv->tlv_data, crash_data->ramdump_buf,
crash_data->ramdump_buf_len);
sofar += sizeof(*dump_tlv) + crash_data->ramdump_buf_len;
}
}
mutex_unlock(&ar->dump_mutex);
return dump_data;
}
int ath10k_coredump_submit(struct ath10k *ar)
{
struct ath10k_dump_file_data *dump;
if (ath10k_coredump_mask == 0)
/* coredump disabled */
return 0;
dump = ath10k_coredump_build(ar);
if (!dump) {
ath10k_warn(ar, "no crash dump data found for devcoredump");
return -ENODATA;
}
dev_coredumpv(ar->dev, dump, le32_to_cpu(dump->len), GFP_KERNEL);
return 0;
}
int ath10k_coredump_create(struct ath10k *ar)
{
if (ath10k_coredump_mask == 0)
/* coredump disabled */
return 0;
ar->coredump.fw_crash_data = vzalloc(sizeof(*ar->coredump.fw_crash_data));
if (!ar->coredump.fw_crash_data)
return -ENOMEM;
return 0;
}
int ath10k_coredump_register(struct ath10k *ar)
{
struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
if (test_bit(ATH10K_FW_CRASH_DUMP_RAM_DATA, &ath10k_coredump_mask)) {
crash_data->ramdump_buf_len = ath10k_coredump_get_ramdump_size(ar);
if (!crash_data->ramdump_buf_len)
return 0;
crash_data->ramdump_buf = vzalloc(crash_data->ramdump_buf_len);
if (!crash_data->ramdump_buf)
return -ENOMEM;
}
return 0;
}
void ath10k_coredump_unregister(struct ath10k *ar)
{
struct ath10k_fw_crash_data *crash_data = ar->coredump.fw_crash_data;
vfree(crash_data->ramdump_buf);
}
void ath10k_coredump_destroy(struct ath10k *ar)
{
if (ar->coredump.fw_crash_data->ramdump_buf) {
vfree(ar->coredump.fw_crash_data->ramdump_buf);
ar->coredump.fw_crash_data->ramdump_buf = NULL;
ar->coredump.fw_crash_data->ramdump_buf_len = 0;
}
vfree(ar->coredump.fw_crash_data);
ar->coredump.fw_crash_data = NULL;
}
Annotation
- Immediate include surface: `coredump.h`, `linux/devcoredump.h`, `linux/export.h`, `linux/kernel.h`, `linux/types.h`, `linux/utsname.h`, `debug.h`, `hw.h`.
- Detected declarations: `function ath10k_coredump_get_ramdump_size`, `function ath10k_coredump_submit`, `function ath10k_coredump_create`, `function ath10k_coredump_register`, `function ath10k_coredump_unregister`, `function ath10k_coredump_destroy`, `export ath10k_coredump_get_mem_layout`, `export ath10k_coredump_new`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.