Files
scst/iscsi-scst/include/iscsi_scst.h
T
Bart Van Assche 1c71987ad6 Merge branch 'svn-iser'
Conflicts:
	Makefile
	fcst/Makefile
	iscsi-scst/Makefile
	iscsi-scst/include/iscsi_scst.h
	iscsi-scst/include/iscsi_scst_ver.h
	iscsi-scst/kernel/Makefile
	iscsi-scst/kernel/config.c
	iscsi-scst/kernel/conn.c
	iscsi-scst/kernel/digest.c
	iscsi-scst/kernel/digest.h
	iscsi-scst/kernel/event.c
	iscsi-scst/kernel/iscsi.c
	iscsi-scst/kernel/iscsi.h
	iscsi-scst/kernel/iscsi_dbg.h
	iscsi-scst/kernel/iscsi_hdr.h
	iscsi-scst/kernel/nthread.c
	iscsi-scst/kernel/param.c
	iscsi-scst/kernel/session.c
	iscsi-scst/kernel/target.c
	iscsi-scst/usr/Makefile
	iscsi-scst/usr/chap.c
	iscsi-scst/usr/config.c
	iscsi-scst/usr/conn.c
	iscsi-scst/usr/ctldev.c
	iscsi-scst/usr/event.c
	iscsi-scst/usr/iscsi_adm.c
	iscsi-scst/usr/iscsi_adm.h
	iscsi-scst/usr/iscsi_hdr.h
	iscsi-scst/usr/iscsi_scstd.c
	iscsi-scst/usr/iscsid.c
	iscsi-scst/usr/iscsid.h
	iscsi-scst/usr/isns.c
	iscsi-scst/usr/isns_proto.h
	iscsi-scst/usr/log.c
	iscsi-scst/usr/message.c
	iscsi-scst/usr/misc.c
	iscsi-scst/usr/misc.h
	iscsi-scst/usr/param.c
	iscsi-scst/usr/param.h
	iscsi-scst/usr/session.c
	iscsi-scst/usr/target.c
	iscsi-scst/usr/types.h
	nightly/conf/nightly.conf
	qla2x00t/qla2x00-target/Makefile
	qla2x00t/qla2x00-target/README
	qla2x00t/qla2x00-target/qla2x00t.c
	qla2x00t/qla2x00-target/qla2x00t.h
	qla2x00t/qla2x_tgt.h
	qla2x00t/qla2x_tgt_def.h
	qla2x00t/qla_attr.c
	qla2x00t/qla_init.c
	qla2x00t/qla_inline.h
	qla2x00t/qla_isr.c
	qla2x00t/qla_mbx.c
	qla2x00t/qla_os.c
	scripts/generate-release-archive
	scripts/rebuild-rhel-kernel-rpm
	scripts/run-regression-tests
	scst.spec.in
	scst/Makefile
	scst/README
	scst/README_in-tree
	scst/include/scst.h
	scst/include/scst_const.h
	scst/include/scst_debug.h
	scst/include/scst_sgv.h
	scst/include/scst_user.h
	scst/src/Makefile
	scst/src/dev_handlers/Makefile
	scst/src/dev_handlers/scst_cdrom.c
	scst/src/dev_handlers/scst_changer.c
	scst/src/dev_handlers/scst_disk.c
	scst/src/dev_handlers/scst_modisk.c
	scst/src/dev_handlers/scst_processor.c
	scst/src/dev_handlers/scst_raid.c
	scst/src/dev_handlers/scst_tape.c
	scst/src/dev_handlers/scst_user.c
	scst/src/dev_handlers/scst_vdisk.c
	scst/src/scst_debug.c
	scst/src/scst_lib.c
	scst/src/scst_main.c
	scst/src/scst_mem.c
	scst/src/scst_mem.h
	scst/src/scst_module.c
	scst/src/scst_pres.c
	scst/src/scst_pres.h
	scst/src/scst_priv.h
	scst/src/scst_proc.c
	scst/src/scst_sysfs.c
	scst/src/scst_targ.c
	scst/src/scst_tg.c
	scst_local/scst_local.c
	srpt/Makefile
	srpt/README
	srpt/README.ofed
	srpt/conftest/gid_change/Makefile
	srpt/src/ib_srpt.c
	srpt/src/ib_srpt.h
	usr/fileio/Makefile
	usr/fileio/common.c
	usr/fileio/common.h
	usr/fileio/debug.c
	usr/fileio/debug.h
	usr/fileio/fileio.c
	www/comparison.html
	www/contributing.html
	www/downloads.html
	www/handler_fileio_tgt.html
	www/index.html
	www/mc_s.html
	www/scst_admin.html
	www/scstvslio.html
	www/scstvsstgt.html
	www/solutions.html
	www/target_emulex.html
	www/target_fcoe.html
	www/target_ibmvscsi.html
	www/target_iscsi.html
	www/target_local.html
	www/target_lsi.html
	www/target_mvsas.html
	www/target_old.html
	www/target_qla2x00t.html
	www/target_srp.html
	www/targets.html
	www/users.html
2015-05-03 19:07:39 +02:00

239 lines
5.1 KiB
C

/*
* Copyright (C) 2007 - 2015 Vladislav Bolkhovitin
* Copyright (C) 2007 - 2015 SanDisk Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ISCSI_SCST_U_H
#define _ISCSI_SCST_U_H
#ifdef __KERNEL__
#include <linux/types.h>
#else
#include <sys/uio.h>
#define aligned_u64 uint64_t __attribute__((aligned(8)))
#endif
#include "iscsi_scst_ver.h"
#include "iscsi_scst_itf_ver.h"
/* The maximum length of 223 bytes in the RFC. */
#define ISCSI_NAME_LEN 256
#define ISCSI_PORTAL_LEN 64
/* Full name is iSCSI name + connected portal */
#define ISCSI_FULL_NAME_LEN (ISCSI_NAME_LEN + ISCSI_PORTAL_LEN)
#define ISCSI_LISTEN_PORT 3260
#define SCSI_ID_LEN 24
#define ISCSI_MAX_ATTR_NAME_LEN 50
#define ISCSI_MAX_ATTR_VALUE_LEN 512
enum {
key_initial_r2t,
key_immediate_data,
key_max_connections,
key_max_recv_data_length,
key_max_xmit_data_length,
key_max_burst_length,
key_first_burst_length,
key_default_wait_time,
key_default_retain_time,
key_max_outstanding_r2t,
key_data_pdu_inorder,
key_data_sequence_inorder,
key_error_recovery_level,
key_header_digest,
key_data_digest,
key_ofmarker,
key_ifmarker,
key_ofmarkint,
key_ifmarkint,
key_rdma_extensions,
key_target_recv_data_length,
key_initiator_recv_data_length,
key_max_ahs_length,
key_tagged_buffer_for_solicited_data_only,
key_iser_hello_required,
key_max_outstanding_unexpected_pdus,
session_key_last,
};
enum {
key_queued_cmnds,
key_rsp_timeout,
key_nop_in_interval,
key_nop_in_timeout,
key_max_sessions,
target_key_last,
};
enum {
key_session,
key_target,
};
struct iscsi_kern_target_info {
u32 tid;
u32 cookie;
char name[ISCSI_NAME_LEN];
u32 attrs_num;
aligned_u64 attrs_ptr;
};
struct iscsi_kern_session_info {
u32 tid;
aligned_u64 sid;
char initiator_name[ISCSI_NAME_LEN];
#ifdef CONFIG_SCST_PROC
char user_name[ISCSI_NAME_LEN];
#endif
char full_initiator_name[ISCSI_FULL_NAME_LEN];
u32 exp_cmd_sn;
s32 session_params[session_key_last];
s32 target_params[target_key_last];
};
#define DIGEST_ALL (DIGEST_NONE | DIGEST_CRC32C)
#define DIGEST_NONE (1 << 0)
#define DIGEST_CRC32C (1 << 1)
struct iscsi_kern_conn_info {
u32 tid;
aligned_u64 sid;
u32 cid;
u32 stat_sn;
u32 exp_stat_sn;
int fd;
};
struct iscsi_kern_attr {
u32 mode;
char name[ISCSI_MAX_ATTR_NAME_LEN];
};
struct iscsi_kern_mgmt_cmd_res_info {
u32 tid;
u32 cookie;
u32 req_cmd;
u32 result;
char value[ISCSI_MAX_ATTR_VALUE_LEN];
};
struct iscsi_kern_params_info {
u32 tid;
aligned_u64 sid;
u32 params_type;
u32 partial;
s32 session_params[session_key_last];
s32 target_params[target_key_last];
};
enum iscsi_kern_event_code {
#ifndef CONFIG_SCST_PROC
E_ADD_TARGET,
E_DEL_TARGET,
E_MGMT_CMD,
E_ENABLE_TARGET,
E_DISABLE_TARGET,
E_GET_ATTR_VALUE,
E_SET_ATTR_VALUE,
#endif
E_CONN_CLOSE,
};
struct iscsi_kern_event {
u32 tid;
aligned_u64 sid;
u32 cid;
u32 code;
u32 cookie;
char target_name[ISCSI_NAME_LEN];
u32 param1_size;
u32 param2_size;
};
struct iscsi_kern_register_info {
union {
aligned_u64 version;
struct {
int max_data_seg_len;
int max_queued_cmds;
};
};
};
struct iscsi_kern_attr_info {
u32 tid;
u32 cookie;
struct iscsi_kern_attr attr;
};
struct iscsi_kern_initiator_info {
u32 tid;
char full_initiator_name[ISCSI_FULL_NAME_LEN];
};
#define DEFAULT_NR_QUEUED_CMNDS 32
#define MIN_NR_QUEUED_CMNDS 1
#define MAX_NR_QUEUED_CMNDS 2048
#define DEFAULT_RSP_TIMEOUT 90
#define MIN_RSP_TIMEOUT 2
#define MAX_RSP_TIMEOUT 65535
#define DEFAULT_NOP_IN_INTERVAL 30
#define MIN_NOP_IN_INTERVAL 0
#define MAX_NOP_IN_INTERVAL 65535
#define DEFAULT_NOP_IN_TIMEOUT 30
#define MIN_NOP_IN_TIMEOUT 2
#define MAX_NOP_IN_TIMEOUT 65535
#define NETLINK_ISCSI_SCST 25
#define REGISTER_USERD _IOWR('s', 0, struct iscsi_kern_register_info)
#define ADD_TARGET _IOW('s', 1, struct iscsi_kern_target_info)
#define DEL_TARGET _IOW('s', 2, struct iscsi_kern_target_info)
#define ADD_SESSION _IOW('s', 3, struct iscsi_kern_session_info)
#define DEL_SESSION _IOW('s', 4, struct iscsi_kern_session_info)
#define ADD_CONN _IOW('s', 5, struct iscsi_kern_conn_info)
#define DEL_CONN _IOW('s', 6, struct iscsi_kern_conn_info)
#define ISCSI_PARAM_SET _IOW('s', 7, struct iscsi_kern_params_info)
#define ISCSI_PARAM_GET _IOWR('s', 8, struct iscsi_kern_params_info)
#ifndef CONFIG_SCST_PROC
#define ISCSI_ATTR_ADD _IOW('s', 9, struct iscsi_kern_attr_info)
#define ISCSI_ATTR_DEL _IOW('s', 10, struct iscsi_kern_attr_info)
#define MGMT_CMD_CALLBACK _IOW('s', 11, struct iscsi_kern_mgmt_cmd_res_info)
#endif
#define ISCSI_INITIATOR_ALLOWED _IOW('s', 12, struct iscsi_kern_initiator_info)
static inline int iscsi_is_key_internal(int key)
{
switch (key) {
case key_max_xmit_data_length:
return 1;
default:
return 0;
}
}
#endif