xref: /illumos-gate/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_sp_api.h (revision 14b24e2b79293068c8e016a69ef1d872fb5e2fd5)
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1,  (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 
22 /*
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1,  (the "License").
26 
27 * You may not use this file except in compliance with the License.
28 
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
31 
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
34 */
35 
36 #ifndef __ECORE_SP_API_H__
37 #define __ECORE_SP_API_H__
38 
39 #include "ecore_status.h"
40 
41 enum spq_mode {
42 	ECORE_SPQ_MODE_BLOCK,   /* Client will poll a designated mem. address */
43 	ECORE_SPQ_MODE_CB,  /* Client supplies a callback */
44 	ECORE_SPQ_MODE_EBLOCK,  /* ECORE should block until completion */
45 };
46 
47 struct ecore_hwfn;
48 union event_ring_data;
49 struct eth_slow_path_rx_cqe;
50 
51 struct ecore_spq_comp_cb {
52 	void	(*function)(struct ecore_hwfn *,
53 			 void *,
54 			 union event_ring_data *,
55 			 u8 fw_return_code);
56 	void	*cookie;
57 };
58 
59 
60 /**
61  * @brief ecore_eth_cqe_completion - handles the completion of a
62  *        ramrod on the cqe ring
63  *
64  * @param p_hwfn
65  * @param cqe
66  *
67  * @return enum _ecore_status_t
68  */
69 enum _ecore_status_t ecore_eth_cqe_completion(struct ecore_hwfn *p_hwfn,
70 					      struct eth_slow_path_rx_cqe *cqe);
71 /**
72  * @brief ecore_sp_pf_update_tunn_cfg - PF Function Tunnel configuration
73  *					update  Ramrod
74  *
75  * This ramrod is sent to update a tunneling configuration
76  * for a physical function (PF).
77  *
78  * @param p_hwfn
79  * @param p_tunn - pf update tunneling parameters
80  * @param comp_mode - completion mode
81  * @param p_comp_data - callback function
82  *
83  * @return enum _ecore_status_t
84  */
85 
86 enum _ecore_status_t
87 ecore_sp_pf_update_tunn_cfg(struct ecore_hwfn *p_hwfn,
88 			    struct ecore_tunnel_info *p_tunn,
89 			    enum spq_mode comp_mode,
90 			    struct ecore_spq_comp_cb *p_comp_data);
91 #endif
92