aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/iser/iscsi_iser.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/iser/iscsi_iser.h')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h44
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 0e10703cf59e..81a82628a5f1 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -94,7 +94,6 @@
94 /* support upto 512KB in one RDMA */ 94 /* support upto 512KB in one RDMA */
95#define ISCSI_ISER_SG_TABLESIZE (0x80000 >> SHIFT_4K) 95#define ISCSI_ISER_SG_TABLESIZE (0x80000 >> SHIFT_4K)
96#define ISCSI_ISER_MAX_LUN 256 96#define ISCSI_ISER_MAX_LUN 256
97#define ISCSI_ISER_MAX_CMD_LEN 16
98 97
99/* QP settings */ 98/* QP settings */
100/* Maximal bounds on received asynchronous PDUs */ 99/* Maximal bounds on received asynchronous PDUs */
@@ -172,7 +171,8 @@ struct iser_data_buf {
172/* fwd declarations */ 171/* fwd declarations */
173struct iser_device; 172struct iser_device;
174struct iscsi_iser_conn; 173struct iscsi_iser_conn;
175struct iscsi_iser_cmd_task; 174struct iscsi_iser_task;
175struct iscsi_endpoint;
176 176
177struct iser_mem_reg { 177struct iser_mem_reg {
178 u32 lkey; 178 u32 lkey;
@@ -196,7 +196,7 @@ struct iser_regd_buf {
196#define MAX_REGD_BUF_VECTOR_LEN 2 196#define MAX_REGD_BUF_VECTOR_LEN 2
197 197
198struct iser_dto { 198struct iser_dto {
199 struct iscsi_iser_cmd_task *ctask; 199 struct iscsi_iser_task *task;
200 struct iser_conn *ib_conn; 200 struct iser_conn *ib_conn;
201 int notify_enable; 201 int notify_enable;
202 202
@@ -240,7 +240,9 @@ struct iser_device {
240 240
241struct iser_conn { 241struct iser_conn {
242 struct iscsi_iser_conn *iser_conn; /* iser conn for upcalls */ 242 struct iscsi_iser_conn *iser_conn; /* iser conn for upcalls */
243 struct iscsi_endpoint *ep;
243 enum iser_ib_conn_state state; /* rdma connection state */ 244 enum iser_ib_conn_state state; /* rdma connection state */
245 atomic_t refcount;
244 spinlock_t lock; /* used for state changes */ 246 spinlock_t lock; /* used for state changes */
245 struct iser_device *device; /* device context */ 247 struct iser_device *device; /* device context */
246 struct rdma_cm_id *cma_id; /* CMA ID */ 248 struct rdma_cm_id *cma_id; /* CMA ID */
@@ -259,11 +261,9 @@ struct iser_conn {
259struct iscsi_iser_conn { 261struct iscsi_iser_conn {
260 struct iscsi_conn *iscsi_conn;/* ptr to iscsi conn */ 262 struct iscsi_conn *iscsi_conn;/* ptr to iscsi conn */
261 struct iser_conn *ib_conn; /* iSER IB conn */ 263 struct iser_conn *ib_conn; /* iSER IB conn */
262
263 rwlock_t lock;
264}; 264};
265 265
266struct iscsi_iser_cmd_task { 266struct iscsi_iser_task {
267 struct iser_desc desc; 267 struct iser_desc desc;
268 struct iscsi_iser_conn *iser_conn; 268 struct iscsi_iser_conn *iser_conn;
269 enum iser_task_status status; 269 enum iser_task_status status;
@@ -296,22 +296,26 @@ extern int iser_debug_level;
296/* allocate connection resources needed for rdma functionality */ 296/* allocate connection resources needed for rdma functionality */
297int iser_conn_set_full_featured_mode(struct iscsi_conn *conn); 297int iser_conn_set_full_featured_mode(struct iscsi_conn *conn);
298 298
299int iser_send_control(struct iscsi_conn *conn, 299int iser_send_control(struct iscsi_conn *conn,
300 struct iscsi_mgmt_task *mtask); 300 struct iscsi_task *task);
301 301
302int iser_send_command(struct iscsi_conn *conn, 302int iser_send_command(struct iscsi_conn *conn,
303 struct iscsi_cmd_task *ctask); 303 struct iscsi_task *task);
304 304
305int iser_send_data_out(struct iscsi_conn *conn, 305int iser_send_data_out(struct iscsi_conn *conn,
306 struct iscsi_cmd_task *ctask, 306 struct iscsi_task *task,
307 struct iscsi_data *hdr); 307 struct iscsi_data *hdr);
308 308
309void iscsi_iser_recv(struct iscsi_conn *conn, 309void iscsi_iser_recv(struct iscsi_conn *conn,
310 struct iscsi_hdr *hdr, 310 struct iscsi_hdr *hdr,
311 char *rx_data, 311 char *rx_data,
312 int rx_data_len); 312 int rx_data_len);
313 313
314int iser_conn_init(struct iser_conn **ib_conn); 314void iser_conn_init(struct iser_conn *ib_conn);
315
316void iser_conn_get(struct iser_conn *ib_conn);
317
318void iser_conn_put(struct iser_conn *ib_conn);
315 319
316void iser_conn_terminate(struct iser_conn *ib_conn); 320void iser_conn_terminate(struct iser_conn *ib_conn);
317 321
@@ -320,9 +324,9 @@ void iser_rcv_completion(struct iser_desc *desc,
320 324
321void iser_snd_completion(struct iser_desc *desc); 325void iser_snd_completion(struct iser_desc *desc);
322 326
323void iser_ctask_rdma_init(struct iscsi_iser_cmd_task *ctask); 327void iser_task_rdma_init(struct iscsi_iser_task *task);
324 328
325void iser_ctask_rdma_finalize(struct iscsi_iser_cmd_task *ctask); 329void iser_task_rdma_finalize(struct iscsi_iser_task *task);
326 330
327void iser_dto_buffs_release(struct iser_dto *dto); 331void iser_dto_buffs_release(struct iser_dto *dto);
328 332
@@ -332,10 +336,10 @@ void iser_reg_single(struct iser_device *device,
332 struct iser_regd_buf *regd_buf, 336 struct iser_regd_buf *regd_buf,
333 enum dma_data_direction direction); 337 enum dma_data_direction direction);
334 338
335void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_cmd_task *ctask, 339void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_task *task,
336 enum iser_data_dir cmd_dir); 340 enum iser_data_dir cmd_dir);
337 341
338int iser_reg_rdma_mem(struct iscsi_iser_cmd_task *ctask, 342int iser_reg_rdma_mem(struct iscsi_iser_task *task,
339 enum iser_data_dir cmd_dir); 343 enum iser_data_dir cmd_dir);
340 344
341int iser_connect(struct iser_conn *ib_conn, 345int iser_connect(struct iser_conn *ib_conn,
@@ -355,10 +359,10 @@ int iser_post_send(struct iser_desc *tx_desc);
355int iser_conn_state_comp(struct iser_conn *ib_conn, 359int iser_conn_state_comp(struct iser_conn *ib_conn,
356 enum iser_ib_conn_state comp); 360 enum iser_ib_conn_state comp);
357 361
358int iser_dma_map_task_data(struct iscsi_iser_cmd_task *iser_ctask, 362int iser_dma_map_task_data(struct iscsi_iser_task *iser_task,
359 struct iser_data_buf *data, 363 struct iser_data_buf *data,
360 enum iser_data_dir iser_dir, 364 enum iser_data_dir iser_dir,
361 enum dma_data_direction dma_dir); 365 enum dma_data_direction dma_dir);
362 366
363void iser_dma_unmap_task_data(struct iscsi_iser_cmd_task *iser_ctask); 367void iser_dma_unmap_task_data(struct iscsi_iser_task *iser_task);
364#endif 368#endif