drivers/net/wireless/ath/ath12k/wifi7/ahb.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/wifi7/ahb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/wifi7/ahb.c- Extension
.c- Size
- 2040 bytes
- Lines
- 84
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/of_device.hlinux/platform_device.hlinux/soc/qcom/mdt_loader.h../ahb.hahb.h../debug.h../hif.hhw.hdp.hcore.h
Detected Declarations
function ath12k_wifi7_ahb_probefunction ath12k_wifi7_ahb_initfunction ath12k_wifi7_ahb_exit
Annotated Snippet
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/soc/qcom/mdt_loader.h>
#include "../ahb.h"
#include "ahb.h"
#include "../debug.h"
#include "../hif.h"
#include "hw.h"
#include "dp.h"
#include "core.h"
static const struct of_device_id ath12k_wifi7_ahb_of_match[] = {
{ .compatible = "qcom,ipq5332-wifi",
.data = (void *)ATH12K_HW_IPQ5332_HW10,
},
{ .compatible = "qcom,ipq5424-wifi",
.data = (void *)ATH12K_HW_IPQ5424_HW10,
},
{ }
};
MODULE_DEVICE_TABLE(of, ath12k_wifi7_ahb_of_match);
static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
{
struct ath12k_ahb *ab_ahb;
enum ath12k_hw_rev hw_rev;
struct ath12k_base *ab;
int ret;
ab = platform_get_drvdata(pdev);
ab_ahb = ath12k_ab_to_ahb(ab);
hw_rev = (enum ath12k_hw_rev)(kernel_ulong_t)of_device_get_match_data(&pdev->dev);
switch (hw_rev) {
case ATH12K_HW_IPQ5332_HW10:
ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
ab_ahb->scm_auth_enabled = true;
break;
case ATH12K_HW_IPQ5424_HW10:
ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
ab_ahb->scm_auth_enabled = false;
break;
default:
return -EOPNOTSUPP;
}
ab->target_mem_mode = ATH12K_QMI_MEMORY_MODE_DEFAULT;
ab->hw_rev = hw_rev;
ret = ath12k_wifi7_hw_init(ab);
if (ret) {
ath12k_err(ab, "WiFi-7 hw_init for AHB failed: %d\n", ret);
return ret;
}
return 0;
}
static struct ath12k_ahb_driver ath12k_wifi7_ahb_driver = {
.name = "ath12k_wifi7_ahb",
.id_table = ath12k_wifi7_ahb_of_match,
.ops.probe = ath12k_wifi7_ahb_probe,
.ops.arch_init = ath12k_wifi7_arch_init,
.ops.arch_deinit = ath12k_wifi7_arch_deinit,
};
int ath12k_wifi7_ahb_init(void)
{
return ath12k_ahb_register_driver(ATH12K_DEVICE_FAMILY_WIFI7,
&ath12k_wifi7_ahb_driver);
}
void ath12k_wifi7_ahb_exit(void)
{
ath12k_ahb_unregister_driver(ATH12K_DEVICE_FAMILY_WIFI7);
}
Annotation
- Immediate include surface: `linux/of_device.h`, `linux/platform_device.h`, `linux/soc/qcom/mdt_loader.h`, `../ahb.h`, `ahb.h`, `../debug.h`, `../hif.h`, `hw.h`.
- Detected declarations: `function ath12k_wifi7_ahb_probe`, `function ath12k_wifi7_ahb_init`, `function ath12k_wifi7_ahb_exit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.