aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/libiscsi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/libiscsi.h')
-rw-r--r--include/scsi/libiscsi.h31
1 files changed, 16 insertions, 15 deletions
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