aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-21 16:54:00 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:16 -0400
commita4804cd6eb19318ae8d08ea967cfeaaf5c5b68a6 (patch)
treea69acbfdf4e3646ebb7583f0627b7b7952d13b10 /include/scsi
parent756135215ec743be6fdce2bdebe8cdb9f8a231f6 (diff)
[SCSI] iscsi: add iscsi host helpers
This finishes the host/session unbinding, by adding some helpers to add and remove hosts and the session they manage. 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/libiscsi.h11
-rw-r--r--include/scsi/scsi_transport_iscsi.h4
2 files changed, 13 insertions, 2 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 8a6271c20935..9a26d715a953 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -32,6 +32,7 @@
32#include <scsi/iscsi_if.h> 32#include <scsi/iscsi_if.h>
33 33
34struct scsi_transport_template; 34struct scsi_transport_template;
35struct scsi_host_template;
35struct scsi_device; 36struct scsi_device;
36struct Scsi_Host; 37struct Scsi_Host;
37struct scsi_cmnd; 38struct scsi_cmnd;
@@ -41,6 +42,7 @@ struct iscsi_cls_session;
41struct iscsi_cls_conn; 42struct iscsi_cls_conn;
42struct iscsi_session; 43struct iscsi_session;
43struct iscsi_nopin; 44struct iscsi_nopin;
45struct device;
44 46
45/* #define DEBUG_SCSI */ 47/* #define DEBUG_SCSI */
46#ifdef DEBUG_SCSI 48#ifdef DEBUG_SCSI
@@ -311,6 +313,8 @@ struct iscsi_host {
311 char local_address[ISCSI_ADDRESS_BUF_LEN]; 313 char local_address[ISCSI_ADDRESS_BUF_LEN];
312}; 314};
313 315
316#define iscsi_host_priv(_shost) \
317 (shost_priv(_shost) + sizeof(struct iscsi_host))
314/* 318/*
315 * scsi host template 319 * scsi host template
316 */ 320 */
@@ -330,8 +334,11 @@ extern int iscsi_host_set_param(struct Scsi_Host *shost,
330 int buflen); 334 int buflen);
331extern int iscsi_host_get_param(struct Scsi_Host *shost, 335extern int iscsi_host_get_param(struct Scsi_Host *shost,
332 enum iscsi_host_param param, char *buf); 336 enum iscsi_host_param param, char *buf);
333extern void iscsi_host_setup(struct Scsi_Host *shost, uint16_t qdepth); 337extern int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev);
334extern void iscsi_host_teardown(struct Scsi_Host *shost); 338extern struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
339 int dd_data_size, uint16_t qdepth);
340extern void iscsi_host_remove(struct Scsi_Host *shost);
341extern void iscsi_host_free(struct Scsi_Host *shost);
335 342
336/* 343/*
337 * session management 344 * session management
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 702eda2904d7..761f62da7cc8 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -207,6 +207,10 @@ struct iscsi_cls_host {
207 char scan_workq_name[KOBJ_NAME_LEN]; 207 char scan_workq_name[KOBJ_NAME_LEN];
208}; 208};
209 209
210extern void iscsi_host_for_each_session(struct Scsi_Host *shost,
211 void (*fn)(struct iscsi_cls_session *));
212
213
210/* 214/*
211 * session and connection functions that can be used by HW iSCSI LLDs 215 * session and connection functions that can be used by HW iSCSI LLDs
212 */ 216 */