2 * Copyright (C) 2007 - 2009 Vladislav Bolkhovitin
3 * Copyright (C) 2007 - 2009 ID7 Ltd.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation, version 2
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef _ISCSI_SCST_U_H
17 #define _ISCSI_SCST_U_H
23 #include "iscsi_scst_ver.h"
24 #include "iscsi_scst_itf_ver.h"
26 /* The maximum length of 223 bytes in the RFC. */
27 #define ISCSI_NAME_LEN 256
29 #define ISCSI_LISTEN_PORT 3260
31 #define SCSI_ID_LEN 24
34 #define aligned_u64 uint64_t __attribute__((aligned(8)))
37 struct iscsi_kern_target_info {
39 char name[ISCSI_NAME_LEN];
42 struct iscsi_kern_session_info {
46 char initiator_name[ISCSI_NAME_LEN];
47 char user_name[ISCSI_NAME_LEN];
51 #define DIGEST_ALL (DIGEST_NONE | DIGEST_CRC32C)
52 #define DIGEST_NONE (1 << 0)
53 #define DIGEST_CRC32C (1 << 1)
55 struct iscsi_kern_conn_info {
69 key_max_recv_data_length,
70 key_max_xmit_data_length,
72 key_first_burst_length,
73 key_default_wait_time,
74 key_default_retain_time,
75 key_max_outstanding_r2t,
77 key_data_sequence_inorder,
78 key_error_recovery_level,
98 struct iscsi_kern_param_info {
105 s32 session_param[session_key_last];
106 s32 target_param[target_key_last];
109 enum iscsi_kern_event_state {
113 struct iscsi_kern_event {
120 struct iscsi_kern_register_info {
124 #define DEFAULT_NR_QUEUED_CMNDS 32
125 #define MIN_NR_QUEUED_CMNDS 1
126 #define MAX_NR_QUEUED_CMNDS 256
128 #define NETLINK_ISCSI_SCST 25
130 /* On success returns MAX_DATA_SEG_LEN */
131 #define REGISTER_USERD _IOW('s', 0, struct iscsi_kern_register_info)
133 #define ADD_TARGET _IOW('s', 1, struct iscsi_kern_target_info)
134 #define DEL_TARGET _IOW('s', 2, struct iscsi_kern_target_info)
135 #define ADD_SESSION _IOW('s', 3, struct iscsi_kern_session_info)
136 #define DEL_SESSION _IOW('s', 4, struct iscsi_kern_session_info)
137 #define ADD_CONN _IOW('s', 5, struct iscsi_kern_conn_info)
138 #define DEL_CONN _IOW('s', 6, struct iscsi_kern_conn_info)
139 #define ISCSI_PARAM_SET _IOW('s', 7, struct iscsi_kern_param_info)
140 #define ISCSI_PARAM_GET _IOWR('s', 8, struct iscsi_kern_param_info)
142 static inline int iscsi_is_key_internal(int key)
145 case key_max_xmit_data_length: