aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/scsi/iscsi_if.h2
-rw-r--r--include/scsi/scsi_transport_iscsi.h19
2 files changed, 20 insertions, 1 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 2c3a89b64e71..eebe2b15161b 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -174,6 +174,7 @@ enum iscsi_param {
174 ISCSI_PARAM_TPGT, 174 ISCSI_PARAM_TPGT,
175 ISCSI_PARAM_PERSISTENT_ADDRESS, 175 ISCSI_PARAM_PERSISTENT_ADDRESS,
176 ISCSI_PARAM_PERSISTENT_PORT, 176 ISCSI_PARAM_PERSISTENT_PORT,
177 ISCSI_PARAM_SESS_RECOVERY_TMO,
177 178
178 /* pased in through bind conn using transport_fd */ 179 /* pased in through bind conn using transport_fd */
179 ISCSI_PARAM_CONN_PORT, 180 ISCSI_PARAM_CONN_PORT,
@@ -201,6 +202,7 @@ enum iscsi_param {
201#define ISCSI_TPGT (1 << ISCSI_PARAM_TPGT) 202#define ISCSI_TPGT (1 << ISCSI_PARAM_TPGT)
202#define ISCSI_PERSISTENT_ADDRESS (1 << ISCSI_PARAM_PERSISTENT_ADDRESS) 203#define ISCSI_PERSISTENT_ADDRESS (1 << ISCSI_PARAM_PERSISTENT_ADDRESS)
203#define ISCSI_PERSISTENT_PORT (1 << ISCSI_PARAM_PERSISTENT_PORT) 204#define ISCSI_PERSISTENT_PORT (1 << ISCSI_PARAM_PERSISTENT_PORT)
205#define ISCSI_SESS_RECOVERY_TMO (1 << ISCSI_PARAM_SESS_RECOVERY_TMO)
204#define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT) 206#define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT)
205#define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS) 207#define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS)
206 208
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 4b200645c84b..9d2b99159ee7 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -90,6 +90,7 @@ struct iscsi_transport {
90 char *data, uint32_t data_size); 90 char *data, uint32_t data_size);
91 void (*get_stats) (struct iscsi_cls_conn *conn, 91 void (*get_stats) (struct iscsi_cls_conn *conn,
92 struct iscsi_stats *stats); 92 struct iscsi_stats *stats);
93 void (*session_recovery_timedout) (struct iscsi_cls_session *session);
93}; 94};
94 95
95/* 96/*
@@ -130,12 +131,20 @@ struct iscsi_cls_conn {
130 131
131struct iscsi_cls_session { 132struct iscsi_cls_session {
132 struct list_head sess_list; /* item in session_list */ 133 struct list_head sess_list; /* item in session_list */
134 struct list_head host_list;
133 struct iscsi_transport *transport; 135 struct iscsi_transport *transport;
134 136
135 /* iSCSI values used as unique id by userspace. */ 137 /* iSCSI values used as unique id by userspace. */
136 char *targetname; 138 char *targetname;
137 int tpgt; 139 int tpgt;
138 140
141 /* recovery fields */
142 int recovery_tmo;
143 struct work_struct recovery_work;
144
145 int target_id;
146 int channel;
147
139 int sid; /* session id */ 148 int sid; /* session id */
140 void *dd_data; /* LLD private data */ 149 void *dd_data; /* LLD private data */
141 struct device dev; /* sysfs transport/container device */ 150 struct device dev; /* sysfs transport/container device */
@@ -147,15 +156,23 @@ struct iscsi_cls_session {
147#define iscsi_session_to_shost(_session) \ 156#define iscsi_session_to_shost(_session) \
148 dev_to_shost(_session->dev.parent) 157 dev_to_shost(_session->dev.parent)
149 158
159struct iscsi_host {
160 int next_target_id;
161 struct list_head sessions;
162 struct mutex mutex;
163};
164
150/* 165/*
151 * session and connection functions that can be used by HW iSCSI LLDs 166 * session and connection functions that can be used by HW iSCSI LLDs
152 */ 167 */
153extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, 168extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost,
154 struct iscsi_transport *t); 169 struct iscsi_transport *t, int channel);
155extern int iscsi_destroy_session(struct iscsi_cls_session *session); 170extern int iscsi_destroy_session(struct iscsi_cls_session *session);
156extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, 171extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess,
157 uint32_t cid); 172 uint32_t cid);
158extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); 173extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);
174extern void iscsi_unblock_session(struct iscsi_cls_session *session);
175extern void iscsi_block_session(struct iscsi_cls_session *session);
159 176
160/* 177/*
161 * session functions used by software iscsi 178 * session functions used by software iscsi