xref: /wlan-driver/qca-wifi-host-cmn/dp/wifi3.0/dp_rings.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021-2024 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 #ifndef _DP_RINGS_H_
21*5113495bSYour Name #define _DP_RINGS_H_
22*5113495bSYour Name 
23*5113495bSYour Name #include <dp_types.h>
24*5113495bSYour Name #include <dp_internal.h>
25*5113495bSYour Name #ifdef WIFI_MONITOR_SUPPORT
26*5113495bSYour Name #include <dp_mon.h>
27*5113495bSYour Name #endif
28*5113495bSYour Name 
29*5113495bSYour Name #ifdef WLAN_FEATURE_DP_EVENT_HISTORY
dp_is_mon_mask_valid(struct dp_soc * soc,struct dp_intr * intr_ctx)30*5113495bSYour Name static inline bool dp_is_mon_mask_valid(struct dp_soc *soc,
31*5113495bSYour Name 					struct dp_intr *intr_ctx)
32*5113495bSYour Name {
33*5113495bSYour Name 	if (intr_ctx->rx_mon_ring_mask)
34*5113495bSYour Name 		return true;
35*5113495bSYour Name 
36*5113495bSYour Name 	return false;
37*5113495bSYour Name }
38*5113495bSYour Name #else
dp_is_mon_mask_valid(struct dp_soc * soc,struct dp_intr * intr_ctx)39*5113495bSYour Name static inline bool dp_is_mon_mask_valid(struct dp_soc *soc,
40*5113495bSYour Name 					struct dp_intr *intr_ctx)
41*5113495bSYour Name {
42*5113495bSYour Name 	return false;
43*5113495bSYour Name }
44*5113495bSYour Name #endif
45*5113495bSYour Name 
46*5113495bSYour Name #ifndef QCA_HOST_MODE_WIFI_DISABLED
47*5113495bSYour Name 
48*5113495bSYour Name /**
49*5113495bSYour Name  * dp_srng_get_cpu() - Get the smp processor id for srng processing
50*5113495bSYour Name  *
51*5113495bSYour Name  * Return: smp processor id
52*5113495bSYour Name  */
dp_srng_get_cpu(void)53*5113495bSYour Name static inline int dp_srng_get_cpu(void)
54*5113495bSYour Name {
55*5113495bSYour Name 	return qdf_get_cpu();
56*5113495bSYour Name }
57*5113495bSYour Name 
58*5113495bSYour Name #else /* QCA_HOST_MODE_WIFI_DISABLED */
59*5113495bSYour Name 
60*5113495bSYour Name /**
61*5113495bSYour Name  * dp_srng_get_cpu() - Get the smp processor id for srng processing
62*5113495bSYour Name  *
63*5113495bSYour Name  * Return: smp processor id
64*5113495bSYour Name  */
dp_srng_get_cpu(void)65*5113495bSYour Name static inline int dp_srng_get_cpu(void)
66*5113495bSYour Name {
67*5113495bSYour Name 	return 0;
68*5113495bSYour Name }
69*5113495bSYour Name 
70*5113495bSYour Name #endif /* QCA_HOST_MODE_WIFI_DISABLED */
71*5113495bSYour Name 
72*5113495bSYour Name /**
73*5113495bSYour Name  * dp_interrupt_timer() - timer poll for interrupts
74*5113495bSYour Name  * @arg: SoC Handle
75*5113495bSYour Name  *
76*5113495bSYour Name  * Return:
77*5113495bSYour Name  *
78*5113495bSYour Name  */
79*5113495bSYour Name void dp_interrupt_timer(void *arg);
80*5113495bSYour Name 
81*5113495bSYour Name /**
82*5113495bSYour Name  * dp_soc_print_inactive_objects() - prints inactive peer and vdev list
83*5113495bSYour Name  * @soc: DP SOC handle
84*5113495bSYour Name  *
85*5113495bSYour Name  */
86*5113495bSYour Name void dp_soc_print_inactive_objects(struct dp_soc *soc);
87*5113495bSYour Name 
88*5113495bSYour Name /**
89*5113495bSYour Name  * dp_get_tx_pending() - read pending tx
90*5113495bSYour Name  * @pdev_handle: Datapath PDEV handle
91*5113495bSYour Name  *
92*5113495bSYour Name  * Return: outstanding tx
93*5113495bSYour Name  */
94*5113495bSYour Name int32_t dp_get_tx_pending(struct cdp_pdev *pdev_handle);
95*5113495bSYour Name 
96*5113495bSYour Name /**
97*5113495bSYour Name  * dp_find_missing_tx_comp() - check for leaked descriptor in tx path
98*5113495bSYour Name  * @soc: DP SOC context
99*5113495bSYour Name  *
100*5113495bSYour Name  * Parse through descriptors in all pools and validate magic number and
101*5113495bSYour Name  * completion time. Trigger self recovery if magic value is corrupted.
102*5113495bSYour Name  *
103*5113495bSYour Name  * Return: None.
104*5113495bSYour Name  */
105*5113495bSYour Name void dp_find_missing_tx_comp(struct dp_soc *soc);
106*5113495bSYour Name 
107*5113495bSYour Name void dp_enable_verbose_debug(struct dp_soc *soc);
108*5113495bSYour Name 
109*5113495bSYour Name QDF_STATUS dp_peer_legacy_setup(struct dp_soc *soc, struct dp_peer *peer);
110*5113495bSYour Name 
111*5113495bSYour Name uint32_t dp_service_srngs_wrapper(void *dp_ctx, uint32_t dp_budget, int cpu);
112*5113495bSYour Name 
113*5113495bSYour Name void dp_soc_interrupt_map_calculate(struct dp_soc *soc, int intr_ctx_num,
114*5113495bSYour Name 				    int *irq_id_map, int *num_irq);
115*5113495bSYour Name void dp_srng_msi_setup(struct dp_soc *soc, struct dp_srng *srng,
116*5113495bSYour Name 		       struct hal_srng_params *ring_params,
117*5113495bSYour Name 		       int ring_type, int ring_num);
118*5113495bSYour Name void
119*5113495bSYour Name dp_srng_configure_interrupt_thresholds(struct dp_soc *soc,
120*5113495bSYour Name 				       struct hal_srng_params *ring_params,
121*5113495bSYour Name 				       int ring_type, int ring_num,
122*5113495bSYour Name 				       int num_entries);
123*5113495bSYour Name 
124*5113495bSYour Name int dp_process_lmac_rings(struct dp_intr *int_ctx, int total_budget);
125*5113495bSYour Name 
126*5113495bSYour Name /**
127*5113495bSYour Name  * dp_service_lmac_rings()- timer to reap lmac rings
128*5113495bSYour Name  * @arg: SoC Handle
129*5113495bSYour Name  *
130*5113495bSYour Name  * Return:
131*5113495bSYour Name  *
132*5113495bSYour Name  */
133*5113495bSYour Name void dp_service_lmac_rings(void *arg);
134*5113495bSYour Name 
135*5113495bSYour Name /**
136*5113495bSYour Name  * dp_service_srngs() - Top level interrupt handler for DP Ring interrupts
137*5113495bSYour Name  * @dp_ctx: DP SOC handle
138*5113495bSYour Name  * @dp_budget: Number of frames/descriptors that can be processed in one shot
139*5113495bSYour Name  * @cpu: CPU on which this instance is running
140*5113495bSYour Name  *
141*5113495bSYour Name  * Return: remaining budget/quota for the soc device
142*5113495bSYour Name  */
143*5113495bSYour Name uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget, int cpu);
144*5113495bSYour Name 
145*5113495bSYour Name /**
146*5113495bSYour Name  * dp_soc_set_interrupt_mode() - Set the interrupt mode in soc
147*5113495bSYour Name  * @soc: DP soc handle
148*5113495bSYour Name  *
149*5113495bSYour Name  * Set the appropriate interrupt mode flag in the soc
150*5113495bSYour Name  */
151*5113495bSYour Name void dp_soc_set_interrupt_mode(struct dp_soc *soc);
152*5113495bSYour Name 
153*5113495bSYour Name /**
154*5113495bSYour Name  * dp_srng_find_ring_in_mask() - find which ext_group a ring belongs
155*5113495bSYour Name  * @ring_num: ring num of the ring being queried
156*5113495bSYour Name  * @grp_mask: the grp_mask array for the ring type in question.
157*5113495bSYour Name  *
158*5113495bSYour Name  * The grp_mask array is indexed by group number and the bit fields correspond
159*5113495bSYour Name  * to ring numbers.  We are finding which interrupt group a ring belongs to.
160*5113495bSYour Name  *
161*5113495bSYour Name  * Return: the index in the grp_mask array with the ring number.
162*5113495bSYour Name  * -QDF_STATUS_E_NOENT if no entry is found
163*5113495bSYour Name  */
dp_srng_find_ring_in_mask(int ring_num,uint8_t * grp_mask)164*5113495bSYour Name static inline int dp_srng_find_ring_in_mask(int ring_num, uint8_t *grp_mask)
165*5113495bSYour Name {
166*5113495bSYour Name 	int ext_group_num;
167*5113495bSYour Name 	uint8_t mask = 1 << ring_num;
168*5113495bSYour Name 
169*5113495bSYour Name 	for (ext_group_num = 0; ext_group_num < WLAN_CFG_INT_NUM_CONTEXTS;
170*5113495bSYour Name 	     ext_group_num++) {
171*5113495bSYour Name 		if (mask & grp_mask[ext_group_num])
172*5113495bSYour Name 			return ext_group_num;
173*5113495bSYour Name 	}
174*5113495bSYour Name 
175*5113495bSYour Name 	return -QDF_STATUS_E_NOENT;
176*5113495bSYour Name }
177*5113495bSYour Name 
178*5113495bSYour Name /* MCL specific functions */
179*5113495bSYour Name #if defined(DP_CON_MON)
180*5113495bSYour Name 
181*5113495bSYour Name #ifdef DP_CON_MON_MSI_ENABLED
182*5113495bSYour Name /**
183*5113495bSYour Name  * dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
184*5113495bSYour Name  * @soc: pointer to dp_soc handle
185*5113495bSYour Name  * @intr_ctx_num: interrupt context number for which mon mask is needed
186*5113495bSYour Name  *
187*5113495bSYour Name  * For MCL, monitor mode rings are being processed in timer contexts (polled).
188*5113495bSYour Name  * This function is returning 0, since in interrupt mode(softirq based RX),
189*5113495bSYour Name  * we donot want to process monitor mode rings in a softirq.
190*5113495bSYour Name  *
191*5113495bSYour Name  * So, in case packet log is enabled for SAP/STA/P2P modes,
192*5113495bSYour Name  * regular interrupt processing will not process monitor mode rings. It would be
193*5113495bSYour Name  * done in a separate timer context.
194*5113495bSYour Name  *
195*5113495bSYour Name  * Return: 0
196*5113495bSYour Name  */
197*5113495bSYour Name static inline uint32_t
dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc * soc,int intr_ctx_num)198*5113495bSYour Name dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx_num)
199*5113495bSYour Name {
200*5113495bSYour Name 	return wlan_cfg_get_rx_mon_ring_mask(soc->wlan_cfg_ctx, intr_ctx_num);
201*5113495bSYour Name }
202*5113495bSYour Name #else
203*5113495bSYour Name /**
204*5113495bSYour Name  * dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
205*5113495bSYour Name  * @soc: pointer to dp_soc handle
206*5113495bSYour Name  * @intr_ctx_num: interrupt context number for which mon mask is needed
207*5113495bSYour Name  *
208*5113495bSYour Name  * For MCL, monitor mode rings are being processed in timer contexts (polled).
209*5113495bSYour Name  * This function is returning 0, since in interrupt mode(softirq based RX),
210*5113495bSYour Name  * we donot want to process monitor mode rings in a softirq.
211*5113495bSYour Name  *
212*5113495bSYour Name  * So, in case packet log is enabled for SAP/STA/P2P modes,
213*5113495bSYour Name  * regular interrupt processing will not process monitor mode rings. It would be
214*5113495bSYour Name  * done in a separate timer context.
215*5113495bSYour Name  *
216*5113495bSYour Name  * Return: 0
217*5113495bSYour Name  */
218*5113495bSYour Name static inline uint32_t
dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc * soc,int intr_ctx_num)219*5113495bSYour Name dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx_num)
220*5113495bSYour Name {
221*5113495bSYour Name 	return 0;
222*5113495bSYour Name }
223*5113495bSYour Name #endif
224*5113495bSYour Name 
225*5113495bSYour Name #else
226*5113495bSYour Name 
227*5113495bSYour Name /**
228*5113495bSYour Name  * dp_soc_get_mon_mask_for_interrupt_mode() - get mon mode mask for intr mode
229*5113495bSYour Name  * @soc: pointer to dp_soc handle
230*5113495bSYour Name  * @intr_ctx_num: interrupt context number for which mon mask is needed
231*5113495bSYour Name  *
232*5113495bSYour Name  * Return: mon mask value
233*5113495bSYour Name  */
234*5113495bSYour Name static inline
dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc * soc,int intr_ctx_num)235*5113495bSYour Name uint32_t dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc,
236*5113495bSYour Name 						int intr_ctx_num)
237*5113495bSYour Name {
238*5113495bSYour Name 	return wlan_cfg_get_rx_mon_ring_mask(soc->wlan_cfg_ctx, intr_ctx_num);
239*5113495bSYour Name }
240*5113495bSYour Name #endif
241*5113495bSYour Name 
242*5113495bSYour Name #ifdef DISABLE_MON_RING_MSI_CFG
243*5113495bSYour Name /**
244*5113495bSYour Name  * dp_skip_msi_cfg() - Check if msi cfg has to be skipped for ring_type
245*5113495bSYour Name  * @soc: DP SoC context
246*5113495bSYour Name  * @ring_type: sring type
247*5113495bSYour Name  *
248*5113495bSYour Name  * Return: True if msi cfg should be skipped for srng type else false
249*5113495bSYour Name  */
dp_skip_msi_cfg(struct dp_soc * soc,int ring_type)250*5113495bSYour Name static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
251*5113495bSYour Name {
252*5113495bSYour Name 	if (ring_type == RXDMA_MONITOR_STATUS)
253*5113495bSYour Name 		return true;
254*5113495bSYour Name 
255*5113495bSYour Name 	return false;
256*5113495bSYour Name }
257*5113495bSYour Name #else
258*5113495bSYour Name #ifdef DP_CON_MON_MSI_ENABLED
259*5113495bSYour Name #ifdef WLAN_SOFTUMAC_SUPPORT
dp_skip_msi_cfg(struct dp_soc * soc,int ring_type)260*5113495bSYour Name static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
261*5113495bSYour Name {
262*5113495bSYour Name 	if (soc->cdp_soc.ol_ops->get_con_mode &&
263*5113495bSYour Name 	    soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) {
264*5113495bSYour Name 		if (ring_type != RXDMA_MONITOR_STATUS)
265*5113495bSYour Name 			return true;
266*5113495bSYour Name 	} else if (ring_type == RXDMA_MONITOR_STATUS &&
267*5113495bSYour Name 		   !dp_mon_mode_local_pkt_capture(soc)) {
268*5113495bSYour Name 		return true;
269*5113495bSYour Name 	}
270*5113495bSYour Name 
271*5113495bSYour Name 	return false;
272*5113495bSYour Name }
273*5113495bSYour Name #else
dp_skip_msi_cfg(struct dp_soc * soc,int ring_type)274*5113495bSYour Name static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
275*5113495bSYour Name {
276*5113495bSYour Name 	if (soc->cdp_soc.ol_ops->get_con_mode &&
277*5113495bSYour Name 	    soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) {
278*5113495bSYour Name 		if (ring_type == REO_DST || ring_type == RXDMA_DST)
279*5113495bSYour Name 			return true;
280*5113495bSYour Name 	} else if (ring_type == RXDMA_MONITOR_STATUS &&
281*5113495bSYour Name 		  !dp_mon_mode_local_pkt_capture(soc)) {
282*5113495bSYour Name 		return true;
283*5113495bSYour Name 	}
284*5113495bSYour Name 
285*5113495bSYour Name 	return false;
286*5113495bSYour Name }
287*5113495bSYour Name #endif
288*5113495bSYour Name #else
dp_skip_msi_cfg(struct dp_soc * soc,int ring_type)289*5113495bSYour Name static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
290*5113495bSYour Name {
291*5113495bSYour Name 	return false;
292*5113495bSYour Name }
293*5113495bSYour Name #endif /* DP_CON_MON_MSI_ENABLED */
294*5113495bSYour Name #endif /* DISABLE_MON_RING_MSI_CFG */
295*5113495bSYour Name 
296*5113495bSYour Name /**
297*5113495bSYour Name  * dp_is_msi_group_number_invalid() - check msi_group_number valid or not
298*5113495bSYour Name  * @soc: dp_soc
299*5113495bSYour Name  * @msi_group_number: MSI group number.
300*5113495bSYour Name  * @msi_data_count: MSI data count.
301*5113495bSYour Name  *
302*5113495bSYour Name  * Return: true if msi_group_number is invalid.
303*5113495bSYour Name  */
dp_is_msi_group_number_invalid(struct dp_soc * soc,int msi_group_number,int msi_data_count)304*5113495bSYour Name static inline bool dp_is_msi_group_number_invalid(struct dp_soc *soc,
305*5113495bSYour Name 						  int msi_group_number,
306*5113495bSYour Name 						  int msi_data_count)
307*5113495bSYour Name {
308*5113495bSYour Name 	if (soc && soc->osdev && soc->osdev->dev &&
309*5113495bSYour Name 	    pld_is_one_msi(soc->osdev->dev))
310*5113495bSYour Name 		return false;
311*5113495bSYour Name 
312*5113495bSYour Name 	return msi_group_number > msi_data_count;
313*5113495bSYour Name }
314*5113495bSYour Name 
315*5113495bSYour Name #ifndef WLAN_SOFTUMAC_SUPPORT
316*5113495bSYour Name /**
317*5113495bSYour Name  * dp_soc_attach_poll() - Register handlers for DP interrupts
318*5113495bSYour Name  * @txrx_soc: DP SOC handle
319*5113495bSYour Name  *
320*5113495bSYour Name  * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
321*5113495bSYour Name  * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
322*5113495bSYour Name  * rx_monitor_ring mask to indicate the rings that are processed by the handler.
323*5113495bSYour Name  *
324*5113495bSYour Name  * Return: 0 for success, nonzero for failure.
325*5113495bSYour Name  */
326*5113495bSYour Name QDF_STATUS dp_soc_attach_poll(struct cdp_soc_t *txrx_soc);
327*5113495bSYour Name 
328*5113495bSYour Name /**
329*5113495bSYour Name  * dp_soc_interrupt_attach() - Register handlers for DP interrupts
330*5113495bSYour Name  * @txrx_soc: DP SOC handle
331*5113495bSYour Name  *
332*5113495bSYour Name  * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
333*5113495bSYour Name  * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
334*5113495bSYour Name  * rx_monitor_ring mask to indicate the rings that are processed by the handler.
335*5113495bSYour Name  *
336*5113495bSYour Name  * Return: 0 for success. nonzero for failure.
337*5113495bSYour Name  */
338*5113495bSYour Name QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc);
339*5113495bSYour Name 
340*5113495bSYour Name /**
341*5113495bSYour Name  * dp_hw_link_desc_ring_free() - Free h/w link desc rings
342*5113495bSYour Name  * @soc: DP SOC handle
343*5113495bSYour Name  *
344*5113495bSYour Name  * Return: none
345*5113495bSYour Name  */
346*5113495bSYour Name void dp_hw_link_desc_ring_free(struct dp_soc *soc);
347*5113495bSYour Name 
348*5113495bSYour Name /**
349*5113495bSYour Name  * dp_hw_link_desc_ring_alloc() - Allocate hw link desc rings
350*5113495bSYour Name  * @soc: DP SOC handle
351*5113495bSYour Name  *
352*5113495bSYour Name  * Allocate memory for WBM_IDLE_LINK srng ring if the number of
353*5113495bSYour Name  * link descriptors is less then the max_allocated size. else
354*5113495bSYour Name  * allocate memory for wbm_idle_scatter_buffer.
355*5113495bSYour Name  *
356*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS: success
357*5113495bSYour Name  *         QDF_STATUS_E_NO_MEM: No memory (Failure)
358*5113495bSYour Name  */
359*5113495bSYour Name QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc);
360*5113495bSYour Name 
361*5113495bSYour Name /**
362*5113495bSYour Name  * dp_hw_link_desc_ring_init() - Initialize hw link desc rings
363*5113495bSYour Name  * @soc: DP SOC handle
364*5113495bSYour Name  *
365*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS: success
366*5113495bSYour Name  *         QDF_STATUS_E_FAILURE: failure
367*5113495bSYour Name  */
368*5113495bSYour Name QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc);
369*5113495bSYour Name 
370*5113495bSYour Name /**
371*5113495bSYour Name  * dp_hw_link_desc_ring_deinit() - Reset hw link desc rings
372*5113495bSYour Name  * @soc: DP SOC handle
373*5113495bSYour Name  *
374*5113495bSYour Name  * Return: None
375*5113495bSYour Name  */
376*5113495bSYour Name void dp_hw_link_desc_ring_deinit(struct dp_soc *soc);
377*5113495bSYour Name 
378*5113495bSYour Name /**
379*5113495bSYour Name  * dp_ipa_hal_tx_init_alt_data_ring() - IPA hal init data rings
380*5113495bSYour Name  * @soc: DP SOC handle
381*5113495bSYour Name  *
382*5113495bSYour Name  * Return: None
383*5113495bSYour Name  */
384*5113495bSYour Name void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc);
385*5113495bSYour Name 
386*5113495bSYour Name /*
387*5113495bSYour Name  * dp_soc_reset_ring_map() - Reset cpu ring map
388*5113495bSYour Name  * @soc: Datapath soc handler
389*5113495bSYour Name  *
390*5113495bSYour Name  * This api resets the default cpu ring map
391*5113495bSYour Name  */
392*5113495bSYour Name void dp_soc_reset_cpu_ring_map(struct dp_soc *soc);
393*5113495bSYour Name 
394*5113495bSYour Name /*
395*5113495bSYour Name  * dp_soc_reset_ipa_vlan_intr_mask() - reset interrupt mask for IPA offloaded
396*5113495bSYour Name  * ring for vlan tagged traffic
397*5113495bSYour Name  * @dp_soc - DP Soc handle
398*5113495bSYour Name  *
399*5113495bSYour Name  * Return: Return void
400*5113495bSYour Name  */
401*5113495bSYour Name void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc);
402*5113495bSYour Name 
403*5113495bSYour Name /*
404*5113495bSYour Name  * dp_soc_reset_intr_mask() - reset interrupt mask
405*5113495bSYour Name  * @dp_soc - DP Soc handle
406*5113495bSYour Name  *
407*5113495bSYour Name  * Return: Return void
408*5113495bSYour Name  */
409*5113495bSYour Name void dp_soc_reset_intr_mask(struct dp_soc *soc);
410*5113495bSYour Name 
411*5113495bSYour Name /*
412*5113495bSYour Name  * dp_reo_frag_dst_set() - configure reo register to set the
413*5113495bSYour Name  *                        fragment destination ring
414*5113495bSYour Name  * @soc : Datapath soc
415*5113495bSYour Name  * @frag_dst_ring : output parameter to set fragment destination ring
416*5113495bSYour Name  *
417*5113495bSYour Name  * Based on offload_radio below fragment destination rings is selected
418*5113495bSYour Name  * 0 - TCL
419*5113495bSYour Name  * 1 - SW1
420*5113495bSYour Name  * 2 - SW2
421*5113495bSYour Name  * 3 - SW3
422*5113495bSYour Name  * 4 - SW4
423*5113495bSYour Name  * 5 - Release
424*5113495bSYour Name  * 6 - FW
425*5113495bSYour Name  * 7 - alternate select
426*5113495bSYour Name  *
427*5113495bSYour Name  * return: void
428*5113495bSYour Name  */
429*5113495bSYour Name void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring);
430*5113495bSYour Name 
431*5113495bSYour Name /**
432*5113495bSYour Name  * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
433*5113495bSYour Name  * @pdev:  DP_PDEV handle
434*5113495bSYour Name  *
435*5113495bSYour Name  * Return: void
436*5113495bSYour Name  */
437*5113495bSYour Name void
438*5113495bSYour Name dp_dscp_tid_map_setup(struct dp_pdev *pdev);
439*5113495bSYour Name 
440*5113495bSYour Name /**
441*5113495bSYour Name  * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
442*5113495bSYour Name  * @pdev: DP_PDEV handle
443*5113495bSYour Name  *
444*5113495bSYour Name  * Return: void
445*5113495bSYour Name  */
446*5113495bSYour Name void
447*5113495bSYour Name dp_pcp_tid_map_setup(struct dp_pdev *pdev);
448*5113495bSYour Name 
449*5113495bSYour Name /**
450*5113495bSYour Name  * dp_soc_deinit() - Deinitialize txrx SOC
451*5113495bSYour Name  * @txrx_soc: Opaque DP SOC handle
452*5113495bSYour Name  *
453*5113495bSYour Name  * Return: None
454*5113495bSYour Name  */
455*5113495bSYour Name void dp_soc_deinit(void *txrx_soc);
456*5113495bSYour Name 
457*5113495bSYour Name #ifdef QCA_HOST2FW_RXBUF_RING
458*5113495bSYour Name void
459*5113495bSYour Name dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
460*5113495bSYour Name 				int lmac_id);
461*5113495bSYour Name #endif
462*5113495bSYour Name 
463*5113495bSYour Name /*
464*5113495bSYour Name  * dp_peer_setup_wifi3() - initialize the peer
465*5113495bSYour Name  * @soc_hdl: soc handle object
466*5113495bSYour Name  * @vdev_id : vdev_id of vdev object
467*5113495bSYour Name  * @peer_mac: Peer's mac address
468*5113495bSYour Name  * @peer_setup_info: peer setup info for MLO
469*5113495bSYour Name  *
470*5113495bSYour Name  * Return: QDF_STATUS
471*5113495bSYour Name  */
472*5113495bSYour Name QDF_STATUS
473*5113495bSYour Name dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
474*5113495bSYour Name 		    uint8_t *peer_mac,
475*5113495bSYour Name 		    struct cdp_peer_setup_info *setup_info);
476*5113495bSYour Name 
477*5113495bSYour Name uint32_t dp_get_tx_rings_grp_bitmap(struct cdp_soc_t *soc_hdl);
478*5113495bSYour Name 
479*5113495bSYour Name /*
480*5113495bSYour Name  * dp_set_ba_aging_timeout() - set ba aging timeout per AC
481*5113495bSYour Name  * @txrx_soc: cdp soc handle
482*5113495bSYour Name  * @ac: Access category
483*5113495bSYour Name  * @value: timeout value in millisec
484*5113495bSYour Name  *
485*5113495bSYour Name  * Return: void
486*5113495bSYour Name  */
487*5113495bSYour Name void dp_set_ba_aging_timeout(struct cdp_soc_t *txrx_soc,
488*5113495bSYour Name 			     uint8_t ac, uint32_t value);
489*5113495bSYour Name 
490*5113495bSYour Name /*
491*5113495bSYour Name  * dp_get_ba_aging_timeout() - get ba aging timeout per AC
492*5113495bSYour Name  * @txrx_soc: cdp soc handle
493*5113495bSYour Name  * @ac: access category
494*5113495bSYour Name  * @value: timeout value in millisec
495*5113495bSYour Name  *
496*5113495bSYour Name  * Return: void
497*5113495bSYour Name  */
498*5113495bSYour Name void dp_get_ba_aging_timeout(struct cdp_soc_t *txrx_soc,
499*5113495bSYour Name 			     uint8_t ac, uint32_t *value);
500*5113495bSYour Name 
501*5113495bSYour Name /*
502*5113495bSYour Name  * dp_set_pdev_reo_dest() - set the reo destination ring for this pdev
503*5113495bSYour Name  * @txrx_soc: cdp soc handle
504*5113495bSYour Name  * @pdev_id: id of physical device object
505*5113495bSYour Name  * @val: reo destination ring index (1 - 4)
506*5113495bSYour Name  *
507*5113495bSYour Name  * Return: QDF_STATUS
508*5113495bSYour Name  */
509*5113495bSYour Name QDF_STATUS
510*5113495bSYour Name dp_set_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id,
511*5113495bSYour Name 		     enum cdp_host_reo_dest_ring val);
512*5113495bSYour Name 
513*5113495bSYour Name /*
514*5113495bSYour Name  * dp_get_pdev_reo_dest() - get the reo destination for this pdev
515*5113495bSYour Name  * @txrx_soc: cdp soc handle
516*5113495bSYour Name  * @pdev_id: id of physical device object
517*5113495bSYour Name  *
518*5113495bSYour Name  * Return: reo destination ring index
519*5113495bSYour Name  */
520*5113495bSYour Name enum cdp_host_reo_dest_ring
521*5113495bSYour Name dp_get_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id);
522*5113495bSYour Name 
523*5113495bSYour Name /**
524*5113495bSYour Name  * dp_set_pdev_pcp_tid_map_wifi3(): update pcp tid map in pdev
525*5113495bSYour Name  * @psoc: dp soc handle
526*5113495bSYour Name  * @pdev_id: id of DP_PDEV handle
527*5113495bSYour Name  * @pcp: pcp value
528*5113495bSYour Name  * @tid: tid value passed by the user
529*5113495bSYour Name  *
530*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success
531*5113495bSYour Name  */
532*5113495bSYour Name QDF_STATUS dp_set_pdev_pcp_tid_map_wifi3(ol_txrx_soc_handle psoc,
533*5113495bSYour Name 					 uint8_t pdev_id,
534*5113495bSYour Name 					 uint8_t pcp, uint8_t tid);
535*5113495bSYour Name 
536*5113495bSYour Name /**
537*5113495bSYour Name  * dp_set_vdev_pcp_tid_map_wifi3(): update pcp tid map in vdev
538*5113495bSYour Name  * @soc_hdl: DP soc handle
539*5113495bSYour Name  * @vdev_id: id of DP_VDEV handle
540*5113495bSYour Name  * @pcp: pcp value
541*5113495bSYour Name  * @tid: tid value passed by the user
542*5113495bSYour Name  *
543*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS on success
544*5113495bSYour Name  */
545*5113495bSYour Name QDF_STATUS dp_set_vdev_pcp_tid_map_wifi3(struct cdp_soc_t *soc_hdl,
546*5113495bSYour Name 					 uint8_t vdev_id,
547*5113495bSYour Name 					 uint8_t pcp, uint8_t tid);
548*5113495bSYour Name 
549*5113495bSYour Name /* *
550*5113495bSYour Name  * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
551*5113495bSYour Name  * @soc: dp soc.
552*5113495bSYour Name  * @pdev: dp pdev.
553*5113495bSYour Name  *
554*5113495bSYour Name  * Return: None.
555*5113495bSYour Name  */
556*5113495bSYour Name void
557*5113495bSYour Name dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev);
558*5113495bSYour Name 
559*5113495bSYour Name /**
560*5113495bSYour Name  * dp_display_srng_info() - Dump the srng HP TP info
561*5113495bSYour Name  * @soc_hdl: CDP Soc handle
562*5113495bSYour Name  *
563*5113495bSYour Name  * This function dumps the SW hp/tp values for the important rings.
564*5113495bSYour Name  * HW hp/tp values are not being dumped, since it can lead to
565*5113495bSYour Name  * READ NOC error when UMAC is in low power state. MCC does not have
566*5113495bSYour Name  * device force wake working yet.
567*5113495bSYour Name  *
568*5113495bSYour Name  * Return: rings are empty
569*5113495bSYour Name  */
570*5113495bSYour Name bool dp_display_srng_info(struct cdp_soc_t *soc_hdl);
571*5113495bSYour Name 
572*5113495bSYour Name #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
573*5113495bSYour Name QDF_STATUS dp_drain_txrx(struct cdp_soc_t *soc_handle, uint8_t rx_only);
574*5113495bSYour Name 
575*5113495bSYour Name /*
576*5113495bSYour Name  * dp_update_ring_hptp() - update dp rings hptp
577*5113495bSYour Name  * @soc: dp soc handler
578*5113495bSYour Name  * @force_flush_tx: force flush the Tx ring hp
579*5113495bSYour Name  */
580*5113495bSYour Name void dp_update_ring_hptp(struct dp_soc *soc, bool force_flush_tx);
581*5113495bSYour Name #endif
582*5113495bSYour Name 
583*5113495bSYour Name /*
584*5113495bSYour Name  * dp_flush_tcl_ring() - flush TCL ring hp
585*5113495bSYour Name  * @pdev: dp pdev
586*5113495bSYour Name  * @ring_id: TCL ring id
587*5113495bSYour Name  *
588*5113495bSYour Name  * Return: 0 on success and error code on failure
589*5113495bSYour Name  */
590*5113495bSYour Name int dp_flush_tcl_ring(struct dp_pdev *pdev, int ring_id);
591*5113495bSYour Name 
592*5113495bSYour Name #ifdef WLAN_FEATURE_STATS_EXT
593*5113495bSYour Name /**
594*5113495bSYour Name  * dp_request_rx_hw_stats - request rx hardware stats
595*5113495bSYour Name  * @soc_hdl: soc handle
596*5113495bSYour Name  * @vdev_id: vdev id
597*5113495bSYour Name  *
598*5113495bSYour Name  * Return: None
599*5113495bSYour Name  */
600*5113495bSYour Name QDF_STATUS
601*5113495bSYour Name dp_request_rx_hw_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
602*5113495bSYour Name #endif
603*5113495bSYour Name 
604*5113495bSYour Name /**
605*5113495bSYour Name  * dp_reset_rx_hw_ext_stats - Reset rx hardware ext stats
606*5113495bSYour Name  * @soc_hdl: soc handle
607*5113495bSYour Name  *
608*5113495bSYour Name  * Return: None
609*5113495bSYour Name  */
610*5113495bSYour Name void dp_reset_rx_hw_ext_stats(struct cdp_soc_t *soc_hdl);
611*5113495bSYour Name 
612*5113495bSYour Name void dp_pdev_set_default_reo(struct dp_pdev *pdev);
613*5113495bSYour Name 
614*5113495bSYour Name /**
615*5113495bSYour Name  * dp_soc_init() - Initialize txrx SOC
616*5113495bSYour Name  * @soc: Opaque DP SOC handle
617*5113495bSYour Name  * @htc_handle: Opaque HTC handle
618*5113495bSYour Name  * @hif_handle: Opaque HIF handle
619*5113495bSYour Name  *
620*5113495bSYour Name  * Return: DP SOC handle on success, NULL on failure
621*5113495bSYour Name  */
622*5113495bSYour Name void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle,
623*5113495bSYour Name 		  struct hif_opaque_softc *hif_handle);
624*5113495bSYour Name 
625*5113495bSYour Name void dp_tx_init_cmd_credit_ring(struct dp_soc *soc);
626*5113495bSYour Name 
627*5113495bSYour Name /**
628*5113495bSYour Name  * dp_soc_srng_deinit() - de-initialize soc srng rings
629*5113495bSYour Name  * @soc: Datapath soc handle
630*5113495bSYour Name  *
631*5113495bSYour Name  */
632*5113495bSYour Name void dp_soc_srng_deinit(struct dp_soc *soc);
633*5113495bSYour Name 
634*5113495bSYour Name /**
635*5113495bSYour Name  * dp_soc_srng_init() - Initialize soc level srng rings
636*5113495bSYour Name  * @soc: Datapath soc handle
637*5113495bSYour Name  *
638*5113495bSYour Name  * return: QDF_STATUS_SUCCESS on success
639*5113495bSYour Name  *	   QDF_STATUS_E_FAILURE on failure
640*5113495bSYour Name  */
641*5113495bSYour Name QDF_STATUS dp_soc_srng_init(struct dp_soc *soc);
642*5113495bSYour Name 
643*5113495bSYour Name /**
644*5113495bSYour Name  * dp_soc_srng_free() - free soc level srng rings
645*5113495bSYour Name  * @soc: Datapath soc handle
646*5113495bSYour Name  *
647*5113495bSYour Name  */
648*5113495bSYour Name void dp_soc_srng_free(struct dp_soc *soc);
649*5113495bSYour Name 
650*5113495bSYour Name /**
651*5113495bSYour Name  * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
652*5113495bSYour Name  * @soc: Datapath soc handle
653*5113495bSYour Name  *
654*5113495bSYour Name  * return: QDF_STATUS_SUCCESS on success
655*5113495bSYour Name  *	   QDF_STATUS_E_NOMEM on failure
656*5113495bSYour Name  */
657*5113495bSYour Name QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc);
658*5113495bSYour Name 
659*5113495bSYour Name /**
660*5113495bSYour Name  * dp_soc_cfg_attach() - set target specific configuration in
661*5113495bSYour Name  *			 dp soc cfg.
662*5113495bSYour Name  * @soc: dp soc handle
663*5113495bSYour Name  */
664*5113495bSYour Name void dp_soc_cfg_attach(struct dp_soc *soc);
665*5113495bSYour Name 
666*5113495bSYour Name #else /* WLAN_SOFTUMAC_SUPPORT */
dp_hw_link_desc_ring_free(struct dp_soc * soc)667*5113495bSYour Name static inline void dp_hw_link_desc_ring_free(struct dp_soc *soc)
668*5113495bSYour Name {
669*5113495bSYour Name }
670*5113495bSYour Name 
dp_hw_link_desc_ring_alloc(struct dp_soc * soc)671*5113495bSYour Name static inline QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc)
672*5113495bSYour Name {
673*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
674*5113495bSYour Name }
675*5113495bSYour Name 
dp_hw_link_desc_ring_init(struct dp_soc * soc)676*5113495bSYour Name static inline QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc)
677*5113495bSYour Name {
678*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
679*5113495bSYour Name }
680*5113495bSYour Name 
dp_hw_link_desc_ring_deinit(struct dp_soc * soc)681*5113495bSYour Name static inline void dp_hw_link_desc_ring_deinit(struct dp_soc *soc)
682*5113495bSYour Name {
683*5113495bSYour Name }
684*5113495bSYour Name 
dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc * soc)685*5113495bSYour Name static inline void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc)
686*5113495bSYour Name {
687*5113495bSYour Name }
688*5113495bSYour Name 
dp_soc_reset_cpu_ring_map(struct dp_soc * soc)689*5113495bSYour Name static inline void dp_soc_reset_cpu_ring_map(struct dp_soc *soc)
690*5113495bSYour Name {
691*5113495bSYour Name }
692*5113495bSYour Name 
dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc * soc)693*5113495bSYour Name static inline void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc)
694*5113495bSYour Name {
695*5113495bSYour Name }
696*5113495bSYour Name 
dp_soc_reset_intr_mask(struct dp_soc * soc)697*5113495bSYour Name static inline void dp_soc_reset_intr_mask(struct dp_soc *soc)
698*5113495bSYour Name {
699*5113495bSYour Name }
700*5113495bSYour Name 
701*5113495bSYour Name static inline
dp_reo_frag_dst_set(struct dp_soc * soc,uint8_t * frag_dst_ring)702*5113495bSYour Name void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring)
703*5113495bSYour Name {
704*5113495bSYour Name }
705*5113495bSYour Name 
706*5113495bSYour Name /**
707*5113495bSYour Name  * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
708*5113495bSYour Name  * @pdev: DP_PDEV handle
709*5113495bSYour Name  *
710*5113495bSYour Name  * Return: void
711*5113495bSYour Name  */
712*5113495bSYour Name static inline void
dp_dscp_tid_map_setup(struct dp_pdev * pdev)713*5113495bSYour Name dp_dscp_tid_map_setup(struct dp_pdev *pdev)
714*5113495bSYour Name {
715*5113495bSYour Name }
716*5113495bSYour Name 
717*5113495bSYour Name /**
718*5113495bSYour Name  * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
719*5113495bSYour Name  * @pdev: DP_PDEV handle
720*5113495bSYour Name  *
721*5113495bSYour Name  * Return: void
722*5113495bSYour Name  */
723*5113495bSYour Name static inline void
dp_pcp_tid_map_setup(struct dp_pdev * pdev)724*5113495bSYour Name dp_pcp_tid_map_setup(struct dp_pdev *pdev)
725*5113495bSYour Name {
726*5113495bSYour Name }
727*5113495bSYour Name 
728*5113495bSYour Name #ifdef QCA_HOST2FW_RXBUF_RING
729*5113495bSYour Name static inline void
dp_htt_setup_rxdma_err_dst_ring(struct dp_soc * soc,int mac_id,int lmac_id)730*5113495bSYour Name dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
731*5113495bSYour Name 				int lmac_id)
732*5113495bSYour Name {
733*5113495bSYour Name 	if ((soc->cdp_soc.ol_ops->get_con_mode &&
734*5113495bSYour Name 	     soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) &&
735*5113495bSYour Name 	    soc->rxdma_err_dst_ring[lmac_id].hal_srng)
736*5113495bSYour Name 		htt_srng_setup(soc->htt_handle, mac_id,
737*5113495bSYour Name 			       soc->rxdma_err_dst_ring[lmac_id].hal_srng,
738*5113495bSYour Name 			       RXDMA_DST);
739*5113495bSYour Name }
740*5113495bSYour Name #endif
741*5113495bSYour Name 
742*5113495bSYour Name /* *
743*5113495bSYour Name  * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
744*5113495bSYour Name  * @soc: dp soc.
745*5113495bSYour Name  * @pdev: dp pdev.
746*5113495bSYour Name  *
747*5113495bSYour Name  * Return: None.
748*5113495bSYour Name  */
749*5113495bSYour Name static inline void
dp_dump_wbm_idle_hptp(struct dp_soc * soc,struct dp_pdev * pdev)750*5113495bSYour Name dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev)
751*5113495bSYour Name {
752*5113495bSYour Name }
753*5113495bSYour Name 
dp_pdev_set_default_reo(struct dp_pdev * pdev)754*5113495bSYour Name static inline void dp_pdev_set_default_reo(struct dp_pdev *pdev)
755*5113495bSYour Name {
756*5113495bSYour Name }
757*5113495bSYour Name 
dp_tx_init_cmd_credit_ring(struct dp_soc * soc)758*5113495bSYour Name static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc)
759*5113495bSYour Name {
760*5113495bSYour Name }
761*5113495bSYour Name 
762*5113495bSYour Name /**
763*5113495bSYour Name  * dp_soc_srng_deinit() - de-initialize soc srng rings
764*5113495bSYour Name  * @soc: Datapath soc handle
765*5113495bSYour Name  *
766*5113495bSYour Name  */
dp_soc_srng_deinit(struct dp_soc * soc)767*5113495bSYour Name static inline void dp_soc_srng_deinit(struct dp_soc *soc)
768*5113495bSYour Name {
769*5113495bSYour Name }
770*5113495bSYour Name 
771*5113495bSYour Name /**
772*5113495bSYour Name  * dp_soc_srng_init() - Initialize soc level srng rings
773*5113495bSYour Name  * @soc: Datapath soc handle
774*5113495bSYour Name  *
775*5113495bSYour Name  * return: QDF_STATUS_SUCCESS on success
776*5113495bSYour Name  *	   QDF_STATUS_E_FAILURE on failure
777*5113495bSYour Name  */
dp_soc_srng_init(struct dp_soc * soc)778*5113495bSYour Name static inline QDF_STATUS dp_soc_srng_init(struct dp_soc *soc)
779*5113495bSYour Name {
780*5113495bSYour Name 	dp_enable_verbose_debug(soc);
781*5113495bSYour Name 
782*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
783*5113495bSYour Name }
784*5113495bSYour Name 
785*5113495bSYour Name /**
786*5113495bSYour Name  * dp_soc_srng_free() - free soc level srng rings
787*5113495bSYour Name  * @soc: Datapath soc handle
788*5113495bSYour Name  *
789*5113495bSYour Name  */
dp_soc_srng_free(struct dp_soc * soc)790*5113495bSYour Name static inline void dp_soc_srng_free(struct dp_soc *soc)
791*5113495bSYour Name {
792*5113495bSYour Name }
793*5113495bSYour Name 
794*5113495bSYour Name /**
795*5113495bSYour Name  * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
796*5113495bSYour Name  * @soc: Datapath soc handle
797*5113495bSYour Name  *
798*5113495bSYour Name  * return: QDF_STATUS_SUCCESS on success
799*5113495bSYour Name  *	   QDF_STATUS_E_NOMEM on failure
800*5113495bSYour Name  */
dp_soc_srng_alloc(struct dp_soc * soc)801*5113495bSYour Name static inline QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc)
802*5113495bSYour Name {
803*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
804*5113495bSYour Name }
805*5113495bSYour Name 
806*5113495bSYour Name /**
807*5113495bSYour Name  * dp_display_srng_info() - Dump the ring Read/Write idx info
808*5113495bSYour Name  * @soc_hdl: CDP Soc handle
809*5113495bSYour Name  *
810*5113495bSYour Name  * This function dumps the SW Read/Write idx for the important rings.
811*5113495bSYour Name  *
812*5113495bSYour Name  * Return:  rings are empty
813*5113495bSYour Name  */
dp_display_srng_info(struct cdp_soc_t * soc_hdl)814*5113495bSYour Name static inline bool dp_display_srng_info(struct cdp_soc_t *soc_hdl)
815*5113495bSYour Name {
816*5113495bSYour Name /*TODO add support display SOFTUMAC data rings info*/
817*5113495bSYour Name 	return true;
818*5113495bSYour Name }
819*5113495bSYour Name 
820*5113495bSYour Name #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
dp_drain_txrx(struct cdp_soc_t * soc_handle,uint8_t rx_only)821*5113495bSYour Name static inline QDF_STATUS dp_drain_txrx(struct cdp_soc_t *soc_handle,
822*5113495bSYour Name 				       uint8_t rx_only)
823*5113495bSYour Name {
824*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
825*5113495bSYour Name }
826*5113495bSYour Name #endif
827*5113495bSYour Name #endif /* WLAN_SOFTUMAC_SUPPORT */
828*5113495bSYour Name 
829*5113495bSYour Name #if defined(WLAN_FEATURE_NEAR_FULL_IRQ) && !defined(WLAN_SOFTUMAC_SUPPORT)
830*5113495bSYour Name void dp_srng_msi2_setup(struct dp_soc *soc,
831*5113495bSYour Name 			struct hal_srng_params *ring_params,
832*5113495bSYour Name 			int ring_type, int ring_num, int nf_msi_grp_num);
833*5113495bSYour Name void dp_srng_set_msi2_ring_params(struct dp_soc *soc,
834*5113495bSYour Name 				  struct hal_srng_params *ring_params,
835*5113495bSYour Name 				  qdf_dma_addr_t msi2_addr,
836*5113495bSYour Name 				  uint32_t msi2_data);
837*5113495bSYour Name uint8_t *dp_srng_get_near_full_irq_mask(struct dp_soc *soc,
838*5113495bSYour Name 					enum hal_ring_type ring_type,
839*5113495bSYour Name 					int ring_num);
840*5113495bSYour Name void
841*5113495bSYour Name dp_srng_configure_nf_interrupt_thresholds(struct dp_soc *soc,
842*5113495bSYour Name 					  struct hal_srng_params *ring_params,
843*5113495bSYour Name 					  int ring_type);
844*5113495bSYour Name #else
845*5113495bSYour Name static inline void
dp_srng_msi2_setup(struct dp_soc * soc,struct hal_srng_params * ring_params,int ring_type,int ring_num,int nf_msi_grp_num)846*5113495bSYour Name dp_srng_msi2_setup(struct dp_soc *soc,
847*5113495bSYour Name 		   struct hal_srng_params *ring_params,
848*5113495bSYour Name 		   int ring_type, int ring_num, int nf_msi_grp_num)
849*5113495bSYour Name {
850*5113495bSYour Name }
851*5113495bSYour Name 
852*5113495bSYour Name static inline void
dp_srng_set_msi2_ring_params(struct dp_soc * soc,struct hal_srng_params * ring_params,qdf_dma_addr_t msi2_addr,uint32_t msi2_data)853*5113495bSYour Name dp_srng_set_msi2_ring_params(struct dp_soc *soc,
854*5113495bSYour Name 			     struct hal_srng_params *ring_params,
855*5113495bSYour Name 			     qdf_dma_addr_t msi2_addr,
856*5113495bSYour Name 			     uint32_t msi2_data)
857*5113495bSYour Name {
858*5113495bSYour Name }
859*5113495bSYour Name 
860*5113495bSYour Name static inline
dp_srng_get_near_full_irq_mask(struct dp_soc * soc,enum hal_ring_type ring_type,int ring_num)861*5113495bSYour Name uint8_t *dp_srng_get_near_full_irq_mask(struct dp_soc *soc,
862*5113495bSYour Name 					enum hal_ring_type ring_type,
863*5113495bSYour Name 					int ring_num)
864*5113495bSYour Name {
865*5113495bSYour Name 	return NULL;
866*5113495bSYour Name }
867*5113495bSYour Name 
868*5113495bSYour Name static inline void
dp_srng_configure_nf_interrupt_thresholds(struct dp_soc * soc,struct hal_srng_params * ring_params,int ring_type)869*5113495bSYour Name dp_srng_configure_nf_interrupt_thresholds(struct dp_soc *soc,
870*5113495bSYour Name 					  struct hal_srng_params *ring_params,
871*5113495bSYour Name 					  int ring_type)
872*5113495bSYour Name {
873*5113495bSYour Name }
874*5113495bSYour Name #endif
875*5113495bSYour Name 
876*5113495bSYour Name #ifdef WLAN_SUPPORT_DPDK
877*5113495bSYour Name /*
878*5113495bSYour Name  * dp_soc_reset_dpdk_intr_mask() - reset interrupt mask
879*5113495bSYour Name  * @dp_soc - DP Soc handle
880*5113495bSYour Name  *
881*5113495bSYour Name  * Return: Return void
882*5113495bSYour Name  */
883*5113495bSYour Name void dp_soc_reset_dpdk_intr_mask(struct dp_soc *soc);
884*5113495bSYour Name #else
dp_soc_reset_dpdk_intr_mask(struct dp_soc * soc)885*5113495bSYour Name static inline void dp_soc_reset_dpdk_intr_mask(struct dp_soc *soc)
886*5113495bSYour Name { }
887*5113495bSYour Name #endif
888*5113495bSYour Name #endif /* _DP_RINGS_H_ */
889