mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
wifi: ath12k: Move wbm_rbm_map to hw specific hal files
Move wbm_rbm_map from common hal file to hw specific hal files, since these implementations are specific and configurable for each hardware. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-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-5-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
parent
369cb192c2
commit
1c1d4b491d
|
|
@ -558,12 +558,10 @@ static int ath12k_ahb_config_ext_irq(struct ath12k_base *ab)
|
|||
{
|
||||
const struct ath12k_hw_ring_mask *ring_mask;
|
||||
struct ath12k_ext_irq_grp *irq_grp;
|
||||
const struct hal_ops *hal_ops;
|
||||
int i, j, irq, irq_idx, ret;
|
||||
u32 num_irq;
|
||||
|
||||
ring_mask = ab->hw_params->ring_mask;
|
||||
hal_ops = ab->hal.hal_ops;
|
||||
for (i = 0; i < ATH12K_EXT_IRQ_GRP_NUM_MAX; i++) {
|
||||
irq_grp = &ab->ext_irq_grp[i];
|
||||
num_irq = 0;
|
||||
|
|
@ -583,7 +581,7 @@ static int ath12k_ahb_config_ext_irq(struct ath12k_base *ab)
|
|||
* tcl_to_wbm_rbm_map point to the same ring number.
|
||||
*/
|
||||
if (ring_mask->tx[i] &
|
||||
BIT(hal_ops->tcl_to_wbm_rbm_map[j].wbm_ring_num)) {
|
||||
BIT(ab->hal.tcl_to_wbm_rbm_map[j].wbm_ring_num)) {
|
||||
irq_grp->irqs[num_irq++] =
|
||||
wbm2host_tx_completions_ring1 - j;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ static int ath12k_dp_srng_calculate_msi_group(struct ath12k_base *ab,
|
|||
grp_mask = &ab->hw_params->ring_mask->rx_wbm_rel[0];
|
||||
ring_num = 0;
|
||||
} else {
|
||||
map = ab->hal.hal_ops->tcl_to_wbm_rbm_map;
|
||||
map = ab->hal.tcl_to_wbm_rbm_map;
|
||||
for (i = 0; i < ab->hw_params->max_tx_ring; i++) {
|
||||
if (ring_num == map[i].wbm_ring_num) {
|
||||
ring_num = i;
|
||||
|
|
@ -508,7 +508,7 @@ static int ath12k_dp_srng_common_setup(struct ath12k_base *ab)
|
|||
}
|
||||
|
||||
for (i = 0; i < ab->hw_params->max_tx_ring; i++) {
|
||||
map = ab->hal.hal_ops->tcl_to_wbm_rbm_map;
|
||||
map = ab->hal.tcl_to_wbm_rbm_map;
|
||||
tx_comp_ring_num = map[i].wbm_ring_num;
|
||||
|
||||
ret = ath12k_dp_srng_setup(ab, &dp->tx_ring[i].tcl_data_ring,
|
||||
|
|
|
|||
|
|
@ -12,42 +12,6 @@
|
|||
#include "wifi7/hal_qcn9274.h"
|
||||
#include "wifi7/hal_wcn7850.h"
|
||||
|
||||
const struct ath12k_hal_tcl_to_wbm_rbm_map
|
||||
ath12k_hal_qcn9274_tcl_to_wbm_rbm_map[DP_TCL_NUM_RING_MAX] = {
|
||||
{
|
||||
.wbm_ring_num = 0,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW0_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 1,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW1_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 2,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW2_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 4,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW4_BM,
|
||||
}
|
||||
};
|
||||
|
||||
const struct ath12k_hal_tcl_to_wbm_rbm_map
|
||||
ath12k_hal_wcn7850_tcl_to_wbm_rbm_map[DP_TCL_NUM_RING_MAX] = {
|
||||
{
|
||||
.wbm_ring_num = 0,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW0_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 2,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW2_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 4,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW4_BM,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned int ath12k_hal_reo1_ring_id_offset(struct ath12k_base *ab)
|
||||
{
|
||||
return HAL_REO1_RING_ID(ab) - HAL_REO1_RING_BASE_LSB(ab);
|
||||
|
|
|
|||
|
|
@ -1473,6 +1473,8 @@ struct ath12k_hal {
|
|||
int num_shadow_reg_configured;
|
||||
|
||||
u32 hal_desc_sz;
|
||||
|
||||
const struct ath12k_hal_tcl_to_wbm_rbm_map *tcl_to_wbm_rbm_map;
|
||||
};
|
||||
|
||||
/* Maps WBM ring number and Return Buffer Manager Id per TCL ring */
|
||||
|
|
@ -1582,11 +1584,11 @@ enum nl80211_he_ru_alloc ath12k_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones)
|
|||
struct ath12k_hw_version_map {
|
||||
const struct hal_ops *hal_ops;
|
||||
u32 hal_desc_sz;
|
||||
const struct ath12k_hal_tcl_to_wbm_rbm_map *tcl_to_wbm_rbm_map;
|
||||
};
|
||||
|
||||
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 (*rx_desc_set_msdu_len)(struct hal_rx_desc *desc, u16 len);
|
||||
void (*rx_desc_get_dot11_hdr)(struct hal_rx_desc *desc,
|
||||
struct ieee80211_hdr *hdr);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ int ath12k_wifi7_dp_tx(struct ath12k_pdev_dp *dp_pdev, struct ath12k_link_vif *a
|
|||
ti.ring_id = ring_selector % ab->hw_params->max_tx_ring;
|
||||
|
||||
ring_map |= BIT(ti.ring_id);
|
||||
ti.rbm_id = ab->hal.hal_ops->tcl_to_wbm_rbm_map[ti.ring_id].rbm_id;
|
||||
ti.rbm_id = ab->hal.tcl_to_wbm_rbm_map[ti.ring_id].rbm_id;
|
||||
|
||||
tx_ring = &dp->tx_ring[ti.ring_id];
|
||||
|
||||
|
|
|
|||
|
|
@ -14,18 +14,22 @@ static const struct ath12k_hw_version_map ath12k_wifi7_hw_ver_map[] = {
|
|||
[ATH12K_HW_QCN9274_HW10] = {
|
||||
.hal_ops = &hal_qcn9274_ops,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9274_compact),
|
||||
.tcl_to_wbm_rbm_map = ath12k_hal_tcl_to_wbm_rbm_map_qcn9274,
|
||||
},
|
||||
[ATH12K_HW_QCN9274_HW20] = {
|
||||
.hal_ops = &hal_qcn9274_ops,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9274_compact),
|
||||
.tcl_to_wbm_rbm_map = ath12k_hal_tcl_to_wbm_rbm_map_qcn9274,
|
||||
},
|
||||
[ATH12K_HW_WCN7850_HW20] = {
|
||||
.hal_ops = &hal_wcn7850_ops,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn7850),
|
||||
.tcl_to_wbm_rbm_map = ath12k_hal_tcl_to_wbm_rbm_map_wcn7850,
|
||||
},
|
||||
[ATH12K_HW_IPQ5332_HW10] = {
|
||||
.hal_ops = &hal_qcn9274_ops,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9274_compact),
|
||||
.tcl_to_wbm_rbm_map = ath12k_hal_tcl_to_wbm_rbm_map_qcn9274,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -37,6 +41,7 @@ int ath12k_wifi7_hal_init(struct ath12k_base *ab)
|
|||
|
||||
hal->hal_ops = ath12k_wifi7_hw_ver_map[ab->hw_rev].hal_ops;
|
||||
hal->hal_desc_sz = ath12k_wifi7_hw_ver_map[ab->hw_rev].hal_desc_sz;
|
||||
hal->tcl_to_wbm_rbm_map = ath12k_wifi7_hw_ver_map[ab->hw_rev].tcl_to_wbm_rbm_map;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -681,9 +681,28 @@ static int ath12k_hal_srng_create_config_qcn9274(struct ath12k_base *ab)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const struct ath12k_hal_tcl_to_wbm_rbm_map
|
||||
ath12k_hal_tcl_to_wbm_rbm_map_qcn9274[DP_TCL_NUM_RING_MAX] = {
|
||||
{
|
||||
.wbm_ring_num = 0,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW0_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 1,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW1_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 2,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW2_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 4,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW4_BM,
|
||||
},
|
||||
};
|
||||
|
||||
const struct hal_ops hal_qcn9274_ops = {
|
||||
.create_srng_config = ath12k_hal_srng_create_config_qcn9274,
|
||||
.tcl_to_wbm_rbm_map = ath12k_hal_qcn9274_tcl_to_wbm_rbm_map,
|
||||
.rx_desc_set_msdu_len = ath12k_hal_rx_desc_set_msdu_len_qcn9274,
|
||||
.rx_desc_get_dot11_hdr = ath12k_hal_rx_desc_get_dot11_hdr_qcn9274,
|
||||
.rx_desc_get_crypto_header = ath12k_hal_rx_desc_get_crypto_hdr_qcn9274,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
extern const struct hal_ops hal_qcn9274_ops;
|
||||
extern const struct ath12k_hal_tcl_to_wbm_rbm_map
|
||||
ath12k_hal_qcn9274_tcl_to_wbm_rbm_map[DP_TCL_NUM_RING_MAX];
|
||||
ath12k_hal_tcl_to_wbm_rbm_map_qcn9274[DP_TCL_NUM_RING_MAX];
|
||||
|
||||
u8 ath12k_hal_rx_desc_get_l3_pad_bytes_qcn9274(struct hal_rx_desc *desc);
|
||||
void ath12k_hal_rx_desc_copy_end_tlv_qcn9274(struct hal_rx_desc *fdesc,
|
||||
|
|
|
|||
|
|
@ -690,9 +690,24 @@ static int ath12k_hal_srng_create_config_wcn7850(struct ath12k_base *ab)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const struct ath12k_hal_tcl_to_wbm_rbm_map
|
||||
ath12k_hal_tcl_to_wbm_rbm_map_wcn7850[DP_TCL_NUM_RING_MAX] = {
|
||||
{
|
||||
.wbm_ring_num = 0,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW0_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 2,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW2_BM,
|
||||
},
|
||||
{
|
||||
.wbm_ring_num = 4,
|
||||
.rbm_id = HAL_RX_BUF_RBM_SW4_BM,
|
||||
},
|
||||
};
|
||||
|
||||
const struct hal_ops hal_wcn7850_ops = {
|
||||
.create_srng_config = ath12k_hal_srng_create_config_wcn7850,
|
||||
.tcl_to_wbm_rbm_map = ath12k_hal_wcn7850_tcl_to_wbm_rbm_map,
|
||||
.rx_desc_set_msdu_len = ath12k_hal_rx_desc_set_msdu_len_wcn7850,
|
||||
.rx_desc_get_dot11_hdr = ath12k_hal_rx_desc_get_dot11_hdr_wcn7850,
|
||||
.rx_desc_get_crypto_header = ath12k_hal_rx_desc_get_crypto_hdr_wcn7850,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
extern const struct hal_ops hal_wcn7850_ops;
|
||||
extern const struct ath12k_hal_tcl_to_wbm_rbm_map
|
||||
ath12k_hal_wcn7850_tcl_to_wbm_rbm_map[DP_TCL_NUM_RING_MAX];
|
||||
ath12k_hal_tcl_to_wbm_rbm_map_wcn7850[DP_TCL_NUM_RING_MAX];
|
||||
|
||||
u8 ath12k_hal_rx_desc_get_l3_pad_bytes_wcn7850(struct hal_rx_desc *desc);
|
||||
void ath12k_hal_rx_desc_copy_end_tlv_wcn7850(struct hal_rx_desc *fdesc,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user