diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-05-21 16:54:13 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 09:22:20 -0400 |
commit | d82ff9be733a2e6da4f6c2ab4e9216f3f536503d (patch) | |
tree | ec02aa5148e8d9739683fb703732b7edbaf3b3ac /include/scsi | |
parent | 7970634b81a6e3561954517bca42615542c4535b (diff) |
[SCSI] iscsi class: add endpoint class
Add sysfs representation for the endpoint, so userspace can match the
host and session to the endpoint. This will allow us to set the host's
parent correctly at host creation time.
The next patches will convert tcp and iser, and fix iser's dma_mask
bug.
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 | 2 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 801a677777cc..a0f13a280e71 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -80,7 +80,7 @@ struct iscsi_uevent { | |||
80 | uint16_t queue_depth; | 80 | uint16_t queue_depth; |
81 | } c_session; | 81 | } c_session; |
82 | struct msg_create_bound_session { | 82 | struct msg_create_bound_session { |
83 | uint32_t host_no; | 83 | uint64_t ep_handle; |
84 | uint32_t initial_cmdsn; | 84 | uint32_t initial_cmdsn; |
85 | uint16_t cmds_max; | 85 | uint16_t cmds_max; |
86 | uint16_t queue_depth; | 86 | uint16_t queue_depth; |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index d6b823195563..f5444e033cc9 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | struct scsi_transport_template; | 31 | struct scsi_transport_template; |
32 | struct iscsi_transport; | 32 | struct iscsi_transport; |
33 | struct iscsi_endpoint; | ||
33 | struct Scsi_Host; | 34 | struct Scsi_Host; |
34 | struct iscsi_cls_conn; | 35 | struct iscsi_cls_conn; |
35 | struct iscsi_conn; | 36 | struct iscsi_conn; |
@@ -85,7 +86,7 @@ struct iscsi_transport { | |||
85 | /* LLD sets this to indicate what values it can export to sysfs */ | 86 | /* LLD sets this to indicate what values it can export to sysfs */ |
86 | uint64_t param_mask; | 87 | uint64_t param_mask; |
87 | uint64_t host_param_mask; | 88 | uint64_t host_param_mask; |
88 | struct iscsi_cls_session *(*create_session) (struct Scsi_Host *shost, | 89 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, |
89 | uint16_t cmds_max, uint16_t qdepth, | 90 | uint16_t cmds_max, uint16_t qdepth, |
90 | uint32_t sn, uint32_t *hn); | 91 | uint32_t sn, uint32_t *hn); |
91 | void (*destroy_session) (struct iscsi_cls_session *session); | 92 | void (*destroy_session) (struct iscsi_cls_session *session); |
@@ -117,10 +118,10 @@ struct iscsi_transport { | |||
117 | void (*cleanup_task) (struct iscsi_conn *conn, | 118 | void (*cleanup_task) (struct iscsi_conn *conn, |
118 | struct iscsi_task *task); | 119 | struct iscsi_task *task); |
119 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); | 120 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); |
120 | int (*ep_connect) (struct sockaddr *dst_addr, int non_blocking, | 121 | struct iscsi_endpoint *(*ep_connect) (struct sockaddr *dst_addr, |
121 | uint64_t *ep_handle); | 122 | int non_blocking); |
122 | int (*ep_poll) (uint64_t ep_handle, int timeout_ms); | 123 | int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms); |
123 | void (*ep_disconnect) (uint64_t ep_handle); | 124 | void (*ep_disconnect) (struct iscsi_endpoint *ep); |
124 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, | 125 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, |
125 | uint32_t enable, struct sockaddr *dst_addr); | 126 | uint32_t enable, struct sockaddr *dst_addr); |
126 | }; | 127 | }; |
@@ -203,6 +204,11 @@ struct iscsi_cls_host { | |||
203 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, | 204 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, |
204 | void (*fn)(struct iscsi_cls_session *)); | 205 | void (*fn)(struct iscsi_cls_session *)); |
205 | 206 | ||
207 | struct iscsi_endpoint { | ||
208 | void *dd_data; /* LLD private data */ | ||
209 | struct device dev; | ||
210 | unsigned int id; | ||
211 | }; | ||
206 | 212 | ||
207 | /* | 213 | /* |
208 | * session and connection functions that can be used by HW iSCSI LLDs | 214 | * session and connection functions that can be used by HW iSCSI LLDs |
@@ -233,5 +239,8 @@ extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); | |||
233 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); | 239 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); |
234 | extern void iscsi_block_session(struct iscsi_cls_session *session); | 240 | extern void iscsi_block_session(struct iscsi_cls_session *session); |
235 | extern int iscsi_scan_finished(struct Scsi_Host *shost, unsigned long time); | 241 | extern int iscsi_scan_finished(struct Scsi_Host *shost, unsigned long time); |
242 | extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size); | ||
243 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); | ||
244 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); | ||
236 | 245 | ||
237 | #endif | 246 | #endif |