FreeBSD kernel CAM code
ctl_error.h File Reference
#include <machine/stdarg.h>
Include dependency graph for ctl_error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ctl_set_sense_data_va (struct scsi_sense_data *sense_data, u_int *sense_len, void *lun, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap)
 
void ctl_set_sense_data (struct scsi_sense_data *sense_data, u_int *sense_len, void *lun, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq,...)
 
void ctl_set_sense (struct ctl_scsiio *ctsio, int current_error, int sense_key, int asc, int ascq,...)
 
void ctl_sense_to_desc (struct scsi_sense_data_fixed *sense_src, struct scsi_sense_data_desc *sense_dest)
 
void ctl_sense_to_fixed (struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest)
 
void ctl_set_ua (struct ctl_scsiio *ctsio, int asc, int ascq)
 
ctl_ua_type ctl_build_qae (struct ctl_lun *lun, uint32_t initidx, uint8_t *resp)
 
ctl_ua_type ctl_build_ua (struct ctl_lun *lun, uint32_t initidx, struct scsi_sense_data *sense, u_int *sense_len, scsi_sense_data_type sense_format)
 
void ctl_set_overlapped_cmd (struct ctl_scsiio *ctsio)
 
void ctl_set_overlapped_tag (struct ctl_scsiio *ctsio, uint8_t tag)
 
void ctl_set_invalid_field (struct ctl_scsiio *ctsio, int sks_valid, int command, int field, int bit_valid, int bit)
 
void ctl_set_invalid_field_ciu (struct ctl_scsiio *ctsio)
 
void ctl_set_invalid_opcode (struct ctl_scsiio *ctsio)
 
void ctl_set_param_len_error (struct ctl_scsiio *ctsio)
 
void ctl_set_already_locked (struct ctl_scsiio *ctsio)
 
void ctl_set_unsupported_lun (struct ctl_scsiio *ctsio)
 
void ctl_set_lun_transit (struct ctl_scsiio *ctsio)
 
void ctl_set_lun_standby (struct ctl_scsiio *ctsio)
 
void ctl_set_lun_unavail (struct ctl_scsiio *ctsio)
 
void ctl_set_internal_failure (struct ctl_scsiio *ctsio, int sks_valid, uint16_t retry_count)
 
void ctl_set_medium_error (struct ctl_scsiio *ctsio, int read)
 
void ctl_set_aborted (struct ctl_scsiio *ctsio)
 
void ctl_set_lba_out_of_range (struct ctl_scsiio *ctsio, uint64_t lba)
 
void ctl_set_lun_stopped (struct ctl_scsiio *ctsio)
 
void ctl_set_lun_int_reqd (struct ctl_scsiio *ctsio)
 
void ctl_set_lun_ejected (struct ctl_scsiio *ctsio)
 
void ctl_set_lun_no_media (struct ctl_scsiio *ctsio)
 
void ctl_set_illegal_pr_release (struct ctl_scsiio *ctsio)
 
void ctl_set_medium_format_corrupted (struct ctl_scsiio *ctsio)
 
void ctl_set_medium_magazine_inaccessible (struct ctl_scsiio *ctsio)
 
void ctl_set_data_phase_error (struct ctl_scsiio *ctsio)
 
void ctl_set_reservation_conflict (struct ctl_scsiio *ctsio)
 
void ctl_set_queue_full (struct ctl_scsiio *ctsio)
 
void ctl_set_busy (struct ctl_scsiio *ctsio)
 
void ctl_set_task_aborted (struct ctl_scsiio *ctsio)
 
void ctl_set_hw_write_protected (struct ctl_scsiio *ctsio)
 
void ctl_set_space_alloc_fail (struct ctl_scsiio *ctsio)
 
void ctl_set_success (struct ctl_scsiio *ctsio)
 

Function Documentation

◆ ctl_build_qae()

ctl_ua_type ctl_build_qae ( struct ctl_lun lun,
uint32_t  initidx,
uint8_t *  resp 
)

Definition at line 498 of file ctl_error.c.

References CTL_MAX_INIT_PER_PORT, CTL_UA_NONE, CTL_UA_POWERON, ctl_ua_to_ascq(), ctl_lun::lun_lock, ctl_lun::pending_ua, and SSD_KEY_UNIT_ATTENTION.

Referenced by ctl_query_async_event().

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

◆ ctl_build_ua()

ctl_ua_type ctl_build_ua ( struct ctl_lun lun,
uint32_t  initidx,
struct scsi_sense_data sense,
u_int *  sense_len,
scsi_sense_data_type  sense_format 
)

◆ ctl_sense_to_desc()

◆ ctl_sense_to_fixed()

◆ ctl_set_aborted()

void ctl_set_aborted ( struct ctl_scsiio ctsio)

Definition at line 768 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ABORTED_COMMAND.

Referenced by ctl_inject_error().

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

◆ ctl_set_already_locked()

void ctl_set_already_locked ( struct ctl_scsiio ctsio)

Definition at line 698 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ILLEGAL_REQUEST.

Here is the call graph for this function:

◆ ctl_set_busy()

◆ ctl_set_data_phase_error()

void ctl_set_data_phase_error ( struct ctl_scsiio ctsio)

Definition at line 917 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by cfiscsi_handle_data_segment(), and ctlfedone().

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

◆ ctl_set_hw_write_protected()

void ctl_set_hw_write_protected ( struct ctl_scsiio ctsio)

Definition at line 965 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_DATA_PROTECT.

Referenced by ctl_be_block_biodone(), ctl_be_block_dispatch_file(), ctl_be_block_dispatch_zvol(), ctl_be_block_unmap_file(), and ctl_scsiio_lun_check().

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

◆ ctl_set_illegal_pr_release()

void ctl_set_illegal_pr_release ( struct ctl_scsiio ctsio)

Definition at line 845 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ILLEGAL_REQUEST.

Referenced by ctl_persistent_reserve_out().

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

◆ ctl_set_internal_failure()

void ctl_set_internal_failure ( struct ctl_scsiio ctsio,
int  sks_valid,
uint16_t  retry_count 
)

◆ ctl_set_invalid_field()

◆ ctl_set_invalid_field_ciu()

void ctl_set_invalid_field_ciu ( struct ctl_scsiio ctsio)

Definition at line 653 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ABORTED_COMMAND.

Referenced by ctl_datamove_done_process().

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

◆ ctl_set_invalid_opcode()

◆ ctl_set_lba_out_of_range()

void ctl_set_lba_out_of_range ( struct ctl_scsiio ctsio,
uint64_t  lba 
)

Definition at line 779 of file ctl_error.c.

References ctl_set_sense(), scsi_u64to8b(), SSD_ELEM_INFO, SSD_ELEM_NONE, SSD_ELEM_SKIP, and SSD_KEY_ILLEGAL_REQUEST.

Referenced by ctl_cnw(), ctl_get_lba_status(), ctl_populate_token(), ctl_read_write(), ctl_sync_cache(), ctl_unmap(), ctl_verify(), ctl_write_same(), and ctl_write_using_token().

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

◆ ctl_set_lun_ejected()

void ctl_set_lun_ejected ( struct ctl_scsiio ctsio)

Definition at line 821 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_lun_int_reqd()

void ctl_set_lun_int_reqd ( struct ctl_scsiio ctsio)

Definition at line 809 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_lun_no_media()

void ctl_set_lun_no_media ( struct ctl_scsiio ctsio)

Definition at line 833 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_lun_standby()

void ctl_set_lun_standby ( struct ctl_scsiio ctsio)

Definition at line 869 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_lun_stopped()

void ctl_set_lun_stopped ( struct ctl_scsiio ctsio)

Definition at line 797 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_lun_transit()

void ctl_set_lun_transit ( struct ctl_scsiio ctsio)

Definition at line 857 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_lun_unavail()

void ctl_set_lun_unavail ( struct ctl_scsiio ctsio)

Definition at line 881 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Referenced by ctl_scsiio_lun_check().

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

◆ ctl_set_medium_error()

void ctl_set_medium_error ( struct ctl_scsiio ctsio,
int  read 
)

Definition at line 746 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_MEDIUM_ERROR.

Referenced by ctl_be_block_biodone(), ctl_be_block_dispatch_file(), ctl_be_block_dispatch_zvol(), ctl_be_block_unmap_file(), and ctl_inject_error().

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

◆ ctl_set_medium_format_corrupted()

void ctl_set_medium_format_corrupted ( struct ctl_scsiio ctsio)

Definition at line 893 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_MEDIUM_ERROR.

Here is the call graph for this function:

◆ ctl_set_medium_magazine_inaccessible()

void ctl_set_medium_magazine_inaccessible ( struct ctl_scsiio ctsio)

Definition at line 905 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_NOT_READY.

Here is the call graph for this function:

◆ ctl_set_overlapped_cmd()

void ctl_set_overlapped_cmd ( struct ctl_scsiio ctsio)

Definition at line 591 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ILLEGAL_REQUEST.

Referenced by ctl_scsiio_precheck(), ctl_serialize_other_sc_cmd(), and ctl_try_unblock_io().

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

◆ ctl_set_overlapped_tag()

void ctl_set_overlapped_tag ( struct ctl_scsiio ctsio,
uint8_t  tag 
)

Definition at line 603 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ILLEGAL_REQUEST.

Referenced by ctl_scsiio_precheck(), ctl_serialize_other_sc_cmd(), and ctl_try_unblock_io().

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

◆ ctl_set_param_len_error()

void ctl_set_param_len_error ( struct ctl_scsiio ctsio)

Definition at line 686 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ILLEGAL_REQUEST.

Referenced by ctl_do_mode_select(), ctl_extended_copy_lid1(), ctl_extended_copy_lid4(), and ctl_mode_select().

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

◆ ctl_set_queue_full()

void ctl_set_queue_full ( struct ctl_scsiio ctsio)

◆ ctl_set_reservation_conflict()

void ctl_set_reservation_conflict ( struct ctl_scsiio ctsio)

◆ ctl_set_sense()

◆ ctl_set_sense_data()

void ctl_set_sense_data ( struct scsi_sense_data sense_data,
u_int *  sense_len,
void *  lun,
scsi_sense_data_type  sense_format,
int  current_error,
int  sense_key,
int  asc,
int  ascq,
  ... 
)

Definition at line 115 of file ctl_error.c.

References ctl_set_sense_data_va().

Referenced by ctl_build_ua(), ctl_request_sense(), ctl_sense_to_desc(), and ctl_sense_to_fixed().

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

◆ ctl_set_sense_data_va()

void ctl_set_sense_data_va ( struct scsi_sense_data sense_data,
u_int *  sense_len,
void *  lun,
scsi_sense_data_type  sense_format,
int  current_error,
int  sense_key,
int  asc,
int  ascq,
va_list  ap 
)

Definition at line 70 of file ctl_error.c.

References ctl_lun::lun, SCP_DSENSE, scsi_set_sense_data_va(), SSD_FULL_SIZE, SSD_TYPE_DESC, SSD_TYPE_FIXED, and SSD_TYPE_NONE.

Referenced by ctl_set_sense(), and ctl_set_sense_data().

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

◆ ctl_set_space_alloc_fail()

void ctl_set_space_alloc_fail ( struct ctl_scsiio ctsio)

Definition at line 977 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_DATA_PROTECT.

Referenced by ctl_backend_ramdisk_rw(), ctl_backend_ramdisk_ws(), ctl_be_block_biodone(), ctl_be_block_dispatch_file(), ctl_be_block_dispatch_zvol(), and ctl_be_block_unmap_file().

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

◆ ctl_set_success()

void ctl_set_success ( struct ctl_scsiio ctsio)

Definition at line 989 of file ctl_error.c.

References CTL_SUCCESS, ctl_scsiio::io_hdr, ctl_scsiio::scsi_status, SCSI_STATUS_OK, ctl_scsiio::sense_len, and ctl_io_hdr::status.

Referenced by ctl_backend_ramdisk_config_write(), ctl_backend_ramdisk_move_done(), ctl_backend_ramdisk_rw(), ctl_backend_ramdisk_submit(), ctl_backend_ramdisk_unmap(), ctl_backend_ramdisk_ws(), ctl_be_block_biodone(), ctl_be_block_compare(), ctl_be_block_config_write(), ctl_be_block_dispatch_file(), ctl_be_block_dispatch_zvol(), ctl_be_block_flush_file(), ctl_be_block_move_done(), ctl_be_block_unmap_file(), ctl_cnw(), ctl_copy_operation_abort(), ctl_do_mode_select(), ctl_extended_copy_lid1(), ctl_extended_copy_lid4(), ctl_format(), ctl_get_config(), ctl_get_event_status(), ctl_get_lba_status(), ctl_inquiry_evpd_bdc(), ctl_inquiry_evpd_block_limits(), ctl_inquiry_evpd_devid(), ctl_inquiry_evpd_eid(), ctl_inquiry_evpd_lbp(), ctl_inquiry_evpd_mpp(), ctl_inquiry_evpd_scsi_ports(), ctl_inquiry_evpd_serial(), ctl_inquiry_evpd_sfs(), ctl_inquiry_evpd_supported(), ctl_inquiry_evpd_tpc(), ctl_inquiry_std(), ctl_log_sense(), ctl_mechanism_status(), ctl_mode_select(), ctl_mode_sense(), ctl_persistent_reserve_in(), ctl_persistent_reserve_out(), ctl_populate_token(), ctl_read_buffer(), ctl_read_capacity(), ctl_read_capacity_16(), ctl_read_defect(), ctl_read_toc(), ctl_read_write(), ctl_receive_copy_failure_details(), ctl_receive_copy_operating_parameters(), ctl_receive_copy_status_lid1(), ctl_receive_copy_status_lid4(), ctl_receive_rod_token_information(), ctl_report_all_rod_tokens(), ctl_report_ident_info(), ctl_report_luns(), ctl_report_supported_opcodes(), ctl_report_supported_tmf(), ctl_report_tagret_port_groups(), ctl_report_timestamp(), ctl_request_sense(), ctl_scsi_release(), ctl_scsi_reserve(), ctl_tur(), ctl_unmap(), ctl_verify(), ctl_write_buffer(), and tpc_process().

◆ ctl_set_task_aborted()

void ctl_set_task_aborted ( struct ctl_scsiio ctsio)

◆ ctl_set_ua()

void ctl_set_ua ( struct ctl_scsiio ctsio,
int  asc,
int  ascq 
)

Definition at line 382 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_UNIT_ATTENTION.

Referenced by ctl_inject_error().

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

◆ ctl_set_unsupported_lun()

void ctl_set_unsupported_lun ( struct ctl_scsiio ctsio)

Definition at line 710 of file ctl_error.c.

References ctl_set_sense(), SSD_ELEM_NONE, and SSD_KEY_ILLEGAL_REQUEST.

Referenced by ctl_scsiio_precheck().

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