Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 1 | #include <linux/module.h> |
| 2 | #include <linux/list.h> |
| 3 | #include "../../../drivers/target/iscsi/iscsi_target_core.h" |
| 4 | |
| 5 | struct iscsit_transport { |
| 6 | #define ISCSIT_TRANSPORT_NAME 16 |
| 7 | char name[ISCSIT_TRANSPORT_NAME]; |
| 8 | int transport_type; |
Nicholas Bellinger | d703ce2 | 2013-08-17 14:27:56 -0700 | [diff] [blame] | 9 | int priv_size; |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 10 | struct module *owner; |
| 11 | struct list_head t_node; |
| 12 | int (*iscsit_setup_np)(struct iscsi_np *, struct __kernel_sockaddr_storage *); |
| 13 | int (*iscsit_accept_np)(struct iscsi_np *, struct iscsi_conn *); |
| 14 | void (*iscsit_free_np)(struct iscsi_np *); |
| 15 | void (*iscsit_free_conn)(struct iscsi_conn *); |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 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 | |
Nicholas Bellinger | d703ce2 | 2013-08-17 14:27:56 -0700 | [diff] [blame] | 25 | static inline void *iscsit_priv_cmd(struct iscsi_cmd *cmd) |
| 26 | { |
| 27 | return (void *)(cmd + 1); |
| 28 | } |
| 29 | |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 30 | /* |
| 31 | * From iscsi_target_transport.c |
| 32 | */ |
| 33 | |
| 34 | extern int iscsit_register_transport(struct iscsit_transport *); |
| 35 | extern void iscsit_unregister_transport(struct iscsit_transport *); |
| 36 | extern struct iscsit_transport *iscsit_get_transport(int); |
| 37 | extern void iscsit_put_transport(struct iscsit_transport *); |
| 38 | |
| 39 | /* |
| 40 | * From iscsi_target.c |
| 41 | */ |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 42 | extern int iscsit_setup_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 43 | unsigned char *); |
| 44 | extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *); |
| 45 | extern int iscsit_process_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 46 | struct iscsi_scsi_req *); |
| 47 | extern int iscsit_check_dataout_hdr(struct iscsi_conn *, unsigned char *, |
| 48 | struct iscsi_cmd **); |
| 49 | extern int iscsit_check_dataout_payload(struct iscsi_cmd *, struct iscsi_data *, |
| 50 | bool); |
Nicholas Bellinger | 778de36 | 2013-06-14 16:07:47 -0700 | [diff] [blame] | 51 | extern int iscsit_setup_nop_out(struct iscsi_conn *, struct iscsi_cmd *, |
| 52 | struct iscsi_nopout *); |
| 53 | extern int iscsit_process_nop_out(struct iscsi_conn *, struct iscsi_cmd *, |
| 54 | struct iscsi_nopout *); |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 55 | extern int iscsit_handle_logout_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 56 | unsigned char *); |
| 57 | extern int iscsit_handle_task_mgt_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 58 | unsigned char *); |
Nicholas Bellinger | 64534aa | 2013-06-14 16:46:16 -0700 | [diff] [blame] | 59 | extern int iscsit_setup_text_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 60 | struct iscsi_text *); |
| 61 | extern int iscsit_process_text_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 62 | struct iscsi_text *); |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 63 | extern void iscsit_build_rsp_pdu(struct iscsi_cmd *, struct iscsi_conn *, |
| 64 | bool, struct iscsi_scsi_rsp *); |
| 65 | extern void iscsit_build_nopin_rsp(struct iscsi_cmd *, struct iscsi_conn *, |
| 66 | struct iscsi_nopin *, bool); |
| 67 | extern void iscsit_build_task_mgt_rsp(struct iscsi_cmd *, struct iscsi_conn *, |
| 68 | struct iscsi_tm_rsp *); |
Nicholas Bellinger | 889c8a6 | 2013-06-14 18:49:55 -0700 | [diff] [blame] | 69 | extern int iscsit_build_text_rsp(struct iscsi_cmd *, struct iscsi_conn *, |
| 70 | struct iscsi_text_rsp *); |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 71 | extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *, |
| 72 | struct iscsi_reject *); |
| 73 | extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *, |
| 74 | struct iscsi_logout_rsp *); |
| 75 | extern int iscsit_logout_post_handler(struct iscsi_cmd *, struct iscsi_conn *); |
| 76 | /* |
| 77 | * From iscsi_target_device.c |
| 78 | */ |
| 79 | extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *); |
| 80 | /* |
Nicholas Bellinger | b2cb964 | 2013-07-03 03:05:37 -0700 | [diff] [blame] | 81 | * From iscsi_target_erl0.c |
| 82 | */ |
| 83 | extern void iscsit_cause_connection_reinstatement(struct iscsi_conn *, int); |
| 84 | /* |
Nicholas Bellinger | 3f99306 | 2013-03-06 21:53:26 -0800 | [diff] [blame] | 85 | * From iscsi_target_erl1.c |
| 86 | */ |
| 87 | extern void iscsit_stop_dataout_timer(struct iscsi_cmd *); |
| 88 | |
| 89 | /* |
| 90 | * From iscsi_target_tmr.c |
| 91 | */ |
| 92 | extern int iscsit_tmr_post_handler(struct iscsi_cmd *, struct iscsi_conn *); |
| 93 | |
| 94 | /* |
| 95 | * From iscsi_target_util.c |
| 96 | */ |
Nicholas Bellinger | 676687c | 2014-01-20 03:36:44 +0000 | [diff] [blame] | 97 | extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, int); |
Nicholas Bellinger | 561bf15 | 2013-07-03 03:58:58 -0700 | [diff] [blame] | 98 | extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *, |
| 99 | unsigned char *, __be32); |
Nicholas Bellinger | d703ce2 | 2013-08-17 14:27:56 -0700 | [diff] [blame] | 100 | extern void iscsit_release_cmd(struct iscsi_cmd *); |