18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 28c2ecf20Sopenharmony_ci/* QLogic qed NIC Driver 38c2ecf20Sopenharmony_ci * Copyright (c) 2015-2017 QLogic Corporation 48c2ecf20Sopenharmony_ci * Copyright (c) 2019-2020 Marvell International Ltd. 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef _QED_ISCSI_H 88c2ecf20Sopenharmony_ci#define _QED_ISCSI_H 98c2ecf20Sopenharmony_ci#include <linux/types.h> 108c2ecf20Sopenharmony_ci#include <linux/list.h> 118c2ecf20Sopenharmony_ci#include <linux/slab.h> 128c2ecf20Sopenharmony_ci#include <linux/spinlock.h> 138c2ecf20Sopenharmony_ci#include <linux/qed/tcp_common.h> 148c2ecf20Sopenharmony_ci#include <linux/qed/qed_iscsi_if.h> 158c2ecf20Sopenharmony_ci#include <linux/qed/qed_chain.h> 168c2ecf20Sopenharmony_ci#include "qed.h" 178c2ecf20Sopenharmony_ci#include "qed_hsi.h" 188c2ecf20Sopenharmony_ci#include "qed_mcp.h" 198c2ecf20Sopenharmony_ci#include "qed_sp.h" 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_cistruct qed_iscsi_info { 228c2ecf20Sopenharmony_ci spinlock_t lock; /* Connection resources. */ 238c2ecf20Sopenharmony_ci struct list_head free_list; 248c2ecf20Sopenharmony_ci u16 max_num_outstanding_tasks; 258c2ecf20Sopenharmony_ci void *event_context; 268c2ecf20Sopenharmony_ci iscsi_event_cb_t event_cb; 278c2ecf20Sopenharmony_ci}; 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_QED_ISCSI) 308c2ecf20Sopenharmony_ciint qed_iscsi_alloc(struct qed_hwfn *p_hwfn); 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_civoid qed_iscsi_setup(struct qed_hwfn *p_hwfn); 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_civoid qed_iscsi_free(struct qed_hwfn *p_hwfn); 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci/** 378c2ecf20Sopenharmony_ci * @brief - Fills provided statistics struct with statistics. 388c2ecf20Sopenharmony_ci * 398c2ecf20Sopenharmony_ci * @param cdev 408c2ecf20Sopenharmony_ci * @param stats - points to struct that will be filled with statistics. 418c2ecf20Sopenharmony_ci */ 428c2ecf20Sopenharmony_civoid qed_get_protocol_stats_iscsi(struct qed_dev *cdev, 438c2ecf20Sopenharmony_ci struct qed_mcp_iscsi_stats *stats); 448c2ecf20Sopenharmony_ci#else /* IS_ENABLED(CONFIG_QED_ISCSI) */ 458c2ecf20Sopenharmony_cistatic inline int qed_iscsi_alloc(struct qed_hwfn *p_hwfn) 468c2ecf20Sopenharmony_ci{ 478c2ecf20Sopenharmony_ci return -EINVAL; 488c2ecf20Sopenharmony_ci} 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistatic inline void qed_iscsi_setup(struct qed_hwfn *p_hwfn) {} 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_cistatic inline void qed_iscsi_free(struct qed_hwfn *p_hwfn) {} 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_cistatic inline void 558c2ecf20Sopenharmony_ciqed_get_protocol_stats_iscsi(struct qed_dev *cdev, 568c2ecf20Sopenharmony_ci struct qed_mcp_iscsi_stats *stats) {} 578c2ecf20Sopenharmony_ci#endif /* IS_ENABLED(CONFIG_QED_ISCSI) */ 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci#endif 60