aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/libiscsi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/libiscsi.h')
-rw-r--r--include/scsi/libiscsi.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 889f51fabab9..7b90b63fb5c7 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -70,8 +70,6 @@ enum {
70#define ISCSI_SUSPEND_BIT 1 70#define ISCSI_SUSPEND_BIT 1
71 71
72#define ISCSI_ITT_MASK (0xfff) 72#define ISCSI_ITT_MASK (0xfff)
73#define ISCSI_CID_SHIFT 12
74#define ISCSI_CID_MASK (0xffff << ISCSI_CID_SHIFT)
75#define ISCSI_AGE_SHIFT 28 73#define ISCSI_AGE_SHIFT 28
76#define ISCSI_AGE_MASK (0xf << ISCSI_AGE_SHIFT) 74#define ISCSI_AGE_MASK (0xf << ISCSI_AGE_SHIFT)
77 75
@@ -135,6 +133,14 @@ static inline void* iscsi_next_hdr(struct iscsi_cmd_task *ctask)
135 return (void*)ctask->hdr + ctask->hdr_len; 133 return (void*)ctask->hdr + ctask->hdr_len;
136} 134}
137 135
136/* Connection's states */
137enum {
138 ISCSI_CONN_INITIAL_STAGE,
139 ISCSI_CONN_STARTED,
140 ISCSI_CONN_STOPPED,
141 ISCSI_CONN_CLEANUP_WAIT,
142};
143
138struct iscsi_conn { 144struct iscsi_conn {
139 struct iscsi_cls_conn *cls_conn; /* ptr to class connection */ 145 struct iscsi_cls_conn *cls_conn; /* ptr to class connection */
140 void *dd_data; /* iscsi_transport data */ 146 void *dd_data; /* iscsi_transport data */
@@ -227,6 +233,17 @@ struct iscsi_pool {
227 int max; /* Max number of elements */ 233 int max; /* Max number of elements */
228}; 234};
229 235
236/* Session's states */
237enum {
238 ISCSI_STATE_FREE = 1,
239 ISCSI_STATE_LOGGED_IN,
240 ISCSI_STATE_FAILED,
241 ISCSI_STATE_TERMINATE,
242 ISCSI_STATE_IN_RECOVERY,
243 ISCSI_STATE_RECOVERY_FAILED,
244 ISCSI_STATE_LOGGING_OUT,
245};
246
230struct iscsi_session { 247struct iscsi_session {
231 /* 248 /*
232 * Syncs up the scsi eh thread with the iscsi eh thread when sending 249 * Syncs up the scsi eh thread with the iscsi eh thread when sending
@@ -325,6 +342,10 @@ extern int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
325#define session_to_cls(_sess) \ 342#define session_to_cls(_sess) \
326 hostdata_session(_sess->host->hostdata) 343 hostdata_session(_sess->host->hostdata)
327 344
345#define iscsi_session_printk(prefix, _sess, fmt, a...) \
346 iscsi_cls_session_printk(prefix, \
347 (struct iscsi_cls_session *)session_to_cls(_sess), fmt, ##a)
348
328/* 349/*
329 * connection management 350 * connection management
330 */ 351 */
@@ -339,6 +360,9 @@ extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err);
339extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, 360extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
340 enum iscsi_param param, char *buf); 361 enum iscsi_param param, char *buf);
341 362
363#define iscsi_conn_printk(prefix, _c, fmt, a...) \
364 iscsi_cls_conn_printk(prefix, _c->cls_conn, fmt, ##a)
365
342/* 366/*
343 * pdu and task processing 367 * pdu and task processing
344 */ 368 */
@@ -349,8 +373,6 @@ extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *,
349 char *, uint32_t); 373 char *, uint32_t);
350extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, 374extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
351 char *, int); 375 char *, int);
352extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
353 char *, int);
354extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *, 376extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *,
355 uint32_t *); 377 uint32_t *);
356extern void iscsi_requeue_ctask(struct iscsi_cmd_task *ctask); 378extern void iscsi_requeue_ctask(struct iscsi_cmd_task *ctask);