blob: 42de1843aa40d06f9967693ab5dbf20852e84629 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Nicholas Bellingere48354c2011-07-23 06:43:04 +00002#ifndef ISCSI_TARGET_H
3#define ISCSI_TARGET_H
4
Bart Van Assche8dcf07b2016-11-14 15:47:14 -08005#include <linux/types.h>
6#include <linux/spinlock.h>
7
8struct iscsi_cmd;
9struct iscsi_conn;
10struct iscsi_np;
11struct iscsi_portal_group;
12struct iscsi_session;
13struct iscsi_tpg_np;
14struct kref;
15struct sockaddr_storage;
16
Nicholas Bellingere48354c2011-07-23 06:43:04 +000017extern struct iscsi_tiqn *iscsit_get_tiqn_for_login(unsigned char *);
18extern struct iscsi_tiqn *iscsit_get_tiqn(unsigned char *, int);
19extern void iscsit_put_tiqn_for_login(struct iscsi_tiqn *);
20extern struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *);
21extern void iscsit_del_tiqn(struct iscsi_tiqn *);
22extern int iscsit_access_np(struct iscsi_np *, struct iscsi_portal_group *);
Nicholas Bellingera91eb7d2013-08-15 12:49:02 -070023extern void iscsit_login_kref_put(struct kref *);
24extern int iscsit_deaccess_np(struct iscsi_np *, struct iscsi_portal_group *,
25 struct iscsi_tpg_np *);
Andy Grover13a3cf02015-08-24 10:26:06 -070026extern bool iscsit_check_np_match(struct sockaddr_storage *,
Nicholas Bellinger05b96892013-02-18 20:59:27 -080027 struct iscsi_np *, int);
Andy Grover13a3cf02015-08-24 10:26:06 -070028extern struct iscsi_np *iscsit_add_np(struct sockaddr_storage *,
Andy Grover76c28f12015-08-24 10:26:03 -070029 int);
Nicholas Bellingere48354c2011-07-23 06:43:04 +000030extern int iscsit_reset_np_thread(struct iscsi_np *, struct iscsi_tpg_np *,
Nicholas Bellingera91eb7d2013-08-15 12:49:02 -070031 struct iscsi_portal_group *, bool);
Nicholas Bellingere48354c2011-07-23 06:43:04 +000032extern int iscsit_del_np(struct iscsi_np *);
Nicholas Bellingerba159912013-07-03 03:48:24 -070033extern int iscsit_reject_cmd(struct iscsi_cmd *cmd, u8, unsigned char *);
Nicholas Bellinger3e1c81a2013-03-06 22:18:24 -080034extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *);
Nicholas Bellingere48354c2011-07-23 06:43:04 +000035extern int iscsit_logout_closesession(struct iscsi_cmd *, struct iscsi_conn *);
36extern int iscsit_logout_closeconnection(struct iscsi_cmd *, struct iscsi_conn *);
37extern int iscsit_logout_removeconnforrecovery(struct iscsi_cmd *, struct iscsi_conn *);
38extern int iscsit_send_async_msg(struct iscsi_conn *, u16, u8, u8);
Nicholas Bellinger3e1c81a2013-03-06 22:18:24 -080039extern int iscsit_build_r2ts_for_cmd(struct iscsi_conn *, struct iscsi_cmd *, bool recovery);
Nicholas Bellingere48354c2011-07-23 06:43:04 +000040extern void iscsit_thread_get_cpumask(struct iscsi_conn *);
41extern int iscsi_target_tx_thread(void *);
42extern int iscsi_target_rx_thread(void *);
43extern int iscsit_close_connection(struct iscsi_conn *);
44extern int iscsit_close_session(struct iscsi_session *);
45extern void iscsit_fail_session(struct iscsi_session *);
46extern int iscsit_free_session(struct iscsi_session *);
47extern void iscsit_stop_session(struct iscsi_session *, int, int);
48extern int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *, int);
49
50extern struct iscsit_global *iscsit_global;
Christoph Hellwig9ac89282015-04-08 20:01:35 +020051extern const struct target_core_fabric_ops iscsi_ops;
Nicholas Bellingere48354c2011-07-23 06:43:04 +000052
53extern struct kmem_cache *lio_dr_cache;
54extern struct kmem_cache *lio_ooo_cache;
Nicholas Bellingere48354c2011-07-23 06:43:04 +000055extern struct kmem_cache *lio_qr_cache;
56extern struct kmem_cache *lio_r2t_cache;
57
Christoph Hellwigfceb5bc2012-09-26 08:00:36 -040058extern struct idr sess_idr;
59extern struct mutex auth_id_lock;
60extern spinlock_t sess_idr_lock;
61
62
Nicholas Bellingere48354c2011-07-23 06:43:04 +000063#endif /*** ISCSI_TARGET_H ***/