Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 2 | #ifndef ISCSI_TARGET_H |
| 3 | #define ISCSI_TARGET_H |
| 4 | |
Bart Van Assche | 8dcf07b | 2016-11-14 15:47:14 -0800 | [diff] [blame] | 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 | |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 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 *); |
Nicholas Bellinger | a91eb7d | 2013-08-15 12:49:02 -0700 | [diff] [blame] | 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 *); |
Andy Grover | 13a3cf0 | 2015-08-24 10:26:06 -0700 | [diff] [blame] | 26 | extern bool iscsit_check_np_match(struct sockaddr_storage *, |
Nicholas Bellinger | 05b9689 | 2013-02-18 20:59:27 -0800 | [diff] [blame] | 27 | struct iscsi_np *, int); |
Andy Grover | 13a3cf0 | 2015-08-24 10:26:06 -0700 | [diff] [blame] | 28 | extern struct iscsi_np *iscsit_add_np(struct sockaddr_storage *, |
Andy Grover | 76c28f1 | 2015-08-24 10:26:03 -0700 | [diff] [blame] | 29 | int); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 30 | extern int iscsit_reset_np_thread(struct iscsi_np *, struct iscsi_tpg_np *, |
Nicholas Bellinger | a91eb7d | 2013-08-15 12:49:02 -0700 | [diff] [blame] | 31 | struct iscsi_portal_group *, bool); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 32 | extern int iscsit_del_np(struct iscsi_np *); |
Nicholas Bellinger | ba15991 | 2013-07-03 03:48:24 -0700 | [diff] [blame] | 33 | extern int iscsit_reject_cmd(struct iscsi_cmd *cmd, u8, unsigned char *); |
Nicholas Bellinger | 3e1c81a | 2013-03-06 22:18:24 -0800 | [diff] [blame] | 34 | extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 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); |
Nicholas Bellinger | 3e1c81a | 2013-03-06 22:18:24 -0800 | [diff] [blame] | 39 | extern int iscsit_build_r2ts_for_cmd(struct iscsi_conn *, struct iscsi_cmd *, bool recovery); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 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; |
Christoph Hellwig | 9ac8928 | 2015-04-08 20:01:35 +0200 | [diff] [blame] | 51 | extern const struct target_core_fabric_ops iscsi_ops; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 52 | |
| 53 | extern struct kmem_cache *lio_dr_cache; |
| 54 | extern struct kmem_cache *lio_ooo_cache; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 55 | extern struct kmem_cache *lio_qr_cache; |
| 56 | extern struct kmem_cache *lio_r2t_cache; |
| 57 | |
Christoph Hellwig | fceb5bc | 2012-09-26 08:00:36 -0400 | [diff] [blame] | 58 | extern struct idr sess_idr; |
| 59 | extern struct mutex auth_id_lock; |
| 60 | extern spinlock_t sess_idr_lock; |
| 61 | |
| 62 | |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 63 | #endif /*** ISCSI_TARGET_H ***/ |