blob: e5d09d242ba3be8e89df14b9e0611dda759c49be [file] [log] [blame]
Nicholas Bellinger3f993062013-03-06 21:53:26 -08001#include <linux/module.h>
2#include <linux/list.h>
3#include "../../../drivers/target/iscsi/iscsi_target_core.h"
4
5struct iscsit_transport {
6#define ISCSIT_TRANSPORT_NAME 16
7 char name[ISCSIT_TRANSPORT_NAME];
8 int transport_type;
9 struct module *owner;
10 struct list_head t_node;
11 int (*iscsit_setup_np)(struct iscsi_np *, struct __kernel_sockaddr_storage *);
12 int (*iscsit_accept_np)(struct iscsi_np *, struct iscsi_conn *);
13 void (*iscsit_free_np)(struct iscsi_np *);
14 void (*iscsit_free_conn)(struct iscsi_conn *);
15 struct iscsi_cmd *(*iscsit_alloc_cmd)(struct iscsi_conn *, gfp_t);
16 int (*iscsit_get_login_rx)(struct iscsi_conn *, struct iscsi_login *);
17 int (*iscsit_put_login_tx)(struct iscsi_conn *, struct iscsi_login *, u32);
18 int (*iscsit_immediate_queue)(struct iscsi_conn *, struct iscsi_cmd *, int);
19 int (*iscsit_response_queue)(struct iscsi_conn *, struct iscsi_cmd *, int);
20 int (*iscsit_get_dataout)(struct iscsi_conn *, struct iscsi_cmd *, bool);
21 int (*iscsit_queue_data_in)(struct iscsi_conn *, struct iscsi_cmd *);
22 int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *);
23};
24
25/*
26 * From iscsi_target_transport.c
27 */
28
29extern int iscsit_register_transport(struct iscsit_transport *);
30extern void iscsit_unregister_transport(struct iscsit_transport *);
31extern struct iscsit_transport *iscsit_get_transport(int);
32extern void iscsit_put_transport(struct iscsit_transport *);
33
34/*
35 * From iscsi_target.c
36 */
Nicholas Bellinger3f993062013-03-06 21:53:26 -080037extern int iscsit_setup_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *,
38 unsigned char *);
39extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *);
40extern int iscsit_process_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *,
41 struct iscsi_scsi_req *);
42extern int iscsit_check_dataout_hdr(struct iscsi_conn *, unsigned char *,
43 struct iscsi_cmd **);
44extern int iscsit_check_dataout_payload(struct iscsi_cmd *, struct iscsi_data *,
45 bool);
Nicholas Bellinger778de362013-06-14 16:07:47 -070046extern int iscsit_setup_nop_out(struct iscsi_conn *, struct iscsi_cmd *,
47 struct iscsi_nopout *);
48extern int iscsit_process_nop_out(struct iscsi_conn *, struct iscsi_cmd *,
49 struct iscsi_nopout *);
Nicholas Bellinger3f993062013-03-06 21:53:26 -080050extern int iscsit_handle_logout_cmd(struct iscsi_conn *, struct iscsi_cmd *,
51 unsigned char *);
52extern int iscsit_handle_task_mgt_cmd(struct iscsi_conn *, struct iscsi_cmd *,
53 unsigned char *);
Nicholas Bellinger64534aa2013-06-14 16:46:16 -070054extern int iscsit_setup_text_cmd(struct iscsi_conn *, struct iscsi_cmd *,
55 struct iscsi_text *);
56extern int iscsit_process_text_cmd(struct iscsi_conn *, struct iscsi_cmd *,
57 struct iscsi_text *);
Nicholas Bellinger3f993062013-03-06 21:53:26 -080058extern void iscsit_build_rsp_pdu(struct iscsi_cmd *, struct iscsi_conn *,
59 bool, struct iscsi_scsi_rsp *);
60extern void iscsit_build_nopin_rsp(struct iscsi_cmd *, struct iscsi_conn *,
61 struct iscsi_nopin *, bool);
62extern void iscsit_build_task_mgt_rsp(struct iscsi_cmd *, struct iscsi_conn *,
63 struct iscsi_tm_rsp *);
Nicholas Bellinger889c8a62013-06-14 18:49:55 -070064extern int iscsit_build_text_rsp(struct iscsi_cmd *, struct iscsi_conn *,
65 struct iscsi_text_rsp *);
Nicholas Bellinger3f993062013-03-06 21:53:26 -080066extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *,
67 struct iscsi_reject *);
68extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *,
69 struct iscsi_logout_rsp *);
70extern int iscsit_logout_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
71/*
72 * From iscsi_target_device.c
73 */
74extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *);
75/*
Nicholas Bellingerb2cb9642013-07-03 03:05:37 -070076 * From iscsi_target_erl0.c
77 */
78extern void iscsit_cause_connection_reinstatement(struct iscsi_conn *, int);
79/*
Nicholas Bellinger3f993062013-03-06 21:53:26 -080080 * From iscsi_target_erl1.c
81 */
82extern void iscsit_stop_dataout_timer(struct iscsi_cmd *);
83
84/*
85 * From iscsi_target_tmr.c
86 */
87extern int iscsit_tmr_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
88
89/*
90 * From iscsi_target_util.c
91 */
92extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t);
Nicholas Bellinger561bf152013-07-03 03:58:58 -070093extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *,
94 unsigned char *, __be32);