diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2006-06-28 13:00:30 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-29 11:08:46 -0400 |
commit | 8434aa8b6fe5af27a33b8aa830c24e3680356c83 (patch) | |
tree | dc8120fddd1d237dd9d47299b90c40874320daaf /include/scsi | |
parent | e6f3b63f50b4bb9fdc9025e0c3994acd265ad3a2 (diff) |
[SCSI] iscsi: break up session creation into two stages
qla4xxx is initialized in two steps like other HW drivers.
It allocates the host, sets up the HW, then adds the host.
For iscsi part of HW setup is setting up persistent iscsi
sessions. At that time, the interupts are off and the driver
is not completely set up so we just want to allocate them.
We do not want to add them to sysfs and expose them to userspace
because userspace could try to do lots of fun things with them
like scanning and at that time the driver is not ready.
So this patch breakes up the session creation like other
functions that use the driver model in two the alloc
and add parts. When the driver is ready, it can then add
the sessions and userspace can begin using them.
This also fixes a bug in the addition error patch where
we forgot to do a get on the session.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 2e3cb37af047..53493d591355 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -199,6 +199,9 @@ struct iscsi_cls_session { | |||
199 | #define iscsi_session_to_shost(_session) \ | 199 | #define iscsi_session_to_shost(_session) \ |
200 | dev_to_shost(_session->dev.parent) | 200 | dev_to_shost(_session->dev.parent) |
201 | 201 | ||
202 | #define starget_to_session(_stgt) \ | ||
203 | iscsi_dev_to_session(_stgt->dev.parent) | ||
204 | |||
202 | struct iscsi_host { | 205 | struct iscsi_host { |
203 | int next_target_id; | 206 | int next_target_id; |
204 | struct list_head sessions; | 207 | struct list_head sessions; |
@@ -208,8 +211,13 @@ struct iscsi_host { | |||
208 | /* | 211 | /* |
209 | * session and connection functions that can be used by HW iSCSI LLDs | 212 | * session and connection functions that can be used by HW iSCSI LLDs |
210 | */ | 213 | */ |
214 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, | ||
215 | struct iscsi_transport *transport); | ||
216 | extern int iscsi_add_session(struct iscsi_cls_session *session); | ||
211 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, | 217 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, |
212 | struct iscsi_transport *t); | 218 | struct iscsi_transport *t); |
219 | extern void iscsi_remove_session(struct iscsi_cls_session *session); | ||
220 | extern void iscsi_free_session(struct iscsi_cls_session *session); | ||
213 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); | 221 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); |
214 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, | 222 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, |
215 | uint32_t cid); | 223 | uint32_t cid); |