Relocate hw_init call from the shared probe path to target-specific
probe implementations. Handle Wi-Fi 7 initialization entirely within
its corresponding target-specific file.
Improve modularity by decoupling hardware-dependent initialization from
common probe logic. Support broader effort to separate shared and
target-specific code paths.
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-9-8c9b0eb9335d@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
#include "ahb_wifi7.h"
#include "debug.h"
#include "hif.h"
+#include "hw_wifi7.h"
static const struct of_device_id ath12k_wifi7_ahb_of_match[] = {
{ .compatible = "qcom,ipq5332-wifi",
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);
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;
}
int ath12k_core_pre_init(struct ath12k_base *ab)
{
const struct ath12k_mem_profile_based_param *param;
- int ret;
-
- ret = ath12k_hw_init(ab);
- if (ret) {
- ath12k_err(ab, "failed to init hw params: %d\n", ret);
- return ret;
- }
param = &ath12k_mem_profile_based_param[ab->target_mem_mode];
ab->profile_param = param;
return "unknown";
}
-int ath12k_hw_init(struct ath12k_base *ab);
-
#endif
#include "ce.h"
#include "ce_wifi7.h"
#include "hw.h"
+#include "hw_wifi7.h"
#include "mhi.h"
#include "dp_rx.h"
#include "peer.h"
},
};
-int ath12k_hw_init(struct ath12k_base *ab)
+int ath12k_wifi7_hw_init(struct ath12k_base *ab)
{
const struct ath12k_hw_params *hw_params = NULL;
int i;
--- /dev/null
+/* 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.
+ */
+
+#ifndef ATH12K_WIFI7_HW_H
+#define ATH12K_WIFI7_HW_H
+
+struct ath12k_base;
+int ath12k_wifi7_hw_init(struct ath12k_base *ab);
+
+#endif /* ATH12K_WIFI7_HW_H */
#include "core.h"
#include "hif.h"
#include "mhi.h"
+#include "hw_wifi7.h"
#define QCN9274_DEVICE_ID 0x1109
#define WCN7850_DEVICE_ID 0x1107
u32 soc_hw_version_major, soc_hw_version_minor;
struct ath12k_pci *ab_pci;
struct ath12k_base *ab;
+ int ret;
ab = pci_get_drvdata(pdev);
if (!ab)
return -EOPNOTSUPP;
}
+ ret = ath12k_wifi7_hw_init(ab);
+ if (ret) {
+ dev_err(&pdev->dev, "WiFi-7 hw_init for PCI failed: %d\n", ret);
+ return ret;
+ }
+
return 0;
}