summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorManish Rangankar <manish.rangankar@qlogic.com>2011-07-25 13:48:52 -0500
committerJames Bottomley <JBottomley@Parallels.com>2011-08-27 08:36:23 -0600
commit17fa575eec7254fb089f858cae135d64cd015440 (patch)
tree42678af6a81a429bf38264d0879e6476abe7a71c /include/scsi
parenta355943ca847ca3a264d468e408217562234d019 (diff)
downloadlinux-17fa575eec7254fb089f858cae135d64cd015440.tar.bz2
[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 {
ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7,
ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
+ ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
};
enum iscsi_tgt_dscvr {
@@ -198,6 +199,11 @@ struct iscsi_uevent {
uint32_t cid;
uint64_t recv_handle;
} recv_req;
+ struct msg_conn_login {
+ uint32_t sid;
+ uint32_t cid;
+ uint32_t state; /* enum iscsi_conn_state */
+ } conn_login;
struct msg_conn_error {
uint32_t sid;
uint32_t cid;
@@ -309,6 +315,16 @@ enum iscsi_net_param {
ISCSI_NET_PARAM_IFACE_NAME = 17,
};
+enum iscsi_conn_state {
+ ISCSI_CONN_STATE_FREE,
+ ISCSI_CONN_STATE_XPT_WAIT,
+ ISCSI_CONN_STATE_IN_LOGIN,
+ ISCSI_CONN_STATE_LOGGED_IN,
+ ISCSI_CONN_STATE_IN_LOGOUT,
+ ISCSI_CONN_STATE_LOGOUT_REQUESTED,
+ ISCSI_CONN_STATE_CLEANUP_WAIT,
+};
+
/*
* Common error codes
*/
@@ -421,6 +437,7 @@ enum iscsi_host_param {
#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */
#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal,
and verification */
+#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */
/*
* 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);
*/
extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn,
enum iscsi_err error);
+extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn,
+ enum iscsi_conn_state state);
extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
char *data, uint32_t data_size);
@@ -268,6 +270,7 @@ struct iscsi_iface {
dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a)
extern int iscsi_session_chkready(struct iscsi_cls_session *session);
+extern int iscsi_is_session_online(struct iscsi_cls_session *session);
extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost,
struct iscsi_transport *transport, int dd_size);
extern int iscsi_add_session(struct iscsi_cls_session *session,