linux/include/target/iscsi/iscsi_target_core.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ISCSI_TARGET_CORE_H
#define ISCSI_TARGET_CORE_H

#include <linux/dma-direction.h>     /* enum dma_data_direction */
#include <linux/list.h>              /* struct list_head */
#include <linux/sched.h>
#include <linux/socket.h>            /* struct sockaddr_storage */
#include <linux/types.h>             /* u8 */
#include <scsi/iscsi_proto.h>        /* itt_t */
#include <target/target_core_base.h> /* struct se_cmd */

struct sock;

#define ISCSIT_VERSION
#define ISCSI_MAX_DATASN_MISSING_COUNT
#define ISCSI_TX_THREAD_TCP_TIMEOUT
#define ISCSI_RX_THREAD_TCP_TIMEOUT
#define SECONDS_FOR_ASYNC_LOGOUT
#define SECONDS_FOR_ASYNC_TEXT
#define SECONDS_FOR_LOGOUT_COMP
#define WHITE_SPACE
#define ISCSIT_MIN_TAGS
#define ISCSIT_EXTRA_TAGS
#define ISCSIT_TCP_BACKLOG
#define ISCSI_RX_THREAD_NAME
#define ISCSI_TX_THREAD_NAME
#define ISCSI_IQN_LEN
#define NA_AUTHENTICATION_INHERITED

/* struct iscsi_node_attrib sanity values */
#define NA_DATAOUT_TIMEOUT
#define NA_DATAOUT_TIMEOUT_MAX
#define NA_DATAOUT_TIMEOUT_MIX
#define NA_DATAOUT_TIMEOUT_RETRIES
#define NA_DATAOUT_TIMEOUT_RETRIES_MAX
#define NA_DATAOUT_TIMEOUT_RETRIES_MIN
#define NA_NOPIN_TIMEOUT
#define NA_NOPIN_TIMEOUT_MAX
#define NA_NOPIN_TIMEOUT_MIN
#define NA_NOPIN_RESPONSE_TIMEOUT
#define NA_NOPIN_RESPONSE_TIMEOUT_MAX
#define NA_NOPIN_RESPONSE_TIMEOUT_MIN
#define NA_RANDOM_DATAIN_PDU_OFFSETS
#define NA_RANDOM_DATAIN_SEQ_OFFSETS
#define NA_RANDOM_R2T_OFFSETS

/* struct iscsi_tpg_attrib sanity values */
#define TA_AUTHENTICATION
#define TA_LOGIN_TIMEOUT
#define TA_LOGIN_TIMEOUT_MAX
#define TA_LOGIN_TIMEOUT_MIN
#define TA_GENERATE_NODE_ACLS
#define TA_DEFAULT_CMDSN_DEPTH
#define TA_DEFAULT_CMDSN_DEPTH_MAX
#define TA_DEFAULT_CMDSN_DEPTH_MIN
#define TA_CACHE_DYNAMIC_ACLS
/* Enabled by default in demo mode (generic_node_acls=1) */
#define TA_DEMO_MODE_WRITE_PROTECT
/* Disabled by default in production mode w/ explict ACLs */
#define TA_PROD_MODE_WRITE_PROTECT
#define TA_DEMO_MODE_DISCOVERY
#define TA_DEFAULT_ERL
#define TA_CACHE_CORE_NPS
/* T10 protection information disabled by default */
#define TA_DEFAULT_T10_PI
#define TA_DEFAULT_FABRIC_PROT_TYPE
/* TPG status needs to be enabled to return sendtargets discovery endpoint info */
#define TA_DEFAULT_TPG_ENABLED_SENDTARGETS
/*
 * Used to control the sending of keys with optional to respond state bit,
 * as a workaround for non RFC compliant initiators,that do not propose,
 * nor respond to specific keys required for login to complete.
 *
 * See iscsi_check_proposer_for_optional_reply() for more details.
 */
#define TA_DEFAULT_LOGIN_KEYS_WORKAROUND

#define ISCSI_IOV_DATA_BUFFER

enum iscsit_transport_type {};

/* RFC-3720 7.1.4  Standard Connection State Diagram for a Target */
enum target_conn_state_table {};

/* RFC-3720 7.3.2  Session State Diagram for a Target */
enum target_sess_state_table {};

/* struct iscsi_data_count->type */
enum data_count_type {};

/* struct iscsi_datain_req->dr_complete */
enum datain_req_comp_table {};

/* struct iscsi_datain_req->recovery */
enum datain_req_rec_table {};

/* struct iscsi_portal_group->state */
enum tpg_state_table {};

/* struct iscsi_tiqn->tiqn_state */
enum tiqn_state_table {};

/* struct iscsit_cmd->cmd_flags */
enum cmd_flags_table {};

/* struct iscsit_cmd->i_state */
enum cmd_i_state_table {};

/* Used for iscsi_recover_cmdsn() return values */
enum recover_cmdsn_ret_table {};

/* Used for iscsi_handle_immediate_data() return values */
enum immedate_data_ret_table {};

/* Used for iscsi_decide_dataout_action() return values */
enum dataout_action_ret_table {};

/* Used for struct iscsi_node_auth->naf_flags */
enum naf_flags_table {};

/* Used by various struct timer_list to manage iSCSI specific state */
enum iscsi_timer_flags_table {};

/* Used for struct iscsi_np->np_flags */
enum np_flags_table {};

/* Used for struct iscsi_np->np_thread_state */
enum np_thread_state_table {};

struct iscsi_conn_ops {};

struct iscsi_sess_ops {};

struct iscsi_queue_req {};

struct iscsi_param_list {};

struct iscsi_datain_req {} ____cacheline_aligned;

struct iscsi_ooo_cmdsn {} ____cacheline_aligned;

struct iscsi_datain {} ____cacheline_aligned;

struct iscsi_r2t {} ____cacheline_aligned;

struct iscsit_cmd {}  ____cacheline_aligned;

struct iscsi_tmr_req {};

struct iscsit_conn {} ____cacheline_aligned;

struct iscsi_conn_recovery {}  ____cacheline_aligned;

struct iscsit_session {} ____cacheline_aligned;

struct iscsi_login {} ____cacheline_aligned;

struct iscsi_node_attrib {};

struct se_dev_entry_s;

struct iscsi_node_auth {};

#include "iscsi_target_stat.h"

struct iscsi_node_stat_grps {};

struct iscsi_node_acl {};

static inline struct iscsi_node_acl *
to_iscsi_nacl(struct se_node_acl *se_nacl)
{}

struct iscsi_tpg_attrib {};

struct iscsi_np {} ____cacheline_aligned;

struct iscsi_tpg_np {};

struct iscsi_portal_group {} ____cacheline_aligned;

static inline struct iscsi_portal_group *
to_iscsi_tpg(struct se_portal_group *se_tpg)
{}

struct iscsi_wwn_stat_grps {};

struct iscsi_tiqn {} ____cacheline_aligned;

struct iscsit_global {};

static inline u32 session_get_next_ttt(struct iscsit_session *session)
{}

extern struct iscsit_cmd *iscsit_find_cmd_from_itt(struct iscsit_conn *, itt_t);

extern void iscsit_thread_check_cpumask(struct iscsit_conn *conn,
					struct task_struct *p,
					int mode);

#endif /* ISCSI_TARGET_CORE_H */