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_ISCSI_API_H__
37 #define __ECORE_ISCSI_API_H__
39 #ifndef __EXTRACT__LINUX__
40 typedef enum _ecore_status_t (*iscsi_event_cb_t
)(void *context
,
45 struct ecore_iscsi_conn
{
46 osal_list_entry_t list_entry
;
57 dma_addr_t sq_pbl_addr
;
58 struct ecore_chain r2tq
;
59 struct ecore_chain xhq
;
60 struct ecore_chain uhq
;
62 struct tcp_upload_params
*tcp_upload_params_virt_addr
;
63 dma_addr_t tcp_upload_params_phys_addr
;
64 struct scsi_terminate_extra_params
*queue_cnts_virt_addr
;
65 dma_addr_t queue_cnts_phys_addr
;
66 dma_addr_t syn_phy_addr
;
68 u16 syn_ip_payload_length
;
110 u16 da_timeout_value
;
114 #define ECORE_ISCSI_CONN_HD_EN 0x01
115 #define ECORE_ISCSI_CONN_DD_EN 0x02
116 #define ECORE_ISCSI_CONN_INITIAL_R2T 0x04
117 #define ECORE_ISCSI_CONN_IMMEDIATE_DATA 0x08
121 u32 max_recv_pdu_length
;
122 u32 max_send_pdu_length
;
123 u32 first_seq_length
;
128 u8 abortive_dsconnect
;
131 #ifndef __EXTRACT__LINUX__
132 struct ecore_iscsi_stats
134 u64 iscsi_rx_bytes_cnt
;
135 u64 iscsi_rx_packet_cnt
;
136 u64 iscsi_rx_new_ooo_isle_events_cnt
;
137 u32 iscsi_cmdq_threshold_cnt
;
138 u32 iscsi_rq_threshold_cnt
;
139 u32 iscsi_immq_threshold_cnt
;
141 u64 iscsi_rx_dropped_pdus_task_not_valid
;
143 u64 iscsi_rx_data_pdu_cnt
;
144 u64 iscsi_rx_r2t_pdu_cnt
;
145 u64 iscsi_rx_total_pdu_cnt
;
147 u64 iscsi_tx_go_to_slow_start_event_cnt
;
148 u64 iscsi_tx_fast_retransmit_event_cnt
;
150 u64 iscsi_tx_data_pdu_cnt
;
151 u64 iscsi_tx_r2t_pdu_cnt
;
152 u64 iscsi_tx_total_pdu_cnt
;
154 u64 iscsi_tx_bytes_cnt
;
155 u64 iscsi_tx_packet_cnt
;
160 * @brief ecore_iscsi_acquire_connection - allocate resources,
161 * provides connecion handle (CID)as out parameter.
164 * @param p_conn partially initialized incoming container of
165 * iSCSI connection data
166 * @return enum _ecore_status_t
169 ecore_iscsi_acquire_connection(struct ecore_hwfn
*p_hwfn
,
170 struct ecore_iscsi_conn
*p_in_conn
,
171 struct ecore_iscsi_conn
**p_out_conn
);
173 void OSAL_IOMEM
*ecore_iscsi_get_db_addr(struct ecore_hwfn
*p_hwfn
,
176 void OSAL_IOMEM
*ecore_iscsi_get_global_cmdq_cons(struct ecore_hwfn
*p_hwfn
,
179 void OSAL_IOMEM
*ecore_iscsi_get_primary_bdq_prod(struct ecore_hwfn
*p_hwfn
,
182 void OSAL_IOMEM
*ecore_iscsi_get_secondary_bdq_prod(struct ecore_hwfn
*p_hwfn
,
186 * @brief ecore_iscsi_offload_connection - offload previously
187 * allocated iSCSI connection
190 * @param p_conn container of iSCSI connection data
192 * @return enum _ecore_status_t
195 ecore_iscsi_offload_connection(struct ecore_hwfn
*p_hwfn
,
196 struct ecore_iscsi_conn
*p_conn
);
199 * @brief ecore_iscsi_release_connection - deletes connecton
200 * resources (incliding container of iSCSI connection
204 * @param p_conn container of iSCSI connection data
206 void ecore_iscsi_release_connection(struct ecore_hwfn
*p_hwfn
,
207 struct ecore_iscsi_conn
*p_conn
);
210 * @brief ecore_iscsi_terminate_connection - destroys previously
211 * offloaded iSCSI connection
214 * @param p_conn container of iSCSI connection data
216 * @return enum _ecore_status_t
219 ecore_iscsi_terminate_connection(struct ecore_hwfn
*p_hwfn
,
220 struct ecore_iscsi_conn
*p_conn
);
224 * @brief ecore_iscsi_update_connection - updates previously
225 * offloaded iSCSI connection
229 * @param p_conn container of iSCSI connection data
231 * @return enum _ecore_status_t
234 ecore_iscsi_update_connection(struct ecore_hwfn
*p_hwfn
,
235 struct ecore_iscsi_conn
*p_conn
);
238 * @brief ecore_iscsi_mac_update_connection - updates remote MAC for previously
239 * offloaded iSCSI connection
243 * @param p_conn container of iSCSI connection data
245 * @return enum _ecore_status_t
248 ecore_iscsi_update_remote_mac(struct ecore_hwfn
*p_hwfn
,
249 struct ecore_iscsi_conn
*p_conn
);
252 * @brief ecore_iscsi_clear_connection_sq - clear SQ
253 * offloaded iSCSI connection
257 * @param p_conn container of iSCSI connection data
259 * @return enum _ecore_status_t
262 ecore_iscsi_clear_connection_sq(struct ecore_hwfn
*p_hwfn
,
263 struct ecore_iscsi_conn
*p_conn
);
266 * @brief ecore_sp_iscsi_func_start
268 * This ramrod inits iSCSI functionality in FW
274 * @return enum _ecore_status_t
277 ecore_sp_iscsi_func_start(struct ecore_hwfn
*p_hwfn
,
278 enum spq_mode comp_mode
,
279 struct ecore_spq_comp_cb
*p_comp_addr
,
280 void *async_event_context
,
281 iscsi_event_cb_t async_event_cb
);
284 ecore_sp_iscsi_func_stop(struct ecore_hwfn
*p_hwfn
,
285 enum spq_mode comp_mode
,
286 struct ecore_spq_comp_cb
*p_comp_addr
);
289 ecore_iscsi_get_stats(struct ecore_hwfn
*p_hwfn
,
290 struct ecore_iscsi_stats
*stats
);