Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
0002 /* QLogic qed NIC Driver
0003  * Copyright (c) 2015-2017  QLogic Corporation
0004  * Copyright (c) 2019-2020 Marvell International Ltd.
0005  */
0006 
0007 #ifndef _QED_ISCSI_H
0008 #define _QED_ISCSI_H
0009 #include <linux/types.h>
0010 #include <linux/list.h>
0011 #include <linux/slab.h>
0012 #include <linux/spinlock.h>
0013 #include <linux/qed/tcp_common.h>
0014 #include <linux/qed/qed_iscsi_if.h>
0015 #include <linux/qed/qed_chain.h>
0016 #include "qed.h"
0017 #include "qed_hsi.h"
0018 #include "qed_mcp.h"
0019 #include "qed_sp.h"
0020 
0021 struct qed_iscsi_info {
0022     spinlock_t lock; /* Connection resources. */
0023     struct list_head free_list;
0024     u16 max_num_outstanding_tasks;
0025     void *event_context;
0026     iscsi_event_cb_t event_cb;
0027 };
0028 
0029 #if IS_ENABLED(CONFIG_QED_ISCSI)
0030 int qed_iscsi_alloc(struct qed_hwfn *p_hwfn);
0031 
0032 void qed_iscsi_setup(struct qed_hwfn *p_hwfn);
0033 
0034 void qed_iscsi_free(struct qed_hwfn *p_hwfn);
0035 
0036 /**
0037  * qed_get_protocol_stats_iscsi(): Fills provided statistics
0038  *                                 struct with statistics.
0039  *
0040  * @cdev: Qed dev pointer.
0041  * @stats: Points to struct that will be filled with statistics.
0042  *
0043  * Return: Void.
0044  */
0045 void qed_get_protocol_stats_iscsi(struct qed_dev *cdev,
0046                   struct qed_mcp_iscsi_stats *stats);
0047 #else /* IS_ENABLED(CONFIG_QED_ISCSI) */
0048 static inline int qed_iscsi_alloc(struct qed_hwfn *p_hwfn)
0049 {
0050     return -EINVAL;
0051 }
0052 
0053 static inline void qed_iscsi_setup(struct qed_hwfn *p_hwfn) {}
0054 
0055 static inline void qed_iscsi_free(struct qed_hwfn *p_hwfn) {}
0056 
0057 static inline void
0058 qed_get_protocol_stats_iscsi(struct qed_dev *cdev,
0059                  struct qed_mcp_iscsi_stats *stats) {}
0060 #endif /* IS_ENABLED(CONFIG_QED_ISCSI) */
0061 
0062 #endif