aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorManish Rangankar <manish.rangankar@qlogic.com>2011-07-25 14:48:52 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-08-27 10:36:23 -0400
commit17fa575eec7254fb089f858cae135d64cd015440 (patch)
tree42678af6a81a429bf38264d0879e6476abe7a71c /include/scsi
parenta355943ca847ca3a264d468e408217562234d019 (diff)
[SCSI] scsi_transport_iscsi: Add conn login, kernel to user, event to support offload session login.
Offload drivers like qla4xxx will offload the sending of the login/logout pdus still, so this patch adds iscsi_conn_login_event which is used by these types of drivers to notify userspace that the connection has changed state. It also adds a iscsi_is_session_online helper so the lld can query the sessions state field. Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_if.h17
-rw-r--r--include/scsi/scsi_transport_iscsi.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index d3f256a232f8..629ca42dfe75 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -71,6 +71,7 @@ enum iscsi_uevent_e {
71 71
72 ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, 72 ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7,
73 ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, 73 ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
74 ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
74}; 75};
75 76
76enum iscsi_tgt_dscvr { 77enum iscsi_tgt_dscvr {
@@ -198,6 +199,11 @@ struct iscsi_uevent {
198 uint32_t cid; 199 uint32_t cid;
199 uint64_t recv_handle; 200 uint64_t recv_handle;
200 } recv_req; 201 } recv_req;
202 struct msg_conn_login {
203 uint32_t sid;
204 uint32_t cid;
205 uint32_t state; /* enum iscsi_conn_state */
206 } conn_login;
201 struct msg_conn_error { 207 struct msg_conn_error {
202 uint32_t sid; 208 uint32_t sid;
203 uint32_t cid; 209 uint32_t cid;
@@ -309,6 +315,16 @@ enum iscsi_net_param {
309 ISCSI_NET_PARAM_IFACE_NAME = 17, 315 ISCSI_NET_PARAM_IFACE_NAME = 17,
310}; 316};
311 317
318enum iscsi_conn_state {
319 ISCSI_CONN_STATE_FREE,
320 ISCSI_CONN_STATE_XPT_WAIT,
321 ISCSI_CONN_STATE_IN_LOGIN,
322 ISCSI_CONN_STATE_LOGGED_IN,
323 ISCSI_CONN_STATE_IN_LOGOUT,
324 ISCSI_CONN_STATE_LOGOUT_REQUESTED,
325 ISCSI_CONN_STATE_CLEANUP_WAIT,
326};
327
312/* 328/*
313 * Common error codes 329 * Common error codes
314 */ 330 */
@@ -421,6 +437,7 @@ enum iscsi_host_param {
421#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ 437#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */
422#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, 438#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal,
423 and verification */ 439 and verification */
440#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */
424 441
425/* 442/*
426 * These flags describes reason of stop_conn() call 443 * These flags describes reason of stop_conn() call
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 4a3edeeae8f6..3389cd5ea94c 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -156,6 +156,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt);
156 */ 156 */
157extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, 157extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn,
158 enum iscsi_err error); 158 enum iscsi_err error);
159extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn,
160 enum iscsi_conn_state state);
159extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 161extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
160 char *data, uint32_t data_size); 162 char *data, uint32_t data_size);
161 163
@@ -268,6 +270,7 @@ struct iscsi_iface {
268 dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) 270 dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a)
269 271
270extern int iscsi_session_chkready(struct iscsi_cls_session *session); 272extern int iscsi_session_chkready(struct iscsi_cls_session *session);
273extern int iscsi_is_session_online(struct iscsi_cls_session *session);
271extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, 274extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost,
272 struct iscsi_transport *transport, int dd_size); 275 struct iscsi_transport *transport, int dd_size);
273extern int iscsi_add_session(struct iscsi_cls_session *session, 276extern int iscsi_add_session(struct iscsi_cls_session *session,