]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Move Wi-Fi 7 specific init routines to dedicated file
authorKiran Venkatappa <quic_kiranv@quicinc.com>
Tue, 12 Aug 2025 17:09:34 +0000 (22:39 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Wed, 20 Aug 2025 21:39:04 +0000 (14:39 -0700)
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>
drivers/net/wireless/ath/ath12k/Makefile
drivers/net/wireless/ath/ath12k/core.c
drivers/net/wireless/ath/ath12k/core_wifi7.c [new file with mode: 0644]

index 5c044e39633057651f80c3039f1340e791e419b4..9c7a32930ed60eafc36fa65aa0ac001d9237eaf8 100644 (file)
@@ -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 \
index 1333422724e4e873c8a36a53cf0faf4eda82c1a4..b1a26027de3f8d83a7823fba94cc0ef1df38c7b7 100644 (file)
 #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 @@ err_sc_free:
        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");
diff --git a/drivers/net/wireless/ath/ath12k/core_wifi7.c b/drivers/net/wireless/ath/ath12k/core_wifi7.c
new file mode 100644 (file)
index 0000000..85ea890
--- /dev/null
@@ -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");