aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-21 16:53:59 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 09:22:16 -0400
commit756135215ec743be6fdce2bdebe8cdb9f8a231f6 (patch)
tree7eb0a5a23731fcd974f9e5e5d136fe6944d4761c /include/scsi
parent32c6e1b9a2e27076b7070a9ec56a9e5437ebd725 (diff)
[SCSI] iscsi: remove session and host binding in libiscsi
bnx2i allocates a host per netdevice but will use libiscsi, so this unbinds the session from the host in that code. This will also be useful for the iser parent device dma settings fixes. 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.h7
-rw-r--r--include/scsi/libiscsi.h31
-rw-r--r--include/scsi/scsi_transport_iscsi.h8
3 files changed, 19 insertions, 27 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 1883c85cd3ee..801a677777cc 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -310,13 +310,6 @@ enum iscsi_host_param {
310 310
311#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 311#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
312#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 312#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
313#define hostdata_session(_hostdata) (iscsi_ptr(*(unsigned long *)_hostdata))
314
315/**
316 * iscsi_hostdata - get LLD hostdata from scsi_host
317 * @_hostdata: pointer to scsi host's hostdata
318 **/
319#define iscsi_hostdata(_hostdata) ((void*)_hostdata + sizeof(unsigned long))
320 313
321/* 314/*
322 * These flags presents iSCSI Data-Path capabilities. 315 * These flags presents iSCSI Data-Path capabilities.
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index f24cf0246739..8a6271c20935 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -209,9 +209,6 @@ struct iscsi_conn {
209 /* remote portal currently connected to */ 209 /* remote portal currently connected to */
210 int portal_port; 210 int portal_port;
211 char portal_address[ISCSI_ADDRESS_BUF_LEN]; 211 char portal_address[ISCSI_ADDRESS_BUF_LEN];
212 /* local address */
213 int local_port;
214 char local_address[ISCSI_ADDRESS_BUF_LEN];
215 212
216 /* MIB-statistics */ 213 /* MIB-statistics */
217 uint64_t txdata_octets; 214 uint64_t txdata_octets;
@@ -247,6 +244,7 @@ enum {
247}; 244};
248 245
249struct iscsi_session { 246struct iscsi_session {
247 struct iscsi_cls_session *cls_session;
250 /* 248 /*
251 * Syncs up the scsi eh thread with the iscsi eh thread when sending 249 * Syncs up the scsi eh thread with the iscsi eh thread when sending
252 * task management functions. This must be taken before the session 250 * task management functions. This must be taken before the session
@@ -282,10 +280,6 @@ struct iscsi_session {
282 char *password; 280 char *password;
283 char *password_in; 281 char *password_in;
284 char *targetname; 282 char *targetname;
285 char *initiatorname;
286 /* hw address or netdev iscsi connection is bound to */
287 char *hwaddress;
288 char *netdev;
289 /* control data */ 283 /* control data */
290 struct iscsi_transport *tt; 284 struct iscsi_transport *tt;
291 struct Scsi_Host *host; 285 struct Scsi_Host *host;
@@ -307,6 +301,16 @@ struct iscsi_session {
307 struct iscsi_pool mgmtpool; /* Mgmt PDU's pool */ 301 struct iscsi_pool mgmtpool; /* Mgmt PDU's pool */
308}; 302};
309 303
304struct iscsi_host {
305 char *initiatorname;
306 /* hw address or netdev iscsi connection is bound to */
307 char *hwaddress;
308 char *netdev;
309 /* local address */
310 int local_port;
311 char local_address[ISCSI_ADDRESS_BUF_LEN];
312};
313
310/* 314/*
311 * scsi host template 315 * scsi host template
312 */ 316 */
@@ -326,27 +330,24 @@ extern int iscsi_host_set_param(struct Scsi_Host *shost,
326 int buflen); 330 int buflen);
327extern int iscsi_host_get_param(struct Scsi_Host *shost, 331extern int iscsi_host_get_param(struct Scsi_Host *shost,
328 enum iscsi_host_param param, char *buf); 332 enum iscsi_host_param param, char *buf);
333extern void iscsi_host_setup(struct Scsi_Host *shost, uint16_t qdepth);
334extern void iscsi_host_teardown(struct Scsi_Host *shost);
329 335
330/* 336/*
331 * session management 337 * session management
332 */ 338 */
333extern struct iscsi_cls_session * 339extern struct iscsi_cls_session *
334iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *, 340iscsi_session_setup(struct iscsi_transport *, struct Scsi_Host *shost,
335 uint16_t, uint16_t, int, int, uint32_t, uint32_t *); 341 uint16_t, int, int, uint32_t);
336extern void iscsi_session_teardown(struct iscsi_cls_session *); 342extern void iscsi_session_teardown(struct iscsi_cls_session *);
337extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *);
338extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); 343extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
339extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn, 344extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
340 enum iscsi_param param, char *buf, int buflen); 345 enum iscsi_param param, char *buf, int buflen);
341extern int iscsi_session_get_param(struct iscsi_cls_session *cls_session, 346extern int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
342 enum iscsi_param param, char *buf); 347 enum iscsi_param param, char *buf);
343 348
344#define session_to_cls(_sess) \
345 hostdata_session(_sess->host->hostdata)
346
347#define iscsi_session_printk(prefix, _sess, fmt, a...) \ 349#define iscsi_session_printk(prefix, _sess, fmt, a...) \
348 iscsi_cls_session_printk(prefix, \ 350 iscsi_cls_session_printk(prefix, _sess->cls_session, fmt, ##a)
349 (struct iscsi_cls_session *)session_to_cls(_sess), fmt, ##a)
350 351
351/* 352/*
352 * connection management 353 * connection management
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 728702292a80..702eda2904d7 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -83,15 +83,13 @@ struct iscsi_transport {
83 /* LLD sets this to indicate what values it can export to sysfs */ 83 /* LLD sets this to indicate what values it can export to sysfs */
84 uint64_t param_mask; 84 uint64_t param_mask;
85 uint64_t host_param_mask; 85 uint64_t host_param_mask;
86 struct scsi_host_template *host_template;
87 /* LLD connection data size */ 86 /* LLD connection data size */
88 int conndata_size; 87 int conndata_size;
89 /* LLD session data size */ 88 /* LLD session data size */
90 int sessiondata_size; 89 int sessiondata_size;
91 int max_lun; 90 struct iscsi_cls_session *(*create_session) (struct Scsi_Host *shost,
92 struct iscsi_cls_session *(*create_session) (struct iscsi_transport *it, 91 uint16_t cmds_max, uint16_t qdepth,
93 struct scsi_transport_template *t, struct Scsi_Host *shost, 92 uint32_t sn, uint32_t *hn);
94 uint16_t cmds_max, uint16_t qdepth, uint32_t sn, uint32_t *hn);
95 void (*destroy_session) (struct iscsi_cls_session *session); 93 void (*destroy_session) (struct iscsi_cls_session *session);
96 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess, 94 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess,
97 uint32_t cid); 95 uint32_t cid);