1 #ifndef ISCSI_TARGET_H 2 #define ISCSI_TARGET_H 3 4 #include <linux/types.h> 5 #include <linux/spinlock.h> 6 7 struct iscsi_cmd; 8 struct iscsi_conn; 9 struct iscsi_np; 10 struct iscsi_portal_group; 11 struct iscsi_session; 12 struct iscsi_tpg_np; 13 struct kref; 14 struct sockaddr_storage; 15 16 extern struct iscsi_tiqn *iscsit_get_tiqn_for_login(unsigned char *); 17 extern struct iscsi_tiqn *iscsit_get_tiqn(unsigned char *, int); 18 extern void iscsit_put_tiqn_for_login(struct iscsi_tiqn *); 19 extern struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *); 20 extern void iscsit_del_tiqn(struct iscsi_tiqn *); 21 extern int iscsit_access_np(struct iscsi_np *, struct iscsi_portal_group *); 22 extern void iscsit_login_kref_put(struct kref *); 23 extern int iscsit_deaccess_np(struct iscsi_np *, struct iscsi_portal_group *, 24 struct iscsi_tpg_np *); 25 extern bool iscsit_check_np_match(struct sockaddr_storage *, 26 struct iscsi_np *, int); 27 extern struct iscsi_np *iscsit_add_np(struct sockaddr_storage *, 28 int); 29 extern int iscsit_reset_np_thread(struct iscsi_np *, struct iscsi_tpg_np *, 30 struct iscsi_portal_group *, bool); 31 extern int iscsit_del_np(struct iscsi_np *); 32 extern int iscsit_reject_cmd(struct iscsi_cmd *cmd, u8, unsigned char *); 33 extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *); 34 extern int iscsit_logout_closesession(struct iscsi_cmd *, struct iscsi_conn *); 35 extern int iscsit_logout_closeconnection(struct iscsi_cmd *, struct iscsi_conn *); 36 extern int iscsit_logout_removeconnforrecovery(struct iscsi_cmd *, struct iscsi_conn *); 37 extern int iscsit_send_async_msg(struct iscsi_conn *, u16, u8, u8); 38 extern int iscsit_build_r2ts_for_cmd(struct iscsi_conn *, struct iscsi_cmd *, bool recovery); 39 extern void iscsit_thread_get_cpumask(struct iscsi_conn *); 40 extern int iscsi_target_tx_thread(void *); 41 extern int iscsi_target_rx_thread(void *); 42 extern int iscsit_close_connection(struct iscsi_conn *); 43 extern int iscsit_close_session(struct iscsi_session *); 44 extern void iscsit_fail_session(struct iscsi_session *); 45 extern int iscsit_free_session(struct iscsi_session *); 46 extern void iscsit_stop_session(struct iscsi_session *, int, int); 47 extern int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *, int); 48 49 extern struct iscsit_global *iscsit_global; 50 extern const struct target_core_fabric_ops iscsi_ops; 51 52 extern struct kmem_cache *lio_dr_cache; 53 extern struct kmem_cache *lio_ooo_cache; 54 extern struct kmem_cache *lio_qr_cache; 55 extern struct kmem_cache *lio_r2t_cache; 56 57 extern struct idr sess_idr; 58 extern struct mutex auth_id_lock; 59 extern spinlock_t sess_idr_lock; 60 61 62 #endif /*** ISCSI_TARGET_H ***/ 63