FreeBSD kernel CAM code
|
Go to the source code of this file.
Data Structures | |
struct | ctl_wwpn_iid |
struct | ctl_port |
struct | ctl_frontend |
Macros | |
#define | CTL_FRONTEND_DECLARE(name, driver) |
Typedefs | |
typedef int(* | fe_init_t) (void) |
typedef int(* | fe_shutdown_t) (void) |
typedef void(* | port_func_t) (void *onoff_arg) |
typedef int(* | port_info_func_t) (void *onoff_arg, struct sbuf *sb) |
typedef int(* | lun_func_t) (void *arg, int lun_id) |
typedef int(* | fe_ioctl_t) (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) |
Enumerations | |
enum | ctl_port_status { CTL_PORT_STATUS_NONE = 0x00 , CTL_PORT_STATUS_ONLINE = 0x01 , CTL_PORT_STATUS_HA_SHARED = 0x02 } |
Functions | |
int | ctl_frontend_register (struct ctl_frontend *fe) |
int | ctl_frontend_deregister (struct ctl_frontend *fe) |
struct ctl_frontend * | ctl_frontend_find (char *frontend_name) |
int | ctl_port_register (struct ctl_port *port) |
int | ctl_port_deregister (struct ctl_port *port) |
void | ctl_port_set_wwns (struct ctl_port *port, int wwnn_valid, uint64_t wwnn, int wwpn_valid, uint64_t wwpn) |
void | ctl_port_online (struct ctl_port *fe) |
void | ctl_port_offline (struct ctl_port *fe) |
int | ctl_queue (union ctl_io *io) |
int | ctl_run (union ctl_io *io) |
int | ctl_queue_sense (union ctl_io *io) |
int | ctl_add_initiator (struct ctl_port *port, int iid, uint64_t wwpn, char *name) |
int | ctl_remove_initiator (struct ctl_port *port, int iid) |
#define CTL_FRONTEND_DECLARE | ( | name, | |
driver | |||
) |
Definition at line 62 of file ctl_frontend.h.
typedef int(* fe_init_t) (void) |
Definition at line 54 of file ctl_frontend.h.
typedef int(* fe_ioctl_t) (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) |
Definition at line 59 of file ctl_frontend.h.
typedef int(* fe_shutdown_t) (void) |
Definition at line 55 of file ctl_frontend.h.
typedef int(* lun_func_t) (void *arg, int lun_id) |
Definition at line 58 of file ctl_frontend.h.
typedef void(* port_func_t) (void *onoff_arg) |
Definition at line 56 of file ctl_frontend.h.
typedef int(* port_info_func_t) (void *onoff_arg, struct sbuf *sb) |
Definition at line 57 of file ctl_frontend.h.
enum ctl_port_status |
Enumerator | |
---|---|
CTL_PORT_STATUS_NONE | |
CTL_PORT_STATUS_ONLINE | |
CTL_PORT_STATUS_HA_SHARED |
Definition at line 48 of file ctl_frontend.h.
int ctl_add_initiator | ( | struct ctl_port * | port, |
int | iid, | ||
uint64_t | wwpn, | ||
char * | name | ||
) |
Definition at line 2174 of file ctl.c.
References ctl_isc_announce_iid(), ctl_softc::ctl_lock, CTL_MAX_INIT_PER_PORT, ctl_port::ctl_softc, ctl_wwpn_iid::in_use, ctl_wwpn_iid::last_use, ctl_wwpn_iid::name, ctl_port::targ_port, ctl_wwpn_iid::wwpn, and ctl_port::wwpn_iid.
Referenced by cfiscsi_session_register_initiator(), and ctlfeasync().
int ctl_frontend_deregister | ( | struct ctl_frontend * | fe | ) |
Definition at line 109 of file ctl_frontend.c.
References control_softc, ctl_softc::ctl_lock, ctl_frontend::name, ctl_softc::num_frontends, and ctl_frontend::shutdown.
Referenced by ctl_shutdown().
struct ctl_frontend * ctl_frontend_find | ( | char * | frontend_name | ) |
Definition at line 131 of file ctl_frontend.c.
References control_softc, ctl_softc::ctl_lock, and ctl_frontend::name.
Referenced by ctl_ioctl().
int ctl_frontend_register | ( | struct ctl_frontend * | fe | ) |
Definition at line 73 of file ctl_frontend.c.
References control_softc, ctl_softc::ctl_lock, ctl_frontend::init, ctl_frontend::name, and ctl_softc::num_frontends.
Referenced by ctl_init().
int ctl_port_deregister | ( | struct ctl_port * | port | ) |
Definition at line 227 of file ctl_frontend.c.
References ctl_clear_mask(), ctl_softc::ctl_lock, ctl_lun_map_deinit(), ctl_pool_free(), ctl_port::ctl_pool_ref, ctl_softc::ctl_port_mask, ctl_softc::ctl_ports, ctl_port::ctl_softc, ctl_port::frontend, ctl_port::init_devid, ctl_port::max_initiators, ctl_wwpn_iid::name, ctl_softc::num_ports, ctl_port::options, ctl_port::port_devid, ctl_port::port_lock, ctl_port::targ_port, ctl_port::target_devid, and ctl_port::wwpn_iid.
Referenced by cfcs_shutdown(), cfi_ioctl_port_create(), cfi_ioctl_port_remove(), cfi_shutdown(), cfiscsi_target_release(), ctl_ha_shutdown(), ctlfeasync(), and tpcl_shutdown().
void ctl_port_offline | ( | struct ctl_port * | fe | ) |
Definition at line 357 of file ctl_frontend.c.
References ctl_est_ua_all(), ctl_isc_announce_port(), ctl_softc::ctl_lock, ctl_lun_map_from_port(), ctl_lun_map_to_port(), ctl_port::ctl_softc, CTL_UA_INQ_CHANGE, ctl_lun::lun, ctl_port::lun_disable, ctl_port::lun_map, ctl_port::lun_map_size, ctl_port::onoff_arg, ctl_port::port_offline, ctl_port::status, and ctl_port::targ_lun_arg.
Referenced by cfcs_shutdown(), cfi_ioctl_port_create(), cfi_ioctl_port_remove(), cfi_shutdown(), cfiscsi_ioctl_port_remove(), ctl_ioctl(), and tpcl_shutdown().
void ctl_port_online | ( | struct ctl_port * | fe | ) |
Definition at line 314 of file ctl_frontend.c.
References ctl_est_ua_all(), ctl_isc_announce_port(), ctl_softc::ctl_lock, ctl_lun_map_from_port(), ctl_lun_map_to_port(), CTL_PORT_STATUS_HA_SHARED, CTL_PORT_STATUS_ONLINE, ctl_port::ctl_softc, CTL_UA_INQ_CHANGE, ctl_softc::is_single, ctl_lun::lun, ctl_port::lun_enable, ctl_port::lun_map, ctl_port::lun_map_size, ctl_port::onoff_arg, ctl_port::options, ctl_port::port_online, ctl_port::status, and ctl_port::targ_lun_arg.
Referenced by cfi_init(), cfi_ioctl_port_create(), ctl_ioctl(), and tpcl_init().
int ctl_port_register | ( | struct ctl_port * | port | ) |
Definition at line 148 of file ctl_frontend.c.
References control_softc, ctl_clear_mask(), ctl_ffz(), ctl_softc::ctl_lock, CTL_MAX_INIT_PER_PORT, ctl_pool_create(), ctl_port::ctl_pool_ref, ctl_softc::ctl_port_mask, ctl_softc::ctl_ports, ctl_set_mask(), ctl_port::ctl_softc, ctl_port::frontend, ctl_io_stats::item, ctl_port::max_initiators, ctl_softc::num_ports, ctl_port::num_requested_ctl_io, ctl_port::options, ctl_port::port_lock, ctl_softc::port_max, ctl_softc::port_min, ctl_port::port_name, ctl_port::stats, ctl_port::targ_port, and ctl_port::wwpn_iid.
Referenced by cfcs_init(), cfi_init(), cfi_ioctl_port_create(), cfiscsi_ioctl_port_create(), ctl_isc_port_sync(), ctlfeasync(), and tpcl_init().
void ctl_port_set_wwns | ( | struct ctl_port * | port, |
int | wwnn_valid, | ||
uint64_t | wwnn, | ||
int | wwpn_valid, | ||
uint64_t | wwpn | ||
) |
Definition at line 263 of file ctl_frontend.c.
References CTL_PORT_FC, CTL_PORT_ISCSI, CTL_PORT_SAS, CTL_WWPN_LEN, ctl_devid::data, scsi_vpd_id_descriptor::id_type, scsi_vpd_id_descriptor::identifier, ctl_devid::len, scsi_vpd_id_descriptor::length, ctl_port::port_devid, ctl_port::port_type, scsi_vpd_id_descriptor::proto_codeset, SCSI_PROTO_FC, SCSI_PROTO_ISCSI, SCSI_PROTO_SAS, SCSI_PROTO_SPI, scsi_u64to8b(), SVPD_ID_ASSOC_PORT, SVPD_ID_ASSOC_TARGET, SVPD_ID_CODESET_BINARY, SVPD_ID_PIV, SVPD_ID_TYPE_NAA, ctl_port::target_devid, ctl_port::wwnn, and ctl_port::wwpn.
Referenced by cfcs_init(), ctl_ioctl(), and ctlfe_onoffline().
int ctl_queue | ( | union ctl_io * | io | ) |
Definition at line 13270 of file ctl.c.
References ctl_scsiio::cdb, ctl_debug, CTL_DEBUG_CDB, CTL_DEBUG_PRINT, ctl_enqueue_incoming(), ctl_io_print(), CTL_IO_SCSI, CTL_IO_TASK, ctl_lun_map_from_port(), CTL_PORT, CTL_RETVAL_COMPLETE, ctl_io::io_hdr, ctl_io_hdr::io_type, ctl_io_hdr::nexus, ctl_io::scsiio, ctl_io_hdr::start_bt, ctl_io_hdr::start_time, ctl_nexus::targ_lun, and ctl_nexus::targ_mapped_lun.
Referenced by cfcs_action(), ctlfedone(), and tpcl_queue().
int ctl_queue_sense | ( | union ctl_io * | io | ) |
Definition at line 13218 of file ctl.c.
References CTL_DEBUG_PRINT, ctl_free_io(), ctl_get_initindex(), ctl_softc::ctl_lock, ctl_lun_map_from_port(), ctl_softc::ctl_luns, CTL_MAX_INIT_PER_PORT, ctl_max_luns, CTL_PORT, CTL_RETVAL_COMPLETE, CTL_SOFTC, ctl_io::io_hdr, ctl_lun::lun, ctl_lun::lun_lock, ctl_io_hdr::nexus, ctl_lun::pending_sense, ctl_io::scsiio, ctl_scsiio::sense_data, ctl_scsiio::sense_len, and ctl_nexus::targ_lun.
Referenced by ctlfedone().
int ctl_remove_initiator | ( | struct ctl_port * | port, |
int | iid | ||
) |
Definition at line 2145 of file ctl.c.
References ctl_i_t_nexus_loss(), ctl_isc_announce_iid(), ctl_softc::ctl_lock, CTL_MAX_INIT_PER_PORT, ctl_port::ctl_softc, CTL_UA_POWERON, ctl_wwpn_iid::in_use, ctl_wwpn_iid::last_use, and ctl_port::wwpn_iid.
Referenced by cfiscsi_session_unregister_initiator(), and ctlfeasync().
int ctl_run | ( | union ctl_io * | io | ) |
Definition at line 13301 of file ctl.c.
References ctl_scsiio::cdb, ctl_debug, CTL_DEBUG_CDB, CTL_DEBUG_PRINT, ctl_io_print(), CTL_IO_SCSI, CTL_IO_TASK, ctl_lun_map_from_port(), CTL_PORT, CTL_RETVAL_COMPLETE, ctl_run_task(), ctl_scsiio_precheck(), ctl_io::io_hdr, ctl_io_hdr::io_type, ctl_io_hdr::nexus, ctl_io::scsiio, ctl_io_hdr::start_bt, ctl_io_hdr::start_time, ctl_nexus::targ_lun, and ctl_nexus::targ_mapped_lun.
Referenced by cfi_submit_wait(), cfiscsi_pdu_handle_scsi_command(), cfiscsi_pdu_handle_task_request(), and cfiscsi_session_terminate_tasks().