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.
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.
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]
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").
27 * You may not use this file except in compliance with the License.
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
36 #ifndef __ECORE_OOO_H__
37 #define __ECORE_OOO_H__
41 #define ECORE_MAX_NUM_ISLES 256
42 #define ECORE_MAX_NUM_OOO_HISTORY_ENTRIES 512
44 #define ECORE_OOO_LEFT_BUF 0
45 #define ECORE_OOO_RIGHT_BUF 1
47 struct ecore_ooo_buffer
{
48 osal_list_entry_t list_entry
;
49 void *rx_buffer_virt_addr
;
50 dma_addr_t rx_buffer_phys_addr
;
58 struct ecore_ooo_isle
{
59 osal_list_entry_t list_entry
;
60 osal_list_t buffers_list
;
63 struct ecore_ooo_archipelago
{
64 osal_list_t isles_list
;
67 struct ecore_ooo_history
{
68 struct ooo_opaque
*p_cqes
;
73 struct ecore_ooo_info
{
74 osal_list_t free_buffers_list
;
75 osal_list_t ready_buffers_list
;
76 osal_list_t free_isles_list
;
77 struct ecore_ooo_archipelago
*p_archipelagos_mem
;
78 struct ecore_ooo_isle
*p_isles_mem
;
79 struct ecore_ooo_history ooo_history
;
83 u16 max_num_archipelagos
;
87 enum _ecore_status_t
ecore_ooo_alloc(struct ecore_hwfn
*p_hwfn
);
89 void ecore_ooo_setup(struct ecore_hwfn
*p_hwfn
);
91 void ecore_ooo_free(struct ecore_hwfn
*p_hwfn
);
93 void ecore_ooo_save_history_entry(struct ecore_hwfn
*p_hwfn
,
94 struct ecore_ooo_info
*p_ooo_info
,
95 struct ooo_opaque
*p_cqe
);
97 void ecore_ooo_release_connection_isles(struct ecore_hwfn
*p_hwfn
,
98 struct ecore_ooo_info
*p_ooo_info
,
101 void ecore_ooo_release_all_isles(struct ecore_hwfn
*p_hwfn
,
102 struct ecore_ooo_info
*p_ooo_info
);
104 void ecore_ooo_put_free_buffer(struct ecore_hwfn
*p_hwfn
,
105 struct ecore_ooo_info
*p_ooo_info
,
106 struct ecore_ooo_buffer
*p_buffer
);
108 struct ecore_ooo_buffer
*
109 ecore_ooo_get_free_buffer(struct ecore_hwfn
*p_hwfn
,
110 struct ecore_ooo_info
*p_ooo_info
);
112 void ecore_ooo_put_ready_buffer(struct ecore_hwfn
*p_hwfn
,
113 struct ecore_ooo_info
*p_ooo_info
,
114 struct ecore_ooo_buffer
*p_buffer
,
117 struct ecore_ooo_buffer
*
118 ecore_ooo_get_ready_buffer(struct ecore_hwfn
*p_hwfn
,
119 struct ecore_ooo_info
*p_ooo_info
);
121 void ecore_ooo_delete_isles(struct ecore_hwfn
*p_hwfn
,
122 struct ecore_ooo_info
*p_ooo_info
,
127 void ecore_ooo_add_new_isle(struct ecore_hwfn
*p_hwfn
,
128 struct ecore_ooo_info
*p_ooo_info
,
131 struct ecore_ooo_buffer
*p_buffer
);
133 void ecore_ooo_add_new_buffer(struct ecore_hwfn
*p_hwfn
,
134 struct ecore_ooo_info
*p_ooo_info
,
137 struct ecore_ooo_buffer
*p_buffer
,
140 void ecore_ooo_join_isles(struct ecore_hwfn
*p_hwfn
,
141 struct ecore_ooo_info
*p_ooo_info
,
145 void ecore_ooo_dump_rx_event(struct ecore_hwfn
*p_hwfn
,
146 struct ooo_opaque
*iscsi_ooo
,
147 struct ecore_ooo_buffer
*p_buffer
);
149 #endif /*__ECORE_OOO_H__*/