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_ISCSI_H__
37*14b24e2bSVaishali Kulkarni #define __ECORE_ISCSI_H__
38*14b24e2bSVaishali Kulkarni 
39*14b24e2bSVaishali Kulkarni #include "ecore.h"
40*14b24e2bSVaishali Kulkarni #include "ecore_chain.h"
41*14b24e2bSVaishali Kulkarni #include "ecore_hsi_common.h"
42*14b24e2bSVaishali Kulkarni #include "tcp_common.h"
43*14b24e2bSVaishali Kulkarni #include "ecore_hsi_iscsi.h"
44*14b24e2bSVaishali Kulkarni #include "ecore_sp_commands.h"
45*14b24e2bSVaishali Kulkarni #include "ecore_iscsi_api.h"
46*14b24e2bSVaishali Kulkarni 
47*14b24e2bSVaishali Kulkarni struct ecore_iscsi_info {
48*14b24e2bSVaishali Kulkarni 	osal_spinlock_t	 lock;
49*14b24e2bSVaishali Kulkarni 	osal_list_t	 free_list;
50*14b24e2bSVaishali Kulkarni 	u16		 max_num_outstanding_tasks;
51*14b24e2bSVaishali Kulkarni 	void		 *event_context;
52*14b24e2bSVaishali Kulkarni 	iscsi_event_cb_t event_cb;
53*14b24e2bSVaishali Kulkarni };
54*14b24e2bSVaishali Kulkarni 
55*14b24e2bSVaishali Kulkarni enum _ecore_status_t ecore_iscsi_alloc(struct ecore_hwfn *p_hwfn);
56*14b24e2bSVaishali Kulkarni 
57*14b24e2bSVaishali Kulkarni void ecore_iscsi_setup(struct ecore_hwfn *p_hwfn);
58*14b24e2bSVaishali Kulkarni 
59*14b24e2bSVaishali Kulkarni void ecore_iscsi_free(struct ecore_hwfn *p_hwfn);
60*14b24e2bSVaishali Kulkarni 
61*14b24e2bSVaishali Kulkarni void ecore_iscsi_free_connection(struct ecore_hwfn *p_hwfn,
62*14b24e2bSVaishali Kulkarni 				 struct ecore_iscsi_conn *p_conn);
63*14b24e2bSVaishali Kulkarni 
64*14b24e2bSVaishali Kulkarni /**
65*14b24e2bSVaishali Kulkarni  * @brief ecore_sp_iscsi_conn_offload - iSCSI connection offload
66*14b24e2bSVaishali Kulkarni  *
67*14b24e2bSVaishali Kulkarni  * This ramrod offloads iSCSI connection to FW
68*14b24e2bSVaishali Kulkarni  *
69*14b24e2bSVaishali Kulkarni  * @param p_path
70*14b24e2bSVaishali Kulkarni  * @param p_conn
71*14b24e2bSVaishali Kulkarni  * @param comp_mode
72*14b24e2bSVaishali Kulkarni  * @param comp_addr
73*14b24e2bSVaishali Kulkarni  *
74*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
75*14b24e2bSVaishali Kulkarni  */
76*14b24e2bSVaishali Kulkarni enum _ecore_status_t
77*14b24e2bSVaishali Kulkarni ecore_sp_iscsi_conn_offload(struct ecore_hwfn *p_hwfn,
78*14b24e2bSVaishali Kulkarni 			    struct ecore_iscsi_conn *p_conn,
79*14b24e2bSVaishali Kulkarni 			    enum spq_mode comp_mode,
80*14b24e2bSVaishali Kulkarni 			    struct ecore_spq_comp_cb *p_comp_addr);
81*14b24e2bSVaishali Kulkarni 
82*14b24e2bSVaishali Kulkarni /**
83*14b24e2bSVaishali Kulkarni  * @brief ecore_sp_iscsi_conn_update - iSCSI connection update
84*14b24e2bSVaishali Kulkarni  *
85*14b24e2bSVaishali Kulkarni  * This ramrod updatess iSCSI ofloadedconnection in FW
86*14b24e2bSVaishali Kulkarni  *
87*14b24e2bSVaishali Kulkarni  * @param p_path
88*14b24e2bSVaishali Kulkarni  * @param p_conn
89*14b24e2bSVaishali Kulkarni  * @param comp_mode
90*14b24e2bSVaishali Kulkarni  * @param comp_addr
91*14b24e2bSVaishali Kulkarni  *
92*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
93*14b24e2bSVaishali Kulkarni  */
94*14b24e2bSVaishali Kulkarni enum _ecore_status_t
95*14b24e2bSVaishali Kulkarni ecore_sp_iscsi_conn_update(struct ecore_hwfn *p_hwfn,
96*14b24e2bSVaishali Kulkarni 			   struct ecore_iscsi_conn *p_conn,
97*14b24e2bSVaishali Kulkarni 			   enum spq_mode comp_mode,
98*14b24e2bSVaishali Kulkarni 			   struct ecore_spq_comp_cb *p_comp_addr);
99*14b24e2bSVaishali Kulkarni 
100*14b24e2bSVaishali Kulkarni /**
101*14b24e2bSVaishali Kulkarni  * @brief ecore_sp_iscsi_mac_update - iSCSI connection's MAC update
102*14b24e2bSVaishali Kulkarni  *
103*14b24e2bSVaishali Kulkarni  * This ramrod updates remote MAC for iSCSI offloaded connection in FW
104*14b24e2bSVaishali Kulkarni  *
105*14b24e2bSVaishali Kulkarni  * @param p_path
106*14b24e2bSVaishali Kulkarni  * @param p_conn
107*14b24e2bSVaishali Kulkarni  * @param comp_mode
108*14b24e2bSVaishali Kulkarni  * @param comp_addr
109*14b24e2bSVaishali Kulkarni  *
110*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
111*14b24e2bSVaishali Kulkarni  */
112*14b24e2bSVaishali Kulkarni enum _ecore_status_t
113*14b24e2bSVaishali Kulkarni ecore_sp_iscsi_mac_update(struct ecore_hwfn *p_hwfn,
114*14b24e2bSVaishali Kulkarni 			  struct ecore_iscsi_conn *p_conn,
115*14b24e2bSVaishali Kulkarni 			  enum spq_mode comp_mode,
116*14b24e2bSVaishali Kulkarni 			  struct ecore_spq_comp_cb *p_comp_addr);
117*14b24e2bSVaishali Kulkarni 
118*14b24e2bSVaishali Kulkarni /**
119*14b24e2bSVaishali Kulkarni  * @brief ecore_sp_iscsi_conn_terminate - iSCSI connection
120*14b24e2bSVaishali Kulkarni  *        terminate
121*14b24e2bSVaishali Kulkarni  *
122*14b24e2bSVaishali Kulkarni  * This ramrod deletes iSCSI offloaded connection in FW
123*14b24e2bSVaishali Kulkarni  *
124*14b24e2bSVaishali Kulkarni  * @param p_path
125*14b24e2bSVaishali Kulkarni  * @param p_conn
126*14b24e2bSVaishali Kulkarni  * @param comp_mode
127*14b24e2bSVaishali Kulkarni  * @param comp_addr
128*14b24e2bSVaishali Kulkarni  *
129*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
130*14b24e2bSVaishali Kulkarni  */
131*14b24e2bSVaishali Kulkarni enum _ecore_status_t
132*14b24e2bSVaishali Kulkarni ecore_sp_iscsi_conn_terminate(struct ecore_hwfn *p_hwfn,
133*14b24e2bSVaishali Kulkarni 			      struct ecore_iscsi_conn *p_conn,
134*14b24e2bSVaishali Kulkarni 			      enum spq_mode comp_mode,
135*14b24e2bSVaishali Kulkarni 			      struct ecore_spq_comp_cb *p_comp_addr);
136*14b24e2bSVaishali Kulkarni 
137*14b24e2bSVaishali Kulkarni /**
138*14b24e2bSVaishali Kulkarni  * @brief ecore_sp_iscsi_conn_clear_sq - iSCSI connection
139*14b24e2bSVaishali Kulkarni  *        clear SQ
140*14b24e2bSVaishali Kulkarni  *
141*14b24e2bSVaishali Kulkarni  * This ramrod clears connection's SQ in FW
142*14b24e2bSVaishali Kulkarni  *
143*14b24e2bSVaishali Kulkarni  * @param p_path
144*14b24e2bSVaishali Kulkarni  * @param p_conn
145*14b24e2bSVaishali Kulkarni  * @param comp_mode
146*14b24e2bSVaishali Kulkarni  * @param comp_addr
147*14b24e2bSVaishali Kulkarni  *
148*14b24e2bSVaishali Kulkarni  * @return enum _ecore_status_t
149*14b24e2bSVaishali Kulkarni  */
150*14b24e2bSVaishali Kulkarni enum _ecore_status_t
151*14b24e2bSVaishali Kulkarni ecore_sp_iscsi_conn_clear_sq(struct ecore_hwfn *p_hwfn,
152*14b24e2bSVaishali Kulkarni 			     struct ecore_iscsi_conn *p_conn,
153*14b24e2bSVaishali Kulkarni 			     enum spq_mode comp_mode,
154*14b24e2bSVaishali Kulkarni 			     struct ecore_spq_comp_cb *p_comp_addr);
155*14b24e2bSVaishali Kulkarni 
156*14b24e2bSVaishali Kulkarni #endif  /*__ECORE_ISCSI_H__*/
157*14b24e2bSVaishali Kulkarni