1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef ISCSI_TARGET_H 3 #define ISCSI_TARGET_H 4 5 #include <linux/types.h> 6 #include <linux/spinlock.h> 7 8 struct iscsit_cmd; 9 struct iscsit_conn; 10 struct iscsi_np; 11 struct iscsi_portal_group; 12 struct iscsit_session; 13 struct iscsi_tpg_np; 14 struct kref; 15 struct sockaddr_storage; 16 17 extern struct iscsi_tiqn *iscsit_get_tiqn_for_login(unsigned char *); 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 iscsit_cmd *cmd, u8, unsigned char *); 33 extern void iscsit_set_unsolicited_dataout(struct iscsit_cmd *); 34 extern int iscsit_logout_closesession(struct iscsit_cmd *, struct iscsit_conn *); 35 extern int iscsit_logout_closeconnection(struct iscsit_cmd *, struct iscsit_conn *); 36 extern int iscsit_logout_removeconnforrecovery(struct iscsit_cmd *, struct iscsit_conn *); 37 extern int iscsit_build_r2ts_for_cmd(struct iscsit_conn *, struct iscsit_cmd *, bool recovery); 38 extern void iscsit_thread_get_cpumask(struct iscsit_conn *); 39 extern int iscsi_target_tx_thread(void *); 40 extern int iscsi_target_rx_thread(void *); 41 extern int iscsit_close_connection(struct iscsit_conn *); 42 extern int iscsit_close_session(struct iscsit_session *, bool can_sleep); 43 extern void iscsit_fail_session(struct iscsit_session *); 44 extern void iscsit_stop_session(struct iscsit_session *, int, int); 45 extern int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *, int); 46 47 extern struct iscsit_global *iscsit_global; 48 extern const struct target_core_fabric_ops iscsi_ops; 49 50 extern struct kmem_cache *lio_dr_cache; 51 extern struct kmem_cache *lio_ooo_cache; 52 extern struct kmem_cache *lio_qr_cache; 53 extern struct kmem_cache *lio_r2t_cache; 54 55 extern struct ida sess_ida; 56 extern struct mutex auth_id_lock; 57 58 #endif /*** ISCSI_TARGET_H ***/ 59