linux/include/target/target_core_base.h

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

#include <linux/configfs.h>      /* struct config_group */
#include <linux/dma-direction.h> /* enum dma_data_direction */
#include <linux/sbitmap.h>
#include <linux/percpu-refcount.h>
#include <linux/semaphore.h>     /* struct semaphore */
#include <linux/completion.h>

#define TARGET_CORE_VERSION

/*
 * Maximum size of a CDB that can be stored in se_cmd without allocating
 * memory dynamically for the CDB.
 */
#define TCM_MAX_COMMAND_SIZE
/*
 * From include/scsi/scsi_cmnd.h:SCSI_SENSE_BUFFERSIZE, currently
 * defined 96, but the real limit is 252 (or 260 including the header)
 */
#define TRANSPORT_SENSE_BUFFER
/* Used by transport_send_check_condition_and_sense() */
#define SPC_SENSE_KEY_OFFSET
#define SPC_ADD_SENSE_LEN_OFFSET
#define SPC_DESC_TYPE_OFFSET
#define SPC_ADDITIONAL_DESC_LEN_OFFSET
#define SPC_VALIDITY_OFFSET
#define SPC_ASC_KEY_OFFSET
#define SPC_ASCQ_KEY_OFFSET
#define TRANSPORT_IQN_LEN
/* Used by target_core_store_alua_lu_gp() and target_core_alua_lu_gp_show_attr_members() */
#define LU_GROUP_NAME_BUF
/* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */
#define TG_PT_GROUP_NAME_BUF
/* Used to parse VPD into struct t10_vpd */
#define VPD_TMP_BUF_SIZE
/* Used by transport_generic_cmd_sequencer() */
#define READ_BLOCK_LEN
#define READ_CAP_LEN
#define READ_POSITION_LEN
#define INQUIRY_LEN
/* Used by transport_get_inquiry_vpd_serial() */
#define INQUIRY_VPD_SERIAL_LEN
/* Used by transport_get_inquiry_vpd_device_ident() */
#define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN

#define INQUIRY_VENDOR_LEN
#define INQUIRY_MODEL_LEN
#define INQUIRY_REVISION_LEN

/* Attempts before moving from SHORT to LONG */
#define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD
#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT
#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG

#define PYX_TRANSPORT_STATUS_INTERVAL

/* struct se_dev_attrib sanity values */
/* Default max_unmap_lba_count */
#define DA_MAX_UNMAP_LBA_COUNT
/* Default max_unmap_block_desc_count */
#define DA_MAX_UNMAP_BLOCK_DESC_COUNT
/* Default unmap_granularity */
#define DA_UNMAP_GRANULARITY_DEFAULT
/* Default unmap_granularity_alignment */
#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT
/* Default unmap_zeroes_data */
#define DA_UNMAP_ZEROES_DATA_DEFAULT
/* Default max_write_same_len, disabled by default */
#define DA_MAX_WRITE_SAME_LEN
/* Use a model alias based on the configfs backend device name */
#define DA_EMULATE_MODEL_ALIAS
/* Emulation for WriteCache and SYNCHRONIZE_CACHE */
#define DA_EMULATE_WRITE_CACHE
/* Emulation for TASK_ABORTED status (TAS) by default */
#define DA_EMULATE_TAS
/* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */
#define DA_EMULATE_TPU
/*
 * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using
 * block/blk-lib.c:blkdev_issue_discard()
 */
#define DA_EMULATE_TPWS
/* Emulation for CompareAndWrite (AtomicTestandSet) by default */
#define DA_EMULATE_CAW
/* Emulation for 3rd Party Copy (ExtendedCopy) by default */
#define DA_EMULATE_3PC
/* No Emulation for PSCSI by default */
#define DA_EMULATE_ALUA
/* Emulate SCSI2 RESERVE/RELEASE and Persistent Reservations by default */
#define DA_EMULATE_PR
/* Emulation for REPORT SUPPORTED OPERATION CODES */
#define DA_EMULATE_RSOC
/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
#define DA_ENFORCE_PR_ISIDS
/* Force SPC-3 PR Activate Persistence across Target Power Loss */
#define DA_FORCE_PR_APTPL
#define DA_STATUS_MAX_SECTORS_MIN
#define DA_STATUS_MAX_SECTORS_MAX
/* By default don't report non-rotating (solid state) medium */
#define DA_IS_NONROT
/* Queue Algorithm Modifier default for restricted reordering in control mode page */
#define DA_EMULATE_REST_REORD

#define SE_INQUIRY_BUF
#define SE_MODE_PAGE_BUF
#define SE_SENSE_BUF

enum target_submit_type {};

/* struct se_hba->hba_flags */
enum hba_flags_table {};

/* Special transport agnostic struct se_cmd->t_states */
enum transport_state_table {};

/* Used for struct se_cmd->se_cmd_flags */
enum se_cmd_flags_table {};

/*
 * Used by transport_send_check_condition_and_sense()
 * to signal which ASC/ASCQ sense payload should be built.
 */
sense_reason_t;

enum tcm_sense_reason_table {};

enum target_sc_flags_table {};

/* fabric independent task management function values */
enum tcm_tmreq_table {};

/* fabric independent task management response values */
enum tcm_tmrsp_table {};

/*
 * Used for target SCSI statistics
 */
scsi_index_t;

struct se_cmd;

struct t10_alua_lba_map_member {};

struct t10_alua_lba_map {};

struct t10_alua {};

struct t10_alua_lu_gp {};

struct t10_alua_lu_gp_member {};

struct t10_alua_tg_pt_gp {};

struct t10_vpd {};

struct t10_wwn {};

struct t10_pr_registration {};

struct t10_reservation {};

struct se_tmr_req {};

enum target_prot_op {};

#define TARGET_PROT_ALL

enum target_prot_type {};

/* Emulation for UNIT ATTENTION Interlock Control */
enum target_ua_intlck_ctrl {};

enum target_core_dif_check {};

/* for sam_task_attr */
#define TCM_SIMPLE_TAG
#define TCM_HEAD_TAG
#define TCM_ORDERED_TAG
#define TCM_ACA_TAG

struct se_cmd {};

struct se_ua {};

struct se_node_acl {};

static inline struct se_node_acl *acl_to_nacl(struct config_item *item)
{}

static inline struct se_node_acl *attrib_to_nacl(struct config_item *item)
{}

static inline struct se_node_acl *auth_to_nacl(struct config_item *item)
{}

static inline struct se_node_acl *param_to_nacl(struct config_item *item)
{}

static inline struct se_node_acl *fabric_stat_to_nacl(struct config_item *item)
{}

struct target_cmd_counter {};

struct se_session {};

struct se_device;
struct se_transform_info;
struct scatterlist;

struct se_ml_stat_grps {};

struct se_lun_acl {};

struct se_dev_entry {};

struct se_dev_attrib {};

struct se_port_stat_grps {};

struct scsi_port_stats {};

struct se_lun {};

struct se_dev_stat_grps {};

struct se_cmd_queue {};

struct se_dev_plug {};

struct se_device_queue {};

struct se_device {};

struct target_opcode_descriptor {};

struct se_hba {};

struct se_tpg_np {};

static inline struct se_tpg_np *to_tpg_np(struct config_item *item)
{}

struct se_portal_group {};

static inline struct se_portal_group *to_tpg(struct config_item *item)
{}

static inline struct se_portal_group *attrib_to_tpg(struct config_item *item)
{}

static inline struct se_portal_group *auth_to_tpg(struct config_item *item)
{}

static inline struct se_portal_group *param_to_tpg(struct config_item *item)
{}

enum {};

struct se_wwn {};

static inline void atomic_inc_mb(atomic_t *v)
{}

static inline void atomic_dec_mb(atomic_t *v)
{}

static inline void target_free_tag(struct se_session *sess, struct se_cmd *cmd)
{}

#endif /* TARGET_CORE_BASE_H */