1 /* QLogic qed NIC Driver
2  * Copyright (c) 2015 QLogic Corporation
3  *
4  * This software is available under the terms of the GNU General Public License
5  * (GPL) Version 2, available from the file COPYING in the main directory of
6  * this source tree.
7  */
8 
9 #ifndef _QED_ISCSI_H
10 #define _QED_ISCSI_H
11 #include <linux/types.h>
12 #include <linux/list.h>
13 #include <linux/slab.h>
14 #include <linux/spinlock.h>
15 #include <linux/qed/tcp_common.h>
16 #include <linux/qed/qed_iscsi_if.h>
17 #include <linux/qed/qed_chain.h>
18 #include "qed.h"
19 #include "qed_hsi.h"
20 #include "qed_mcp.h"
21 #include "qed_sp.h"
22 
23 struct qed_iscsi_info {
24 	spinlock_t lock; /* Connection resources. */
25 	struct list_head free_list;
26 	u16 max_num_outstanding_tasks;
27 	void *event_context;
28 	iscsi_event_cb_t event_cb;
29 };
30 
31 #ifdef CONFIG_QED_LL2
32 extern const struct qed_ll2_ops qed_ll2_ops_pass;
33 #endif
34 
35 #if IS_ENABLED(CONFIG_QED_ISCSI)
36 struct qed_iscsi_info *qed_iscsi_alloc(struct qed_hwfn *p_hwfn);
37 
38 void qed_iscsi_setup(struct qed_hwfn *p_hwfn,
39 		     struct qed_iscsi_info *p_iscsi_info);
40 
41 void qed_iscsi_free(struct qed_hwfn *p_hwfn,
42 		    struct qed_iscsi_info *p_iscsi_info);
43 #else /* IS_ENABLED(CONFIG_QED_ISCSI) */
44 static inline struct qed_iscsi_info *qed_iscsi_alloc(
45 		struct qed_hwfn *p_hwfn) { return NULL; }
46 static inline void qed_iscsi_setup(struct qed_hwfn *p_hwfn,
47 				   struct qed_iscsi_info *p_iscsi_info) {}
48 static inline void qed_iscsi_free(struct qed_hwfn *p_hwfn,
49 				  struct qed_iscsi_info *p_iscsi_info) {}
50 #endif /* IS_ENABLED(CONFIG_QED_ISCSI) */
51 
52 #endif
53