1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /* QLogic qed NIC Driver
3 * Copyright (c) 2015-2017 QLogic Corporation
4 * Copyright (c) 2019-2020 Marvell International Ltd.
9 #include <linux/types.h>
10 #include <linux/list.h>
11 #include <linux/slab.h>
12 #include <linux/spinlock.h>
13 #include <linux/qed/tcp_common.h>
14 #include <linux/qed/qed_iscsi_if.h>
15 #include <linux/qed/qed_chain.h>
21 struct qed_iscsi_info
{
22 spinlock_t lock
; /* Connection resources. */
23 struct list_head free_list
;
24 u16 max_num_outstanding_tasks
;
26 iscsi_event_cb_t event_cb
;
29 #if IS_ENABLED(CONFIG_QED_ISCSI)
30 int qed_iscsi_alloc(struct qed_hwfn
*p_hwfn
);
32 void qed_iscsi_setup(struct qed_hwfn
*p_hwfn
);
34 void qed_iscsi_free(struct qed_hwfn
*p_hwfn
);
37 * @brief - Fills provided statistics struct with statistics.
40 * @param stats - points to struct that will be filled with statistics.
42 void qed_get_protocol_stats_iscsi(struct qed_dev
*cdev
,
43 struct qed_mcp_iscsi_stats
*stats
);
44 #else /* IS_ENABLED(CONFIG_QED_ISCSI) */
45 static inline int qed_iscsi_alloc(struct qed_hwfn
*p_hwfn
)
50 static inline void qed_iscsi_setup(struct qed_hwfn
*p_hwfn
) {}
52 static inline void qed_iscsi_free(struct qed_hwfn
*p_hwfn
) {}
55 qed_get_protocol_stats_iscsi(struct qed_dev
*cdev
,
56 struct qed_mcp_iscsi_stats
*stats
) {}
57 #endif /* IS_ENABLED(CONFIG_QED_ISCSI) */