1*14b24e2bSVaishali Kulkarni /*
2*14b24e2bSVaishali Kulkarni * CDDL HEADER START
3*14b24e2bSVaishali Kulkarni *
4*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the
5*14b24e2bSVaishali Kulkarni * Common Development and Distribution License, v.1,  (the "License").
6*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
7*14b24e2bSVaishali Kulkarni *
8*14b24e2bSVaishali Kulkarni * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*14b24e2bSVaishali Kulkarni * or http://opensource.org/licenses/CDDL-1.0.
10*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions
11*14b24e2bSVaishali Kulkarni * and limitations under the License.
12*14b24e2bSVaishali Kulkarni *
13*14b24e2bSVaishali Kulkarni * When distributing Covered Code, include this CDDL HEADER in each
14*14b24e2bSVaishali Kulkarni * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*14b24e2bSVaishali Kulkarni * If applicable, add the following below this CDDL HEADER, with the
16*14b24e2bSVaishali Kulkarni * fields enclosed by brackets "[]" replaced with your own identifying
17*14b24e2bSVaishali Kulkarni * information: Portions Copyright [yyyy] [name of copyright owner]
18*14b24e2bSVaishali Kulkarni *
19*14b24e2bSVaishali Kulkarni * CDDL HEADER END
20*14b24e2bSVaishali Kulkarni */
21*14b24e2bSVaishali Kulkarni 
22*14b24e2bSVaishali Kulkarni /*
23*14b24e2bSVaishali Kulkarni * Copyright 2014-2017 Cavium, Inc.
24*14b24e2bSVaishali Kulkarni * The contents of this file are subject to the terms of the Common Development
25*14b24e2bSVaishali Kulkarni * and Distribution License, v.1,  (the "License").
26*14b24e2bSVaishali Kulkarni 
27*14b24e2bSVaishali Kulkarni * You may not use this file except in compliance with the License.
28*14b24e2bSVaishali Kulkarni 
29*14b24e2bSVaishali Kulkarni * You can obtain a copy of the License at available
30*14b24e2bSVaishali Kulkarni * at http://opensource.org/licenses/CDDL-1.0
31*14b24e2bSVaishali Kulkarni 
32*14b24e2bSVaishali Kulkarni * See the License for the specific language governing permissions and
33*14b24e2bSVaishali Kulkarni * limitations under the License.
34*14b24e2bSVaishali Kulkarni */
35*14b24e2bSVaishali Kulkarni 
36*14b24e2bSVaishali Kulkarni #ifndef __ECORE_INT_API_H__
37*14b24e2bSVaishali Kulkarni #define __ECORE_INT_API_H__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #ifndef __EXTRACT__LINUX__
40*14b24e2bSVaishali Kulkarni #define ECORE_SB_IDX		0x0002
41*14b24e2bSVaishali Kulkarni 
42*14b24e2bSVaishali Kulkarni #define RX_PI		0
43*14b24e2bSVaishali Kulkarni #define TX_PI(tc)	(RX_PI + 1 + tc)
44*14b24e2bSVaishali Kulkarni 
45*14b24e2bSVaishali Kulkarni #ifndef ECORE_INT_MODE
46*14b24e2bSVaishali Kulkarni #define ECORE_INT_MODE
47*14b24e2bSVaishali Kulkarni enum ecore_int_mode {
48*14b24e2bSVaishali Kulkarni 	ECORE_INT_MODE_INTA,
49*14b24e2bSVaishali Kulkarni 	ECORE_INT_MODE_MSIX,
50*14b24e2bSVaishali Kulkarni 	ECORE_INT_MODE_MSI,
51*14b24e2bSVaishali Kulkarni 	ECORE_INT_MODE_POLL,
52*14b24e2bSVaishali Kulkarni };
53*14b24e2bSVaishali Kulkarni #endif
54*14b24e2bSVaishali Kulkarni 
55*14b24e2bSVaishali Kulkarni struct ecore_sb_info {
56*14b24e2bSVaishali Kulkarni 	struct status_block *sb_virt;
57*14b24e2bSVaishali Kulkarni 	dma_addr_t sb_phys;
58*14b24e2bSVaishali Kulkarni 	u32 sb_ack; /* Last given ack */
59*14b24e2bSVaishali Kulkarni 	u16 igu_sb_id;
60*14b24e2bSVaishali Kulkarni 	void OSAL_IOMEM *igu_addr;
61*14b24e2bSVaishali Kulkarni 	u8 flags;
62*14b24e2bSVaishali Kulkarni #define ECORE_SB_INFO_INIT 	0x1
63*14b24e2bSVaishali Kulkarni #define ECORE_SB_INFO_SETUP 	0x2
64*14b24e2bSVaishali Kulkarni 
65*14b24e2bSVaishali Kulkarni #ifdef ECORE_CONFIG_DIRECT_HWFN
66*14b24e2bSVaishali Kulkarni 	struct ecore_hwfn *p_hwfn;
67*14b24e2bSVaishali Kulkarni #endif
68*14b24e2bSVaishali Kulkarni 	struct ecore_dev *p_dev;
69*14b24e2bSVaishali Kulkarni };
70*14b24e2bSVaishali Kulkarni 
71*14b24e2bSVaishali Kulkarni struct ecore_sb_info_dbg {
72*14b24e2bSVaishali Kulkarni 	u32 igu_prod;
73*14b24e2bSVaishali Kulkarni 	u32 igu_cons;
74*14b24e2bSVaishali Kulkarni 	u16 pi[PIS_PER_SB];
75*14b24e2bSVaishali Kulkarni };
76*14b24e2bSVaishali Kulkarni 
77*14b24e2bSVaishali Kulkarni struct ecore_sb_cnt_info {
78*14b24e2bSVaishali Kulkarni 	/* Original, current, and free SBs for PF */
79*14b24e2bSVaishali Kulkarni 	int orig;
80*14b24e2bSVaishali Kulkarni 	int cnt;
81*14b24e2bSVaishali Kulkarni 	int free_cnt;
82*14b24e2bSVaishali Kulkarni 
83*14b24e2bSVaishali Kulkarni 	/* Original, current and free SBS for child VFs */
84*14b24e2bSVaishali Kulkarni 	int iov_orig;
85*14b24e2bSVaishali Kulkarni 	int iov_cnt;
86*14b24e2bSVaishali Kulkarni 	int free_cnt_iov;
87*14b24e2bSVaishali Kulkarni };
88*14b24e2bSVaishali Kulkarni 
ecore_sb_update_sb_idx(struct ecore_sb_info * sb_info)89*14b24e2bSVaishali Kulkarni static OSAL_INLINE u16 ecore_sb_update_sb_idx(struct ecore_sb_info *sb_info)
90*14b24e2bSVaishali Kulkarni {
91*14b24e2bSVaishali Kulkarni 	u32 prod = 0;
92*14b24e2bSVaishali Kulkarni 	u16 rc   = 0;
93*14b24e2bSVaishali Kulkarni 
94*14b24e2bSVaishali Kulkarni 	// barrier(); /* status block is written to by the chip */
95*14b24e2bSVaishali Kulkarni 	// FIXME: need some sort of barrier.
96*14b24e2bSVaishali Kulkarni 	prod = OSAL_LE32_TO_CPU(sb_info->sb_virt->prod_index) &
97*14b24e2bSVaishali Kulkarni 	       STATUS_BLOCK_PROD_INDEX_MASK;
98*14b24e2bSVaishali Kulkarni 	if (sb_info->sb_ack != prod) {
99*14b24e2bSVaishali Kulkarni 		sb_info->sb_ack = prod;
100*14b24e2bSVaishali Kulkarni 		rc |= ECORE_SB_IDX;
101*14b24e2bSVaishali Kulkarni 	}
102*14b24e2bSVaishali Kulkarni 
103*14b24e2bSVaishali Kulkarni 	OSAL_MMIOWB(sb_info->p_dev);
104*14b24e2bSVaishali Kulkarni 	return rc;
105*14b24e2bSVaishali Kulkarni }
106*14b24e2bSVaishali Kulkarni 
107*14b24e2bSVaishali Kulkarni /**
108*14b24e2bSVaishali Kulkarni  * @brief This function creates an update command for interrupts that is
109*14b24e2bSVaishali Kulkarni  *        written to the IGU.
110*14b24e2bSVaishali Kulkarni  *
111*14b24e2bSVaishali Kulkarni  * @param sb_info 	- This is the structure allocated and
112*14b24e2bSVaishali Kulkarni  *      	   initialized per status block. Assumption is
113*14b24e2bSVaishali Kulkarni  *      	   that it was initialized using ecore_sb_init
114*14b24e2bSVaishali Kulkarni  * @param int_cmd 	- Enable/Disable/Nop
115*14b24e2bSVaishali Kulkarni  * @param upd_flg 	- whether igu consumer should be
116*14b24e2bSVaishali Kulkarni  *      	   updated.
117*14b24e2bSVaishali Kulkarni  *
118*14b24e2bSVaishali Kulkarni  * @return OSAL_INLINE void
119*14b24e2bSVaishali Kulkarni  */
ecore_sb_ack(struct ecore_sb_info * sb_info,enum igu_int_cmd int_cmd,u8 upd_flg)120*14b24e2bSVaishali Kulkarni static OSAL_INLINE void ecore_sb_ack(struct ecore_sb_info *sb_info,
121*14b24e2bSVaishali Kulkarni 				     enum igu_int_cmd int_cmd, u8 upd_flg)
122*14b24e2bSVaishali Kulkarni {
123*14b24e2bSVaishali Kulkarni 	struct igu_prod_cons_update igu_ack = { 0 };
124*14b24e2bSVaishali Kulkarni 
125*14b24e2bSVaishali Kulkarni 	igu_ack.sb_id_and_flags =
126*14b24e2bSVaishali Kulkarni 		((sb_info->sb_ack << IGU_PROD_CONS_UPDATE_SB_INDEX_SHIFT) |
127*14b24e2bSVaishali Kulkarni 		 (upd_flg << IGU_PROD_CONS_UPDATE_UPDATE_FLAG_SHIFT) |
128*14b24e2bSVaishali Kulkarni 		 (int_cmd << IGU_PROD_CONS_UPDATE_ENABLE_INT_SHIFT) |
129*14b24e2bSVaishali Kulkarni 		 (IGU_SEG_ACCESS_REG <<
130*14b24e2bSVaishali Kulkarni 		  IGU_PROD_CONS_UPDATE_SEGMENT_ACCESS_SHIFT));
131*14b24e2bSVaishali Kulkarni 
132*14b24e2bSVaishali Kulkarni #ifdef ECORE_CONFIG_DIRECT_HWFN
133*14b24e2bSVaishali Kulkarni 	DIRECT_REG_WR(sb_info->p_hwfn, sb_info->igu_addr,
134*14b24e2bSVaishali Kulkarni 		      igu_ack.sb_id_and_flags);
135*14b24e2bSVaishali Kulkarni #else
136*14b24e2bSVaishali Kulkarni 	DIRECT_REG_WR(OSAL_NULL, sb_info->igu_addr, igu_ack.sb_id_and_flags);
137*14b24e2bSVaishali Kulkarni #endif
138*14b24e2bSVaishali Kulkarni 	/* Both segments (interrupts & acks) are written to same place address;
139*14b24e2bSVaishali Kulkarni 	 * Need to guarantee all commands will be received (in-order) by HW.
140*14b24e2bSVaishali Kulkarni 	 */
141*14b24e2bSVaishali Kulkarni 	OSAL_MMIOWB(sb_info->p_dev);
142*14b24e2bSVaishali Kulkarni 	OSAL_BARRIER(sb_info->p_dev);
143*14b24e2bSVaishali Kulkarni }
144*14b24e2bSVaishali Kulkarni 
145*14b24e2bSVaishali Kulkarni #ifdef ECORE_CONFIG_DIRECT_HWFN
__internal_ram_wr(struct ecore_hwfn * p_hwfn,void OSAL_IOMEM * addr,int size,u32 * data)146*14b24e2bSVaishali Kulkarni static OSAL_INLINE void __internal_ram_wr(struct ecore_hwfn *p_hwfn,
147*14b24e2bSVaishali Kulkarni 					  void OSAL_IOMEM *addr,
148*14b24e2bSVaishali Kulkarni 					  int size, u32 *data)
149*14b24e2bSVaishali Kulkarni #else
150*14b24e2bSVaishali Kulkarni static OSAL_INLINE void __internal_ram_wr(void *p_hwfn,
151*14b24e2bSVaishali Kulkarni 					  void OSAL_IOMEM *addr,
152*14b24e2bSVaishali Kulkarni 					  int size, u32 *data)
153*14b24e2bSVaishali Kulkarni 
154*14b24e2bSVaishali Kulkarni #endif
155*14b24e2bSVaishali Kulkarni {
156*14b24e2bSVaishali Kulkarni 	unsigned int i;
157*14b24e2bSVaishali Kulkarni 
158*14b24e2bSVaishali Kulkarni 	for (i = 0; i < size / sizeof(*data); i++)
159*14b24e2bSVaishali Kulkarni 		DIRECT_REG_WR(p_hwfn, &((u32 OSAL_IOMEM *)addr)[i], data[i]);
160*14b24e2bSVaishali Kulkarni }
161*14b24e2bSVaishali Kulkarni 
162*14b24e2bSVaishali Kulkarni #ifdef ECORE_CONFIG_DIRECT_HWFN
internal_ram_wr(struct ecore_hwfn * p_hwfn,void OSAL_IOMEM * addr,int size,u32 * data)163*14b24e2bSVaishali Kulkarni static OSAL_INLINE void internal_ram_wr(struct ecore_hwfn *p_hwfn,
164*14b24e2bSVaishali Kulkarni 					void OSAL_IOMEM *addr,
165*14b24e2bSVaishali Kulkarni 					int size, u32 *data)
166*14b24e2bSVaishali Kulkarni {
167*14b24e2bSVaishali Kulkarni 	__internal_ram_wr(p_hwfn, addr, size, data);
168*14b24e2bSVaishali Kulkarni }
169*14b24e2bSVaishali Kulkarni #else
internal_ram_wr(void OSAL_IOMEM * addr,int size,u32 * data)170*14b24e2bSVaishali Kulkarni static OSAL_INLINE void internal_ram_wr(void OSAL_IOMEM *addr,
171*14b24e2bSVaishali Kulkarni 					int size, u32 *data)
172*14b24e2bSVaishali Kulkarni {
173*14b24e2bSVaishali Kulkarni 	__internal_ram_wr(OSAL_NULL, addr, size, data);
174*14b24e2bSVaishali Kulkarni }
175*14b24e2bSVaishali Kulkarni #endif
176*14b24e2bSVaishali Kulkarni #endif
177*14b24e2bSVaishali Kulkarni 
178*14b24e2bSVaishali Kulkarni struct ecore_hwfn;
179*14b24e2bSVaishali Kulkarni struct ecore_ptt;
180*14b24e2bSVaishali Kulkarni 
181*14b24e2bSVaishali Kulkarni enum ecore_coalescing_fsm {
182*14b24e2bSVaishali Kulkarni 	ECORE_COAL_RX_STATE_MACHINE,
183*14b24e2bSVaishali Kulkarni 	ECORE_COAL_TX_STATE_MACHINE
184*14b24e2bSVaishali Kulkarni };
185*14b24e2bSVaishali Kulkarni 
186*14b24e2bSVaishali Kulkarni /**
187*14b24e2bSVaishali Kulkarni  * @brief ecore_int_cau_conf_pi - configure cau for a given
188*14b24e2bSVaishali Kulkarni  *        status block
189*14b24e2bSVaishali Kulkarni  *
190*14b24e2bSVaishali Kulkarni  * @param p_hwfn
191*14b24e2bSVaishali Kulkarni  * @param p_ptt
192*14b24e2bSVaishali Kulkarni  * @param p_sb
193*14b24e2bSVaishali Kulkarni  * @param pi_index
194*14b24e2bSVaishali Kulkarni  * @param state
195*14b24e2bSVaishali Kulkarni  * @param timeset
196*14b24e2bSVaishali Kulkarni  */
197*14b24e2bSVaishali Kulkarni void ecore_int_cau_conf_pi(struct ecore_hwfn		*p_hwfn,
198*14b24e2bSVaishali Kulkarni 			   struct ecore_ptt		*p_ptt,
199*14b24e2bSVaishali Kulkarni 			   struct ecore_sb_info		*p_sb,
200*14b24e2bSVaishali Kulkarni 			   u32				pi_index,
201*14b24e2bSVaishali Kulkarni 			   enum ecore_coalescing_fsm	coalescing_fsm,
202*14b24e2bSVaishali Kulkarni 			   u8				timeset);
203*14b24e2bSVaishali Kulkarni 
204*14b24e2bSVaishali Kulkarni /**
205*14b24e2bSVaishali Kulkarni  * @brief ecore_int_igu_enable_int - enable device interrupts
206*14b24e2bSVaishali Kulkarni  *
207*14b24e2bSVaishali Kulkarni  * @param p_hwfn
208*14b24e2bSVaishali Kulkarni  * @param p_ptt
209*14b24e2bSVaishali Kulkarni  * @param int_mode - interrupt mode to use
210*14b24e2bSVaishali Kulkarni  */
211*14b24e2bSVaishali Kulkarni void ecore_int_igu_enable_int(struct ecore_hwfn *p_hwfn,
212*14b24e2bSVaishali Kulkarni 			      struct ecore_ptt *p_ptt,
213*14b24e2bSVaishali Kulkarni 			      enum ecore_int_mode int_mode);
214*14b24e2bSVaishali Kulkarni 
215*14b24e2bSVaishali Kulkarni /**
216*14b24e2bSVaishali Kulkarni  * @brief ecore_int_igu_disable_int - disable device interrupts
217*14b24e2bSVaishali Kulkarni  *
218*14b24e2bSVaishali Kulkarni  * @param p_hwfn
219*14b24e2bSVaishali Kulkarni  * @param p_ptt
220*14b24e2bSVaishali Kulkarni  */
221*14b24e2bSVaishali Kulkarni void ecore_int_igu_disable_int(struct ecore_hwfn *p_hwfn,
222*14b24e2bSVaishali Kulkarni 			       struct ecore_ptt	*p_ptt);
223*14b24e2bSVaishali Kulkarni 
224*14b24e2bSVaishali Kulkarni /**
225*14b24e2bSVaishali Kulkarni  * @brief ecore_int_igu_read_sisr_reg - Reads the single isr multiple dpc
226*14b24e2bSVaishali Kulkarni  *        register from igu.
227*14b24e2bSVaishali Kulkarni  *
228*14b24e2bSVaishali Kulkarni  * @param p_hwfn
229*14b24e2bSVaishali Kulkarni  *
230*14b24e2bSVaishali Kulkarni  * @return u64
231*14b24e2bSVaishali Kulkarni  */
232*14b24e2bSVaishali Kulkarni u64 ecore_int_igu_read_sisr_reg(struct ecore_hwfn *p_hwfn);
233*14b24e2bSVaishali Kulkarni 
234*14b24e2bSVaishali Kulkarni #define ECORE_SP_SB_ID 0xffff
235*14b24e2bSVaishali Kulkarni 
236*14b24e2bSVaishali Kulkarni /**
237*14b24e2bSVaishali Kulkarni  * @brief ecore_int_sb_init - Initializes the sb_info structure.
238*14b24e2bSVaishali Kulkarni  *
239*14b24e2bSVaishali Kulkarni  * once the structure is initialized it can be passed to sb related functions.
240*14b24e2bSVaishali Kulkarni  *
241*14b24e2bSVaishali Kulkarni  * @param p_hwfn
242*14b24e2bSVaishali Kulkarni  * @param p_ptt
243*14b24e2bSVaishali Kulkarni  * @param sb_info	points to an uninitialized (but
244*14b24e2bSVaishali Kulkarni  *			allocated) sb_info structure
245*14b24e2bSVaishali Kulkarni  * @param sb_virt_addr
246*14b24e2bSVaishali Kulkarni  * @param sb_phy_addr
247*14b24e2bSVaishali Kulkarni  * @param sb_id		the sb_id to be used (zero based in driver)
248*14b24e2bSVaishali Kulkarni  *			should use ECORE_SP_SB_ID for SP Status block
249*14b24e2bSVaishali Kulkarni  *
250*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
251*14b24e2bSVaishali Kulkarni  */
252*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_int_sb_init(struct ecore_hwfn	*p_hwfn,
253*14b24e2bSVaishali Kulkarni 				       struct ecore_ptt		*p_ptt,
254*14b24e2bSVaishali Kulkarni 				       struct ecore_sb_info	*sb_info,
255*14b24e2bSVaishali Kulkarni 				       void			*sb_virt_addr,
256*14b24e2bSVaishali Kulkarni 				       dma_addr_t		sb_phy_addr,
257*14b24e2bSVaishali Kulkarni 				       u16			sb_id);
258*14b24e2bSVaishali Kulkarni /**
259*14b24e2bSVaishali Kulkarni  * @brief ecore_int_sb_setup - Setup the sb.
260*14b24e2bSVaishali Kulkarni  *
261*14b24e2bSVaishali Kulkarni  * @param p_hwfn
262*14b24e2bSVaishali Kulkarni  * @param p_ptt
263*14b24e2bSVaishali Kulkarni  * @param sb_info	initialized sb_info structure
264*14b24e2bSVaishali Kulkarni  */
265*14b24e2bSVaishali Kulkarni void ecore_int_sb_setup(
266*14b24e2bSVaishali Kulkarni 		struct ecore_hwfn	*p_hwfn,
267*14b24e2bSVaishali Kulkarni 		struct ecore_ptt		*p_ptt,
268*14b24e2bSVaishali Kulkarni 		struct ecore_sb_info	*sb_info);
269*14b24e2bSVaishali Kulkarni 
270*14b24e2bSVaishali Kulkarni /**
271*14b24e2bSVaishali Kulkarni  * @brief ecore_int_sb_release - releases the sb_info structure.
272*14b24e2bSVaishali Kulkarni  *
273*14b24e2bSVaishali Kulkarni  * once the structure is released, it's memory can be freed
274*14b24e2bSVaishali Kulkarni  *
275*14b24e2bSVaishali Kulkarni  * @param p_hwfn
276*14b24e2bSVaishali Kulkarni  * @param sb_info	points to an allocated sb_info structure
277*14b24e2bSVaishali Kulkarni  * @param sb_id		the sb_id to be used (zero based in driver)
278*14b24e2bSVaishali Kulkarni  *			should never be equal to ECORE_SP_SB_ID
279*14b24e2bSVaishali Kulkarni  *			(SP Status block)
280*14b24e2bSVaishali Kulkarni  *
281*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
282*14b24e2bSVaishali Kulkarni  */
283*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_int_sb_release(struct ecore_hwfn	*p_hwfn,
284*14b24e2bSVaishali Kulkarni 					  struct ecore_sb_info	*sb_info,
285*14b24e2bSVaishali Kulkarni 					  u16			sb_id);
286*14b24e2bSVaishali Kulkarni 
287*14b24e2bSVaishali Kulkarni /**
288*14b24e2bSVaishali Kulkarni  * @brief ecore_int_sp_dpc - To be called when an interrupt is received on the
289*14b24e2bSVaishali Kulkarni  *        default status block.
290*14b24e2bSVaishali Kulkarni  *
291*14b24e2bSVaishali Kulkarni  * @param p_hwfn - pointer to hwfn
292*14b24e2bSVaishali Kulkarni  *
293*14b24e2bSVaishali Kulkarni  */
294*14b24e2bSVaishali Kulkarni void ecore_int_sp_dpc(osal_int_ptr_t hwfn_cookie);
295*14b24e2bSVaishali Kulkarni 
296*14b24e2bSVaishali Kulkarni /**
297*14b24e2bSVaishali Kulkarni  * @brief ecore_int_get_num_sbs - get the number of status
298*14b24e2bSVaishali Kulkarni  *        blocks configured for this funciton in the igu.
299*14b24e2bSVaishali Kulkarni  *
300*14b24e2bSVaishali Kulkarni  * @param p_hwfn
301*14b24e2bSVaishali Kulkarni  * @param p_sb_cnt_info
302*14b24e2bSVaishali Kulkarni  *
303*14b24e2bSVaishali Kulkarni  * @return
304*14b24e2bSVaishali Kulkarni  */
305*14b24e2bSVaishali Kulkarni void ecore_int_get_num_sbs(struct ecore_hwfn	    *p_hwfn,
306*14b24e2bSVaishali Kulkarni 			   struct ecore_sb_cnt_info *p_sb_cnt_info);
307*14b24e2bSVaishali Kulkarni 
308*14b24e2bSVaishali Kulkarni /**
309*14b24e2bSVaishali Kulkarni  * @brief ecore_int_disable_post_isr_release - performs the cleanup post ISR
310*14b24e2bSVaishali Kulkarni  *        release. The API need to be called after releasing all slowpath IRQs
311*14b24e2bSVaishali Kulkarni  *        of the device.
312*14b24e2bSVaishali Kulkarni  *
313*14b24e2bSVaishali Kulkarni  * @param p_dev
314*14b24e2bSVaishali Kulkarni  *
315*14b24e2bSVaishali Kulkarni  */
316*14b24e2bSVaishali Kulkarni void ecore_int_disable_post_isr_release(struct ecore_dev *p_dev);
317*14b24e2bSVaishali Kulkarni 
318*14b24e2bSVaishali Kulkarni /**
319*14b24e2bSVaishali Kulkarni  * @brief ecore_int_attn_clr_enable - sets whether the general behavior is
320*14b24e2bSVaishali Kulkarni  *        preventing attentions from being reasserted, or following the
321*14b24e2bSVaishali Kulkarni  *        attributes of the specific attention.
322*14b24e2bSVaishali Kulkarni  *
323*14b24e2bSVaishali Kulkarni  * @param p_dev
324*14b24e2bSVaishali Kulkarni  * @param clr_enable
325*14b24e2bSVaishali Kulkarni  *
326*14b24e2bSVaishali Kulkarni  */
327*14b24e2bSVaishali Kulkarni void ecore_int_attn_clr_enable(struct ecore_dev *p_dev, bool clr_enable);
328*14b24e2bSVaishali Kulkarni 
329*14b24e2bSVaishali Kulkarni /**
330*14b24e2bSVaishali Kulkarni  * @brief Read debug information regarding a given SB.
331*14b24e2bSVaishali Kulkarni  *
332*14b24e2bSVaishali Kulkarni  * @param p_hwfn
333*14b24e2bSVaishali Kulkarni  * @param p_ptt
334*14b24e2bSVaishali Kulkarni  * @param p_sb - point to Status block for which we want to get info.
335*14b24e2bSVaishali Kulkarni  * @param p_info - pointer to struct to fill with information regarding SB.
336*14b24e2bSVaishali Kulkarni  *
337*14b24e2bSVaishali Kulkarni  * @return ECORE_SUCCESS if pointer is filled; failure otherwise.
338*14b24e2bSVaishali Kulkarni  */
339*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_int_get_sb_dbg(struct ecore_hwfn *p_hwfn,
340*14b24e2bSVaishali Kulkarni 					  struct ecore_ptt *p_ptt,
341*14b24e2bSVaishali Kulkarni 					  struct ecore_sb_info *p_sb,
342*14b24e2bSVaishali Kulkarni 					  struct ecore_sb_info_dbg *p_info);
343*14b24e2bSVaishali Kulkarni 
344*14b24e2bSVaishali Kulkarni /**
345*14b24e2bSVaishali Kulkarni  * @brief - Move a free Status block between PF and child VF
346*14b24e2bSVaishali Kulkarni  *
347*14b24e2bSVaishali Kulkarni  * @param p_hwfn
348*14b24e2bSVaishali Kulkarni  * @param p_ptt
349*14b24e2bSVaishali Kulkarni  * @param sb_id - The PF fastpath vector to be moved [re-assigned if claiming
350*14b24e2bSVaishali Kulkarni  *                from VF, given-up if moving to VF]
351*14b24e2bSVaishali Kulkarni  * @param b_to_vf - PF->VF == true, VF->PF == false
352*14b24e2bSVaishali Kulkarni  *
353*14b24e2bSVaishali Kulkarni  * @return ECORE_SUCCESS if SB successfully moved.
354*14b24e2bSVaishali Kulkarni  */
355*14b24e2bSVaishali Kulkarni enum _ecore_status_t
356*14b24e2bSVaishali Kulkarni ecore_int_igu_relocate_sb(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
357*14b24e2bSVaishali Kulkarni 			  u16 sb_id, bool b_to_vf);
358*14b24e2bSVaishali Kulkarni #endif