diff options
Diffstat (limited to 'include/scsi/scsi_transport_iscsi.h')
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index b684426a5900..5a3df1d7085f 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -34,6 +34,7 @@ struct iscsi_cls_conn; | |||
34 | struct iscsi_conn; | 34 | struct iscsi_conn; |
35 | struct iscsi_cmd_task; | 35 | struct iscsi_cmd_task; |
36 | struct iscsi_mgmt_task; | 36 | struct iscsi_mgmt_task; |
37 | struct sockaddr; | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * struct iscsi_transport - iSCSI Transport template | 40 | * struct iscsi_transport - iSCSI Transport template |
@@ -46,7 +47,12 @@ struct iscsi_mgmt_task; | |||
46 | * @bind_conn: associate this connection with existing iSCSI session | 47 | * @bind_conn: associate this connection with existing iSCSI session |
47 | * and specified transport descriptor | 48 | * and specified transport descriptor |
48 | * @destroy_conn: destroy inactive iSCSI connection | 49 | * @destroy_conn: destroy inactive iSCSI connection |
49 | * @set_param: set iSCSI Data-Path operational parameter | 50 | * @set_param: set iSCSI parameter. Return 0 on success, -ENODATA |
51 | * when param is not supported, and a -Exx value on other | ||
52 | * error. | ||
53 | * @get_param get iSCSI parameter. Must return number of bytes | ||
54 | * copied to buffer on success, -ENODATA when param | ||
55 | * is not supported, and a -Exx value on other error | ||
50 | * @start_conn: set connection to be operational | 56 | * @start_conn: set connection to be operational |
51 | * @stop_conn: suspend/recover/terminate connection | 57 | * @stop_conn: suspend/recover/terminate connection |
52 | * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. | 58 | * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. |
@@ -97,15 +103,11 @@ struct iscsi_transport { | |||
97 | void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); | 103 | void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); |
98 | void (*destroy_conn) (struct iscsi_cls_conn *conn); | 104 | void (*destroy_conn) (struct iscsi_cls_conn *conn); |
99 | int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, | 105 | int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, |
100 | uint32_t value); | 106 | char *buf, int buflen); |
101 | int (*get_conn_param) (struct iscsi_cls_conn *conn, | 107 | int (*get_conn_param) (struct iscsi_cls_conn *conn, |
102 | enum iscsi_param param, uint32_t *value); | 108 | enum iscsi_param param, char *buf); |
103 | int (*get_session_param) (struct iscsi_cls_session *session, | 109 | int (*get_session_param) (struct iscsi_cls_session *session, |
104 | enum iscsi_param param, uint32_t *value); | 110 | enum iscsi_param param, char *buf); |
105 | int (*get_conn_str_param) (struct iscsi_cls_conn *conn, | ||
106 | enum iscsi_param param, char *buf); | ||
107 | int (*get_session_str_param) (struct iscsi_cls_session *session, | ||
108 | enum iscsi_param param, char *buf); | ||
109 | int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 111 | int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
110 | char *data, uint32_t data_size); | 112 | char *data, uint32_t data_size); |
111 | void (*get_stats) (struct iscsi_cls_conn *conn, | 113 | void (*get_stats) (struct iscsi_cls_conn *conn, |
@@ -127,6 +129,8 @@ struct iscsi_transport { | |||
127 | uint64_t *ep_handle); | 129 | uint64_t *ep_handle); |
128 | int (*ep_poll) (uint64_t ep_handle, int timeout_ms); | 130 | int (*ep_poll) (uint64_t ep_handle, int timeout_ms); |
129 | void (*ep_disconnect) (uint64_t ep_handle); | 131 | void (*ep_disconnect) (uint64_t ep_handle); |
132 | int (*tgt_dscvr) (enum iscsi_tgt_dscvr type, uint32_t host_no, | ||
133 | uint32_t enable, struct sockaddr *dst_addr); | ||
130 | }; | 134 | }; |
131 | 135 | ||
132 | /* | 136 | /* |
@@ -155,13 +159,6 @@ struct iscsi_cls_conn { | |||
155 | struct iscsi_transport *transport; | 159 | struct iscsi_transport *transport; |
156 | uint32_t cid; /* connection id */ | 160 | uint32_t cid; /* connection id */ |
157 | 161 | ||
158 | /* portal/group values we got during discovery */ | ||
159 | char *persistent_address; | ||
160 | int persistent_port; | ||
161 | /* portal/group values we are currently using */ | ||
162 | char *address; | ||
163 | int port; | ||
164 | |||
165 | int active; /* must be accessed with the connlock */ | 162 | int active; /* must be accessed with the connlock */ |
166 | struct device dev; /* sysfs transport/container device */ | 163 | struct device dev; /* sysfs transport/container device */ |
167 | struct mempool_zone *z_error; | 164 | struct mempool_zone *z_error; |
@@ -185,16 +182,11 @@ struct iscsi_cls_session { | |||
185 | struct list_head host_list; | 182 | struct list_head host_list; |
186 | struct iscsi_transport *transport; | 183 | struct iscsi_transport *transport; |
187 | 184 | ||
188 | /* iSCSI values used as unique id by userspace. */ | ||
189 | char *targetname; | ||
190 | int tpgt; | ||
191 | |||
192 | /* recovery fields */ | 185 | /* recovery fields */ |
193 | int recovery_tmo; | 186 | int recovery_tmo; |
194 | struct work_struct recovery_work; | 187 | struct work_struct recovery_work; |
195 | 188 | ||
196 | int target_id; | 189 | int target_id; |
197 | int channel; | ||
198 | 190 | ||
199 | int sid; /* session id */ | 191 | int sid; /* session id */ |
200 | void *dd_data; /* LLD private data */ | 192 | void *dd_data; /* LLD private data */ |
@@ -207,8 +199,10 @@ struct iscsi_cls_session { | |||
207 | #define iscsi_session_to_shost(_session) \ | 199 | #define iscsi_session_to_shost(_session) \ |
208 | dev_to_shost(_session->dev.parent) | 200 | dev_to_shost(_session->dev.parent) |
209 | 201 | ||
202 | #define starget_to_session(_stgt) \ | ||
203 | iscsi_dev_to_session(_stgt->dev.parent) | ||
204 | |||
210 | struct iscsi_host { | 205 | struct iscsi_host { |
211 | int next_target_id; | ||
212 | struct list_head sessions; | 206 | struct list_head sessions; |
213 | struct mutex mutex; | 207 | struct mutex mutex; |
214 | }; | 208 | }; |
@@ -216,8 +210,17 @@ struct iscsi_host { | |||
216 | /* | 210 | /* |
217 | * session and connection functions that can be used by HW iSCSI LLDs | 211 | * session and connection functions that can be used by HW iSCSI LLDs |
218 | */ | 212 | */ |
213 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, | ||
214 | struct iscsi_transport *transport); | ||
215 | extern int iscsi_add_session(struct iscsi_cls_session *session, | ||
216 | unsigned int target_id); | ||
217 | extern int iscsi_if_create_session_done(struct iscsi_cls_conn *conn); | ||
218 | extern int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn); | ||
219 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, | 219 | extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, |
220 | struct iscsi_transport *t, int channel); | 220 | struct iscsi_transport *t, |
221 | unsigned int target_id); | ||
222 | extern void iscsi_remove_session(struct iscsi_cls_session *session); | ||
223 | extern void iscsi_free_session(struct iscsi_cls_session *session); | ||
221 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); | 224 | extern int iscsi_destroy_session(struct iscsi_cls_session *session); |
222 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, | 225 | extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, |
223 | uint32_t cid); | 226 | uint32_t cid); |
@@ -225,4 +228,5 @@ extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); | |||
225 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); | 228 | extern void iscsi_unblock_session(struct iscsi_cls_session *session); |
226 | extern void iscsi_block_session(struct iscsi_cls_session *session); | 229 | extern void iscsi_block_session(struct iscsi_cls_session *session); |
227 | 230 | ||
231 | |||
228 | #endif | 232 | #endif |