mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
wifi: ath12k: Initialize desc_size through hal_init
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>
This commit is contained in:
parent
c0600b35e0
commit
74ed243dad
|
|
@ -28,6 +28,7 @@ ath12k-y += wifi7/hal_tx.o \
|
|||
wifi7/dp_rx.o \
|
||||
wifi7/dp_tx.o \
|
||||
wifi7/dp.o \
|
||||
wifi7/hal.o \
|
||||
wifi7/hal_qcn9274.o \
|
||||
wifi7/hal_wcn7850.o
|
||||
|
||||
|
|
|
|||
|
|
@ -930,8 +930,6 @@ static int ath12k_core_start(struct ath12k_base *ab)
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -913,11 +913,6 @@ void ath12k_dp_pdev_pre_alloc(struct ath12k *ar)
|
|||
/* 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);
|
||||
|
|
|
|||
|
|
@ -526,5 +526,4 @@ struct ath12k_rx_desc_info *ath12k_dp_get_rx_desc(struct ath12k_base *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
|
||||
|
|
|
|||
|
|
@ -1103,11 +1103,8 @@ static void ath12k_hal_unregister_srng_lock_keys(struct ath12k_base *ab)
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -1578,6 +1578,10 @@ enum nl80211_he_ru_alloc ath12k_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones)
|
|||
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;
|
||||
|
|
@ -1593,7 +1597,6 @@ struct hal_ops {
|
|||
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);
|
||||
|
|
|
|||
36
drivers/net/wireless/ath/ath12k/wifi7/hal.c
Normal file
36
drivers/net/wireless/ath/ath12k/wifi7/hal.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// 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);
|
||||
12
drivers/net/wireless/ath/ath12k/wifi7/hal.h
Normal file
12
drivers/net/wireless/ath/ath12k/wifi7/hal.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* 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
|
||||
|
|
@ -690,7 +690,6 @@ const struct hal_ops hal_qcn9274_ops = {
|
|||
.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,
|
||||
|
|
|
|||
|
|
@ -699,7 +699,6 @@ const struct hal_ops hal_wcn7850_ops = {
|
|||
.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,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#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,
|
||||
|
|
@ -1124,6 +1125,8 @@ int ath12k_wifi7_hw_init(struct ath12k_base *ab)
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user