xref: /illumos-gate/usr/src/uts/common/io/qede/579xx/drivers/ecore/ecore_cxt_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_CXT_API_H__
37 #define __ECORE_CXT_API_H__
38 
39 struct ecore_hwfn;
40 
41 struct ecore_cxt_info {
42 	void			*p_cxt;
43 	u32			iid;
44 	enum protocol_type	type;
45 };
46 
47 #define MAX_TID_BLOCKS			512
48 struct ecore_tid_mem {
49 	u32 tid_size;
50 	u32 num_tids_per_block;
51 	u32 waste;
52 	u8 *blocks[MAX_TID_BLOCKS]; /* 4K */
53 };
54 
55 /**
56 * @brief ecoreo_cid_get_cxt_info - Returns the context info for a specific cid
57 *
58 *
59 * @param p_hwfn
60 * @param p_info in/out
61 *
62 * @return enum _ecore_status_t
63 */
64 enum _ecore_status_t ecore_cxt_get_cid_info(struct ecore_hwfn *p_hwfn,
65 					    struct ecore_cxt_info *p_info);
66 
67 /**
68 * @brief ecore_cxt_get_tid_mem_info
69 *
70 * @param p_hwfn
71 * @param p_info
72 *
73 * @return enum _ecore_status_t
74 */
75 enum _ecore_status_t ecore_cxt_get_tid_mem_info(struct ecore_hwfn *p_hwfn,
76 						struct ecore_tid_mem *p_info);
77 
78 #endif
79