mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
wifi: ath12k: Move HAL REO and Rx buf related APIs to wifi7 directory
Move the hardware specific HAL APIs to hal.c file inside wifi7 directory. These APIs will be called through the hal_ops mechanism, which are registered separately by qcn and wcn Handling following APIs: ath12k_wifi7_hal_reo_qdesc_setup ath12k_wifi7_hal_reo_init_cmd_ring ath12k_wifi7_hal_reo_hw_setup ath12k_wifi7_hal_rx_buf_addr_info_set ath12k_wifi7_hal_rx_buf_addr_info_get 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-14-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
parent
356942d328
commit
17540a7c9b
|
|
@ -54,7 +54,7 @@ static int ath12k_dbring_bufs_replenish(struct ath12k *ar,
|
|||
cookie = u32_encode_bits(ar->pdev_idx, DP_RXDMA_BUF_COOKIE_PDEV_ID) |
|
||||
u32_encode_bits(buf_id, DP_RXDMA_BUF_COOKIE_BUF_ID);
|
||||
|
||||
ath12k_wifi7_hal_rx_buf_addr_info_set(desc, paddr, cookie, 0);
|
||||
ath12k_hal_rx_buf_addr_info_set(&ab->hal, desc, paddr, cookie, 0);
|
||||
|
||||
ath12k_hal_srng_access_end(ab, srng);
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ int ath12k_dbring_buffer_release_event(struct ath12k_base *ab,
|
|||
|
||||
num_buff_reaped++;
|
||||
|
||||
ath12k_wifi7_hal_rx_buf_addr_info_get(&desc, &paddr, &cookie, &rbm);
|
||||
ath12k_hal_rx_buf_addr_info_get(&ab->hal, &desc, &paddr, &cookie, &rbm);
|
||||
|
||||
buf_id = u32_get_bits(cookie, DP_RXDMA_BUF_COOKIE_BUF_ID);
|
||||
|
||||
|
|
|
|||
|
|
@ -562,7 +562,7 @@ static int ath12k_dp_srng_common_setup(struct ath12k_base *ab)
|
|||
}
|
||||
|
||||
srng = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id];
|
||||
ath12k_wifi7_hal_reo_init_cmd_ring(ab, srng);
|
||||
ath12k_hal_reo_init_cmd_ring(ab, srng);
|
||||
|
||||
ret = ath12k_dp_srng_setup(ab, &dp->reo_status_ring, HAL_REO_STATUS,
|
||||
0, 0, DP_REO_STATUS_RING_SIZE);
|
||||
|
|
@ -586,7 +586,7 @@ static int ath12k_dp_srng_common_setup(struct ath12k_base *ab)
|
|||
HAL_HASH_ROUTING_RING_SW3 << 24 |
|
||||
HAL_HASH_ROUTING_RING_SW4 << 28;
|
||||
|
||||
ath12k_wifi7_hal_reo_hw_setup(ab, ring_hash_map);
|
||||
ath12k_hal_reo_hw_setup(ab, ring_hash_map);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab,
|
|||
|
||||
num_remain--;
|
||||
|
||||
ath12k_wifi7_hal_rx_buf_addr_info_set(desc, paddr, cookie, mgr);
|
||||
ath12k_hal_rx_buf_addr_info_set(&ab->hal, desc, paddr, cookie,
|
||||
mgr);
|
||||
}
|
||||
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -96,6 +96,31 @@ void ath12k_hal_setup_link_idle_list(struct ath12k_base *ab,
|
|||
end_offset);
|
||||
}
|
||||
|
||||
void ath12k_hal_reo_hw_setup(struct ath12k_base *ab, u32 ring_hash_map)
|
||||
{
|
||||
ab->hal.hal_ops->reo_hw_setup(ab, ring_hash_map);
|
||||
}
|
||||
|
||||
void ath12k_hal_reo_init_cmd_ring(struct ath12k_base *ab, struct hal_srng *srng)
|
||||
{
|
||||
ab->hal.hal_ops->reo_init_cmd_ring(ab, srng);
|
||||
}
|
||||
|
||||
void ath12k_hal_rx_buf_addr_info_set(struct ath12k_hal *hal,
|
||||
struct ath12k_buffer_addr *binfo,
|
||||
dma_addr_t paddr, u32 cookie, u8 manager)
|
||||
{
|
||||
hal->hal_ops->rx_buf_addr_info_set(binfo, paddr, cookie, manager);
|
||||
}
|
||||
|
||||
void ath12k_hal_rx_buf_addr_info_get(struct ath12k_hal *hal,
|
||||
struct ath12k_buffer_addr *binfo,
|
||||
dma_addr_t *paddr, u32 *msdu_cookies,
|
||||
u8 *rbm)
|
||||
{
|
||||
hal->hal_ops->rx_buf_addr_info_get(binfo, paddr, msdu_cookies, rbm);
|
||||
}
|
||||
|
||||
static int ath12k_hal_alloc_cont_rdp(struct ath12k_hal *hal)
|
||||
{
|
||||
size_t size;
|
||||
|
|
|
|||
|
|
@ -1729,15 +1729,17 @@ struct hal_ops {
|
|||
struct hal_wbm_idle_scatter_list *sbuf,
|
||||
u32 nsbufs, u32 tot_link_desc,
|
||||
u32 end_offset);
|
||||
void (*reo_init_cmd_ring)(struct ath12k_base *ab,
|
||||
struct hal_srng *srng);
|
||||
void (*reo_hw_setup)(struct ath12k_base *ab, u32 ring_hash_map);
|
||||
void (*rx_buf_addr_info_set)(struct ath12k_buffer_addr *binfo,
|
||||
dma_addr_t paddr, u32 cookie, u8 manager);
|
||||
void (*rx_buf_addr_info_get)(struct ath12k_buffer_addr *binfo,
|
||||
dma_addr_t *paddr, u32 *msdu_cookies,
|
||||
u8 *rbm);
|
||||
};
|
||||
|
||||
u32 ath12k_wifi7_hal_reo_qdesc_size(u32 ba_window_size, u8 tid);
|
||||
void ath12k_wifi7_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
|
||||
int tid, u32 ba_window_size,
|
||||
u32 start_seq, enum hal_pn_type type);
|
||||
void ath12k_wifi7_hal_reo_init_cmd_ring(struct ath12k_base *ab,
|
||||
struct hal_srng *srng);
|
||||
void ath12k_wifi7_hal_reo_hw_setup(struct ath12k_base *ab, u32 ring_hash_map);
|
||||
dma_addr_t ath12k_hal_srng_get_tp_addr(struct ath12k_base *ab,
|
||||
struct hal_srng *srng);
|
||||
dma_addr_t ath12k_hal_srng_get_hp_addr(struct ath12k_base *ab,
|
||||
|
|
@ -1806,4 +1808,13 @@ void ath12k_hal_reoq_lut_set_max_peerid(struct ath12k_base *ab);
|
|||
void ath12k_hal_write_reoq_lut_addr(struct ath12k_base *ab, dma_addr_t paddr);
|
||||
void
|
||||
ath12k_hal_write_ml_reoq_lut_addr(struct ath12k_base *ab, dma_addr_t paddr);
|
||||
void ath12k_hal_reo_init_cmd_ring(struct ath12k_base *ab, struct hal_srng *srng);
|
||||
void ath12k_hal_reo_hw_setup(struct ath12k_base *ab, u32 ring_hash_map);
|
||||
void ath12k_hal_rx_buf_addr_info_set(struct ath12k_hal *hal,
|
||||
struct ath12k_buffer_addr *binfo,
|
||||
dma_addr_t paddr, u32 cookie, u8 manager);
|
||||
void ath12k_hal_rx_buf_addr_info_get(struct ath12k_hal *hal,
|
||||
struct ath12k_buffer_addr *binfo,
|
||||
dma_addr_t *paddr, u32 *msdu_cookies,
|
||||
u8 *rbm);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1020,5 +1020,9 @@ const struct hal_ops hal_qcn9274_ops = {
|
|||
.write_reoq_lut_addr = ath12k_wifi7_hal_write_reoq_lut_addr,
|
||||
.write_ml_reoq_lut_addr = ath12k_wifi7_hal_write_ml_reoq_lut_addr,
|
||||
.setup_link_idle_list = ath12k_wifi7_hal_setup_link_idle_list,
|
||||
.reo_init_cmd_ring = ath12k_wifi7_hal_reo_init_cmd_ring,
|
||||
.reo_hw_setup = ath12k_wifi7_hal_reo_hw_setup,
|
||||
.rx_buf_addr_info_set = ath12k_wifi7_hal_rx_buf_addr_info_set,
|
||||
.rx_buf_addr_info_get = ath12k_wifi7_hal_rx_buf_addr_info_get,
|
||||
};
|
||||
EXPORT_SYMBOL(hal_qcn9274_ops);
|
||||
|
|
|
|||
|
|
@ -868,5 +868,11 @@ void ath12k_hal_rx_msdu_list_get(struct ath12k *ar,
|
|||
struct hal_rx_msdu_link *link_desc,
|
||||
struct hal_rx_msdu_list *msdu_list,
|
||||
u16 *num_msdus);
|
||||
void ath12k_wifi7_hal_reo_init_cmd_ring(struct ath12k_base *ab,
|
||||
struct hal_srng *srng);
|
||||
void ath12k_wifi7_hal_reo_hw_setup(struct ath12k_base *ab, u32 ring_hash_map);
|
||||
void ath12k_wifi7_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
|
||||
int tid, u32 ba_window_size,
|
||||
u32 start_seq, enum hal_pn_type type);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -835,5 +835,9 @@ const struct hal_ops hal_wcn7850_ops = {
|
|||
.write_reoq_lut_addr = ath12k_wifi7_hal_write_reoq_lut_addr,
|
||||
.write_ml_reoq_lut_addr = ath12k_wifi7_hal_write_ml_reoq_lut_addr,
|
||||
.setup_link_idle_list = ath12k_wifi7_hal_setup_link_idle_list,
|
||||
.reo_init_cmd_ring = ath12k_wifi7_hal_reo_init_cmd_ring,
|
||||
.reo_hw_setup = ath12k_wifi7_hal_reo_hw_setup,
|
||||
.rx_buf_addr_info_set = ath12k_wifi7_hal_rx_buf_addr_info_set,
|
||||
.rx_buf_addr_info_get = ath12k_wifi7_hal_rx_buf_addr_info_get,
|
||||
};
|
||||
EXPORT_SYMBOL(hal_wcn7850_ops);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user