xref: /wlan-driver/qca-wifi-host-cmn/dp/wifi3.0/li/dp_li.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name #include "dp_types.h"
21*5113495bSYour Name #include "dp_rings.h"
22*5113495bSYour Name #include <dp_internal.h>
23*5113495bSYour Name #include <dp_htt.h>
24*5113495bSYour Name #include "dp_li.h"
25*5113495bSYour Name #include "dp_li_tx.h"
26*5113495bSYour Name #include "dp_tx_desc.h"
27*5113495bSYour Name #include "dp_li_rx.h"
28*5113495bSYour Name #include "dp_peer.h"
29*5113495bSYour Name #include <wlan_utility.h>
30*5113495bSYour Name #include "dp_ipa.h"
31*5113495bSYour Name #ifdef WIFI_MONITOR_SUPPORT
32*5113495bSYour Name #include <dp_mon_1.0.h>
33*5113495bSYour Name #endif
34*5113495bSYour Name 
35*5113495bSYour Name #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
36*5113495bSYour Name static struct wlan_cfg_tcl_wbm_ring_num_map g_tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = {
37*5113495bSYour Name 	{.tcl_ring_num = 0, .wbm_ring_num = 0, .wbm_rbm_id = HAL_LI_WBM_SW0_BM_ID, .for_ipa = 0},
38*5113495bSYour Name 	/*
39*5113495bSYour Name 	 * INVALID_WBM_RING_NUM implies re-use of an existing WBM2SW ring
40*5113495bSYour Name 	 * as indicated by rbm id.
41*5113495bSYour Name 	 */
42*5113495bSYour Name 	{1, INVALID_WBM_RING_NUM, HAL_LI_WBM_SW0_BM_ID, 0},
43*5113495bSYour Name 	{2, 2, HAL_LI_WBM_SW2_BM_ID, 0}
44*5113495bSYour Name };
45*5113495bSYour Name #else
46*5113495bSYour Name static struct wlan_cfg_tcl_wbm_ring_num_map g_tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = {
47*5113495bSYour Name 	{.tcl_ring_num = 0, .wbm_ring_num = 0, .wbm_rbm_id = HAL_LI_WBM_SW0_BM_ID, .for_ipa = 0},
48*5113495bSYour Name 	{1, 1, HAL_LI_WBM_SW1_BM_ID, 0},
49*5113495bSYour Name 	{2, 2, HAL_LI_WBM_SW2_BM_ID, 0},
50*5113495bSYour Name 	/*
51*5113495bSYour Name 	 * Although using wbm_ring 4, wbm_ring 3 is mentioned in order to match
52*5113495bSYour Name 	 * with the tx_mask in dp_service_srngs. Please be careful while using
53*5113495bSYour Name 	 * this table anywhere else.
54*5113495bSYour Name 	 */
55*5113495bSYour Name 	{3, 3, HAL_LI_WBM_SW4_BM_ID, 0}
56*5113495bSYour Name };
57*5113495bSYour Name #endif
58*5113495bSYour Name 
59*5113495bSYour Name #ifdef IPA_WDI3_TX_TWO_PIPES
60*5113495bSYour Name static inline void
dp_soc_cfg_update_tcl_wbm_map_for_ipa(struct wlan_cfg_dp_soc_ctxt * cfg_ctx)61*5113495bSYour Name dp_soc_cfg_update_tcl_wbm_map_for_ipa(struct wlan_cfg_dp_soc_ctxt *cfg_ctx)
62*5113495bSYour Name {
63*5113495bSYour Name 	if (!cfg_ctx->ipa_enabled)
64*5113495bSYour Name 		return;
65*5113495bSYour Name 
66*5113495bSYour Name 	cfg_ctx->tcl_wbm_map_array[IPA_TX_ALT_RING_IDX].wbm_ring_num = 4;
67*5113495bSYour Name 	cfg_ctx->tcl_wbm_map_array[IPA_TX_ALT_RING_IDX].wbm_rbm_id =
68*5113495bSYour Name 							   HAL_LI_WBM_SW4_BM_ID;
69*5113495bSYour Name }
70*5113495bSYour Name #else
71*5113495bSYour Name static inline void
dp_soc_cfg_update_tcl_wbm_map_for_ipa(struct wlan_cfg_dp_soc_ctxt * soc_cfg_ctx)72*5113495bSYour Name dp_soc_cfg_update_tcl_wbm_map_for_ipa(struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx)
73*5113495bSYour Name {
74*5113495bSYour Name }
75*5113495bSYour Name #endif
76*5113495bSYour Name 
dp_soc_cfg_attach_li(struct dp_soc * soc)77*5113495bSYour Name static void dp_soc_cfg_attach_li(struct dp_soc *soc)
78*5113495bSYour Name {
79*5113495bSYour Name 	struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx = soc->wlan_cfg_ctx;
80*5113495bSYour Name 
81*5113495bSYour Name 	dp_soc_cfg_attach(soc);
82*5113495bSYour Name 
83*5113495bSYour Name 	wlan_cfg_set_rx_rel_ring_id(soc_cfg_ctx, WBM2SW_REL_ERR_RING_NUM);
84*5113495bSYour Name 
85*5113495bSYour Name 	soc_cfg_ctx->tcl_wbm_map_array = g_tcl_wbm_map_array;
86*5113495bSYour Name 	dp_soc_cfg_update_tcl_wbm_map_for_ipa(soc_cfg_ctx);
87*5113495bSYour Name }
88*5113495bSYour Name 
dp_get_context_size_li(enum dp_context_type context_type)89*5113495bSYour Name qdf_size_t dp_get_context_size_li(enum dp_context_type context_type)
90*5113495bSYour Name {
91*5113495bSYour Name 	switch (context_type) {
92*5113495bSYour Name 	case DP_CONTEXT_TYPE_SOC:
93*5113495bSYour Name 		return sizeof(struct dp_soc_li);
94*5113495bSYour Name 	case DP_CONTEXT_TYPE_PDEV:
95*5113495bSYour Name 		return sizeof(struct dp_pdev_li);
96*5113495bSYour Name 	case DP_CONTEXT_TYPE_VDEV:
97*5113495bSYour Name 		return sizeof(struct dp_vdev_li);
98*5113495bSYour Name 	case DP_CONTEXT_TYPE_PEER:
99*5113495bSYour Name 		return sizeof(struct dp_peer_li);
100*5113495bSYour Name 	default:
101*5113495bSYour Name 		return 0;
102*5113495bSYour Name 	}
103*5113495bSYour Name }
104*5113495bSYour Name 
dp_soc_attach_li(struct dp_soc * soc,struct cdp_soc_attach_params * params)105*5113495bSYour Name static QDF_STATUS dp_soc_attach_li(struct dp_soc *soc,
106*5113495bSYour Name 				   struct cdp_soc_attach_params *params)
107*5113495bSYour Name {
108*5113495bSYour Name 	soc->wbm_sw0_bm_id = hal_tx_get_wbm_sw0_bm_id();
109*5113495bSYour Name 
110*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
111*5113495bSYour Name }
112*5113495bSYour Name 
dp_soc_detach_li(struct dp_soc * soc)113*5113495bSYour Name static QDF_STATUS dp_soc_detach_li(struct dp_soc *soc)
114*5113495bSYour Name {
115*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
116*5113495bSYour Name }
117*5113495bSYour Name 
dp_soc_interrupt_attach_li(struct cdp_soc_t * txrx_soc)118*5113495bSYour Name static QDF_STATUS dp_soc_interrupt_attach_li(struct cdp_soc_t *txrx_soc)
119*5113495bSYour Name {
120*5113495bSYour Name 	return dp_soc_interrupt_attach(txrx_soc);
121*5113495bSYour Name }
122*5113495bSYour Name 
dp_soc_attach_poll_li(struct cdp_soc_t * txrx_soc)123*5113495bSYour Name static QDF_STATUS dp_soc_attach_poll_li(struct cdp_soc_t *txrx_soc)
124*5113495bSYour Name {
125*5113495bSYour Name 	return dp_soc_attach_poll(txrx_soc);
126*5113495bSYour Name }
127*5113495bSYour Name 
dp_soc_interrupt_detach_li(struct cdp_soc_t * txrx_soc)128*5113495bSYour Name static void dp_soc_interrupt_detach_li(struct cdp_soc_t *txrx_soc)
129*5113495bSYour Name {
130*5113495bSYour Name 	return dp_soc_interrupt_detach(txrx_soc);
131*5113495bSYour Name }
132*5113495bSYour Name 
dp_service_srngs_li(void * dp_ctx,uint32_t dp_budget,int cpu)133*5113495bSYour Name static uint32_t dp_service_srngs_li(void *dp_ctx, uint32_t dp_budget, int cpu)
134*5113495bSYour Name {
135*5113495bSYour Name 	return dp_service_srngs(dp_ctx, dp_budget, cpu);
136*5113495bSYour Name }
137*5113495bSYour Name 
dp_soc_init_li(struct dp_soc * soc,HTC_HANDLE htc_handle,struct hif_opaque_softc * hif_handle)138*5113495bSYour Name static void *dp_soc_init_li(struct dp_soc *soc, HTC_HANDLE htc_handle,
139*5113495bSYour Name 			    struct hif_opaque_softc *hif_handle)
140*5113495bSYour Name {
141*5113495bSYour Name 	wlan_minidump_log(soc, sizeof(*soc), soc->ctrl_psoc,
142*5113495bSYour Name 			  WLAN_MD_DP_SOC, "dp_soc");
143*5113495bSYour Name 
144*5113495bSYour Name 	soc->hif_handle = hif_handle;
145*5113495bSYour Name 
146*5113495bSYour Name 	soc->hal_soc = hif_get_hal_handle(soc->hif_handle);
147*5113495bSYour Name 	if (!soc->hal_soc)
148*5113495bSYour Name 		return NULL;
149*5113495bSYour Name 
150*5113495bSYour Name 	return dp_soc_init(soc, htc_handle, hif_handle);
151*5113495bSYour Name }
152*5113495bSYour Name 
dp_soc_deinit_li(struct dp_soc * soc)153*5113495bSYour Name static QDF_STATUS dp_soc_deinit_li(struct dp_soc *soc)
154*5113495bSYour Name {
155*5113495bSYour Name 	qdf_atomic_set(&soc->cmn_init_done, 0);
156*5113495bSYour Name 
157*5113495bSYour Name 	dp_soc_deinit(soc);
158*5113495bSYour Name 
159*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
160*5113495bSYour Name }
161*5113495bSYour Name 
dp_pdev_attach_li(struct dp_pdev * pdev,struct cdp_pdev_attach_params * params)162*5113495bSYour Name static QDF_STATUS dp_pdev_attach_li(struct dp_pdev *pdev,
163*5113495bSYour Name 				    struct cdp_pdev_attach_params *params)
164*5113495bSYour Name {
165*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
166*5113495bSYour Name }
167*5113495bSYour Name 
dp_pdev_detach_li(struct dp_pdev * pdev)168*5113495bSYour Name static QDF_STATUS dp_pdev_detach_li(struct dp_pdev *pdev)
169*5113495bSYour Name {
170*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
171*5113495bSYour Name }
172*5113495bSYour Name 
dp_vdev_attach_li(struct dp_soc * soc,struct dp_vdev * vdev)173*5113495bSYour Name static QDF_STATUS dp_vdev_attach_li(struct dp_soc *soc, struct dp_vdev *vdev)
174*5113495bSYour Name {
175*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
176*5113495bSYour Name }
177*5113495bSYour Name 
dp_vdev_detach_li(struct dp_soc * soc,struct dp_vdev * vdev)178*5113495bSYour Name static QDF_STATUS dp_vdev_detach_li(struct dp_soc *soc, struct dp_vdev *vdev)
179*5113495bSYour Name {
180*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
181*5113495bSYour Name }
182*5113495bSYour Name 
183*5113495bSYour Name #ifdef AST_OFFLOAD_ENABLE
dp_peer_map_detach_li(struct dp_soc * soc)184*5113495bSYour Name static void dp_peer_map_detach_li(struct dp_soc *soc)
185*5113495bSYour Name {
186*5113495bSYour Name 	dp_soc_wds_detach(soc);
187*5113495bSYour Name 	dp_peer_ast_table_detach(soc);
188*5113495bSYour Name 	dp_peer_ast_hash_detach(soc);
189*5113495bSYour Name 	dp_peer_mec_hash_detach(soc);
190*5113495bSYour Name }
191*5113495bSYour Name 
dp_peer_map_attach_li(struct dp_soc * soc)192*5113495bSYour Name static QDF_STATUS dp_peer_map_attach_li(struct dp_soc *soc)
193*5113495bSYour Name {
194*5113495bSYour Name 	QDF_STATUS status;
195*5113495bSYour Name 
196*5113495bSYour Name 	soc->max_peer_id = soc->max_peers;
197*5113495bSYour Name 
198*5113495bSYour Name 	status = dp_peer_ast_table_attach(soc);
199*5113495bSYour Name 	if (!QDF_IS_STATUS_SUCCESS(status))
200*5113495bSYour Name 		return status;
201*5113495bSYour Name 
202*5113495bSYour Name 	status = dp_peer_ast_hash_attach(soc);
203*5113495bSYour Name 	if (!QDF_IS_STATUS_SUCCESS(status))
204*5113495bSYour Name 		goto ast_table_detach;
205*5113495bSYour Name 
206*5113495bSYour Name 	status = dp_peer_mec_hash_attach(soc);
207*5113495bSYour Name 	if (!QDF_IS_STATUS_SUCCESS(status))
208*5113495bSYour Name 		goto hash_detach;
209*5113495bSYour Name 
210*5113495bSYour Name 	dp_soc_wds_attach(soc);
211*5113495bSYour Name 
212*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
213*5113495bSYour Name 
214*5113495bSYour Name hash_detach:
215*5113495bSYour Name 	dp_peer_ast_hash_detach(soc);
216*5113495bSYour Name ast_table_detach:
217*5113495bSYour Name 	dp_peer_ast_table_detach(soc);
218*5113495bSYour Name 
219*5113495bSYour Name 	return status;
220*5113495bSYour Name }
221*5113495bSYour Name #else
dp_peer_map_detach_li(struct dp_soc * soc)222*5113495bSYour Name static void dp_peer_map_detach_li(struct dp_soc *soc)
223*5113495bSYour Name {
224*5113495bSYour Name }
225*5113495bSYour Name 
dp_peer_map_attach_li(struct dp_soc * soc)226*5113495bSYour Name static QDF_STATUS dp_peer_map_attach_li(struct dp_soc *soc)
227*5113495bSYour Name {
228*5113495bSYour Name 	soc->max_peer_id = soc->max_peers;
229*5113495bSYour Name 
230*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
231*5113495bSYour Name }
232*5113495bSYour Name #endif
233*5113495bSYour Name 
dp_peer_setup_li(struct cdp_soc_t * soc_hdl,uint8_t vdev_id,uint8_t * peer_mac,struct cdp_peer_setup_info * setup_info)234*5113495bSYour Name static QDF_STATUS dp_peer_setup_li(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
235*5113495bSYour Name 				   uint8_t *peer_mac,
236*5113495bSYour Name 				   struct cdp_peer_setup_info *setup_info)
237*5113495bSYour Name {
238*5113495bSYour Name 	return dp_peer_setup_wifi3(soc_hdl, vdev_id, peer_mac, setup_info);
239*5113495bSYour Name }
240*5113495bSYour Name 
dp_get_soc_context_size_li(void)241*5113495bSYour Name qdf_size_t dp_get_soc_context_size_li(void)
242*5113495bSYour Name {
243*5113495bSYour Name 	return sizeof(struct dp_soc);
244*5113495bSYour Name }
245*5113495bSYour Name 
246*5113495bSYour Name #ifdef NO_RX_PKT_HDR_TLV
247*5113495bSYour Name /**
248*5113495bSYour Name  * dp_rxdma_ring_sel_cfg_li() - Setup RXDMA ring config
249*5113495bSYour Name  * @soc: Common DP soc handle
250*5113495bSYour Name  *
251*5113495bSYour Name  * Return: QDF_STATUS
252*5113495bSYour Name  */
253*5113495bSYour Name static QDF_STATUS
dp_rxdma_ring_sel_cfg_li(struct dp_soc * soc)254*5113495bSYour Name dp_rxdma_ring_sel_cfg_li(struct dp_soc *soc)
255*5113495bSYour Name {
256*5113495bSYour Name 	int i;
257*5113495bSYour Name 	int mac_id;
258*5113495bSYour Name 	struct htt_rx_ring_tlv_filter htt_tlv_filter = {0};
259*5113495bSYour Name 	struct dp_srng *rx_mac_srng;
260*5113495bSYour Name 	QDF_STATUS status = QDF_STATUS_SUCCESS;
261*5113495bSYour Name 	uint32_t target_type = hal_get_target_type(soc->hal_soc);
262*5113495bSYour Name 	uint16_t buf_size;
263*5113495bSYour Name 
264*5113495bSYour Name 	buf_size = wlan_cfg_rx_buffer_size(soc->wlan_cfg_ctx);
265*5113495bSYour Name 
266*5113495bSYour Name 	if (target_type == TARGET_TYPE_QCN9160)
267*5113495bSYour Name 		return status;
268*5113495bSYour Name 
269*5113495bSYour Name 	htt_tlv_filter.mpdu_start = 1;
270*5113495bSYour Name 	htt_tlv_filter.msdu_start = 1;
271*5113495bSYour Name 	htt_tlv_filter.mpdu_end = 1;
272*5113495bSYour Name 	htt_tlv_filter.msdu_end = 1;
273*5113495bSYour Name 	htt_tlv_filter.attention = 1;
274*5113495bSYour Name 	htt_tlv_filter.packet = 1;
275*5113495bSYour Name 	htt_tlv_filter.packet_header = 0;
276*5113495bSYour Name 
277*5113495bSYour Name 	htt_tlv_filter.ppdu_start = 0;
278*5113495bSYour Name 	htt_tlv_filter.ppdu_end = 0;
279*5113495bSYour Name 	htt_tlv_filter.ppdu_end_user_stats = 0;
280*5113495bSYour Name 	htt_tlv_filter.ppdu_end_user_stats_ext = 0;
281*5113495bSYour Name 	htt_tlv_filter.ppdu_end_status_done = 0;
282*5113495bSYour Name 	htt_tlv_filter.enable_fp = 1;
283*5113495bSYour Name 	htt_tlv_filter.enable_md = 0;
284*5113495bSYour Name 	htt_tlv_filter.enable_md = 0;
285*5113495bSYour Name 	htt_tlv_filter.enable_mo = 0;
286*5113495bSYour Name 
287*5113495bSYour Name 	htt_tlv_filter.fp_mgmt_filter = 0;
288*5113495bSYour Name 	htt_tlv_filter.fp_ctrl_filter = FILTER_CTRL_BA_REQ;
289*5113495bSYour Name 	htt_tlv_filter.fp_data_filter = (FILTER_DATA_UCAST |
290*5113495bSYour Name 					 FILTER_DATA_MCAST |
291*5113495bSYour Name 					 FILTER_DATA_DATA);
292*5113495bSYour Name 	htt_tlv_filter.mo_mgmt_filter = 0;
293*5113495bSYour Name 	htt_tlv_filter.mo_ctrl_filter = 0;
294*5113495bSYour Name 	htt_tlv_filter.mo_data_filter = 0;
295*5113495bSYour Name 	htt_tlv_filter.md_data_filter = 0;
296*5113495bSYour Name 
297*5113495bSYour Name 	htt_tlv_filter.offset_valid = true;
298*5113495bSYour Name 
299*5113495bSYour Name 	htt_tlv_filter.rx_packet_offset = soc->rx_pkt_tlv_size;
300*5113495bSYour Name 	/*Not subscribing rx_pkt_header*/
301*5113495bSYour Name 	htt_tlv_filter.rx_header_offset = 0;
302*5113495bSYour Name 	htt_tlv_filter.rx_mpdu_start_offset =
303*5113495bSYour Name 				hal_rx_mpdu_start_offset_get(soc->hal_soc);
304*5113495bSYour Name 	htt_tlv_filter.rx_mpdu_end_offset =
305*5113495bSYour Name 				hal_rx_mpdu_end_offset_get(soc->hal_soc);
306*5113495bSYour Name 	htt_tlv_filter.rx_msdu_start_offset =
307*5113495bSYour Name 				hal_rx_msdu_start_offset_get(soc->hal_soc);
308*5113495bSYour Name 	htt_tlv_filter.rx_msdu_end_offset =
309*5113495bSYour Name 				hal_rx_msdu_end_offset_get(soc->hal_soc);
310*5113495bSYour Name 	htt_tlv_filter.rx_attn_offset =
311*5113495bSYour Name 				hal_rx_attn_offset_get(soc->hal_soc);
312*5113495bSYour Name 
313*5113495bSYour Name 	for (i = 0; i < MAX_PDEV_CNT; i++) {
314*5113495bSYour Name 		struct dp_pdev *pdev = soc->pdev_list[i];
315*5113495bSYour Name 
316*5113495bSYour Name 		if (!pdev)
317*5113495bSYour Name 			continue;
318*5113495bSYour Name 
319*5113495bSYour Name 		for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
320*5113495bSYour Name 			int mac_for_pdev =
321*5113495bSYour Name 				dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id);
322*5113495bSYour Name 			/*
323*5113495bSYour Name 			 * Obtain lmac id from pdev to access the LMAC ring
324*5113495bSYour Name 			 * in soc context
325*5113495bSYour Name 			 */
326*5113495bSYour Name 			int lmac_id =
327*5113495bSYour Name 				dp_get_lmac_id_for_pdev_id(soc, mac_id,
328*5113495bSYour Name 							   pdev->pdev_id);
329*5113495bSYour Name 
330*5113495bSYour Name 			rx_mac_srng = dp_get_rxdma_ring(pdev, lmac_id);
331*5113495bSYour Name 			htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
332*5113495bSYour Name 					    rx_mac_srng->hal_srng,
333*5113495bSYour Name 					    RXDMA_BUF, buf_size,
334*5113495bSYour Name 					    &htt_tlv_filter);
335*5113495bSYour Name 		}
336*5113495bSYour Name 	}
337*5113495bSYour Name 	return status;
338*5113495bSYour Name }
339*5113495bSYour Name #else
340*5113495bSYour Name 
341*5113495bSYour Name static QDF_STATUS
dp_rxdma_ring_sel_cfg_li(struct dp_soc * soc)342*5113495bSYour Name dp_rxdma_ring_sel_cfg_li(struct dp_soc *soc)
343*5113495bSYour Name {
344*5113495bSYour Name 	int i;
345*5113495bSYour Name 	int mac_id;
346*5113495bSYour Name 	struct htt_rx_ring_tlv_filter htt_tlv_filter = {0};
347*5113495bSYour Name 	struct dp_srng *rx_mac_srng;
348*5113495bSYour Name 	QDF_STATUS status = QDF_STATUS_SUCCESS;
349*5113495bSYour Name 	uint32_t target_type = hal_get_target_type(soc->hal_soc);
350*5113495bSYour Name 	uint16_t buf_size;
351*5113495bSYour Name 
352*5113495bSYour Name 	buf_size = wlan_cfg_rx_buffer_size(soc->wlan_cfg_ctx);
353*5113495bSYour Name 
354*5113495bSYour Name 	if (target_type == TARGET_TYPE_QCN9160)
355*5113495bSYour Name 		return status;
356*5113495bSYour Name 
357*5113495bSYour Name 	htt_tlv_filter.mpdu_start = 1;
358*5113495bSYour Name 	htt_tlv_filter.msdu_start = 1;
359*5113495bSYour Name 	htt_tlv_filter.mpdu_end = 1;
360*5113495bSYour Name 	htt_tlv_filter.msdu_end = 1;
361*5113495bSYour Name 	htt_tlv_filter.attention = 1;
362*5113495bSYour Name 	htt_tlv_filter.packet = 1;
363*5113495bSYour Name 	htt_tlv_filter.packet_header = 1;
364*5113495bSYour Name 
365*5113495bSYour Name 	htt_tlv_filter.ppdu_start = 0;
366*5113495bSYour Name 	htt_tlv_filter.ppdu_end = 0;
367*5113495bSYour Name 	htt_tlv_filter.ppdu_end_user_stats = 0;
368*5113495bSYour Name 	htt_tlv_filter.ppdu_end_user_stats_ext = 0;
369*5113495bSYour Name 	htt_tlv_filter.ppdu_end_status_done = 0;
370*5113495bSYour Name 	htt_tlv_filter.enable_fp = 1;
371*5113495bSYour Name 	htt_tlv_filter.enable_md = 0;
372*5113495bSYour Name 	htt_tlv_filter.enable_md = 0;
373*5113495bSYour Name 	htt_tlv_filter.enable_mo = 0;
374*5113495bSYour Name 
375*5113495bSYour Name 	htt_tlv_filter.fp_mgmt_filter = 0;
376*5113495bSYour Name 	htt_tlv_filter.fp_ctrl_filter = FILTER_CTRL_BA_REQ;
377*5113495bSYour Name 	htt_tlv_filter.fp_data_filter = (FILTER_DATA_UCAST |
378*5113495bSYour Name 					 FILTER_DATA_MCAST |
379*5113495bSYour Name 					 FILTER_DATA_DATA);
380*5113495bSYour Name 	htt_tlv_filter.mo_mgmt_filter = 0;
381*5113495bSYour Name 	htt_tlv_filter.mo_ctrl_filter = 0;
382*5113495bSYour Name 	htt_tlv_filter.mo_data_filter = 0;
383*5113495bSYour Name 	htt_tlv_filter.md_data_filter = 0;
384*5113495bSYour Name 
385*5113495bSYour Name 	htt_tlv_filter.offset_valid = true;
386*5113495bSYour Name 
387*5113495bSYour Name 	htt_tlv_filter.rx_packet_offset = soc->rx_pkt_tlv_size;
388*5113495bSYour Name 	htt_tlv_filter.rx_header_offset =
389*5113495bSYour Name 				hal_rx_pkt_tlv_offset_get(soc->hal_soc);
390*5113495bSYour Name 	htt_tlv_filter.rx_mpdu_start_offset =
391*5113495bSYour Name 				hal_rx_mpdu_start_offset_get(soc->hal_soc);
392*5113495bSYour Name 	htt_tlv_filter.rx_mpdu_end_offset =
393*5113495bSYour Name 				hal_rx_mpdu_end_offset_get(soc->hal_soc);
394*5113495bSYour Name 	htt_tlv_filter.rx_msdu_start_offset =
395*5113495bSYour Name 				hal_rx_msdu_start_offset_get(soc->hal_soc);
396*5113495bSYour Name 	htt_tlv_filter.rx_msdu_end_offset =
397*5113495bSYour Name 				hal_rx_msdu_end_offset_get(soc->hal_soc);
398*5113495bSYour Name 	htt_tlv_filter.rx_attn_offset =
399*5113495bSYour Name 				hal_rx_attn_offset_get(soc->hal_soc);
400*5113495bSYour Name 
401*5113495bSYour Name 	for (i = 0; i < MAX_PDEV_CNT; i++) {
402*5113495bSYour Name 		struct dp_pdev *pdev = soc->pdev_list[i];
403*5113495bSYour Name 
404*5113495bSYour Name 		if (!pdev)
405*5113495bSYour Name 			continue;
406*5113495bSYour Name 
407*5113495bSYour Name 		for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) {
408*5113495bSYour Name 			int mac_for_pdev =
409*5113495bSYour Name 				dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id);
410*5113495bSYour Name 			/*
411*5113495bSYour Name 			 * Obtain lmac id from pdev to access the LMAC ring
412*5113495bSYour Name 			 * in soc context
413*5113495bSYour Name 			 */
414*5113495bSYour Name 			int lmac_id =
415*5113495bSYour Name 				dp_get_lmac_id_for_pdev_id(soc, mac_id,
416*5113495bSYour Name 							   pdev->pdev_id);
417*5113495bSYour Name 
418*5113495bSYour Name 			rx_mac_srng = dp_get_rxdma_ring(pdev, lmac_id);
419*5113495bSYour Name 			htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev,
420*5113495bSYour Name 					    rx_mac_srng->hal_srng,
421*5113495bSYour Name 					    RXDMA_BUF, buf_size,
422*5113495bSYour Name 					    &htt_tlv_filter);
423*5113495bSYour Name 		}
424*5113495bSYour Name 	}
425*5113495bSYour Name 	return status;
426*5113495bSYour Name 
427*5113495bSYour Name }
428*5113495bSYour Name #endif
429*5113495bSYour Name 
430*5113495bSYour Name static inline
dp_srng_init_li(struct dp_soc * soc,struct dp_srng * srng,int ring_type,int ring_num,int mac_id)431*5113495bSYour Name QDF_STATUS dp_srng_init_li(struct dp_soc *soc, struct dp_srng *srng,
432*5113495bSYour Name 			   int ring_type, int ring_num, int mac_id)
433*5113495bSYour Name {
434*5113495bSYour Name 	return dp_srng_init_idx(soc, srng, ring_type, ring_num, mac_id, 0);
435*5113495bSYour Name }
436*5113495bSYour Name 
437*5113495bSYour Name #ifdef QCA_DP_ENABLE_TX_COMP_RING4
438*5113495bSYour Name static inline
dp_deinit_txcomp_ring4(struct dp_soc * soc)439*5113495bSYour Name void dp_deinit_txcomp_ring4(struct dp_soc *soc)
440*5113495bSYour Name {
441*5113495bSYour Name 	if (soc) {
442*5113495bSYour Name 		wlan_minidump_remove(soc->tx_comp_ring[3].base_vaddr_unaligned,
443*5113495bSYour Name 				     soc->tx_comp_ring[3].alloc_size,
444*5113495bSYour Name 				     soc->ctrl_psoc, WLAN_MD_DP_SRNG_TX_COMP,
445*5113495bSYour Name 				     "Transmit_completion_ring");
446*5113495bSYour Name 		dp_srng_deinit(soc, &soc->tx_comp_ring[3], WBM2SW_RELEASE, 0);
447*5113495bSYour Name 	}
448*5113495bSYour Name }
449*5113495bSYour Name 
450*5113495bSYour Name static inline
dp_init_txcomp_ring4(struct dp_soc * soc)451*5113495bSYour Name QDF_STATUS dp_init_txcomp_ring4(struct dp_soc *soc)
452*5113495bSYour Name {
453*5113495bSYour Name 	if (soc) {
454*5113495bSYour Name 		if (dp_srng_init(soc, &soc->tx_comp_ring[3],
455*5113495bSYour Name 				 WBM2SW_RELEASE, WBM2SW_TXCOMP_RING4_NUM, 0)) {
456*5113495bSYour Name 			dp_err("%pK: dp_srng_init failed for rx_rel_ring",
457*5113495bSYour Name 			       soc);
458*5113495bSYour Name 			return QDF_STATUS_E_FAILURE;
459*5113495bSYour Name 		}
460*5113495bSYour Name 		wlan_minidump_log(soc->tx_comp_ring[3].base_vaddr_unaligned,
461*5113495bSYour Name 				  soc->tx_comp_ring[3].alloc_size,
462*5113495bSYour Name 				  soc->ctrl_psoc, WLAN_MD_DP_SRNG_TX_COMP,
463*5113495bSYour Name 				  "Transmit_completion_ring");
464*5113495bSYour Name 	}
465*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
466*5113495bSYour Name }
467*5113495bSYour Name 
468*5113495bSYour Name static inline
dp_free_txcomp_ring4(struct dp_soc * soc)469*5113495bSYour Name void dp_free_txcomp_ring4(struct dp_soc *soc)
470*5113495bSYour Name {
471*5113495bSYour Name 	if (soc)
472*5113495bSYour Name 		dp_srng_free(soc, &soc->tx_comp_ring[3]);
473*5113495bSYour Name }
474*5113495bSYour Name 
475*5113495bSYour Name static inline
dp_alloc_txcomp_ring4(struct dp_soc * soc,uint32_t tx_comp_ring_size,uint32_t cached)476*5113495bSYour Name QDF_STATUS dp_alloc_txcomp_ring4(struct dp_soc *soc, uint32_t tx_comp_ring_size,
477*5113495bSYour Name 				 uint32_t cached)
478*5113495bSYour Name {
479*5113495bSYour Name 	if (soc) {
480*5113495bSYour Name 		if (dp_srng_alloc(soc, &soc->tx_comp_ring[3], WBM2SW_RELEASE,
481*5113495bSYour Name 				  tx_comp_ring_size, cached)) {
482*5113495bSYour Name 			dp_err("dp_srng_alloc failed for tx_comp_ring");
483*5113495bSYour Name 			return QDF_STATUS_E_FAILURE;
484*5113495bSYour Name 		}
485*5113495bSYour Name 	}
486*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
487*5113495bSYour Name }
488*5113495bSYour Name #else
489*5113495bSYour Name static inline
dp_deinit_txcomp_ring4(struct dp_soc * soc)490*5113495bSYour Name void dp_deinit_txcomp_ring4(struct dp_soc *soc)
491*5113495bSYour Name {
492*5113495bSYour Name }
493*5113495bSYour Name 
494*5113495bSYour Name static inline
dp_init_txcomp_ring4(struct dp_soc * soc)495*5113495bSYour Name QDF_STATUS dp_init_txcomp_ring4(struct dp_soc *soc)
496*5113495bSYour Name {
497*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
498*5113495bSYour Name }
499*5113495bSYour Name 
500*5113495bSYour Name static inline
dp_free_txcomp_ring4(struct dp_soc * soc)501*5113495bSYour Name void dp_free_txcomp_ring4(struct dp_soc *soc)
502*5113495bSYour Name {
503*5113495bSYour Name }
504*5113495bSYour Name 
505*5113495bSYour Name static inline
dp_alloc_txcomp_ring4(struct dp_soc * soc,uint32_t tx_comp_ring_size,uint32_t cached)506*5113495bSYour Name QDF_STATUS dp_alloc_txcomp_ring4(struct dp_soc *soc, uint32_t tx_comp_ring_size,
507*5113495bSYour Name 				 uint32_t cached)
508*5113495bSYour Name {
509*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
510*5113495bSYour Name }
511*5113495bSYour Name #endif
512*5113495bSYour Name 
dp_soc_srng_deinit_li(struct dp_soc * soc)513*5113495bSYour Name static void dp_soc_srng_deinit_li(struct dp_soc *soc)
514*5113495bSYour Name {
515*5113495bSYour Name 	/* Tx Complete ring */
516*5113495bSYour Name 	dp_deinit_txcomp_ring4(soc);
517*5113495bSYour Name }
518*5113495bSYour Name 
dp_soc_srng_free_li(struct dp_soc * soc)519*5113495bSYour Name static void dp_soc_srng_free_li(struct dp_soc *soc)
520*5113495bSYour Name {
521*5113495bSYour Name 	dp_free_txcomp_ring4(soc);
522*5113495bSYour Name }
523*5113495bSYour Name 
dp_soc_srng_alloc_li(struct dp_soc * soc)524*5113495bSYour Name static QDF_STATUS dp_soc_srng_alloc_li(struct dp_soc *soc)
525*5113495bSYour Name {
526*5113495bSYour Name 	uint32_t tx_comp_ring_size;
527*5113495bSYour Name 	uint32_t cached = WLAN_CFG_DST_RING_CACHED_DESC;
528*5113495bSYour Name 	struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
529*5113495bSYour Name 
530*5113495bSYour Name 	soc_cfg_ctx = soc->wlan_cfg_ctx;
531*5113495bSYour Name 
532*5113495bSYour Name 	tx_comp_ring_size = wlan_cfg_tx_comp_ring_size(soc_cfg_ctx);
533*5113495bSYour Name 	/* Disable cached desc if NSS offload is enabled */
534*5113495bSYour Name 	if (wlan_cfg_get_dp_soc_nss_cfg(soc_cfg_ctx))
535*5113495bSYour Name 		cached = 0;
536*5113495bSYour Name 
537*5113495bSYour Name 	if (dp_alloc_txcomp_ring4(soc, tx_comp_ring_size, cached))
538*5113495bSYour Name 		goto fail1;
539*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
540*5113495bSYour Name fail1:
541*5113495bSYour Name 	dp_soc_srng_free_li(soc);
542*5113495bSYour Name 	return QDF_STATUS_E_NOMEM;
543*5113495bSYour Name }
544*5113495bSYour Name 
dp_soc_srng_init_li(struct dp_soc * soc)545*5113495bSYour Name static QDF_STATUS dp_soc_srng_init_li(struct dp_soc *soc)
546*5113495bSYour Name {
547*5113495bSYour Name 	/* Tx comp ring 3 */
548*5113495bSYour Name 	if (dp_init_txcomp_ring4(soc))
549*5113495bSYour Name 		goto fail1;
550*5113495bSYour Name 
551*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
552*5113495bSYour Name fail1:
553*5113495bSYour Name 	/*
554*5113495bSYour Name 	 * Cleanup will be done as part of soc_detach, which will
555*5113495bSYour Name 	 * be called on pdev attach failure
556*5113495bSYour Name 	 */
557*5113495bSYour Name 	dp_soc_srng_deinit_li(soc);
558*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
559*5113495bSYour Name }
560*5113495bSYour Name 
dp_tx_implicit_rbm_set_li(struct dp_soc * soc,uint8_t tx_ring_id,uint8_t bm_id)561*5113495bSYour Name static void dp_tx_implicit_rbm_set_li(struct dp_soc *soc,
562*5113495bSYour Name 				      uint8_t tx_ring_id,
563*5113495bSYour Name 				      uint8_t bm_id)
564*5113495bSYour Name {
565*5113495bSYour Name }
566*5113495bSYour Name 
dp_txrx_set_vdev_param_li(struct dp_soc * soc,struct dp_vdev * vdev,enum cdp_vdev_param_type param,cdp_config_param_type val)567*5113495bSYour Name static QDF_STATUS dp_txrx_set_vdev_param_li(struct dp_soc *soc,
568*5113495bSYour Name 					    struct dp_vdev *vdev,
569*5113495bSYour Name 					    enum cdp_vdev_param_type param,
570*5113495bSYour Name 					    cdp_config_param_type val)
571*5113495bSYour Name {
572*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
573*5113495bSYour Name }
574*5113495bSYour Name 
575*5113495bSYour Name bool
dp_rx_intrabss_handle_nawds_li(struct dp_soc * soc,struct dp_txrx_peer * ta_peer,qdf_nbuf_t nbuf_copy,struct cdp_tid_rx_stats * tid_stats,uint8_t link_id)576*5113495bSYour Name dp_rx_intrabss_handle_nawds_li(struct dp_soc *soc, struct dp_txrx_peer *ta_peer,
577*5113495bSYour Name 			       qdf_nbuf_t nbuf_copy,
578*5113495bSYour Name 			       struct cdp_tid_rx_stats *tid_stats,
579*5113495bSYour Name 			       uint8_t link_id)
580*5113495bSYour Name {
581*5113495bSYour Name 	return false;
582*5113495bSYour Name }
583*5113495bSYour Name 
dp_rx_word_mask_subscribe_li(struct dp_soc * soc,uint32_t * msg_word,void * rx_filter)584*5113495bSYour Name static void dp_rx_word_mask_subscribe_li(struct dp_soc *soc,
585*5113495bSYour Name 					 uint32_t *msg_word,
586*5113495bSYour Name 					 void *rx_filter)
587*5113495bSYour Name {
588*5113495bSYour Name }
589*5113495bSYour Name 
dp_get_rx_hash_key_li(struct dp_soc * soc,struct cdp_lro_hash_config * lro_hash)590*5113495bSYour Name static void dp_get_rx_hash_key_li(struct dp_soc *soc,
591*5113495bSYour Name 				  struct cdp_lro_hash_config *lro_hash)
592*5113495bSYour Name {
593*5113495bSYour Name 	dp_get_rx_hash_key_bytes(lro_hash);
594*5113495bSYour Name }
595*5113495bSYour Name 
dp_peer_get_reo_hash_li(struct dp_vdev * vdev,struct cdp_peer_setup_info * setup_info,enum cdp_host_reo_dest_ring * reo_dest,bool * hash_based,uint8_t * lmac_peer_id_msb)596*5113495bSYour Name static void dp_peer_get_reo_hash_li(struct dp_vdev *vdev,
597*5113495bSYour Name 				    struct cdp_peer_setup_info *setup_info,
598*5113495bSYour Name 				    enum cdp_host_reo_dest_ring *reo_dest,
599*5113495bSYour Name 				    bool *hash_based,
600*5113495bSYour Name 				    uint8_t *lmac_peer_id_msb)
601*5113495bSYour Name {
602*5113495bSYour Name 	dp_vdev_get_default_reo_hash(vdev, reo_dest, hash_based);
603*5113495bSYour Name }
604*5113495bSYour Name 
dp_reo_remap_config_li(struct dp_soc * soc,uint32_t * remap0,uint32_t * remap1,uint32_t * remap2)605*5113495bSYour Name static bool dp_reo_remap_config_li(struct dp_soc *soc,
606*5113495bSYour Name 				   uint32_t *remap0,
607*5113495bSYour Name 				   uint32_t *remap1,
608*5113495bSYour Name 				   uint32_t *remap2)
609*5113495bSYour Name {
610*5113495bSYour Name 	return dp_reo_remap_config(soc, remap0, remap1, remap2);
611*5113495bSYour Name }
612*5113495bSYour Name 
dp_soc_get_num_soc_li(struct dp_soc * soc)613*5113495bSYour Name static uint8_t dp_soc_get_num_soc_li(struct dp_soc *soc)
614*5113495bSYour Name {
615*5113495bSYour Name 	return 1;
616*5113495bSYour Name }
617*5113495bSYour Name 
dp_txrx_get_vdev_mcast_param_li(struct dp_soc * soc,struct dp_vdev * vdev,cdp_config_param_type * val)618*5113495bSYour Name static QDF_STATUS dp_txrx_get_vdev_mcast_param_li(struct dp_soc *soc,
619*5113495bSYour Name 						  struct dp_vdev *vdev,
620*5113495bSYour Name 						  cdp_config_param_type *val)
621*5113495bSYour Name {
622*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
623*5113495bSYour Name }
624*5113495bSYour Name 
dp_get_hw_link_id_li(struct dp_pdev * pdev)625*5113495bSYour Name static uint8_t dp_get_hw_link_id_li(struct dp_pdev *pdev)
626*5113495bSYour Name {
627*5113495bSYour Name 	return 0;
628*5113495bSYour Name }
629*5113495bSYour Name 
dp_get_vdev_stats_for_unmap_peer_li(struct dp_vdev * vdev,struct dp_peer * peer)630*5113495bSYour Name static void dp_get_vdev_stats_for_unmap_peer_li(
631*5113495bSYour Name 					struct dp_vdev *vdev,
632*5113495bSYour Name 					struct dp_peer *peer)
633*5113495bSYour Name {
634*5113495bSYour Name 	dp_get_vdev_stats_for_unmap_peer_legacy(vdev, peer);
635*5113495bSYour Name }
636*5113495bSYour Name 
637*5113495bSYour Name static struct
dp_get_soc_by_chip_id_li(struct dp_soc * soc,uint8_t chip_id)638*5113495bSYour Name dp_soc *dp_get_soc_by_chip_id_li(struct dp_soc *soc,
639*5113495bSYour Name 				 uint8_t chip_id)
640*5113495bSYour Name {
641*5113495bSYour Name 	return soc;
642*5113495bSYour Name }
643*5113495bSYour Name 
dp_initialize_arch_ops_li(struct dp_arch_ops * arch_ops)644*5113495bSYour Name void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops)
645*5113495bSYour Name {
646*5113495bSYour Name #ifndef QCA_HOST_MODE_WIFI_DISABLED
647*5113495bSYour Name 	arch_ops->tx_hw_enqueue = dp_tx_hw_enqueue_li;
648*5113495bSYour Name 	arch_ops->dp_rx_process = dp_rx_process_li;
649*5113495bSYour Name 	arch_ops->dp_tx_send_fast = dp_tx_send;
650*5113495bSYour Name 	arch_ops->tx_comp_get_params_from_hal_desc =
651*5113495bSYour Name 		dp_tx_comp_get_params_from_hal_desc_li;
652*5113495bSYour Name 	arch_ops->dp_tx_process_htt_completion =
653*5113495bSYour Name 			dp_tx_process_htt_completion_li;
654*5113495bSYour Name 	arch_ops->dp_wbm_get_rx_desc_from_hal_desc =
655*5113495bSYour Name 			dp_wbm_get_rx_desc_from_hal_desc_li;
656*5113495bSYour Name 	arch_ops->dp_tx_desc_pool_alloc = dp_tx_desc_pool_alloc_li;
657*5113495bSYour Name 	arch_ops->dp_tx_desc_pool_free = dp_tx_desc_pool_free_li;
658*5113495bSYour Name 	arch_ops->dp_tx_desc_pool_init = dp_tx_desc_pool_init_li;
659*5113495bSYour Name 	arch_ops->dp_tx_desc_pool_deinit = dp_tx_desc_pool_deinit_li;
660*5113495bSYour Name 	arch_ops->dp_rx_desc_pool_init = dp_rx_desc_pool_init_li;
661*5113495bSYour Name 	arch_ops->dp_rx_desc_pool_deinit = dp_rx_desc_pool_deinit_li;
662*5113495bSYour Name 	arch_ops->dp_tx_compute_hw_delay = dp_tx_compute_tx_delay_li;
663*5113495bSYour Name 	arch_ops->dp_rx_chain_msdus = dp_rx_chain_msdus_li;
664*5113495bSYour Name 	arch_ops->dp_rx_wbm_err_reap_desc = dp_rx_wbm_err_reap_desc_li;
665*5113495bSYour Name 	arch_ops->dp_rx_null_q_desc_handle = dp_rx_null_q_desc_handle_li;
666*5113495bSYour Name #else
667*5113495bSYour Name 	arch_ops->dp_rx_desc_pool_init = dp_rx_desc_pool_init_generic;
668*5113495bSYour Name 	arch_ops->dp_rx_desc_pool_deinit = dp_rx_desc_pool_deinit_generic;
669*5113495bSYour Name #endif
670*5113495bSYour Name 	arch_ops->txrx_get_context_size = dp_get_context_size_li;
671*5113495bSYour Name #ifdef WIFI_MONITOR_SUPPORT
672*5113495bSYour Name 	arch_ops->txrx_get_mon_context_size = dp_mon_get_context_size_li;
673*5113495bSYour Name #endif
674*5113495bSYour Name 	arch_ops->txrx_soc_attach = dp_soc_attach_li;
675*5113495bSYour Name 	arch_ops->txrx_soc_detach = dp_soc_detach_li;
676*5113495bSYour Name 	arch_ops->txrx_soc_init = dp_soc_init_li;
677*5113495bSYour Name 	arch_ops->txrx_soc_deinit = dp_soc_deinit_li;
678*5113495bSYour Name 	arch_ops->txrx_soc_srng_alloc = dp_soc_srng_alloc_li;
679*5113495bSYour Name 	arch_ops->txrx_soc_srng_init = dp_soc_srng_init_li;
680*5113495bSYour Name 	arch_ops->txrx_soc_srng_deinit = dp_soc_srng_deinit_li;
681*5113495bSYour Name 	arch_ops->txrx_soc_srng_free = dp_soc_srng_free_li;
682*5113495bSYour Name 	arch_ops->txrx_pdev_attach = dp_pdev_attach_li;
683*5113495bSYour Name 	arch_ops->txrx_pdev_detach = dp_pdev_detach_li;
684*5113495bSYour Name 	arch_ops->txrx_vdev_attach = dp_vdev_attach_li;
685*5113495bSYour Name 	arch_ops->txrx_vdev_detach = dp_vdev_detach_li;
686*5113495bSYour Name 	arch_ops->txrx_peer_map_attach = dp_peer_map_attach_li;
687*5113495bSYour Name 	arch_ops->txrx_peer_map_detach = dp_peer_map_detach_li;
688*5113495bSYour Name 	arch_ops->get_rx_hash_key = dp_get_rx_hash_key_li;
689*5113495bSYour Name 	arch_ops->dp_set_rx_fst = NULL;
690*5113495bSYour Name 	arch_ops->dp_get_rx_fst = NULL;
691*5113495bSYour Name 	arch_ops->dp_rx_fst_ref = NULL;
692*5113495bSYour Name 	arch_ops->dp_rx_fst_deref = NULL;
693*5113495bSYour Name 	arch_ops->txrx_peer_setup = dp_peer_setup_li;
694*5113495bSYour Name 	arch_ops->dp_rx_desc_cookie_2_va =
695*5113495bSYour Name 			dp_rx_desc_cookie_2_va_li;
696*5113495bSYour Name 	arch_ops->dp_rx_intrabss_mcast_handler =
697*5113495bSYour Name 					dp_rx_intrabss_handle_nawds_li;
698*5113495bSYour Name 	arch_ops->dp_rx_word_mask_subscribe = dp_rx_word_mask_subscribe_li;
699*5113495bSYour Name 	arch_ops->dp_rxdma_ring_sel_cfg = dp_rxdma_ring_sel_cfg_li;
700*5113495bSYour Name 	arch_ops->dp_rx_peer_metadata_peer_id_get =
701*5113495bSYour Name 					dp_rx_peer_metadata_peer_id_get_li;
702*5113495bSYour Name 	arch_ops->soc_cfg_attach = dp_soc_cfg_attach_li;
703*5113495bSYour Name 	arch_ops->tx_implicit_rbm_set = dp_tx_implicit_rbm_set_li;
704*5113495bSYour Name 	arch_ops->txrx_set_vdev_param = dp_txrx_set_vdev_param_li;
705*5113495bSYour Name 	arch_ops->txrx_print_peer_stats = dp_print_peer_txrx_stats_li;
706*5113495bSYour Name 	arch_ops->dp_peer_rx_reorder_queue_setup =
707*5113495bSYour Name 					dp_peer_rx_reorder_queue_setup_li;
708*5113495bSYour Name 	arch_ops->peer_get_reo_hash = dp_peer_get_reo_hash_li;
709*5113495bSYour Name 	arch_ops->reo_remap_config = dp_reo_remap_config_li;
710*5113495bSYour Name 	arch_ops->dp_get_soc_by_chip_id = dp_get_soc_by_chip_id_li;
711*5113495bSYour Name 	arch_ops->dp_soc_get_num_soc = dp_soc_get_num_soc_li;
712*5113495bSYour Name 	arch_ops->get_reo_qdesc_addr = dp_rx_get_reo_qdesc_addr_li;
713*5113495bSYour Name 	arch_ops->txrx_get_vdev_mcast_param = dp_txrx_get_vdev_mcast_param_li;
714*5113495bSYour Name 	arch_ops->get_hw_link_id = dp_get_hw_link_id_li;
715*5113495bSYour Name 	arch_ops->txrx_srng_init = dp_srng_init_li;
716*5113495bSYour Name 	arch_ops->dp_get_vdev_stats_for_unmap_peer =
717*5113495bSYour Name 					dp_get_vdev_stats_for_unmap_peer_li;
718*5113495bSYour Name 	arch_ops->dp_get_interface_stats = dp_txrx_get_vdev_stats;
719*5113495bSYour Name #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
720*5113495bSYour Name 	arch_ops->dp_update_ring_hptp = dp_update_ring_hptp;
721*5113495bSYour Name #endif
722*5113495bSYour Name 	arch_ops->dp_flush_tx_ring = dp_flush_tcl_ring;
723*5113495bSYour Name 	arch_ops->dp_soc_interrupt_attach = dp_soc_interrupt_attach_li;
724*5113495bSYour Name 	arch_ops->dp_soc_attach_poll = dp_soc_attach_poll_li;
725*5113495bSYour Name 	arch_ops->dp_soc_interrupt_detach = dp_soc_interrupt_detach_li;
726*5113495bSYour Name 	arch_ops->dp_service_srngs = dp_service_srngs_li;
727*5113495bSYour Name }
728*5113495bSYour Name 
729*5113495bSYour Name #ifdef QCA_DP_TX_HW_SW_NBUF_DESC_PREFETCH
dp_tx_comp_get_prefetched_params_from_hal_desc(struct dp_soc * soc,void * tx_comp_hal_desc,struct dp_tx_desc_s ** r_tx_desc)730*5113495bSYour Name void dp_tx_comp_get_prefetched_params_from_hal_desc(
731*5113495bSYour Name 					struct dp_soc *soc,
732*5113495bSYour Name 					void *tx_comp_hal_desc,
733*5113495bSYour Name 					struct dp_tx_desc_s **r_tx_desc)
734*5113495bSYour Name {
735*5113495bSYour Name 	uint8_t pool_id;
736*5113495bSYour Name 	uint32_t tx_desc_id;
737*5113495bSYour Name 
738*5113495bSYour Name 	tx_desc_id = hal_tx_comp_get_desc_id(tx_comp_hal_desc);
739*5113495bSYour Name 	pool_id = (tx_desc_id & DP_TX_DESC_ID_POOL_MASK) >>
740*5113495bSYour Name 		DP_TX_DESC_ID_POOL_OS;
741*5113495bSYour Name 
742*5113495bSYour Name 	/* Find Tx descriptor */
743*5113495bSYour Name 	*r_tx_desc = dp_tx_desc_find(soc, pool_id,
744*5113495bSYour Name 			(tx_desc_id & DP_TX_DESC_ID_PAGE_MASK) >>
745*5113495bSYour Name 			DP_TX_DESC_ID_PAGE_OS,
746*5113495bSYour Name 			(tx_desc_id & DP_TX_DESC_ID_OFFSET_MASK) >>
747*5113495bSYour Name 			DP_TX_DESC_ID_OFFSET_OS,
748*5113495bSYour Name 			(tx_desc_id & DP_TX_DESC_ID_SPCL_MASK));
749*5113495bSYour Name 	qdf_prefetch((uint8_t *)*r_tx_desc);
750*5113495bSYour Name }
751*5113495bSYour Name #endif
752