FreeBSD kernel CAM code
|
Go to the source code of this file.
Data Structures | |
struct | ctl_be_lun |
struct | ctl_backend_driver |
Macros | |
#define | CTL_BACKEND_DECLARE(name, driver) |
Typedefs | |
typedef void(* | be_callback_t) (struct ctl_be_lun *be_lun) |
typedef int(* | be_init_t) (void) |
typedef int(* | be_shutdown_t) (void) |
typedef int(* | be_func_t) (union ctl_io *io) |
typedef void(* | be_vfunc_t) (union ctl_io *io) |
typedef int(* | be_ioctl_t) (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) |
typedef int(* | be_luninfo_t) (struct ctl_be_lun *be_lun, struct sbuf *sb) |
typedef uint64_t(* | be_lunattr_t) (struct ctl_be_lun *be_lun, const char *attrname) |
Enumerations | |
enum | ctl_lun_serseq { CTL_LUN_SERSEQ_OFF , CTL_LUN_SERSEQ_SOFT , CTL_LUN_SERSEQ_READ , CTL_LUN_SERSEQ_ON } |
enum | ctl_backend_flags { CTL_BE_FLAG_NONE = 0x00 , CTL_BE_FLAG_HAS_CONFIG = 0x01 } |
Functions | |
int | ctl_backend_register (struct ctl_backend_driver *be) |
int | ctl_backend_deregister (struct ctl_backend_driver *be) |
struct ctl_backend_driver * | ctl_backend_find (char *backend_name) |
int | ctl_add_lun (struct ctl_be_lun *be_lun) |
int | ctl_remove_lun (struct ctl_be_lun *be_lun) |
int | ctl_start_lun (struct ctl_be_lun *be_lun) |
int | ctl_stop_lun (struct ctl_be_lun *be_lun) |
int | ctl_lun_no_media (struct ctl_be_lun *be_lun) |
int | ctl_lun_has_media (struct ctl_be_lun *be_lun) |
int | ctl_lun_ejected (struct ctl_be_lun *be_lun) |
int | ctl_lun_primary (struct ctl_be_lun *be_lun) |
int | ctl_lun_secondary (struct ctl_be_lun *be_lun) |
void | ctl_lun_capacity_changed (struct ctl_be_lun *be_lun) |
#define CTL_BACKEND_DECLARE | ( | name, | |
driver | |||
) |
Definition at line 57 of file ctl_backend.h.
typedef void(* be_callback_t) (struct ctl_be_lun *be_lun) |
Definition at line 84 of file ctl_backend.h.
typedef int(* be_func_t) (union ctl_io *io) |
Definition at line 177 of file ctl_backend.h.
typedef int(* be_init_t) (void) |
Definition at line 175 of file ctl_backend.h.
typedef int(* be_ioctl_t) (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) |
Definition at line 179 of file ctl_backend.h.
typedef uint64_t(* be_lunattr_t) (struct ctl_be_lun *be_lun, const char *attrname) |
Definition at line 182 of file ctl_backend.h.
typedef int(* be_luninfo_t) (struct ctl_be_lun *be_lun, struct sbuf *sb) |
Definition at line 181 of file ctl_backend.h.
typedef int(* be_shutdown_t) (void) |
Definition at line 176 of file ctl_backend.h.
typedef void(* be_vfunc_t) (union ctl_io *io) |
Definition at line 178 of file ctl_backend.h.
enum ctl_backend_flags |
Enumerator | |
---|---|
CTL_BE_FLAG_NONE | |
CTL_BE_FLAG_HAS_CONFIG |
Definition at line 170 of file ctl_backend.h.
enum ctl_lun_serseq |
Enumerator | |
---|---|
CTL_LUN_SERSEQ_OFF | |
CTL_LUN_SERSEQ_SOFT | |
CTL_LUN_SERSEQ_READ | |
CTL_LUN_SERSEQ_ON |
Definition at line 48 of file ctl_backend.h.
int ctl_add_lun | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 4571 of file ctl.c.
References ctl_lun::backend, ctl_be_lun::be, ctl_lun::be_lun, control_softc, ctl_clear_mask(), CTL_DEVID_LEN, CTL_DEVID_MIN_LEN, ctl_enable_lun(), ctl_est_ua_all(), ctl_ffz(), ctl_init_log_page_index(), ctl_init_page_index(), ctl_is_set(), ctl_softc::ctl_lock, ctl_be_lun::ctl_lun, CTL_LUN_DISABLED, CTL_LUN_EJECTED, CTL_LUN_FLAG_EJECTED, CTL_LUN_FLAG_ID_REQ, CTL_LUN_FLAG_NO_MEDIA, CTL_LUN_FLAG_PRIMARY, CTL_LUN_FLAG_STOPPED, ctl_softc::ctl_lun_mask, CTL_LUN_NO_MEDIA, CTL_LUN_PRIMARY_SC, CTL_LUN_REMOVABLE, CTL_LUN_STOPPED, ctl_softc::ctl_luns, CTL_MAX_INITIATORS, ctl_max_luns, ctl_max_ports, ctl_set_mask(), ctl_lun::ctl_softc, ctl_tpc_lun_init(), CTL_UA_LUN_CHANGE, CTL_VENDOR, ctl_devid::data, ctl_be_lun::device_id, ctl_be_lun::flags, ctl_lun::flags, hex2bin(), scsi_vpd_id_descriptor::id_type, scsi_vpd_id_descriptor::identifier, ctl_lun::ie_callout, ctl_lun::ie_reported, ctl_io_stats::item, ctl_devid::len, scsi_vpd_id_descriptor::length, ctl_lun::lun, ctl_lun::lun_devid, ctl_be_lun::lun_id, ctl_lun::lun_lock, ctl_be_lun::lun_type, ctl_softc::num_luns, ctl_be_lun::options, ctl_lun::pending_sense, ctl_lun::pending_ua, ctl_lun::pr_keys, ctl_lun::prevent, scsi_vpd_id_descriptor::proto_codeset, ctl_be_lun::req_lun_id, ctl_lun::stats, SVPD_ID_ASSOC_LUN, SVPD_ID_CODESET_ASCII, SVPD_ID_CODESET_BINARY, SVPD_ID_CODESET_UTF8, SVPD_ID_PIV, SVPD_ID_TYPE_EUI64, SVPD_ID_TYPE_NAA, SVPD_ID_TYPE_SCSI_NAME, SVPD_ID_TYPE_T10, SVPD_ID_TYPE_UUID, T_CDROM, T_CHANGER, T_DIRECT, T_PROCESSOR, T_SEQUENTIAL, scsi_vpd_id_t10::vendor, and scsi_vpd_id_t10::vendor_spec_id.
Referenced by ctl_backend_ramdisk_create(), and ctl_be_block_create().
int ctl_backend_deregister | ( | struct ctl_backend_driver * | be | ) |
Definition at line 104 of file ctl_backend.c.
References control_softc, ctl_softc::ctl_lock, ctl_backend_driver::name, ctl_softc::num_backends, and ctl_backend_driver::shutdown.
struct ctl_backend_driver * ctl_backend_find | ( | char * | backend_name | ) |
Definition at line 126 of file ctl_backend.c.
References control_softc, ctl_softc::ctl_lock, and ctl_backend_driver::name.
Referenced by ctl_ioctl().
int ctl_backend_register | ( | struct ctl_backend_driver * | be | ) |
Definition at line 68 of file ctl_backend.c.
References control_softc, ctl_config_move_done(), ctl_softc::ctl_lock, ctl_backend_driver::init, ctl_backend_driver::name, and ctl_softc::num_backends.
void ctl_lun_capacity_changed | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 5073 of file ctl.c.
References ctl_lun::be_lun, ctl_est_ua_all(), CTL_HA_CHAN_CTL, CTL_HA_MODE_XFER, ctl_ha_msg_send(), ctl_be_lun::ctl_lun, CTL_MSG_UA, CTL_UA_CAPACITY_CHANGE, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_modify(), and ctl_be_block_modify().
int ctl_lun_ejected | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 5004 of file ctl.c.
References ctl_lun::be_lun, ctl_be_lun::ctl_lun, CTL_LUN_EJECTED, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_config_write(), and ctl_be_block_config_write().
int ctl_lun_has_media | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 4976 of file ctl.c.
References ctl_lun::be_lun, ctl_est_ua_all(), CTL_HA_CHAN_CTL, CTL_HA_MODE_XFER, ctl_ha_msg_send(), ctl_be_lun::ctl_lun, CTL_LUN_EJECTED, CTL_LUN_NO_MEDIA, CTL_LUN_REMOVABLE, CTL_MSG_UA, CTL_UA_MEDIUM_CHANGE, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_config_write(), ctl_be_block_config_write(), and ctl_be_block_modify().
int ctl_lun_no_media | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 4965 of file ctl.c.
References ctl_lun::be_lun, ctl_be_lun::ctl_lun, CTL_LUN_NO_MEDIA, and ctl_lun::lun.
Referenced by ctl_be_block_config_write(), ctl_be_block_modify(), and ctl_be_block_rm().
int ctl_lun_primary | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 5015 of file ctl.c.
References ctl_lun::be_lun, ctl_est_ua_all(), ctl_isc_announce_lun(), ctl_be_lun::ctl_lun, CTL_LUN_PRIMARY_SC, CTL_UA_ASYM_ACC_CHANGE, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_modify(), and ctl_be_block_modify().
int ctl_lun_secondary | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 5028 of file ctl.c.
References ctl_lun::be_lun, ctl_est_ua_all(), ctl_isc_announce_lun(), ctl_be_lun::ctl_lun, CTL_UA_ASYM_ACC_CHANGE, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_modify(), and ctl_be_block_modify().
int ctl_remove_lun | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 5047 of file ctl.c.
References ctl_lun::be_lun, ctl_disable_lun(), ctl_free_lun(), ctl_be_lun::ctl_lun, CTL_LUN_INVALID, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_rm(), ctl_backend_ramdisk_shutdown(), ctl_be_block_rm(), and ctl_be_block_shutdown().
int ctl_start_lun | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 4943 of file ctl.c.
References ctl_lun::be_lun, ctl_be_lun::ctl_lun, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_config_write(), and ctl_be_block_config_write().
int ctl_stop_lun | ( | struct ctl_be_lun * | be_lun | ) |
Definition at line 4954 of file ctl.c.
References ctl_lun::be_lun, ctl_be_lun::ctl_lun, CTL_LUN_STOPPED, and ctl_lun::lun.
Referenced by ctl_backend_ramdisk_config_write(), and ctl_be_block_config_write().