Path: blob/master/include/target/target_core_fabric_ops.h
10814 views
/* Defined in target_core_configfs.h */1struct target_fabric_configfs;23struct target_core_fabric_ops {4struct configfs_subsystem *tf_subsys;5/*6* Optional to signal struct se_task->task_sg[] padding entries7* for scatterlist chaining using transport_do_task_sg_link(),8* disabled by default9*/10bool task_sg_chaining;11char *(*get_fabric_name)(void);12u8 (*get_fabric_proto_ident)(struct se_portal_group *);13char *(*tpg_get_wwn)(struct se_portal_group *);14u16 (*tpg_get_tag)(struct se_portal_group *);15u32 (*tpg_get_default_depth)(struct se_portal_group *);16u32 (*tpg_get_pr_transport_id)(struct se_portal_group *,17struct se_node_acl *,18struct t10_pr_registration *, int *,19unsigned char *);20u32 (*tpg_get_pr_transport_id_len)(struct se_portal_group *,21struct se_node_acl *,22struct t10_pr_registration *, int *);23char *(*tpg_parse_pr_out_transport_id)(struct se_portal_group *,24const char *, u32 *, char **);25int (*tpg_check_demo_mode)(struct se_portal_group *);26int (*tpg_check_demo_mode_cache)(struct se_portal_group *);27int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *);28int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);29struct se_node_acl *(*tpg_alloc_fabric_acl)(30struct se_portal_group *);31void (*tpg_release_fabric_acl)(struct se_portal_group *,32struct se_node_acl *);33u32 (*tpg_get_inst_index)(struct se_portal_group *);34/*35* Optional function pointer for TCM to perform command map36* from TCM processing thread context, for those struct se_cmd37* initially allocated in interrupt context.38*/39int (*new_cmd_map)(struct se_cmd *);40/*41* Optional function pointer for TCM fabric modules that use42* Linux/NET sockets to allocate struct iovec array to struct se_cmd43*/44int (*alloc_cmd_iovecs)(struct se_cmd *);45/*46* Optional to release struct se_cmd and fabric dependent allocated47* I/O descriptor in transport_cmd_check_stop()48*/49void (*check_stop_free)(struct se_cmd *);50void (*release_cmd_to_pool)(struct se_cmd *);51void (*release_cmd_direct)(struct se_cmd *);52/*53* Called with spin_lock_bh(struct se_portal_group->session_lock held.54*/55int (*shutdown_session)(struct se_session *);56void (*close_session)(struct se_session *);57void (*stop_session)(struct se_session *, int, int);58void (*fall_back_to_erl0)(struct se_session *);59int (*sess_logged_in)(struct se_session *);60u32 (*sess_get_index)(struct se_session *);61/*62* Used only for SCSI fabrics that contain multi-value TransportIDs63* (like iSCSI). All other SCSI fabrics should set this to NULL.64*/65u32 (*sess_get_initiator_sid)(struct se_session *,66unsigned char *, u32);67int (*write_pending)(struct se_cmd *);68int (*write_pending_status)(struct se_cmd *);69void (*set_default_node_attributes)(struct se_node_acl *);70u32 (*get_task_tag)(struct se_cmd *);71int (*get_cmd_state)(struct se_cmd *);72void (*new_cmd_failure)(struct se_cmd *);73int (*queue_data_in)(struct se_cmd *);74int (*queue_status)(struct se_cmd *);75int (*queue_tm_rsp)(struct se_cmd *);76u16 (*set_fabric_sense_len)(struct se_cmd *, u32);77u16 (*get_fabric_sense_len)(void);78int (*is_state_remove)(struct se_cmd *);79/*80* fabric module calls for target_core_fabric_configfs.c81*/82struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *,83struct config_group *, const char *);84void (*fabric_drop_wwn)(struct se_wwn *);85struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *,86struct config_group *, const char *);87void (*fabric_drop_tpg)(struct se_portal_group *);88int (*fabric_post_link)(struct se_portal_group *,89struct se_lun *);90void (*fabric_pre_unlink)(struct se_portal_group *,91struct se_lun *);92struct se_tpg_np *(*fabric_make_np)(struct se_portal_group *,93struct config_group *, const char *);94void (*fabric_drop_np)(struct se_tpg_np *);95struct se_node_acl *(*fabric_make_nodeacl)(struct se_portal_group *,96struct config_group *, const char *);97void (*fabric_drop_nodeacl)(struct se_node_acl *);98};99100101