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