mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
wifi: ath12k: Move Wi-Fi 7 specific init routines to dedicated file
Move Wi-Fi 7 specific module initialization and exit routines from core.c to a new core_wifi7.c file. Decouple these routines from common module entry points to improve modularity. This restructuring is part of a broader effort to modularize the ATH12K driver by separating common logic from hardware family-specific implementations, improving maintainability and scalability. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1 Signed-off-by: Kiran Venkatappa <quic_kiranv@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20250812-ath12k-mod-v1-8-8c9b0eb9335d@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
parent
db2929711d
commit
387b587a86
|
|
@ -1,6 +1,7 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
obj-$(CONFIG_ATH12K) += ath12k.o
|
||||
ath12k-y += core.o \
|
||||
core_wifi7.o \
|
||||
hal.o \
|
||||
hal_tx.o \
|
||||
hal_rx.o \
|
||||
|
|
|
|||
|
|
@ -22,10 +22,7 @@
|
|||
#include "hif.h"
|
||||
#include "pci.h"
|
||||
#include "wow.h"
|
||||
#include "pci_wifi7.h"
|
||||
#include "ahb_wifi7.h"
|
||||
|
||||
static int ahb_err, pci_err;
|
||||
unsigned int ath12k_debug_mask;
|
||||
module_param_named(debug_mask, ath12k_debug_mask, uint, 0644);
|
||||
MODULE_PARM_DESC(debug_mask, "Debugging mask");
|
||||
|
|
@ -2282,32 +2279,3 @@ struct ath12k_base *ath12k_core_alloc(struct device *dev, size_t priv_size,
|
|||
kfree(ab);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int ath12k_init(void)
|
||||
{
|
||||
ahb_err = ath12k_wifi7_ahb_init();
|
||||
if (ahb_err)
|
||||
pr_warn("Failed to initialize ath12k AHB device: %d\n", ahb_err);
|
||||
|
||||
pci_err = ath12k_wifi7_pci_init();
|
||||
if (pci_err)
|
||||
pr_warn("Failed to initialize ath12k PCI device: %d\n", pci_err);
|
||||
|
||||
/* If both failed, return one of the failures (arbitrary) */
|
||||
return ahb_err && pci_err ? ahb_err : 0;
|
||||
}
|
||||
|
||||
static void ath12k_exit(void)
|
||||
{
|
||||
if (!pci_err)
|
||||
ath12k_wifi7_pci_exit();
|
||||
|
||||
if (!ahb_err)
|
||||
ath12k_wifi7_ahb_exit();
|
||||
}
|
||||
|
||||
module_init(ath12k_init);
|
||||
module_exit(ath12k_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11be WLAN devices");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
|
|
|||
44
drivers/net/wireless/ath/ath12k/core_wifi7.c
Normal file
44
drivers/net/wireless/ath/ath12k/core_wifi7.c
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
/*
|
||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include "ahb.h"
|
||||
#include "pci.h"
|
||||
#include "pci_wifi7.h"
|
||||
#include "ahb_wifi7.h"
|
||||
|
||||
static int ahb_err, pci_err;
|
||||
|
||||
static int ath12k_wifi7_init(void)
|
||||
{
|
||||
ahb_err = ath12k_wifi7_ahb_init();
|
||||
if (ahb_err)
|
||||
pr_warn("Failed to initialize ath12k Wi-Fi 7 AHB device: %d\n",
|
||||
ahb_err);
|
||||
|
||||
pci_err = ath12k_wifi7_pci_init();
|
||||
if (pci_err)
|
||||
pr_warn("Failed to initialize ath12k Wi-Fi 7 PCI device: %d\n",
|
||||
pci_err);
|
||||
|
||||
/* If both failed, return one of the failures (arbitrary) */
|
||||
return ahb_err && pci_err ? ahb_err : 0;
|
||||
}
|
||||
|
||||
static void ath12k_wifi7_exit(void)
|
||||
{
|
||||
if (!pci_err)
|
||||
ath12k_wifi7_pci_exit();
|
||||
|
||||
if (!ahb_err)
|
||||
ath12k_wifi7_ahb_exit();
|
||||
}
|
||||
|
||||
module_init(ath12k_wifi7_init);
|
||||
module_exit(ath12k_wifi7_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11be WLAN devices");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
Loading…
Reference in New Issue
Block a user