diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-09-24 12:46:10 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-13 09:28:59 -0400 |
commit | e5bd7b54e93ef7151469a12b8c28d863b9f8a088 (patch) | |
tree | b1e63758dc0272346b7d5e9af6435a87fd94a7ad /include/scsi | |
parent | 1d9edf0270cb5a434d32e95279ce9493581906b3 (diff) |
[SCSI] libiscsi: Support drivers initiating session removal
If the driver knows when hardware is removed like with cxgb3i,
bnx2i, qla4xxx and iser then we will want to remove the sessions/devices
that are bound to that device before removing the host.
cxgb3i and in the future bnx2i will remove the host and that will
remove all the sessions on the hba. iser can call iscsi_kill_session
when it gets an event that indicates that a hca is removed.
And when qla4xxx is hooked in to the lib (it is only hooked into
the class right now) it can call iscsi remove host like the
partial offload card drivers.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/iscsi_if.h | 1 | ||||
-rw-r--r-- | include/scsi/libiscsi.h | 13 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 16be12f1cbe8..f274d248a91f 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -213,6 +213,7 @@ enum iscsi_err { | |||
213 | ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, | 213 | ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, |
214 | ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16, | 214 | ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16, |
215 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, | 215 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, |
216 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, | ||
216 | }; | 217 | }; |
217 | 218 | ||
218 | /* | 219 | /* |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 5e75bb7f311c..7d8cd159f592 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -287,6 +287,11 @@ struct iscsi_session { | |||
287 | struct iscsi_pool cmdpool; /* PDU's pool */ | 287 | struct iscsi_pool cmdpool; /* PDU's pool */ |
288 | }; | 288 | }; |
289 | 289 | ||
290 | enum { | ||
291 | ISCSI_HOST_SETUP, | ||
292 | ISCSI_HOST_REMOVED, | ||
293 | }; | ||
294 | |||
290 | struct iscsi_host { | 295 | struct iscsi_host { |
291 | char *initiatorname; | 296 | char *initiatorname; |
292 | /* hw address or netdev iscsi connection is bound to */ | 297 | /* hw address or netdev iscsi connection is bound to */ |
@@ -295,6 +300,12 @@ struct iscsi_host { | |||
295 | /* local address */ | 300 | /* local address */ |
296 | int local_port; | 301 | int local_port; |
297 | char local_address[ISCSI_ADDRESS_BUF_LEN]; | 302 | char local_address[ISCSI_ADDRESS_BUF_LEN]; |
303 | |||
304 | wait_queue_head_t session_removal_wq; | ||
305 | /* protects sessions and state */ | ||
306 | spinlock_t lock; | ||
307 | int num_sessions; | ||
308 | int state; | ||
298 | }; | 309 | }; |
299 | 310 | ||
300 | /* | 311 | /* |
@@ -351,6 +362,8 @@ extern void iscsi_conn_stop(struct iscsi_cls_conn *, int); | |||
351 | extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, | 362 | extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, |
352 | int); | 363 | int); |
353 | extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); | 364 | extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); |
365 | extern void iscsi_session_failure(struct iscsi_cls_session *cls_session, | ||
366 | enum iscsi_err err); | ||
354 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | 367 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, |
355 | enum iscsi_param param, char *buf); | 368 | enum iscsi_param param, char *buf); |
356 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); | 369 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 8b6c91df4c7a..8749d4d8e244 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -135,7 +135,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt); | |||
135 | /* | 135 | /* |
136 | * control plane upcalls | 136 | * control plane upcalls |
137 | */ | 137 | */ |
138 | extern void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error); | 138 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, |
139 | enum iscsi_err error); | ||
139 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 140 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
140 | char *data, uint32_t data_size); | 141 | char *data, uint32_t data_size); |
141 | 142 | ||