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_DEV_API_H__
37*14b24e2bSVaishali Kulkarni #define __ECORE_DEV_API_H__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #include "ecore_status.h"
40*14b24e2bSVaishali Kulkarni #include "ecore_chain.h"
41*14b24e2bSVaishali Kulkarni #include "ecore_int_api.h"
42*14b24e2bSVaishali Kulkarni 
43*14b24e2bSVaishali Kulkarni struct ecore_wake_info {
44*14b24e2bSVaishali Kulkarni 	u32 wk_info;
45*14b24e2bSVaishali Kulkarni 	u32 wk_details;
46*14b24e2bSVaishali Kulkarni 	u32 wk_pkt_len;
47*14b24e2bSVaishali Kulkarni 	u8  wk_buffer[256];
48*14b24e2bSVaishali Kulkarni };
49*14b24e2bSVaishali Kulkarni 
50*14b24e2bSVaishali Kulkarni /**
51*14b24e2bSVaishali Kulkarni  * @brief ecore_init_dp - initialize the debug level
52*14b24e2bSVaishali Kulkarni  *
53*14b24e2bSVaishali Kulkarni  * @param p_dev
54*14b24e2bSVaishali Kulkarni  * @param dp_module
55*14b24e2bSVaishali Kulkarni  * @param dp_level
56*14b24e2bSVaishali Kulkarni  * @param dp_ctx
57*14b24e2bSVaishali Kulkarni  */
58*14b24e2bSVaishali Kulkarni void ecore_init_dp(struct ecore_dev *p_dev,
59*14b24e2bSVaishali Kulkarni 		   u32 dp_module,
60*14b24e2bSVaishali Kulkarni 		   u8 dp_level,
61*14b24e2bSVaishali Kulkarni 		   void *dp_ctx);
62*14b24e2bSVaishali Kulkarni 
63*14b24e2bSVaishali Kulkarni /**
64*14b24e2bSVaishali Kulkarni  * @brief ecore_init_struct - initialize the device structure to
65*14b24e2bSVaishali Kulkarni  *        its defaults
66*14b24e2bSVaishali Kulkarni  *
67*14b24e2bSVaishali Kulkarni  * @param p_dev
68*14b24e2bSVaishali Kulkarni  */
69*14b24e2bSVaishali Kulkarni void ecore_init_struct(struct ecore_dev *p_dev);
70*14b24e2bSVaishali Kulkarni 
71*14b24e2bSVaishali Kulkarni /**
72*14b24e2bSVaishali Kulkarni  * @brief ecore_resc_free -
73*14b24e2bSVaishali Kulkarni  *
74*14b24e2bSVaishali Kulkarni  * @param p_dev
75*14b24e2bSVaishali Kulkarni  */
76*14b24e2bSVaishali Kulkarni void ecore_resc_free(struct ecore_dev *p_dev);
77*14b24e2bSVaishali Kulkarni 
78*14b24e2bSVaishali Kulkarni /**
79*14b24e2bSVaishali Kulkarni  * @brief ecore_resc_alloc -
80*14b24e2bSVaishali Kulkarni  *
81*14b24e2bSVaishali Kulkarni  * @param p_dev
82*14b24e2bSVaishali Kulkarni  *
83*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
84*14b24e2bSVaishali Kulkarni  */
85*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev);
86*14b24e2bSVaishali Kulkarni 
87*14b24e2bSVaishali Kulkarni /**
88*14b24e2bSVaishali Kulkarni  * @brief ecore_resc_setup -
89*14b24e2bSVaishali Kulkarni  *
90*14b24e2bSVaishali Kulkarni  * @param p_dev
91*14b24e2bSVaishali Kulkarni  */
92*14b24e2bSVaishali Kulkarni void ecore_resc_setup(struct ecore_dev *p_dev);
93*14b24e2bSVaishali Kulkarni 
94*14b24e2bSVaishali Kulkarni enum ecore_override_force_load {
95*14b24e2bSVaishali Kulkarni 	ECORE_OVERRIDE_FORCE_LOAD_NONE,
96*14b24e2bSVaishali Kulkarni 	ECORE_OVERRIDE_FORCE_LOAD_ALWAYS,
97*14b24e2bSVaishali Kulkarni 	ECORE_OVERRIDE_FORCE_LOAD_NEVER,
98*14b24e2bSVaishali Kulkarni };
99*14b24e2bSVaishali Kulkarni 
100*14b24e2bSVaishali Kulkarni struct ecore_drv_load_params {
101*14b24e2bSVaishali Kulkarni 	/* Indicates whether the driver is running over a crash kernel.
102*14b24e2bSVaishali Kulkarni 	 * As part of the load request, this will be used for providing the
103*14b24e2bSVaishali Kulkarni 	 * driver role to the MFW.
104*14b24e2bSVaishali Kulkarni 	 * In case of a crash kernel over PDA - this should be set to false.
105*14b24e2bSVaishali Kulkarni 	 */
106*14b24e2bSVaishali Kulkarni 	bool is_crash_kernel;
107*14b24e2bSVaishali Kulkarni 
108*14b24e2bSVaishali Kulkarni 	/* The timeout value that the MFW should use when locking the engine for
109*14b24e2bSVaishali Kulkarni 	 * the driver load process.
110*14b24e2bSVaishali Kulkarni 	 * A value of '0' means the default value, and '255' means no timeout.
111*14b24e2bSVaishali Kulkarni 	 */
112*14b24e2bSVaishali Kulkarni 	u8 mfw_timeout_val;
113*14b24e2bSVaishali Kulkarni #define ECORE_LOAD_REQ_LOCK_TO_DEFAULT	0
114*14b24e2bSVaishali Kulkarni #define ECORE_LOAD_REQ_LOCK_TO_NONE	255
115*14b24e2bSVaishali Kulkarni 
116*14b24e2bSVaishali Kulkarni 	/* Avoid engine reset when first PF loads on it */
117*14b24e2bSVaishali Kulkarni 	bool avoid_eng_reset;
118*14b24e2bSVaishali Kulkarni 
119*14b24e2bSVaishali Kulkarni 	/* Allow overriding the default force load behavior */
120*14b24e2bSVaishali Kulkarni 	enum ecore_override_force_load override_force_load;
121*14b24e2bSVaishali Kulkarni };
122*14b24e2bSVaishali Kulkarni 
123*14b24e2bSVaishali Kulkarni struct ecore_hw_init_params {
124*14b24e2bSVaishali Kulkarni 	/* Tunneling parameters */
125*14b24e2bSVaishali Kulkarni 	struct ecore_tunnel_info *p_tunn;
126*14b24e2bSVaishali Kulkarni 
127*14b24e2bSVaishali Kulkarni 	bool b_hw_start;
128*14b24e2bSVaishali Kulkarni 
129*14b24e2bSVaishali Kulkarni 	/* Interrupt mode [msix, inta, etc.] to use */
130*14b24e2bSVaishali Kulkarni 	enum ecore_int_mode int_mode;
131*14b24e2bSVaishali Kulkarni 
132*14b24e2bSVaishali Kulkarni 	/* NPAR tx switching to be used for vports configured for tx-switching */
133*14b24e2bSVaishali Kulkarni 	bool allow_npar_tx_switch;
134*14b24e2bSVaishali Kulkarni 
135*14b24e2bSVaishali Kulkarni 	/* Binary fw data pointer in binary fw file */
136*14b24e2bSVaishali Kulkarni 	const u8 *bin_fw_data;
137*14b24e2bSVaishali Kulkarni 
138*14b24e2bSVaishali Kulkarni 	/* Driver load parameters */
139*14b24e2bSVaishali Kulkarni 	struct ecore_drv_load_params *p_drv_load_params;
140*14b24e2bSVaishali Kulkarni };
141*14b24e2bSVaishali Kulkarni 
142*14b24e2bSVaishali Kulkarni /**
143*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_init -
144*14b24e2bSVaishali Kulkarni  *
145*14b24e2bSVaishali Kulkarni  * @param p_dev
146*14b24e2bSVaishali Kulkarni  * @param p_params
147*14b24e2bSVaishali Kulkarni  *
148*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
149*14b24e2bSVaishali Kulkarni  */
150*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_hw_init(struct ecore_dev *p_dev,
151*14b24e2bSVaishali Kulkarni 				   struct ecore_hw_init_params *p_params);
152*14b24e2bSVaishali Kulkarni 
153*14b24e2bSVaishali Kulkarni /**
154*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_timers_stop_all -
155*14b24e2bSVaishali Kulkarni  *
156*14b24e2bSVaishali Kulkarni  * @param p_dev
157*14b24e2bSVaishali Kulkarni  *
158*14b24e2bSVaishali Kulkarni  * @return void
159*14b24e2bSVaishali Kulkarni  */
160*14b24e2bSVaishali Kulkarni void ecore_hw_timers_stop_all(struct ecore_dev *p_dev);
161*14b24e2bSVaishali Kulkarni 
162*14b24e2bSVaishali Kulkarni /**
163*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_stop -
164*14b24e2bSVaishali Kulkarni  *
165*14b24e2bSVaishali Kulkarni  * @param p_dev
166*14b24e2bSVaishali Kulkarni  *
167*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
168*14b24e2bSVaishali Kulkarni  */
169*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_hw_stop(struct ecore_dev *p_dev);
170*14b24e2bSVaishali Kulkarni 
171*14b24e2bSVaishali Kulkarni /**
172*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_stop_fastpath -should be called incase
173*14b24e2bSVaishali Kulkarni  *        slowpath is still required for the device,
174*14b24e2bSVaishali Kulkarni  *        but fastpath is not.
175*14b24e2bSVaishali Kulkarni  *
176*14b24e2bSVaishali Kulkarni  * @param p_dev
177*14b24e2bSVaishali Kulkarni  *
178*14b24e2bSVaishali Kulkarni  */
179*14b24e2bSVaishali Kulkarni void ecore_hw_stop_fastpath(struct ecore_dev *p_dev);
180*14b24e2bSVaishali Kulkarni 
181*14b24e2bSVaishali Kulkarni #ifndef LINUX_REMOVE
182*14b24e2bSVaishali Kulkarni /**
183*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_hibernate_prepare -should be called when
184*14b24e2bSVaishali Kulkarni  *        the system is going into the hibernate state
185*14b24e2bSVaishali Kulkarni  *
186*14b24e2bSVaishali Kulkarni  * @param p_dev
187*14b24e2bSVaishali Kulkarni  *
188*14b24e2bSVaishali Kulkarni  */
189*14b24e2bSVaishali Kulkarni void ecore_hw_hibernate_prepare(struct ecore_dev *p_dev);
190*14b24e2bSVaishali Kulkarni 
191*14b24e2bSVaishali Kulkarni /**
192*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_hibernate_resume -should be called when the system is
193*14b24e2bSVaishali Kulkarni 	  resuming from D3 power state and before calling ecore_hw_init.
194*14b24e2bSVaishali Kulkarni  *
195*14b24e2bSVaishali Kulkarni  * @param p_hwfn
196*14b24e2bSVaishali Kulkarni  *
197*14b24e2bSVaishali Kulkarni  */
198*14b24e2bSVaishali Kulkarni void ecore_hw_hibernate_resume(struct ecore_dev *p_dev);
199*14b24e2bSVaishali Kulkarni 
200*14b24e2bSVaishali Kulkarni #endif
201*14b24e2bSVaishali Kulkarni 
202*14b24e2bSVaishali Kulkarni /**
203*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_start_fastpath -restart fastpath traffic,
204*14b24e2bSVaishali Kulkarni  *        only if hw_stop_fastpath was called
205*14b24e2bSVaishali Kulkarni 
206*14b24e2bSVaishali Kulkarni  * @param p_dev
207*14b24e2bSVaishali Kulkarni  *
208*14b24e2bSVaishali Kulkarni  */
209*14b24e2bSVaishali Kulkarni void ecore_hw_start_fastpath(struct ecore_hwfn *p_hwfn);
210*14b24e2bSVaishali Kulkarni 
211*14b24e2bSVaishali Kulkarni enum ecore_hw_prepare_result {
212*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_SUCCESS,
213*14b24e2bSVaishali Kulkarni 
214*14b24e2bSVaishali Kulkarni 	/* FAILED results indicate probe has failed & cleaned up */
215*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_FAILED_ENG2,
216*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_FAILED_ME,
217*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_FAILED_MEM,
218*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_FAILED_DEV,
219*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_FAILED_NVM,
220*14b24e2bSVaishali Kulkarni 
221*14b24e2bSVaishali Kulkarni 	/* BAD results indicate probe is passed even though some wrongness
222*14b24e2bSVaishali Kulkarni 	 * has occurred; Trying to actually use [I.e., hw_init()] might have
223*14b24e2bSVaishali Kulkarni 	 * dire reprecautions.
224*14b24e2bSVaishali Kulkarni 	 */
225*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_BAD_IOV,
226*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_BAD_MCP,
227*14b24e2bSVaishali Kulkarni 	ECORE_HW_PREPARE_BAD_IGU,
228*14b24e2bSVaishali Kulkarni };
229*14b24e2bSVaishali Kulkarni 
230*14b24e2bSVaishali Kulkarni struct ecore_hw_prepare_params {
231*14b24e2bSVaishali Kulkarni 	/* Personality to initialize */
232*14b24e2bSVaishali Kulkarni 	int personality;
233*14b24e2bSVaishali Kulkarni 
234*14b24e2bSVaishali Kulkarni 	/* Force the driver's default resource allocation */
235*14b24e2bSVaishali Kulkarni 	bool drv_resc_alloc;
236*14b24e2bSVaishali Kulkarni 
237*14b24e2bSVaishali Kulkarni 	/* Check the reg_fifo after any register access */
238*14b24e2bSVaishali Kulkarni 	bool chk_reg_fifo;
239*14b24e2bSVaishali Kulkarni 
240*14b24e2bSVaishali Kulkarni 	/* Request the MFW to initiate PF FLR */
241*14b24e2bSVaishali Kulkarni 	bool initiate_pf_flr;
242*14b24e2bSVaishali Kulkarni 
243*14b24e2bSVaishali Kulkarni 	/* The OS Epoch time in seconds */
244*14b24e2bSVaishali Kulkarni 	u32 epoch;
245*14b24e2bSVaishali Kulkarni 
246*14b24e2bSVaishali Kulkarni 	/* Allow the MFW to collect a crash dump */
247*14b24e2bSVaishali Kulkarni 	bool allow_mdump;
248*14b24e2bSVaishali Kulkarni 
249*14b24e2bSVaishali Kulkarni 	/* Allow prepare to pass even if some initializations are failing.
250*14b24e2bSVaishali Kulkarni 	 * If set, the `p_prepare_res' field would be set with the return,
251*14b24e2bSVaishali Kulkarni 	 * and might allow probe to pass even if there are certain issues.
252*14b24e2bSVaishali Kulkarni 	 */
253*14b24e2bSVaishali Kulkarni 	bool b_relaxed_probe;
254*14b24e2bSVaishali Kulkarni 	enum ecore_hw_prepare_result p_relaxed_res;
255*14b24e2bSVaishali Kulkarni };
256*14b24e2bSVaishali Kulkarni 
257*14b24e2bSVaishali Kulkarni /**
258*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_prepare -
259*14b24e2bSVaishali Kulkarni  *
260*14b24e2bSVaishali Kulkarni  * @param p_dev
261*14b24e2bSVaishali Kulkarni  * @param p_params
262*14b24e2bSVaishali Kulkarni  *
263*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
264*14b24e2bSVaishali Kulkarni  */
265*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_hw_prepare(struct ecore_dev *p_dev,
266*14b24e2bSVaishali Kulkarni 				      struct ecore_hw_prepare_params *p_params);
267*14b24e2bSVaishali Kulkarni 
268*14b24e2bSVaishali Kulkarni /**
269*14b24e2bSVaishali Kulkarni  * @brief ecore_hw_remove -
270*14b24e2bSVaishali Kulkarni  *
271*14b24e2bSVaishali Kulkarni  * @param p_dev
272*14b24e2bSVaishali Kulkarni  */
273*14b24e2bSVaishali Kulkarni void ecore_hw_remove(struct ecore_dev *p_dev);
274*14b24e2bSVaishali Kulkarni 
275*14b24e2bSVaishali Kulkarni /**
276*14b24e2bSVaishali Kulkarni * @brief ecore_set_nwuf_reg -
277*14b24e2bSVaishali Kulkarni *
278*14b24e2bSVaishali Kulkarni * @param p_dev
279*14b24e2bSVaishali Kulkarni * @param wol_flag - wol_capability
280*14b24e2bSVaishali Kulkarni * @param reg_idx - Index of the pattern register
281*14b24e2bSVaishali Kulkarni * @param pattern_size - size of pattern
282*14b24e2bSVaishali Kulkarni * @param crc - CRC value of patter & mask
283*14b24e2bSVaishali Kulkarni *
284*14b24e2bSVaishali Kulkarni * @return enum _ecore_status_t
285*14b24e2bSVaishali Kulkarni */
286*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_set_nwuf_reg(struct ecore_dev *p_dev,
287*14b24e2bSVaishali Kulkarni 	const bool b_enable,
288*14b24e2bSVaishali Kulkarni 	u32 reg_idx,
289*14b24e2bSVaishali Kulkarni 	u32 pattern_size,
290*14b24e2bSVaishali Kulkarni 	u32 crc);
291*14b24e2bSVaishali Kulkarni 
292*14b24e2bSVaishali Kulkarni /**
293*14b24e2bSVaishali Kulkarni * @brief ecore_get_wake_info - get magic packet buffer
294*14b24e2bSVaishali Kulkarni *
295*14b24e2bSVaishali Kulkarni * @param p_dev
296*14b24e2bSVaishali Kulkarni * @param wake_info - pointer to ecore_wake_info buffer
297*14b24e2bSVaishali Kulkarni *
298*14b24e2bSVaishali Kulkarni * @return enum _ecore_status_t
299*14b24e2bSVaishali Kulkarni */
300*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_get_wake_info(struct ecore_dev *p_dev,
301*14b24e2bSVaishali Kulkarni 	struct ecore_wake_info *wake_info);
302*14b24e2bSVaishali Kulkarni 
303*14b24e2bSVaishali Kulkarni /**
304*14b24e2bSVaishali Kulkarni * @brief ecore_wol_buffer_clear - Clear magic package buffer
305*14b24e2bSVaishali Kulkarni *
306*14b24e2bSVaishali Kulkarni * @param p_dev
307*14b24e2bSVaishali Kulkarni *
308*14b24e2bSVaishali Kulkarni * @return void
309*14b24e2bSVaishali Kulkarni */
310*14b24e2bSVaishali Kulkarni void ecore_wol_buffer_clear(struct ecore_dev *p_dev);
311*14b24e2bSVaishali Kulkarni 
312*14b24e2bSVaishali Kulkarni /**
313*14b24e2bSVaishali Kulkarni  * @brief ecore_ptt_acquire - Allocate a PTT window
314*14b24e2bSVaishali Kulkarni  *
315*14b24e2bSVaishali Kulkarni  * Should be called at the entry point to the driver (at the beginning of an
316*14b24e2bSVaishali Kulkarni  * exported function)
317*14b24e2bSVaishali Kulkarni  *
318*14b24e2bSVaishali Kulkarni  * @param p_hwfn
319*14b24e2bSVaishali Kulkarni  *
320*14b24e2bSVaishali Kulkarni  * @return struct ecore_ptt
321*14b24e2bSVaishali Kulkarni  */
322*14b24e2bSVaishali Kulkarni struct ecore_ptt *ecore_ptt_acquire(struct ecore_hwfn *p_hwfn);
323*14b24e2bSVaishali Kulkarni 
324*14b24e2bSVaishali Kulkarni /**
325*14b24e2bSVaishali Kulkarni  * @brief ecore_ptt_release - Release PTT Window
326*14b24e2bSVaishali Kulkarni  *
327*14b24e2bSVaishali Kulkarni  * Should be called at the end of a flow - at the end of the function that
328*14b24e2bSVaishali Kulkarni  * acquired the PTT.
329*14b24e2bSVaishali Kulkarni  *
330*14b24e2bSVaishali Kulkarni  *
331*14b24e2bSVaishali Kulkarni  * @param p_hwfn
332*14b24e2bSVaishali Kulkarni  * @param p_ptt
333*14b24e2bSVaishali Kulkarni  */
334*14b24e2bSVaishali Kulkarni void ecore_ptt_release(struct ecore_hwfn *p_hwfn,
335*14b24e2bSVaishali Kulkarni 		       struct ecore_ptt *p_ptt);
336*14b24e2bSVaishali Kulkarni 
337*14b24e2bSVaishali Kulkarni #ifndef __EXTRACT__LINUX__
338*14b24e2bSVaishali Kulkarni struct ecore_eth_stats_common {
339*14b24e2bSVaishali Kulkarni 	u64 no_buff_discards;
340*14b24e2bSVaishali Kulkarni 	u64 packet_too_big_discard;
341*14b24e2bSVaishali Kulkarni 	u64 ttl0_discard;
342*14b24e2bSVaishali Kulkarni 	u64 rx_ucast_bytes;
343*14b24e2bSVaishali Kulkarni 	u64 rx_mcast_bytes;
344*14b24e2bSVaishali Kulkarni 	u64 rx_bcast_bytes;
345*14b24e2bSVaishali Kulkarni 	u64 rx_ucast_pkts;
346*14b24e2bSVaishali Kulkarni 	u64 rx_mcast_pkts;
347*14b24e2bSVaishali Kulkarni 	u64 rx_bcast_pkts;
348*14b24e2bSVaishali Kulkarni 	u64 mftag_filter_discards;
349*14b24e2bSVaishali Kulkarni 	u64 mac_filter_discards;
350*14b24e2bSVaishali Kulkarni 	u64 tx_ucast_bytes;
351*14b24e2bSVaishali Kulkarni 	u64 tx_mcast_bytes;
352*14b24e2bSVaishali Kulkarni 	u64 tx_bcast_bytes;
353*14b24e2bSVaishali Kulkarni 	u64 tx_ucast_pkts;
354*14b24e2bSVaishali Kulkarni 	u64 tx_mcast_pkts;
355*14b24e2bSVaishali Kulkarni 	u64 tx_bcast_pkts;
356*14b24e2bSVaishali Kulkarni 	u64 tx_err_drop_pkts;
357*14b24e2bSVaishali Kulkarni 	u64 tpa_coalesced_pkts;
358*14b24e2bSVaishali Kulkarni 	u64 tpa_coalesced_events;
359*14b24e2bSVaishali Kulkarni 	u64 tpa_aborts_num;
360*14b24e2bSVaishali Kulkarni 	u64 tpa_not_coalesced_pkts;
361*14b24e2bSVaishali Kulkarni 	u64 tpa_coalesced_bytes;
362*14b24e2bSVaishali Kulkarni 
363*14b24e2bSVaishali Kulkarni 	/* port */
364*14b24e2bSVaishali Kulkarni 	u64 rx_64_byte_packets;
365*14b24e2bSVaishali Kulkarni 	u64 rx_65_to_127_byte_packets;
366*14b24e2bSVaishali Kulkarni 	u64 rx_128_to_255_byte_packets;
367*14b24e2bSVaishali Kulkarni 	u64 rx_256_to_511_byte_packets;
368*14b24e2bSVaishali Kulkarni 	u64 rx_512_to_1023_byte_packets;
369*14b24e2bSVaishali Kulkarni 	u64 rx_1024_to_1518_byte_packets;
370*14b24e2bSVaishali Kulkarni 	u64 rx_crc_errors;
371*14b24e2bSVaishali Kulkarni 	u64 rx_mac_crtl_frames;
372*14b24e2bSVaishali Kulkarni 	u64 rx_pause_frames;
373*14b24e2bSVaishali Kulkarni 	u64 rx_pfc_frames;
374*14b24e2bSVaishali Kulkarni 	u64 rx_align_errors;
375*14b24e2bSVaishali Kulkarni 	u64 rx_carrier_errors;
376*14b24e2bSVaishali Kulkarni 	u64 rx_oversize_packets;
377*14b24e2bSVaishali Kulkarni 	u64 rx_jabbers;
378*14b24e2bSVaishali Kulkarni 	u64 rx_undersize_packets;
379*14b24e2bSVaishali Kulkarni 	u64 rx_fragments;
380*14b24e2bSVaishali Kulkarni 	u64 tx_64_byte_packets;
381*14b24e2bSVaishali Kulkarni 	u64 tx_65_to_127_byte_packets;
382*14b24e2bSVaishali Kulkarni 	u64 tx_128_to_255_byte_packets;
383*14b24e2bSVaishali Kulkarni 	u64 tx_256_to_511_byte_packets;
384*14b24e2bSVaishali Kulkarni 	u64 tx_512_to_1023_byte_packets;
385*14b24e2bSVaishali Kulkarni 	u64 tx_1024_to_1518_byte_packets;
386*14b24e2bSVaishali Kulkarni 	u64 tx_pause_frames;
387*14b24e2bSVaishali Kulkarni 	u64 tx_pfc_frames;
388*14b24e2bSVaishali Kulkarni 	u64 brb_truncates;
389*14b24e2bSVaishali Kulkarni 	u64 brb_discards;
390*14b24e2bSVaishali Kulkarni 	u64 rx_mac_bytes;
391*14b24e2bSVaishali Kulkarni 	u64 rx_mac_uc_packets;
392*14b24e2bSVaishali Kulkarni 	u64 rx_mac_mc_packets;
393*14b24e2bSVaishali Kulkarni 	u64 rx_mac_bc_packets;
394*14b24e2bSVaishali Kulkarni 	u64 rx_mac_frames_ok;
395*14b24e2bSVaishali Kulkarni 	u64 tx_mac_bytes;
396*14b24e2bSVaishali Kulkarni 	u64 tx_mac_uc_packets;
397*14b24e2bSVaishali Kulkarni 	u64 tx_mac_mc_packets;
398*14b24e2bSVaishali Kulkarni 	u64 tx_mac_bc_packets;
399*14b24e2bSVaishali Kulkarni 	u64 tx_mac_ctrl_frames;
400*14b24e2bSVaishali Kulkarni };
401*14b24e2bSVaishali Kulkarni 
402*14b24e2bSVaishali Kulkarni struct ecore_eth_stats_bb {
403*14b24e2bSVaishali Kulkarni 	u64 rx_1519_to_1522_byte_packets;
404*14b24e2bSVaishali Kulkarni 	u64 rx_1519_to_2047_byte_packets;
405*14b24e2bSVaishali Kulkarni 	u64 rx_2048_to_4095_byte_packets;
406*14b24e2bSVaishali Kulkarni 	u64 rx_4096_to_9216_byte_packets;
407*14b24e2bSVaishali Kulkarni 	u64 rx_9217_to_16383_byte_packets;
408*14b24e2bSVaishali Kulkarni 	u64 tx_1519_to_2047_byte_packets;
409*14b24e2bSVaishali Kulkarni 	u64 tx_2048_to_4095_byte_packets;
410*14b24e2bSVaishali Kulkarni 	u64 tx_4096_to_9216_byte_packets;
411*14b24e2bSVaishali Kulkarni 	u64 tx_9217_to_16383_byte_packets;
412*14b24e2bSVaishali Kulkarni 	u64 tx_lpi_entry_count;
413*14b24e2bSVaishali Kulkarni 	u64 tx_total_collisions;
414*14b24e2bSVaishali Kulkarni };
415*14b24e2bSVaishali Kulkarni 
416*14b24e2bSVaishali Kulkarni struct ecore_eth_stats_ah {
417*14b24e2bSVaishali Kulkarni 	u64 rx_1519_to_max_byte_packets;
418*14b24e2bSVaishali Kulkarni 	u64 tx_1519_to_max_byte_packets;
419*14b24e2bSVaishali Kulkarni };
420*14b24e2bSVaishali Kulkarni 
421*14b24e2bSVaishali Kulkarni struct ecore_eth_stats {
422*14b24e2bSVaishali Kulkarni 	struct ecore_eth_stats_common common;
423*14b24e2bSVaishali Kulkarni 	union {
424*14b24e2bSVaishali Kulkarni 		struct ecore_eth_stats_bb bb;
425*14b24e2bSVaishali Kulkarni 		struct ecore_eth_stats_ah ah;
426*14b24e2bSVaishali Kulkarni 	};
427*14b24e2bSVaishali Kulkarni };
428*14b24e2bSVaishali Kulkarni #endif
429*14b24e2bSVaishali Kulkarni 
430*14b24e2bSVaishali Kulkarni enum ecore_dmae_address_type_t {
431*14b24e2bSVaishali Kulkarni 	ECORE_DMAE_ADDRESS_HOST_VIRT,
432*14b24e2bSVaishali Kulkarni 	ECORE_DMAE_ADDRESS_HOST_PHYS,
433*14b24e2bSVaishali Kulkarni 	ECORE_DMAE_ADDRESS_GRC
434*14b24e2bSVaishali Kulkarni };
435*14b24e2bSVaishali Kulkarni 
436*14b24e2bSVaishali Kulkarni /* value of flags If ECORE_DMAE_FLAG_RW_REPL_SRC flag is set and the
437*14b24e2bSVaishali Kulkarni  * source is a block of length DMAE_MAX_RW_SIZE and the
438*14b24e2bSVaishali Kulkarni  * destination is larger, the source block will be duplicated as
439*14b24e2bSVaishali Kulkarni  * many times as required to fill the destination block. This is
440*14b24e2bSVaishali Kulkarni  * used mostly to write a zeroed buffer to destination address
441*14b24e2bSVaishali Kulkarni  * using DMA
442*14b24e2bSVaishali Kulkarni  */
443*14b24e2bSVaishali Kulkarni #define ECORE_DMAE_FLAG_RW_REPL_SRC	0x00000001
444*14b24e2bSVaishali Kulkarni #define ECORE_DMAE_FLAG_VF_SRC		0x00000002
445*14b24e2bSVaishali Kulkarni #define ECORE_DMAE_FLAG_VF_DST		0x00000004
446*14b24e2bSVaishali Kulkarni #define ECORE_DMAE_FLAG_COMPLETION_DST	0x00000008
447*14b24e2bSVaishali Kulkarni 
448*14b24e2bSVaishali Kulkarni struct ecore_dmae_params {
449*14b24e2bSVaishali Kulkarni 	u32 flags; /* consists of ECORE_DMAE_FLAG_* values */
450*14b24e2bSVaishali Kulkarni 	u8 src_vfid;
451*14b24e2bSVaishali Kulkarni 	u8 dst_vfid;
452*14b24e2bSVaishali Kulkarni };
453*14b24e2bSVaishali Kulkarni 
454*14b24e2bSVaishali Kulkarni /**
455*14b24e2bSVaishali Kulkarni  * @brief ecore_dmae_host2grc - copy data from source addr to
456*14b24e2bSVaishali Kulkarni  * dmae registers using the given ptt
457*14b24e2bSVaishali Kulkarni  *
458*14b24e2bSVaishali Kulkarni  * @param p_hwfn
459*14b24e2bSVaishali Kulkarni  * @param p_ptt
460*14b24e2bSVaishali Kulkarni  * @param source_addr
461*14b24e2bSVaishali Kulkarni  * @param grc_addr (dmae_data_offset)
462*14b24e2bSVaishali Kulkarni  * @param size_in_dwords
463*14b24e2bSVaishali Kulkarni  * @param flags (one of the flags defined above)
464*14b24e2bSVaishali Kulkarni  */
465*14b24e2bSVaishali Kulkarni enum _ecore_status_t
466*14b24e2bSVaishali Kulkarni ecore_dmae_host2grc(struct ecore_hwfn *p_hwfn,
467*14b24e2bSVaishali Kulkarni 		    struct ecore_ptt *p_ptt,
468*14b24e2bSVaishali Kulkarni 		    u64 source_addr,
469*14b24e2bSVaishali Kulkarni 		    u32 grc_addr,
470*14b24e2bSVaishali Kulkarni 		    u32 size_in_dwords,
471*14b24e2bSVaishali Kulkarni 		    u32 flags);
472*14b24e2bSVaishali Kulkarni 
473*14b24e2bSVaishali Kulkarni /**
474*14b24e2bSVaishali Kulkarni  * @brief ecore_dmae_grc2host - Read data from dmae data offset
475*14b24e2bSVaishali Kulkarni  * to source address using the given ptt
476*14b24e2bSVaishali Kulkarni  *
477*14b24e2bSVaishali Kulkarni  * @param p_ptt
478*14b24e2bSVaishali Kulkarni  * @param grc_addr (dmae_data_offset)
479*14b24e2bSVaishali Kulkarni  * @param dest_addr
480*14b24e2bSVaishali Kulkarni  * @param size_in_dwords
481*14b24e2bSVaishali Kulkarni  * @param flags - one of the flags defined above
482*14b24e2bSVaishali Kulkarni  */
483*14b24e2bSVaishali Kulkarni enum _ecore_status_t
484*14b24e2bSVaishali Kulkarni ecore_dmae_grc2host(struct ecore_hwfn *p_hwfn,
485*14b24e2bSVaishali Kulkarni 		    struct ecore_ptt *p_ptt,
486*14b24e2bSVaishali Kulkarni 		    u32 grc_addr,
487*14b24e2bSVaishali Kulkarni 		    dma_addr_t dest_addr,
488*14b24e2bSVaishali Kulkarni 		    u32 size_in_dwords,
489*14b24e2bSVaishali Kulkarni 		    u32 flags);
490*14b24e2bSVaishali Kulkarni 
491*14b24e2bSVaishali Kulkarni /**
492*14b24e2bSVaishali Kulkarni  * @brief ecore_dmae_host2host - copy data from to source address
493*14b24e2bSVaishali Kulkarni  * to a destination adress (for SRIOV) using the given ptt
494*14b24e2bSVaishali Kulkarni  *
495*14b24e2bSVaishali Kulkarni  * @param p_hwfn
496*14b24e2bSVaishali Kulkarni  * @param p_ptt
497*14b24e2bSVaishali Kulkarni  * @param source_addr
498*14b24e2bSVaishali Kulkarni  * @param dest_addr
499*14b24e2bSVaishali Kulkarni  * @param size_in_dwords
500*14b24e2bSVaishali Kulkarni  * @param params
501*14b24e2bSVaishali Kulkarni  */
502*14b24e2bSVaishali Kulkarni enum _ecore_status_t
503*14b24e2bSVaishali Kulkarni ecore_dmae_host2host(struct ecore_hwfn *p_hwfn,
504*14b24e2bSVaishali Kulkarni 		     struct ecore_ptt *p_ptt,
505*14b24e2bSVaishali Kulkarni 		     dma_addr_t source_addr,
506*14b24e2bSVaishali Kulkarni 		     dma_addr_t dest_addr,
507*14b24e2bSVaishali Kulkarni 		     u32 size_in_dwords,
508*14b24e2bSVaishali Kulkarni 		     struct ecore_dmae_params *p_params);
509*14b24e2bSVaishali Kulkarni 
510*14b24e2bSVaishali Kulkarni /**
511*14b24e2bSVaishali Kulkarni  * @brief ecore_chain_alloc - Allocate and initialize a chain
512*14b24e2bSVaishali Kulkarni  *
513*14b24e2bSVaishali Kulkarni  * @param p_hwfn
514*14b24e2bSVaishali Kulkarni  * @param intended_use
515*14b24e2bSVaishali Kulkarni  * @param mode
516*14b24e2bSVaishali Kulkarni  * @param num_elems
517*14b24e2bSVaishali Kulkarni  * @param elem_size
518*14b24e2bSVaishali Kulkarni  * @param p_chain
519*14b24e2bSVaishali Kulkarni  *
520*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
521*14b24e2bSVaishali Kulkarni  */
522*14b24e2bSVaishali Kulkarni enum _ecore_status_t
523*14b24e2bSVaishali Kulkarni ecore_chain_alloc(struct ecore_dev *p_dev,
524*14b24e2bSVaishali Kulkarni 		  enum ecore_chain_use_mode intended_use,
525*14b24e2bSVaishali Kulkarni 		  enum ecore_chain_mode mode,
526*14b24e2bSVaishali Kulkarni 		  enum ecore_chain_cnt_type cnt_type,
527*14b24e2bSVaishali Kulkarni 		  u32 num_elems,
528*14b24e2bSVaishali Kulkarni 		  osal_size_t elem_size,
529*14b24e2bSVaishali Kulkarni 		  struct ecore_chain *p_chain,
530*14b24e2bSVaishali Kulkarni 		  struct ecore_chain_ext_pbl *ext_pbl);
531*14b24e2bSVaishali Kulkarni 
532*14b24e2bSVaishali Kulkarni /**
533*14b24e2bSVaishali Kulkarni  * @brief ecore_chain_free - Free chain DMA memory
534*14b24e2bSVaishali Kulkarni  *
535*14b24e2bSVaishali Kulkarni  * @param p_hwfn
536*14b24e2bSVaishali Kulkarni  * @param p_chain
537*14b24e2bSVaishali Kulkarni  */
538*14b24e2bSVaishali Kulkarni void ecore_chain_free(struct ecore_dev *p_dev,
539*14b24e2bSVaishali Kulkarni 		      struct ecore_chain *p_chain);
540*14b24e2bSVaishali Kulkarni 
541*14b24e2bSVaishali Kulkarni /**
542*14b24e2bSVaishali Kulkarni  * @@brief ecore_fw_l2_queue - Get absolute L2 queue ID
543*14b24e2bSVaishali Kulkarni  *
544*14b24e2bSVaishali Kulkarni  *  @param p_hwfn
545*14b24e2bSVaishali Kulkarni  *  @param src_id - relative to p_hwfn
546*14b24e2bSVaishali Kulkarni  *  @param dst_id - absolute per engine
547*14b24e2bSVaishali Kulkarni  *
548*14b24e2bSVaishali Kulkarni  *  @return enum _ecore_status_t
549*14b24e2bSVaishali Kulkarni  */
550*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_fw_l2_queue(struct ecore_hwfn *p_hwfn,
551*14b24e2bSVaishali Kulkarni 				       u16 src_id,
552*14b24e2bSVaishali Kulkarni 				       u16 *dst_id);
553*14b24e2bSVaishali Kulkarni 
554*14b24e2bSVaishali Kulkarni /**
555*14b24e2bSVaishali Kulkarni  * @@brief ecore_fw_vport - Get absolute vport ID
556*14b24e2bSVaishali Kulkarni  *
557*14b24e2bSVaishali Kulkarni  *  @param p_hwfn
558*14b24e2bSVaishali Kulkarni  *  @param src_id - relative to p_hwfn
559*14b24e2bSVaishali Kulkarni  *  @param dst_id - absolute per engine
560*14b24e2bSVaishali Kulkarni  *
561*14b24e2bSVaishali Kulkarni  *  @return enum _ecore_status_t
562*14b24e2bSVaishali Kulkarni  */
563*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_fw_vport(struct ecore_hwfn *p_hwfn,
564*14b24e2bSVaishali Kulkarni 				    u8 src_id,
565*14b24e2bSVaishali Kulkarni 				    u8 *dst_id);
566*14b24e2bSVaishali Kulkarni 
567*14b24e2bSVaishali Kulkarni /**
568*14b24e2bSVaishali Kulkarni  * @@brief ecore_fw_rss_eng - Get absolute RSS engine ID
569*14b24e2bSVaishali Kulkarni  *
570*14b24e2bSVaishali Kulkarni  *  @param p_hwfn
571*14b24e2bSVaishali Kulkarni  *  @param src_id - relative to p_hwfn
572*14b24e2bSVaishali Kulkarni  *  @param dst_id - absolute per engine
573*14b24e2bSVaishali Kulkarni  *
574*14b24e2bSVaishali Kulkarni  *  @return enum _ecore_status_t
575*14b24e2bSVaishali Kulkarni  */
576*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_fw_rss_eng(struct ecore_hwfn *p_hwfn,
577*14b24e2bSVaishali Kulkarni 				      u8 src_id,
578*14b24e2bSVaishali Kulkarni 				      u8 *dst_id);
579*14b24e2bSVaishali Kulkarni 
580*14b24e2bSVaishali Kulkarni /**
581*14b24e2bSVaishali Kulkarni  * @brief ecore_llh_add_mac_filter - configures a MAC filter in llh
582*14b24e2bSVaishali Kulkarni  *
583*14b24e2bSVaishali Kulkarni  * @param p_hwfn
584*14b24e2bSVaishali Kulkarni  * @param p_ptt
585*14b24e2bSVaishali Kulkarni  * @param p_filter - MAC to add
586*14b24e2bSVaishali Kulkarni  */
587*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_llh_add_mac_filter(struct ecore_hwfn *p_hwfn,
588*14b24e2bSVaishali Kulkarni 					  struct ecore_ptt *p_ptt,
589*14b24e2bSVaishali Kulkarni 					  u8 *p_filter);
590*14b24e2bSVaishali Kulkarni 
591*14b24e2bSVaishali Kulkarni /**
592*14b24e2bSVaishali Kulkarni  * @brief ecore_llh_remove_mac_filter - removes a MAC filtre from llh
593*14b24e2bSVaishali Kulkarni  *
594*14b24e2bSVaishali Kulkarni  * @param p_hwfn
595*14b24e2bSVaishali Kulkarni  * @param p_ptt
596*14b24e2bSVaishali Kulkarni  * @param p_filter - MAC to remove
597*14b24e2bSVaishali Kulkarni  */
598*14b24e2bSVaishali Kulkarni void ecore_llh_remove_mac_filter(struct ecore_hwfn *p_hwfn,
599*14b24e2bSVaishali Kulkarni 			     struct ecore_ptt *p_ptt,
600*14b24e2bSVaishali Kulkarni 			     u8 *p_filter);
601*14b24e2bSVaishali Kulkarni 
602*14b24e2bSVaishali Kulkarni enum ecore_llh_port_filter_type_t {
603*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_ETHERTYPE,
604*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_TCP_SRC_PORT,
605*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_TCP_DEST_PORT,
606*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_TCP_SRC_AND_DEST_PORT,
607*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_UDP_SRC_PORT,
608*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_UDP_DEST_PORT,
609*14b24e2bSVaishali Kulkarni 	ECORE_LLH_FILTER_UDP_SRC_AND_DEST_PORT
610*14b24e2bSVaishali Kulkarni };
611*14b24e2bSVaishali Kulkarni 
612*14b24e2bSVaishali Kulkarni /**
613*14b24e2bSVaishali Kulkarni  * @brief ecore_llh_add_protocol_filter - configures a protocol filter in llh
614*14b24e2bSVaishali Kulkarni  *
615*14b24e2bSVaishali Kulkarni  * @param p_hwfn
616*14b24e2bSVaishali Kulkarni  * @param p_ptt
617*14b24e2bSVaishali Kulkarni  * @param source_port_or_eth_type - source port or ethertype to add
618*14b24e2bSVaishali Kulkarni  * @param dest_port - destination port to add
619*14b24e2bSVaishali Kulkarni  * @param type - type of filters and comparing
620*14b24e2bSVaishali Kulkarni  */
621*14b24e2bSVaishali Kulkarni enum _ecore_status_t
622*14b24e2bSVaishali Kulkarni ecore_llh_add_protocol_filter(struct ecore_hwfn *p_hwfn,
623*14b24e2bSVaishali Kulkarni 			      struct ecore_ptt *p_ptt,
624*14b24e2bSVaishali Kulkarni 			      u16 source_port_or_eth_type,
625*14b24e2bSVaishali Kulkarni 			      u16 dest_port,
626*14b24e2bSVaishali Kulkarni 			      enum ecore_llh_port_filter_type_t type);
627*14b24e2bSVaishali Kulkarni 
628*14b24e2bSVaishali Kulkarni /**
629*14b24e2bSVaishali Kulkarni  * @brief ecore_llh_remove_protocol_filter - remove a protocol filter in llh
630*14b24e2bSVaishali Kulkarni  *
631*14b24e2bSVaishali Kulkarni  * @param p_hwfn
632*14b24e2bSVaishali Kulkarni  * @param p_ptt
633*14b24e2bSVaishali Kulkarni  * @param source_port_or_eth_type - source port or ethertype to add
634*14b24e2bSVaishali Kulkarni  * @param dest_port - destination port to add
635*14b24e2bSVaishali Kulkarni  * @param type - type of filters and comparing
636*14b24e2bSVaishali Kulkarni  */
637*14b24e2bSVaishali Kulkarni void
638*14b24e2bSVaishali Kulkarni ecore_llh_remove_protocol_filter(struct ecore_hwfn *p_hwfn,
639*14b24e2bSVaishali Kulkarni 				 struct ecore_ptt *p_ptt,
640*14b24e2bSVaishali Kulkarni 				 u16 source_port_or_eth_type,
641*14b24e2bSVaishali Kulkarni 				 u16 dest_port,
642*14b24e2bSVaishali Kulkarni 				 enum ecore_llh_port_filter_type_t type);
643*14b24e2bSVaishali Kulkarni 
644*14b24e2bSVaishali Kulkarni /**
645*14b24e2bSVaishali Kulkarni  * @brief ecore_llh_clear_all_filters - removes all MAC filters from llh
646*14b24e2bSVaishali Kulkarni  *
647*14b24e2bSVaishali Kulkarni  * @param p_hwfn
648*14b24e2bSVaishali Kulkarni  * @param p_ptt
649*14b24e2bSVaishali Kulkarni  */
650*14b24e2bSVaishali Kulkarni void ecore_llh_clear_all_filters(struct ecore_hwfn *p_hwfn,
651*14b24e2bSVaishali Kulkarni 			     struct ecore_ptt *p_ptt);
652*14b24e2bSVaishali Kulkarni 
653*14b24e2bSVaishali Kulkarni /**
654*14b24e2bSVaishali Kulkarni  * @brief ecore_llh_set_function_as_default - set function as defult per port
655*14b24e2bSVaishali Kulkarni  *
656*14b24e2bSVaishali Kulkarni  * @param p_hwfn
657*14b24e2bSVaishali Kulkarni  * @param p_ptt
658*14b24e2bSVaishali Kulkarni  */
659*14b24e2bSVaishali Kulkarni enum _ecore_status_t
660*14b24e2bSVaishali Kulkarni ecore_llh_set_function_as_default(struct ecore_hwfn *p_hwfn,
661*14b24e2bSVaishali Kulkarni 				  struct ecore_ptt *p_ptt);
662*14b24e2bSVaishali Kulkarni 
663*14b24e2bSVaishali Kulkarni /**
664*14b24e2bSVaishali Kulkarni  *@brief Cleanup of previous driver remains prior to load
665*14b24e2bSVaishali Kulkarni  *
666*14b24e2bSVaishali Kulkarni  * @param p_hwfn
667*14b24e2bSVaishali Kulkarni  * @param p_ptt
668*14b24e2bSVaishali Kulkarni  * @param id - For PF, engine-relative. For VF, PF-relative.
669*14b24e2bSVaishali Kulkarni  * @param is_vf - true iff cleanup is made for a VF.
670*14b24e2bSVaishali Kulkarni  *
671*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
672*14b24e2bSVaishali Kulkarni  */
673*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_final_cleanup(struct ecore_hwfn	*p_hwfn,
674*14b24e2bSVaishali Kulkarni 					 struct ecore_ptt	*p_ptt,
675*14b24e2bSVaishali Kulkarni 					 u16			id,
676*14b24e2bSVaishali Kulkarni 					 bool			is_vf);
677*14b24e2bSVaishali Kulkarni /**
678*14b24e2bSVaishali Kulkarni  * @brief ecore_set_queue_coalesce - Configure coalesce parameters for Rx and
679*14b24e2bSVaishali Kulkarni  *    Tx queue. The fact that we can configure coalescing to up to 511, but on
680*14b24e2bSVaishali Kulkarni  *    varying accuracy [the bigger the value the less accurate] up to a mistake
681*14b24e2bSVaishali Kulkarni  *    of 3usec for the highest values.
682*14b24e2bSVaishali Kulkarni  *    While the API allows setting coalescing per-qid, all queues sharing a SB
683*14b24e2bSVaishali Kulkarni  *    should be in same range [i.e., either 0-0x7f, 0x80-0xff or 0x100-0x1ff]
684*14b24e2bSVaishali Kulkarni  *    otherwise configuration would break.
685*14b24e2bSVaishali Kulkarni  *
686*14b24e2bSVaishali Kulkarni  * @param p_hwfn
687*14b24e2bSVaishali Kulkarni  * @param rx_coal - Rx Coalesce value in micro seconds.
688*14b24e2bSVaishali Kulkarni  * @param tx_coal - TX Coalesce value in micro seconds.
689*14b24e2bSVaishali Kulkarni  * @param p_handle
690*14b24e2bSVaishali Kulkarni  *
691*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
692*14b24e2bSVaishali Kulkarni  **/
693*14b24e2bSVaishali Kulkarni enum _ecore_status_t
694*14b24e2bSVaishali Kulkarni ecore_set_queue_coalesce(struct ecore_hwfn *p_hwfn, u16 rx_coal,
695*14b24e2bSVaishali Kulkarni 			 u16 tx_coal, void *p_handle);
696*14b24e2bSVaishali Kulkarni 
697*14b24e2bSVaishali Kulkarni /**
698*14b24e2bSVaishali Kulkarni  * @brief - Recalculate feature distributions based on HW resources and
699*14b24e2bSVaishali Kulkarni  * user inputs. Currently this affects RDMA_CNQ, PF_L2_QUE and VF_L2_QUE.
700*14b24e2bSVaishali Kulkarni  * As a result, this must not be called while RDMA is active or while VFs
701*14b24e2bSVaishali Kulkarni  * are enabled.
702*14b24e2bSVaishali Kulkarni  *
703*14b24e2bSVaishali Kulkarni  * @param p_hwfn
704*14b24e2bSVaishali Kulkarni  */
705*14b24e2bSVaishali Kulkarni void ecore_hw_set_feat(struct ecore_hwfn *p_hwfn);
706*14b24e2bSVaishali Kulkarni 
707*14b24e2bSVaishali Kulkarni /**
708*14b24e2bSVaishali Kulkarni  * @brief ecore_change_pci_hwfn - Enable or disable PCI BUS MASTER
709*14b24e2bSVaishali Kulkarni  *
710*14b24e2bSVaishali Kulkarni  * @param p_hwfn
711*14b24e2bSVaishali Kulkarni  * @param p_ptt
712*14b24e2bSVaishali Kulkarni  * @param enable - true/false
713*14b24e2bSVaishali Kulkarni  *
714*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
715*14b24e2bSVaishali Kulkarni  */
716*14b24e2bSVaishali Kulkarni enum _ecore_status_t
717*14b24e2bSVaishali Kulkarni ecore_change_pci_hwfn(struct ecore_hwfn *p_hwfn,
718*14b24e2bSVaishali Kulkarni 		      struct ecore_ptt *p_ptt,
719*14b24e2bSVaishali Kulkarni 		      u8 enable);
720*14b24e2bSVaishali Kulkarni 
721*14b24e2bSVaishali Kulkarni #endif