Currently desc_size uses a dedicated hal_ops API for initialization.
Combine it with other hal_params to be initialized in a
single API "hal_init" during probe time using a static array.
hal_init will be used as the common API to initialize
all hal parameters during the probe.
Add hal.c file to add hal definitions that are wifi7 specific
but common between qca and wcn chipsets.
Add hal.h header to add wifi7 specific prototypes/Macros etc
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
Signed-off-by: Pavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20251009111045.1763001-3-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
wifi7/dp_rx.o \
wifi7/dp_tx.o \
wifi7/dp.o \
+ wifi7/hal.o \
wifi7/hal_qcn9274.o \
wifi7/hal_wcn7850.o
goto err_hif_stop;
}
- ath12k_dp_hal_rx_desc_init(ab);
-
ret = ath12k_wmi_cmd_init(ab);
if (ret) {
ath12k_err(ab, "failed to send wmi init cmd: %d\n", ret);
/* TODO: Add any RXDMA setup required per pdev */
}
-void ath12k_dp_hal_rx_desc_init(struct ath12k_base *ab)
-{
- ab->hal.hal_desc_sz = ab->hw_params->hal_ops->rx_desc_get_desc_size();
-}
-
int ath12k_dp_pdev_alloc(struct ath12k_base *ab)
{
struct ath12k_dp *dp = ath12k_ab_to_dp(ab);
u32 cookie);
struct ath12k_tx_desc_info *ath12k_dp_get_tx_desc(struct ath12k_base *ab,
u32 desc_id);
-void ath12k_dp_hal_rx_desc_init(struct ath12k_base *ab);
#endif
int ath12k_hal_srng_init(struct ath12k_base *ab)
{
- struct ath12k_hal *hal = &ab->hal;
int ret;
- memset(hal, 0, sizeof(*hal));
-
ret = ab->hw_params->hal_ops->create_srng_config(ab);
if (ret)
goto err_hal;
return ret;
}
+struct ath12k_hw_version_map {
+ u32 hal_desc_sz;
+};
+
struct hal_ops {
int (*create_srng_config)(struct ath12k_base *ab);
const struct ath12k_hal_tcl_to_wbm_rbm_map *tcl_to_wbm_rbm_map;
void (*extract_rx_desc_data)(struct hal_rx_desc_data *rx_desc_data,
struct hal_rx_desc *rx_desc,
struct hal_rx_desc *ldesc);
- u32 (*rx_desc_get_desc_size)(void);
u32 (*rx_desc_get_mpdu_start_tag)(struct hal_rx_desc *desc);
u32 (*rx_desc_get_mpdu_ppdu_id)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc);
--- /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.
+ */
+#include "hw.h"
+#include "hal_desc.h"
+#include "../hal.h"
+#include "hal.h"
+
+static const struct ath12k_hw_version_map ath12k_wifi7_hw_ver_map[] = {
+ [ATH12K_HW_QCN9274_HW10] = {
+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9274_compact),
+ },
+ [ATH12K_HW_QCN9274_HW20] = {
+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9274_compact),
+ },
+ [ATH12K_HW_WCN7850_HW20] = {
+ .hal_desc_sz = sizeof(struct hal_rx_desc_wcn7850),
+ },
+ [ATH12K_HW_IPQ5332_HW10] = {
+ .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9274_compact),
+ },
+};
+
+int ath12k_wifi7_hal_init(struct ath12k_base *ab)
+{
+ struct ath12k_hal *hal = &ab->hal;
+
+ memset(hal, 0, sizeof(*hal));
+
+ hal->hal_desc_sz = ath12k_wifi7_hw_ver_map[ab->hw_rev].hal_desc_sz;
+
+ return 0;
+}
+EXPORT_SYMBOL(ath12k_wifi7_hal_init);
--- /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_HAL_WIFI7_H
+#define ATH12K_HAL_WIFI7_H
+
+int ath12k_wifi7_hal_init(struct ath12k_base *ab);
+
+#endif
.rx_desc_copy_end_tlv = ath12k_hal_rx_desc_copy_end_tlv_qcn9274,
.rx_desc_get_msdu_src_link_id = ath12k_hal_rx_desc_get_msdu_src_link_qcn9274,
.extract_rx_desc_data = ath12k_hal_extract_rx_desc_data_qcn9274,
- .rx_desc_get_desc_size = ath12k_hal_get_rx_desc_size_qcn9274,
.rx_desc_get_l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcn9274,
.rx_desc_get_mpdu_ppdu_id = ath12k_hal_rx_desc_get_mpdu_ppdu_id_qcn9274,
.rx_desc_get_msdu_payload = ath12k_hal_rx_desc_get_msdu_payload_qcn9274,
.rx_desc_copy_end_tlv = ath12k_hal_rx_desc_copy_end_tlv_wcn7850,
.rx_desc_get_msdu_src_link_id = ath12k_hal_rx_desc_get_msdu_src_link_wcn7850,
.extract_rx_desc_data = ath12k_hal_extract_rx_desc_data_wcn7850,
- .rx_desc_get_desc_size = ath12k_hal_get_rx_desc_size_wcn7850,
.rx_desc_get_l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_wcn7850,
.rx_desc_get_mpdu_start_tag = ath12k_hal_rx_desc_get_mpdu_start_tag_wcn7850,
.rx_desc_get_mpdu_ppdu_id = ath12k_hal_rx_desc_get_mpdu_ppdu_id_wcn7850,
#include "../debugfs.h"
#include "../debugfs_sta.h"
#include "../testmode.h"
+#include "hal.h"
static const guid_t wcn7850_uuid = GUID_INIT(0xf634f534, 0x6147, 0x11ec,
0x90, 0xd6, 0x02, 0x42,
ab->hw_params = hw_params;
ab->ath12k_ops = &ath12k_ops_wifi7;
+ ath12k_wifi7_hal_init(ab);
+
ath12k_info(ab, "Wi-Fi 7 Hardware name: %s\n", ab->hw_params->name);
return 0;