FreeBSD kernel CAM code
ctl_tpc.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/types.h>
#include <sys/lock.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <sys/nv.h>
#include <sys/dnv.h>
#include <machine/atomic.h>
#include <cam/cam.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_da.h>
#include <cam/ctl/ctl_io.h>
#include <cam/ctl/ctl.h>
#include <cam/ctl/ctl_frontend.h>
#include <cam/ctl/ctl_util.h>
#include <cam/ctl/ctl_backend.h>
#include <cam/ctl/ctl_ioctl.h>
#include <cam/ctl/ctl_ha.h>
#include <cam/ctl/ctl_private.h>
#include <cam/ctl/ctl_debug.h>
#include <cam/ctl/ctl_scsi_all.h>
#include <cam/ctl/ctl_tpc.h>
#include <cam/ctl/ctl_error.h>
Include dependency graph for ctl_tpc.c:

Go to the source code of this file.

Data Structures

struct  tpc_io
 
struct  tpc_token
 
struct  tpc_list
 

Macros

#define TPC_MAX_CSCDS   64
 
#define TPC_MAX_SEGS   64
 
#define TPC_MAX_SEG   0
 
#define TPC_MAX_LIST   8192
 
#define TPC_MAX_INLINE   0
 
#define TPC_MAX_LISTS   255
 
#define TPC_MAX_IO_SIZE   (8 * MIN(1024 * 1024, MAX(128 * 1024, maxphys)))
 
#define TPC_MAX_IOCHUNK_SIZE   (TPC_MAX_IO_SIZE * 4)
 
#define TPC_MIN_TOKEN_TIMEOUT   1
 
#define TPC_DFL_TOKEN_TIMEOUT   60
 
#define TPC_MAX_TOKEN_TIMEOUT   600
 

Enumerations

enum  tpc_error_action { TPC_ERR_RETRY = 0x000 , TPC_ERR_FAIL = 0x001 , TPC_ERR_MASK = 0x0ff , TPC_ERR_NO_DECREMENT = 0x100 }
 

Functions

 __FBSDID ("$FreeBSD$")
 
 MALLOC_DEFINE (M_CTL_TPC, "ctltpc", "CTL TPC")
 
 TAILQ_HEAD (runl, tpc_io)
 
static void tpc_timeout (void *arg)
 
void ctl_tpc_init (struct ctl_softc *softc)
 
void ctl_tpc_shutdown (struct ctl_softc *softc)
 
void ctl_tpc_lun_init (struct ctl_lun *lun)
 
void ctl_tpc_lun_clear (struct ctl_lun *lun, uint32_t initidx)
 
void ctl_tpc_lun_shutdown (struct ctl_lun *lun)
 
int ctl_inquiry_evpd_tpc (struct ctl_scsiio *ctsio, int alloc_len)
 
int ctl_receive_copy_operating_parameters (struct ctl_scsiio *ctsio)
 
static struct tpc_listtpc_find_list (struct ctl_lun *lun, uint32_t list_id, uint32_t init_idx)
 
int ctl_receive_copy_status_lid1 (struct ctl_scsiio *ctsio)
 
int ctl_receive_copy_failure_details (struct ctl_scsiio *ctsio)
 
int ctl_receive_copy_status_lid4 (struct ctl_scsiio *ctsio)
 
int ctl_copy_operation_abort (struct ctl_scsiio *ctsio)
 
static uint64_t tpc_resolve (struct tpc_list *list, uint16_t idx, uint32_t *ss, uint32_t *pb, uint32_t *pbo)
 
static void tpc_set_io_error_sense (struct tpc_list *list)
 
static int tpc_process_b2b (struct tpc_list *list)
 
static int tpc_process_verify (struct tpc_list *list)
 
static int tpc_process_register_key (struct tpc_list *list)
 
static off_t tpc_ranges_length (struct scsi_range_desc *range, int nrange)
 
static int tpc_check_ranges_l (struct scsi_range_desc *range, int nrange, uint64_t maxlba, uint64_t *lba)
 
static int tpc_check_ranges_x (struct scsi_range_desc *range, int nrange)
 
static int tpc_skip_ranges (struct scsi_range_desc *range, int nrange, off_t skip, int *srange, off_t *soffset)
 
static int tpc_process_wut (struct tpc_list *list)
 
static int tpc_process_zero_wut (struct tpc_list *list)
 
static void tpc_process (struct tpc_list *list)
 
static tpc_error_action tpc_checkcond_parse (union ctl_io *io)
 
static tpc_error_action tpc_error_parse (union ctl_io *io)
 
void tpc_done (union ctl_io *io)
 
int ctl_extended_copy_lid1 (struct ctl_scsiio *ctsio)
 
int ctl_extended_copy_lid4 (struct ctl_scsiio *ctsio)
 
static void tpc_create_token (struct ctl_lun *lun, struct ctl_port *port, off_t len, struct scsi_token *token)
 
int ctl_populate_token (struct ctl_scsiio *ctsio)
 
int ctl_write_using_token (struct ctl_scsiio *ctsio)
 
int ctl_receive_rod_token_information (struct ctl_scsiio *ctsio)
 
int ctl_report_all_rod_tokens (struct ctl_scsiio *ctsio)
 

Macro Definition Documentation

◆ TPC_DFL_TOKEN_TIMEOUT

#define TPC_DFL_TOKEN_TIMEOUT   60

Definition at line 73 of file ctl_tpc.c.

◆ TPC_MAX_CSCDS

#define TPC_MAX_CSCDS   64

Definition at line 64 of file ctl_tpc.c.

◆ TPC_MAX_INLINE

#define TPC_MAX_INLINE   0

Definition at line 68 of file ctl_tpc.c.

◆ TPC_MAX_IO_SIZE

#define TPC_MAX_IO_SIZE   (8 * MIN(1024 * 1024, MAX(128 * 1024, maxphys)))

Definition at line 70 of file ctl_tpc.c.

◆ TPC_MAX_IOCHUNK_SIZE

#define TPC_MAX_IOCHUNK_SIZE   (TPC_MAX_IO_SIZE * 4)

Definition at line 71 of file ctl_tpc.c.

◆ TPC_MAX_LIST

#define TPC_MAX_LIST   8192

Definition at line 67 of file ctl_tpc.c.

◆ TPC_MAX_LISTS

#define TPC_MAX_LISTS   255

Definition at line 69 of file ctl_tpc.c.

◆ TPC_MAX_SEG

#define TPC_MAX_SEG   0

Definition at line 66 of file ctl_tpc.c.

◆ TPC_MAX_SEGS

#define TPC_MAX_SEGS   64

Definition at line 65 of file ctl_tpc.c.

◆ TPC_MAX_TOKEN_TIMEOUT

#define TPC_MAX_TOKEN_TIMEOUT   600

Definition at line 74 of file ctl_tpc.c.

◆ TPC_MIN_TOKEN_TIMEOUT

#define TPC_MIN_TOKEN_TIMEOUT   1

Definition at line 72 of file ctl_tpc.c.

Enumeration Type Documentation

◆ tpc_error_action

Enumerator
TPC_ERR_RETRY 
TPC_ERR_FAIL 
TPC_ERR_MASK 
TPC_ERR_NO_DECREMENT 

Definition at line 78 of file ctl_tpc.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ ctl_copy_operation_abort()

◆ ctl_extended_copy_lid1()

◆ ctl_extended_copy_lid4()

◆ ctl_inquiry_evpd_tpc()

int ctl_inquiry_evpd_tpc ( struct ctl_scsiio ctsio,
int  alloc_len 
)

Definition at line 272 of file ctl_tpc.c.

References ctl_lun::be_lun, ctl_scsiio::be_move_done, ctl_config_move_done(), ctl_datamove(), CTL_FLAG_ALLOCATED, CTL_LUN, CTL_RETVAL_COMPLETE, ctl_set_success(), scsi_vpd_tpc_descriptor_gco::data_segment_granularity, scsi_vpd_tpc_descriptor_bdrl::default_inactivity_timeout, scsi_vpd_tpc_descriptor::desc_length, scsi_vpd_tpc_descriptor_bdrl::desc_length, scsi_vpd_tpc_descriptor_sc::desc_length, scsi_vpd_tpc_descriptor_pd::desc_length, scsi_vpd_tpc_descriptor_sd::desc_length, scsi_vpd_tpc_descriptor_sdid::desc_length, scsi_vpd_tpc_descriptor_rtf_block::desc_length, scsi_vpd_tpc_descriptor_rtf::desc_length, scsi_vpd_tpc_descriptor_srt::desc_length, scsi_vpd_tpc_descriptor_gco::desc_length, scsi_vpd_tpc_descriptor_bdrl::desc_type, scsi_vpd_tpc_descriptor_sc::desc_type, scsi_vpd_tpc_descriptor_pd::desc_type, scsi_vpd_tpc_descriptor_sd::desc_type, scsi_vpd_tpc_descriptor_sdid::desc_type, scsi_vpd_tpc_descriptor_rtf::desc_type, scsi_vpd_tpc_descriptor_srt::desc_type, scsi_vpd_tpc_descriptor_gco::desc_type, scsi_vpd_tpc_descriptor_sc::descr, scsi_vpd_tpc::descr, scsi_vpd_tpc::device, EC_COA, EC_CSCD_ID, EC_EC_LID1, EC_EC_LID4, EC_PT, EC_SEG_B2B, EC_SEG_REGISTER_KEY, EC_SEG_VERIFY, EC_WUT, EXTENDED_COPY, ctl_io_hdr::flags, scsi_vpd_tpc_descriptor_srtd::flags, scsi_vpd_tpc_descriptor_gco::inline_data_granularity, ctl_scsiio::io_hdr, ctl_scsiio::kern_data_len, ctl_scsiio::kern_data_ptr, ctl_scsiio::kern_rel_offset, ctl_scsiio::kern_sg_entries, ctl_scsiio::kern_total_len, scsi_vpd_tpc_descriptor_sc::list_length, scsi_vpd_tpc_descriptor_sd::list_length, scsi_vpd_tpc_descriptor_sdid::list_length, ctl_lun::lun, ctl_be_lun::lun_type, scsi_vpd_tpc_descriptor_rtf_block::maximum_bytes, scsi_vpd_tpc_descriptor_pd::maximum_cscd_descriptor_count, scsi_vpd_tpc_descriptor_pd::maximum_descriptor_list_length, scsi_vpd_tpc_descriptor_gco::maximum_identified_concurrent_copies, scsi_vpd_tpc_descriptor_bdrl::maximum_inactivity_timeout, scsi_vpd_tpc_descriptor_pd::maximum_inline_data_length, scsi_vpd_tpc_descriptor_bdrl::maximum_ranges, scsi_vpd_tpc_descriptor_pd::maximum_segment_descriptor_count, scsi_vpd_tpc_descriptor_gco::maximum_segment_length, scsi_vpd_tpc_descriptor_rtf::maximum_token_inactivity_timeout, scsi_vpd_tpc_descriptor_rtf::maximum_token_lifetime, scsi_vpd_tpc_descriptor_bdrl::maximum_token_transfer_size, scsi_vpd_tpc_descriptor_rtf::minimum_token_lifetime, scsi_vpd_tpc_descriptor_sc_descr::opcode, scsi_vpd_tpc_descriptor_rtf_block::optimal_bytes, scsi_vpd_tpc_descriptor_rtf_block::optimal_bytes_from_token_per_segment, scsi_vpd_tpc_descriptor_rtf_block::optimal_bytes_to_token_per_segment, scsi_vpd_tpc_descriptor_rtf_block::optimal_length_granularity, scsi_vpd_tpc_descriptor_bdrl::optimal_transfer_count, scsi_vpd_tpc::page_code, scsi_vpd_tpc::page_length, scsi_vpd_tpc_descriptor::parameters, scsi_vpd_tpc_descriptor_srtd::preference_indicator, RCS_RART, RCS_RCFD, RCS_RCOP, RCS_RCS_LID1, RCS_RCS_LID4, RCS_RRTI, RECEIVE_COPY_STATUS, scsi_vpd_tpc_descriptor_rtf::remote_tokens, scsi_vpd_tpc_descriptor_srtd::rod_type, ROD_TYPE_AUR, ROD_TYPE_BLOCK_ZERO, scsi_vpd_tpc_descriptor_srt::rod_type_descriptors, scsi_vpd_tpc_descriptor_srt::rod_type_descriptors_length, scsi_vpd_tpc_descriptor_sc_descr::sa_length, scsi_2btoul(), scsi_u64to8b(), scsi_ulto2b(), scsi_ulto4b(), SID_QUAL_LU_CONNECTED, SID_QUAL_LU_OFFLINE, scsi_vpd_tpc_descriptor_sd::supported_descriptor_codes, scsi_vpd_tpc_descriptor_sdid::supported_descriptor_ids, scsi_vpd_tpc_descriptor_sc_descr::supported_service_actions, SVPD_SCSI_TPC, SVPD_TPC_BDRL, SVPD_TPC_GCO, SVPD_TPC_PD, SVPD_TPC_RTF, SVPD_TPC_RTF_BLOCK, SVPD_TPC_SC, SVPD_TPC_SD, SVPD_TPC_SDID, SVPD_TPC_SRT, SVPD_TPC_SRTD_TIN, SVPD_TPC_SRTD_TOUT, T_DIRECT, scsi_vpd_tpc_descriptor_gco::total_concurrent_copies, TPC_DFL_TOKEN_TIMEOUT, TPC_MAX_CSCDS, TPC_MAX_INLINE, TPC_MAX_IOCHUNK_SIZE, TPC_MAX_LIST, TPC_MAX_LISTS, TPC_MAX_SEG, TPC_MAX_SEGS, TPC_MAX_TOKEN_TIMEOUT, TPC_MIN_TOKEN_TIMEOUT, scsi_vpd_tpc_descriptor_rtf_block::type_format, scsi_vpd_tpc_descriptor_rtf::type_specific_features, and scsi_vpd_tpc_descriptor_rtf::type_specific_features_length.

Referenced by ctl_inquiry_evpd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctl_populate_token()

int ctl_populate_token ( struct ctl_scsiio ctsio)

Definition at line 2020 of file ctl_tpc.c.

References tpc_token::active, ctl_lun::be_lun, ctl_scsiio::be_move_done, ctl_be_lun::blocksize, tpc_token::blocksize, ctl_scsiio::cdb, tpc_list::completed, ctl_config_move_done(), ctl_datamove(), CTL_DEBUG_PRINT, ctl_done(), CTL_FLAG_ALLOCATED, ctl_get_initindex(), CTL_LUN, CTL_PORT, CTL_RETVAL_COMPLETE, ctl_set_invalid_field(), ctl_set_lba_out_of_range(), ctl_set_success(), CTL_SOFTC, tpc_list::curbytes, tpc_list::cursectors, tpc_list::curseg, scsi_populate_token_data::desc, EC_PT_RTV, ctl_io_hdr::flags, tpc_list::flags, scsi_populate_token_data::flags, scsi_populate_token_data::inactivity_timeout, tpc_list::init_idx, tpc_list::init_port, ctl_scsiio::io_hdr, ctl_scsiio::kern_data_len, ctl_scsiio::kern_data_ptr, ctl_scsiio::kern_rel_offset, ctl_scsiio::kern_sg_entries, ctl_scsiio::kern_total_len, tpc_token::last_active, tpc_list::last_active, scsi_populate_token_data::length, scsi_populate_token::length, tpc_list::list_id, scsi_populate_token::list_identifier, ctl_lun::lun, tpc_token::lun, ctl_lun::lun_lock, ctl_be_lun::maxlba, ctl_io_hdr::nexus, tpc_token::nrange, tpc_token::params, tpc_token::range, scsi_populate_token_data::range_descriptor_length, scsi_populate_token_data::rod_type, ROD_TYPE_AUR, scsi_2btoul(), scsi_4btoul(), tpc_list::service_action, scsi_populate_token::service_action, ctl_nexus::targ_port, tpc_token::timeout, tpc_token::token, tpc_check_ranges_l(), tpc_check_ranges_x(), tpc_create_token(), TPC_DFL_TOKEN_TIMEOUT, tpc_find_list(), ctl_softc::tpc_lock, TPC_MAX_SEGS, TPC_MAX_TOKEN_TIMEOUT, TPC_MIN_TOKEN_TIMEOUT, and tpc_ranges_length().

Here is the call graph for this function:

◆ ctl_receive_copy_failure_details()

◆ ctl_receive_copy_operating_parameters()

int ctl_receive_copy_operating_parameters ( struct ctl_scsiio ctsio)

Definition at line 454 of file ctl_tpc.c.

References ctl_scsiio::be_move_done, ctl_scsiio::cdb, ctl_config_move_done(), ctl_datamove(), CTL_DEBUG_PRINT, CTL_FLAG_ALLOCATED, CTL_RETVAL_COMPLETE, ctl_set_success(), scsi_receive_copy_operating_parameters_data::data_segment_granularity, EC_CSCD_ID, EC_SEG_B2B, EC_SEG_REGISTER_KEY, EC_SEG_VERIFY, ctl_io_hdr::flags, scsi_receive_copy_operating_parameters_data::held_data_granularity, scsi_receive_copy_operating_parameters_data::held_data_limit, scsi_receive_copy_operating_parameters_data::implemented_descriptor_list_length, scsi_receive_copy_operating_parameters_data::inline_data_granularity, ctl_scsiio::io_hdr, ctl_scsiio::kern_data_len, ctl_scsiio::kern_data_ptr, ctl_scsiio::kern_rel_offset, ctl_scsiio::kern_sg_entries, ctl_scsiio::kern_total_len, scsi_receive_copy_operating_parameters::length, scsi_receive_copy_operating_parameters_data::length, scsi_receive_copy_operating_parameters_data::list_of_implemented_descriptor_type_codes, scsi_receive_copy_operating_parameters_data::maximum_concurrent_copies, scsi_receive_copy_operating_parameters_data::maximum_cscd_descriptor_count, scsi_receive_copy_operating_parameters_data::maximum_descriptor_list_length, scsi_receive_copy_operating_parameters_data::maximum_inline_data_length, scsi_receive_copy_operating_parameters_data::maximum_segment_descriptor_count, scsi_receive_copy_operating_parameters_data::maximum_segment_length, scsi_receive_copy_operating_parameters_data::maximum_stream_device_transfer_size, RCOP_SNLID, scsi_4btoul(), scsi_ulto2b(), scsi_ulto4b(), scsi_receive_copy_operating_parameters_data::snlid, scsi_receive_copy_operating_parameters_data::total_concurrent_copies, TPC_MAX_CSCDS, TPC_MAX_INLINE, TPC_MAX_LIST, TPC_MAX_LISTS, TPC_MAX_SEG, and TPC_MAX_SEGS.

Here is the call graph for this function:

◆ ctl_receive_copy_status_lid1()

◆ ctl_receive_copy_status_lid4()

int ctl_receive_copy_status_lid4 ( struct ctl_scsiio ctsio)

Definition at line 650 of file ctl_tpc.c.

References tpc_list::abort, scsi_receive_copy_status_lid4_data::available_data, ctl_scsiio::be_move_done, ctl_scsiio::cdb, tpc_list::completed, scsi_receive_copy_status_lid4_data::copy_command_status, ctl_config_move_done(), ctl_datamove(), CTL_DEBUG_PRINT, ctl_done(), CTL_FLAG_ALLOCATED, ctl_get_initindex(), CTL_LUN, CTL_RETVAL_COMPLETE, ctl_set_invalid_field(), ctl_set_success(), tpc_list::curbytes, tpc_list::curops, tpc_list::curseg, tpc_list::error, scsi_receive_copy_status_lid4_data::estimated_status_update_delay, ctl_io_hdr::flags, ctl_scsiio::io_hdr, ctl_scsiio::kern_data_len, ctl_scsiio::kern_data_ptr, ctl_scsiio::kern_rel_offset, ctl_scsiio::kern_sg_entries, ctl_scsiio::kern_total_len, scsi_receive_copy_status_lid4::length, scsi_receive_copy_status_lid4_data::length_of_the_sense_data_field, tpc_list::list_id, scsi_receive_copy_status_lid4::list_identifier, ctl_lun::lun, ctl_lun::lun_lock, ctl_io_hdr::nexus, scsi_receive_copy_status_lid4_data::operation_counter, RCS_CCS_ABORTED, RCS_CCS_COMPLETED, RCS_CCS_ERROR, RCS_CCS_INPROG_FG, RCS_TC_BYTES, scsi_receive_copy_status_lid4_data::response_to_service_action, scsi_4btoul(), scsi_u64to8b(), scsi_ulto2b(), scsi_ulto4b(), scsi_receive_copy_status_lid4_data::segments_processed, scsi_receive_copy_status_lid4_data::sense_data, scsi_receive_copy_status_lid4_data::sense_data_length, tpc_list::service_action, tpc_find_list(), scsi_receive_copy_status_lid4_data::transfer_count, and scsi_receive_copy_status_lid4_data::transfer_count_units.

Here is the call graph for this function:

◆ ctl_receive_rod_token_information()

int ctl_receive_rod_token_information ( struct ctl_scsiio ctsio)

Definition at line 2338 of file ctl_tpc.c.

References tpc_list::abort, scsi_receive_copy_status_lid4_data::available_data, ctl_scsiio::be_move_done, ctl_scsiio::cdb, tpc_list::completed, scsi_receive_copy_status_lid4_data::copy_command_status, ctl_config_move_done(), ctl_datamove(), CTL_DEBUG_PRINT, ctl_done(), CTL_FLAG_ALLOCATED, ctl_get_initindex(), CTL_LUN, CTL_RETVAL_COMPLETE, ctl_set_invalid_field(), ctl_set_success(), tpc_list::curops, tpc_list::cursectors, tpc_list::curseg, tpc_list::error, scsi_receive_copy_status_lid4_data::estimated_status_update_delay, ctl_io_hdr::flags, ctl_scsiio::io_hdr, ctl_scsiio::kern_data_len, ctl_scsiio::kern_data_ptr, ctl_scsiio::kern_rel_offset, ctl_scsiio::kern_sg_entries, ctl_scsiio::kern_total_len, scsi_receive_rod_token_information::length, scsi_receive_copy_status_lid4_data::length_of_the_sense_data_field, tpc_list::list_id, scsi_receive_rod_token_information::list_identifier, ctl_lun::lun, ctl_lun::lun_lock, ctl_io_hdr::nexus, scsi_receive_copy_status_lid4_data::operation_counter, RCS_CCS_ABORTED, RCS_CCS_COMPLETED, RCS_CCS_ERROR, RCS_CCS_INPROG_FG, RCS_TC_LBAS, scsi_receive_copy_status_lid4_data::response_to_service_action, scsi_4btoul(), scsi_u64to8b(), scsi_ulto2b(), scsi_ulto4b(), scsi_receive_copy_status_lid4_data::segments_processed, scsi_receive_copy_status_lid4_data::sense_data, scsi_receive_copy_status_lid4_data::sense_data_length, tpc_list::service_action, tpc_find_list(), scsi_receive_copy_status_lid4_data::transfer_count, and scsi_receive_copy_status_lid4_data::transfer_count_units.

Here is the call graph for this function:

◆ ctl_report_all_rod_tokens()

◆ ctl_tpc_init()

void ctl_tpc_init ( struct ctl_softc softc)

Definition at line 194 of file ctl_tpc.c.

References ctl_softc::ctl_lock, ctl_softc::tpc_lock, ctl_softc::tpc_timeout, and tpc_timeout().

Referenced by ctl_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctl_tpc_lun_clear()

void ctl_tpc_lun_clear ( struct ctl_lun lun,
uint32_t  initidx 
)

Definition at line 230 of file ctl_tpc.c.

References tpc_list::completed, and tpc_list::init_idx.

Referenced by ctl_do_lun_reset(), and ctl_i_t_nexus_loss().

Here is the caller graph for this function:

◆ ctl_tpc_lun_init()

void ctl_tpc_lun_init ( struct ctl_lun lun)

Definition at line 223 of file ctl_tpc.c.

References tpc_token::lun.

Referenced by ctl_add_lun().

Here is the caller graph for this function:

◆ ctl_tpc_lun_shutdown()

void ctl_tpc_lun_shutdown ( struct ctl_lun lun)

Definition at line 245 of file ctl_tpc.c.

References tpc_list::completed, ctl_lun::ctl_softc, tpc_token::lun, tpc_token::token, and ctl_softc::tpc_lock.

Referenced by ctl_free_lun().

Here is the caller graph for this function:

◆ ctl_tpc_shutdown()

void ctl_tpc_shutdown ( struct ctl_softc softc)

Definition at line 205 of file ctl_tpc.c.

References tpc_token::token, ctl_softc::tpc_lock, and ctl_softc::tpc_timeout.

Referenced by ctl_shutdown().

Here is the caller graph for this function:

◆ ctl_write_using_token()

int ctl_write_using_token ( struct ctl_scsiio ctsio)

Definition at line 2184 of file ctl_tpc.c.

References tpc_token::active, ctl_lun::be_lun, ctl_scsiio::be_move_done, ctl_scsiio::cdb, tpc_list::completed, ctl_config_move_done(), ctl_datamove(), CTL_DEBUG_PRINT, ctl_done(), CTL_FLAG_ALLOCATED, ctl_get_initindex(), CTL_LUN, CTL_RETVAL_COMPLETE, ctl_set_invalid_field(), ctl_set_lba_out_of_range(), ctl_set_sense(), CTL_SOFTC, scsi_write_using_token_data::desc, EC_WUT_DEL_TKN, ctl_io_hdr::flags, tpc_list::flags, scsi_write_using_token_data::flags, tpc_list::init_idx, tpc_list::init_port, ctl_scsiio::io_hdr, ctl_scsiio::kern_data_len, ctl_scsiio::kern_data_ptr, ctl_scsiio::kern_rel_offset, ctl_scsiio::kern_sg_entries, ctl_scsiio::kern_total_len, scsi_write_using_token_data::length, scsi_write_using_token::length, tpc_list::list_id, scsi_write_using_token::list_identifier, ctl_lun::lun, ctl_lun::lun_lock, ctl_be_lun::maxlba, ctl_io_hdr::nexus, tpc_list::nrange, tpc_list::offset_into_rod, scsi_write_using_token_data::offset_into_rod, tpc_list::params, tpc_list::range, scsi_write_using_token_data::range_descriptor_length, scsi_write_using_token_data::rod_token, ROD_TYPE_BLOCK_ZERO, scsi_2btoul(), scsi_4btoul(), scsi_8btou64(), tpc_list::service_action, scsi_write_using_token::service_action, SSD_ELEM_NONE, SSD_KEY_ILLEGAL_REQUEST, ctl_nexus::targ_port, tpc_token::timeout, tpc_token::token, tpc_list::token, tpc_check_ranges_l(), tpc_check_ranges_x(), tpc_find_list(), ctl_softc::tpc_lock, TPC_MAX_SEGS, and tpc_process().

Here is the call graph for this function:

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_CTL_TPC  ,
"ctltpc"  ,
"CTL TPC"   
)

◆ TAILQ_HEAD()

TAILQ_HEAD ( runl  ,
tpc_io   
)

◆ tpc_check_ranges_l()

static int tpc_check_ranges_l ( struct scsi_range_desc range,
int  nrange,
uint64_t  maxlba,
uint64_t *  lba 
)
static

Definition at line 1115 of file ctl_tpc.c.

References scsi_4btoul(), and scsi_8btou64().

Referenced by ctl_populate_token(), and ctl_write_using_token().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpc_check_ranges_x()

static int tpc_check_ranges_x ( struct scsi_range_desc range,
int  nrange 
)
static

Definition at line 1134 of file ctl_tpc.c.

References scsi_4btoul(), and scsi_8btou64().

Referenced by ctl_populate_token(), and ctl_write_using_token().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpc_checkcond_parse()

static tpc_error_action tpc_checkcond_parse ( union ctl_io io)
static

◆ tpc_create_token()

◆ tpc_done()

◆ tpc_error_parse()

static tpc_error_action tpc_error_parse ( union ctl_io io)
static

Definition at line 1572 of file ctl_tpc.c.

References CTL_IO_SCSI, CTL_IO_TASK, CTL_SCSI_ERROR, CTL_STATUS_MASK, ctl_io::io_hdr, ctl_io_hdr::io_type, ctl_scsiio::scsi_status, SCSI_STATUS_CHECK_COND, ctl_io::scsiio, ctl_io_hdr::status, tpc_checkcond_parse(), and TPC_ERR_RETRY.

Referenced by tpc_done().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpc_find_list()

◆ tpc_process()

◆ tpc_process_b2b()

◆ tpc_process_register_key()

◆ tpc_process_verify()

◆ tpc_process_wut()

◆ tpc_process_zero_wut()

◆ tpc_ranges_length()

static off_t tpc_ranges_length ( struct scsi_range_desc range,
int  nrange 
)
static

Definition at line 1104 of file ctl_tpc.c.

References scsi_4btoul().

Referenced by ctl_populate_token().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpc_resolve()

static uint64_t tpc_resolve ( struct tpc_list list,
uint16_t  idx,
uint32_t *  ss,
uint32_t *  pb,
uint32_t *  pbo 
)
static

Definition at line 758 of file ctl_tpc.c.

References tpc_list::cscd, tpc_list::init_port, tpc_list::ncscd, and tpcl_resolve().

Referenced by tpc_process_b2b(), tpc_process_register_key(), and tpc_process_verify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpc_set_io_error_sense()

static void tpc_set_io_error_sense ( struct tpc_list list)
static

◆ tpc_skip_ranges()

static int tpc_skip_ranges ( struct scsi_range_desc range,
int  nrange,
off_t  skip,
int *  srange,
off_t *  soffset 
)
static

Definition at line 1154 of file ctl_tpc.c.

References scsi_4btoul().

Referenced by tpc_process_wut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpc_timeout()

static void tpc_timeout ( void *  arg)
static