FreeBSD kernel CAM code
|
#include <sys/queue.h>
#include <cam/cam_sim.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <cam/cam_xpt.h>
#include <sys/module.h>
Go to the source code of this file.
Data Structures | |
struct | periph_driver |
struct | cam_periph |
struct | cam_periph_map_info |
Macros | |
#define | PERIPHDRIVER_DECLARE(name, driver) |
#define | CAM_PERIPH_DRV_EARLY 0x01 |
#define | ppriv_ptr0 periph_priv.entries[0].ptr |
#define | ppriv_ptr1 periph_priv.entries[1].ptr |
#define | ppriv_field0 periph_priv.entries[0].field |
#define | ppriv_field1 periph_priv.entries[1].field |
#define | CAM_PERIPH_RUNNING 0x01 |
#define | CAM_PERIPH_LOCKED 0x02 |
#define | CAM_PERIPH_LOCK_WANTED 0x04 |
#define | CAM_PERIPH_INVALID 0x08 |
#define | CAM_PERIPH_NEW_DEV_FOUND 0x10 |
#define | CAM_PERIPH_RECOVERY_INPROG 0x20 |
#define | CAM_PERIPH_RUN_TASK 0x40 |
#define | CAM_PERIPH_FREE 0x80 |
#define | CAM_PERIPH_ANNOUNCED 0x100 |
#define | CAM_PERIPH_RECOVERY_WAIT 0x200 |
#define | CAM_PERIPH_RECOVERY_WAIT_FAILED 0x400 |
#define | CAM_PERIPH_MAXMAPS 2 |
#define | cam_periph_owned(periph) mtx_owned(xpt_path_mtx((periph)->path)) |
#define | cam_periph_lock(periph) mtx_lock(xpt_path_mtx((periph)->path)) |
#define | cam_periph_unlock(periph) mtx_unlock(xpt_path_mtx((periph)->path)) |
#define | cam_periph_assert(periph, what) mtx_assert(xpt_path_mtx((periph)->path), (what)) |
#define | cam_periph_sleep(periph, chan, priority, wmesg, timo) xpt_path_sleep((periph)->path, (chan), (priority), (wmesg), (timo)) |
#define | CAM_PERIPH_FOREACH(periph, driver) |
#define | CAM_PERIPH_PRINT(p, msg, args...) printf("%s%d:" msg, (periph)->periph_name, (periph)->unit_number, ##args) |
Typedefs | |
typedef void() | periph_init_t(void) |
typedef int() | periph_deinit_t(void) |
typedef void | periph_start_t(struct cam_periph *periph, union ccb *start_ccb) |
typedef cam_status | periph_ctor_t(struct cam_periph *periph, void *arg) |
typedef void | periph_oninv_t(struct cam_periph *periph) |
typedef void | periph_dtor_t(struct cam_periph *periph) |
Enumerations | |
enum | cam_periph_type { CAM_PERIPH_BIO } |
Functions | |
void | periphdriver_register (void *) |
int | periphdriver_unregister (void *) |
void | periphdriver_init (int level) |
cam_status | cam_periph_alloc (periph_ctor_t *periph_ctor, periph_oninv_t *periph_oninvalidate, periph_dtor_t *periph_dtor, periph_start_t *periph_start, char *name, cam_periph_type type, struct cam_path *, ac_callback_t *, ac_code, void *arg) |
struct cam_periph * | cam_periph_find (struct cam_path *path, char *name) |
int | cam_periph_list (struct cam_path *, struct sbuf *) |
int | cam_periph_acquire (struct cam_periph *periph) |
void | cam_periph_doacquire (struct cam_periph *periph) |
void | cam_periph_release (struct cam_periph *periph) |
void | cam_periph_release_locked (struct cam_periph *periph) |
void | cam_periph_release_locked_buses (struct cam_periph *periph) |
int | cam_periph_hold (struct cam_periph *periph, int priority) |
void | cam_periph_unhold (struct cam_periph *periph) |
void | cam_periph_invalidate (struct cam_periph *periph) |
int | cam_periph_mapmem (union ccb *ccb, struct cam_periph_map_info *mapinfo, u_int maxmap) |
void | cam_periph_unmapmem (union ccb *ccb, struct cam_periph_map_info *mapinfo) |
union ccb * | cam_periph_getccb (struct cam_periph *periph, u_int32_t priority) |
int | cam_periph_runccb (union ccb *ccb, int(*error_routine)(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags), cam_flags camflags, u_int32_t sense_flags, struct devstat *ds) |
int | cam_periph_ioctl (struct cam_periph *periph, u_long cmd, caddr_t addr, int(*error_routine)(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags)) |
void | cam_freeze_devq (struct cam_path *path) |
u_int32_t | cam_release_devq (struct cam_path *path, u_int32_t relsim_flags, u_int32_t opening_reduction, u_int32_t arg, int getcount_only) |
void | cam_periph_async (struct cam_periph *periph, u_int32_t code, struct cam_path *path, void *arg) |
void | cam_periph_bus_settle (struct cam_periph *periph, u_int bus_settle_ms) |
void | cam_periph_freeze_after_event (struct cam_periph *periph, struct timeval *event_time, u_int duration_ms) |
int | cam_periph_error (union ccb *ccb, cam_flags camflags, u_int32_t sense_flags) |
int | cam_periph_invalidate_sysctl (SYSCTL_HANDLER_ARGS) |
static __inline struct mtx * | cam_periph_mtx (struct cam_periph *periph) |
static struct cam_periph * | cam_periph_acquire_first (struct periph_driver *driver) |
static struct cam_periph * | cam_periph_acquire_next (struct cam_periph *pperiph) |
Variables | |
struct cam_periph * | xpt_periph |
struct periph_driver ** | periph_drivers |
#define CAM_PERIPH_ANNOUNCED 0x100 |
Definition at line 138 of file cam_periph.h.
#define cam_periph_assert | ( | periph, | |
what | |||
) | mtx_assert(xpt_path_mtx((periph)->path), (what)) |
Definition at line 230 of file cam_periph.h.
#define CAM_PERIPH_DRV_EARLY 0x01 |
Definition at line 99 of file cam_periph.h.
#define CAM_PERIPH_FOREACH | ( | periph, | |
driver | |||
) |
Definition at line 268 of file cam_periph.h.
#define CAM_PERIPH_FREE 0x80 |
Definition at line 137 of file cam_periph.h.
#define CAM_PERIPH_INVALID 0x08 |
Definition at line 133 of file cam_periph.h.
#define cam_periph_lock | ( | periph | ) | mtx_lock(xpt_path_mtx((periph)->path)) |
Definition at line 224 of file cam_periph.h.
#define CAM_PERIPH_LOCK_WANTED 0x04 |
Definition at line 132 of file cam_periph.h.
#define CAM_PERIPH_LOCKED 0x02 |
Definition at line 131 of file cam_periph.h.
#define CAM_PERIPH_MAXMAPS 2 |
Definition at line 155 of file cam_periph.h.
#define CAM_PERIPH_NEW_DEV_FOUND 0x10 |
Definition at line 134 of file cam_periph.h.
#define cam_periph_owned | ( | periph | ) | mtx_owned(xpt_path_mtx((periph)->path)) |
Definition at line 221 of file cam_periph.h.
#define CAM_PERIPH_PRINT | ( | p, | |
msg, | |||
args... | |||
) | printf("%s%d:" msg, (periph)->periph_name, (periph)->unit_number, ##args) |
Definition at line 273 of file cam_periph.h.
#define CAM_PERIPH_RECOVERY_INPROG 0x20 |
Definition at line 135 of file cam_periph.h.
#define CAM_PERIPH_RECOVERY_WAIT 0x200 |
Definition at line 139 of file cam_periph.h.
#define CAM_PERIPH_RECOVERY_WAIT_FAILED 0x400 |
Definition at line 140 of file cam_periph.h.
#define CAM_PERIPH_RUN_TASK 0x40 |
Definition at line 136 of file cam_periph.h.
#define CAM_PERIPH_RUNNING 0x01 |
Definition at line 130 of file cam_periph.h.
#define cam_periph_sleep | ( | periph, | |
chan, | |||
priority, | |||
wmesg, | |||
timo | |||
) | xpt_path_sleep((periph)->path, (chan), (priority), (wmesg), (timo)) |
Definition at line 233 of file cam_periph.h.
#define cam_periph_unlock | ( | periph | ) | mtx_unlock(xpt_path_mtx((periph)->path)) |
Definition at line 227 of file cam_periph.h.
#define PERIPHDRIVER_DECLARE | ( | name, | |
driver | |||
) |
Definition at line 59 of file cam_periph.h.
#define ppriv_field0 periph_priv.entries[0].field |
Definition at line 110 of file cam_periph.h.
#define ppriv_field1 periph_priv.entries[1].field |
Definition at line 111 of file cam_periph.h.
#define ppriv_ptr0 periph_priv.entries[0].ptr |
Definition at line 108 of file cam_periph.h.
#define ppriv_ptr1 periph_priv.entries[1].ptr |
Definition at line 109 of file cam_periph.h.
typedef cam_status periph_ctor_t(struct cam_periph *periph, void *arg) |
Definition at line 115 of file cam_periph.h.
typedef int() periph_deinit_t(void) |
Definition at line 91 of file cam_periph.h.
typedef void periph_dtor_t(struct cam_periph *periph) |
Definition at line 118 of file cam_periph.h.
typedef void() periph_init_t(void) |
Definition at line 85 of file cam_periph.h.
typedef void periph_oninv_t(struct cam_periph *periph) |
Definition at line 117 of file cam_periph.h.
typedef void periph_start_t(struct cam_periph *periph, union ccb *start_ccb) |
Definition at line 113 of file cam_periph.h.
enum cam_periph_type |
Enumerator | |
---|---|
CAM_PERIPH_BIO |
Definition at line 103 of file cam_periph.h.
void cam_freeze_devq | ( | struct cam_path * | path | ) |
Definition at line 1329 of file cam_periph.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DEV_QFREEZE, ccb_hdr::flags, ccb_hdr::func_code, ccb_hdr::path, xpt_action(), XPT_NOOP, and xpt_setup_ccb().
Referenced by cam_periph_freeze_after_event(), pmpdone(), pmpfreeze(), probestart(), and scsi_dev_async().
int cam_periph_acquire | ( | struct cam_periph * | periph | ) |
Definition at line 413 of file cam_periph.c.
References CAM_PERIPH_INVALID, cam_periph::flags, cam_periph::refcount, xpt_lock_buses(), and xpt_unlock_buses().
Referenced by adaasync(), adaopen(), adaregister(), aproberegister(), cam_periph_hold(), cdasync(), cdmediapoll(), cdopen(), cdregister(), cdsysctlinit(), chopen(), chregister(), ctlfe_lun_disable(), ctlferegister(), enc_ctor(), enc_kproc_init(), enc_open(), mmcprobe_register(), ndaopen(), ndaregister(), nvme_probe_register(), passasync(), passopen(), passregister(), pmpasync(), pmpregister(), pmpsysctlinit(), proberegister(), ptopen(), saopen(), saregister(), sdda_add_part(), sddaopen(), sgopen(), sgregister(), and targcdevdtor().
|
inlinestatic |
Definition at line 237 of file cam_periph.h.
References CAM_PERIPH_INVALID, cam_periph::flags, cam_periph::refcount, xpt_lock_buses(), and xpt_unlock_buses().
|
inlinestatic |
Definition at line 252 of file cam_periph.h.
References cam_periph_assert, CAM_PERIPH_INVALID, cam_periph_release(), cam_periph::flags, cam_periph::refcount, xpt_lock_buses(), and xpt_unlock_buses().
cam_status cam_periph_alloc | ( | periph_ctor_t * | periph_ctor, |
periph_oninv_t * | periph_oninvalidate, | ||
periph_dtor_t * | periph_dtor, | ||
periph_start_t * | periph_start, | ||
char * | name, | ||
cam_periph_type | type, | ||
struct cam_path * | path, | ||
ac_callback_t * | ac_callback, | ||
ac_code | code, | ||
void * | arg | ||
) |
Definition at line 197 of file cam_periph.c.
References CAM_DEBUG, CAM_DEBUG_INFO, cam_periph_find(), CAM_PERIPH_INVALID, CAM_PERIPH_NEW_DEV_FOUND, CAM_PRIORITY_NONE, CAM_REQ_CMP, CAM_REQ_INPROG, CAM_REQ_INVALID, CAM_RESRC_UNAVAIL, camperiphunit(), cam_periph::deferred_ac, cam_periph::deferred_callback, cam_path::device, cam_periph::flags, cam_periph::immediate_priority, cam_periph::path, periph_drivers, cam_periph::periph_dtor, cam_periph::periph_name, cam_periph::periph_oninval, cam_periph::periph_start, cam_periph::refcount, cam_periph::scheduled_priority, cam_ed::serial_num, cam_periph::sim, cam_periph::type, cam_periph::unit_number, xpt_add_periph(), xpt_create_path(), xpt_free_path(), xpt_lock_buses(), xpt_path_lun_id(), xpt_path_path_id(), xpt_path_sim(), xpt_path_target_id(), xpt_remove_periph(), and xpt_unlock_buses().
Referenced by adaasync(), ata_scan_lun(), cdasync(), chasync(), ctlfe_lun_enable(), ctlfe_online(), daasync(), enc_async(), mmc_scan_lun(), ndaasync(), nvme_scan_lun(), passasync(), pmpasync(), ptasync(), saasync(), scsi_scan_lun(), sddaasync(), sgasync(), targbhasync(), targenable(), and xpt_init().
void cam_periph_async | ( | struct cam_periph * | periph, |
u_int32_t | code, | ||
struct cam_path * | path, | ||
void * | arg | ||
) |
Definition at line 1471 of file cam_periph.c.
References AC_LOST_DEVICE, and cam_periph_invalidate().
Referenced by adaasync(), cdasync(), chasync(), daasync(), enc_async(), ndaasync(), passasync(), pmpasync(), ptasync(), saasync(), sddaasync(), and sgasync().
void cam_periph_bus_settle | ( | struct cam_periph * | periph, |
u_int | bus_settle_ms | ||
) |
Definition at line 1484 of file cam_periph.c.
References cam_periph_freeze_after_event(), CAM_PRIORITY_NORMAL, ccb_getdevstats::ccb_h, ccb_hdr::func_code, ccb_getdevstats::last_reset, cam_periph::path, xpt_action(), XPT_GDEV_STATS, and xpt_setup_ccb().
void cam_periph_doacquire | ( | struct cam_periph * | periph | ) |
Definition at line 432 of file cam_periph.c.
References cam_periph::refcount, xpt_lock_buses(), and xpt_unlock_buses().
Referenced by passclose(), passrejectios(), probestart(), and xpt_run_allocq().
Definition at line 1864 of file cam_periph.c.
References AC_LOST_DEVICE, AC_UNIT_ATTENTION, CAM_ATA_STATUS_ERROR, CAM_AUTOSENSE_FAIL, CAM_BDR_SENT, CAM_BUSY, CAM_CMD_TIMEOUT, CAM_DATA_RUN_ERR, CAM_DEBUG_INFO, CAM_DEBUGGED, CAM_DEV_NOT_THERE, CAM_DEV_QFRZN, CAM_EPF_ALL, cam_error_print(), CAM_ESF_ALL, CAM_FUNC_NOTAVAIL, CAM_LUN_INVALID, CAM_LUN_WILDCARD, CAM_MSG_REJECT_REC, CAM_NO_HBA, CAM_PATH_INVALID, cam_periph_devctl_notify(), CAM_PERIPH_INVALID, CAM_PROVIDE_FAIL, cam_release_devq(), CAM_REQ_ABORTED, CAM_REQ_CMP, CAM_REQ_CMP_ERR, CAM_REQ_INVALID, CAM_REQ_TERMIO, CAM_REQ_TOO_BIG, CAM_REQUEUE_REQ, CAM_RESRC_UNAVAIL, CAM_RETRY_SELTO, CAM_SCSI_BUS_RESET, CAM_SCSI_STATUS_ERROR, CAM_SEL_TIMEOUT, CAM_SMP_STATUS_ERROR, CAM_STATUS_MASK, CAM_TID_INVALID, CAM_UA_ABORT, CAM_UA_TERMIO, CAM_UNCOR_PARITY, CAM_UNEXP_BUSFREE, CAM_UNREC_HBA_ERROR, camperiphscsistatuserror(), ccb, ccb::ccb_h, ccb::crcn, ccb_rescan::flags, cam_periph::flags, ccb_hdr::func_code, ccb_hdr::path, periph_busy_delay, periph_noresrc_delay, periph_selto_delay, RELSIM_RELEASE_AFTER_TIMEOUT, ccb_hdr::retry_count, SF_NO_PRINT, SF_NO_RETRY, SF_PRINT_ALWAYS, SSQ_LOST, SSQ_PRINT_SENSE, SSQ_RESCAN, SSQ_UA, ccb_hdr::status, xpt_action(), xpt_alloc_ccb_nowait(), xpt_async(), xpt_create_path(), xpt_free_path(), xpt_path_lun_id(), xpt_path_path_id(), xpt_path_periph(), xpt_path_target_id(), xpt_print(), xpt_rescan(), and XPT_SCAN_TGT.
Referenced by adaerror(), aprobedone(), camperiphdone(), cderror(), cherror(), dadump(), daerror(), enc_error(), ndadump(), ndaerror(), nvme_probe_done(), passerror(), pmpdone(), probedone(), pterror(), sadone(), saerror(), sddadump(), sddaerror(), and sgerror().
struct cam_periph * cam_periph_find | ( | struct cam_path * | path, |
char * | name | ||
) |
Definition at line 340 of file cam_periph.c.
References cam_periph_assert, cam_periph::path, periph_drivers, xpt_lock_buses(), xpt_path_comp(), and xpt_unlock_buses().
Referenced by ata_scan_lun(), cam_periph_alloc(), ctlfe_lun_enable(), ctlfe_offline(), ctlfe_online(), mmc_scan_lun(), nvme_scan_lun(), scsi_scan_lun(), targbhasync(), and targenable().
void cam_periph_freeze_after_event | ( | struct cam_periph * | periph, |
struct timeval * | event_time, | ||
u_int | duration_ms | ||
) |
Definition at line 1496 of file cam_periph.c.
References cam_freeze_devq(), cam_release_devq(), cam_periph::path, and RELSIM_RELEASE_AFTER_TIMEOUT.
Referenced by cam_periph_bus_settle(), and proberegister().
union ccb * cam_periph_getccb | ( | struct cam_periph * | periph, |
u_int32_t | priority | ||
) |
Definition at line 4695 of file cam_xpt.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_assert, cam_periph_sleep, cam_periph::immediate_priority, cam_periph::path, ccb_hdr::periph_links, ccb_hdr::pinfo, cam_pinfo::priority, and xpt_run_allocq().
Referenced by adaclose(), adaflush(), cam_periph_ioctl(), cdgetmode(), cdpause(), cdplay(), cdplaymsf(), cdplaytracks(), cdprevent(), cdreaddvdstructure(), cdreadsubchannel(), cdreadtoc(), cdreportkey(), cdsendkey(), cdsetmode(), cdsetspeed(), cdstartunit(), cdstopunit(), chexchange(), chgetelemstatus(), chgetparams(), chielem(), chmove(), chposition(), chsetvoltag(), daclose(), daprevent(), dashutdown(), enc_fsm_step(), enc_runcmd(), ndaclose(), ndaflush(), passdoioctl(), saerase(), sagetparams(), sagetpos(), saloadunload(), samount(), saprevent(), sardpos(), sareservereleaseunit(), saretension(), sarewind(), sasetparams(), sasetpos(), sasetprot(), saspace(), sawritefilemarks(), ses_set_timed_completion(), and sgioctl().
int cam_periph_hold | ( | struct cam_periph * | periph, |
int | priority | ||
) |
Definition at line 486 of file cam_periph.c.
References cam_periph_acquire(), cam_periph_assert, CAM_PERIPH_INVALID, CAM_PERIPH_LOCK_WANTED, CAM_PERIPH_LOCKED, cam_periph_release_locked(), cam_periph_sleep, and cam_periph::flags.
Referenced by adaclose(), adaopen(), adaregister(), cdclose(), cdioctl(), cdopen(), cdregister(), chopen(), chregister(), ndaclose(), ndaopen(), ndaregister(), saclose(), saioctl(), saopen(), sdda_add_part(), sdda_start_init(), sdda_start_init_task(), and sddaopen().
void cam_periph_invalidate | ( | struct cam_periph * | periph | ) |
Definition at line 655 of file cam_periph.c.
References CAM_DEBUG, CAM_DEBUG_INFO, CAM_PERIPH_ANNOUNCED, cam_periph_assert, CAM_PERIPH_INVALID, cam_periph_release_locked(), cam_periph::flags, cam_periph::path, cam_periph::periph_oninval, and xpt_denounce_periph_sbuf().
Referenced by aprobedone(), cam_periph_async(), cam_periph_invalidate_sysctl(), cddone(), cdstart(), chdone(), ctlfe_lun_disable(), ctlfe_offline(), dadone_proberc(), mmcprobe_done(), nvme_probe_done(), probedone(), targbhasync(), targbhctor(), targcdevdtor(), and targenable().
int cam_periph_invalidate_sysctl | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 2182 of file cam_periph.c.
References cam_periph_invalidate(), cam_periph_lock, and cam_periph_unlock.
Referenced by adasysctlinit(), dasysctlinit(), and ndasysctlinit().
int cam_periph_ioctl | ( | struct cam_periph * | periph, |
u_long | cmd, | ||
caddr_t | addr, | ||
int(*)(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags) | error_routine | ||
) |
Definition at line 1109 of file cam_periph.c.
References CAM_GDEVLIST_LAST_DEVICE, CAM_GDEVLIST_MORE_DEVS, cam_periph_getccb(), CAM_PRIORITY_NORMAL, CAMGETPASSTHRU, ccb, ccb::ccb_h, ccb::cgdl, ccb_hdr::func_code, ccb_getdevlist::index, ccb_hdr::path, ccb_getdevlist::periph_name, ccb_getdevlist::status, ccb_getdevlist::unit_number, xpt_action(), XPT_GDEVLIST, xpt_release_ccb(), and xpt_setup_ccb().
Referenced by cdioctl(), chioctl(), enc_ioctl(), passdoioctl(), ptioctl(), and saioctl().
int cam_periph_list | ( | struct cam_path * | path, |
struct sbuf * | sb | ||
) |
Definition at line 370 of file cam_periph.c.
References cam_periph::path, periph_drivers, cam_periph::periph_name, cam_periph::unit_number, xpt_lock_buses(), xpt_path_comp(), and xpt_unlock_buses().
Referenced by ses_elmdevname_callback().
int cam_periph_mapmem | ( | union ccb * | ccb, |
struct cam_periph_map_info * | mapinfo, | ||
u_int | maxmap | ||
) |
Definition at line 793 of file cam_periph.c.
References ccb::ataio, cam_periph_map_info::bp, ccb_dev_advinfo::buf, ccb_dev_advinfo::bufsiz, CAM_DATA_MASK, CAM_DATA_VADDR, CAM_DIR_IN, CAM_DIR_MASK, CAM_DIR_NONE, CAM_DIR_OUT, CAM_PERIPH_MAXMAPS, ccb::ccb_h, ccb::cdai, ccb::cdm, ccb_mmcio::cmd, ccb::csio, ccb_scsiio::data_ptr, ccb_ataio::data_ptr, ccb_nvmeio::data_ptr, ccb_scsiio::dxfer_len, ccb_ataio::dxfer_len, ccb_nvmeio::dxfer_len, ccb_hdr::flags, ccb_hdr::func_code, ccb_dev_match::match_buf_len, ccb_dev_match::matches, ccb::mmcio, cam_periph_map_info::num_bufs_used, ccb::nvmeio, cam_periph_map_info::orig, ccb_dev_match::pattern_buf_len, ccb_dev_match::patterns, periph_mapmem_thresh, ccb_smpio::smp_request, ccb_smpio::smp_request_len, ccb_smpio::smp_response, ccb_smpio::smp_response_len, ccb::smpio, XPT_ATA_IO, XPT_CONT_TARGET_IO, XPT_DEV_ADVINFO, XPT_DEV_MATCH, XPT_MMC_IO, XPT_NVME_ADMIN, XPT_NVME_IO, XPT_SCSI_IO, and XPT_SMP_IO.
Referenced by cam_compat_handle_0x19(), cam_compat_translate_dev_match_0x18(), ndaioctl(), passsendccb(), sgsendccb(), targsendccb(), and xptdoioctl().
|
static |
Definition at line 213 of file cam_periph.h.
References cam_periph::path, and xpt_path_mtx().
Referenced by adaregister(), cam_iosched_init(), cam_periph_release(), cdcheckmedia(), cdregister(), chclose(), chdevgonecb(), ctlfe_requeue_ccb(), ctlfedone(), daregister(), enc_close(), enc_devgonecb(), enc_kproc_init(), pass_add_physpath(), passclose(), passcreatezone(), passdevgonecb(), passregister(), sadevgonecb(), sgclose(), and sgdevgonecb().
void cam_periph_release | ( | struct cam_periph * | periph | ) |
Definition at line 465 of file cam_periph.c.
References cam_periph_assert, cam_periph_mtx(), and cam_periph_release_locked().
Referenced by adaclose(), adadiskgonecb(), adaopen(), adasysctlinit(), cam_periph_acquire_next(), cdclose(), cddiskgonecb(), cdioctl(), cdsysctlinit(), chopen(), ctlfe_drain(), ctlfe_lun_disable(), enc_daemon(), enc_kproc_init(), ndaclose(), ndadiskgonecb(), ndaopen(), ndasysctlinit(), pass_shutdown_kqueue(), pmpsysctlinit(), ptopen(), saclose(), saopen(), sasysctlinit(), sdda_start_init(), sddaclose(), sddadiskgonecb(), sddaopen(), sgopen(), targcdevdtor(), xpt_run_allocq_task(), and xptpdperiphtraverse().
void cam_periph_release_locked | ( | struct cam_periph * | periph | ) |
Definition at line 453 of file cam_periph.c.
References cam_periph_release_locked_buses(), xpt_lock_buses(), and xpt_unlock_buses().
Referenced by adaprobedone(), aprobedone(), cam_periph_hold(), cam_periph_invalidate(), cam_periph_release(), cam_periph_unhold(), cdclose(), cddone(), cdopen(), cdstart(), chclose(), chdevgonecb(), chopen(), chregister(), ctlfe_free_ccb(), enc_close(), enc_ctor(), enc_devgonecb(), enc_open(), mmcprobe_done(), nvme_probe_done(), pass_add_physpath(), passclose(), passdevgonecb(), passdone(), passopen(), passregister(), pmpdone(), probedone(), ptclose(), ptopen(), sadevgonecb(), sadone(), sastart(), sgclose(), sgdevgonecb(), sgopen(), sgregister(), xpt_run_allocq(), and xptperiphtraverse().
void cam_periph_release_locked_buses | ( | struct cam_periph * | periph | ) |
Definition at line 443 of file cam_periph.c.
References cam_periph_assert, camperiphfree(), and cam_periph::refcount.
Referenced by cam_periph_release_locked().
int cam_periph_runccb | ( | union ccb * | ccb, |
int(*)(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags) | error_routine, | ||
cam_flags | camflags, | ||
u_int32_t | sense_flags, | ||
struct devstat * | ds | ||
) |
Definition at line 1207 of file cam_periph.c.
References ccb::ataio, cam_path::bus, CAM_DEV_QFRZN, CAM_DIR_MASK, CAM_DIR_NONE, CAM_DIR_OUT, cam_periph_ccbwait(), cam_periph_done(), cam_release_devq(), CAM_REQ_CMP, CAM_RESRC_UNAVAIL, cam_sim_pollable(), CAM_STATUS_MASK, CAM_UNLOCKED, ccb_hdr::cbfcnp, ccb, ccb::ccb_h, ccb::csio, ccb_scsiio::dxfer_len, ccb_ataio::dxfer_len, ccb_nvmeio::dxfer_len, ccb_hdr::flags, ccb_hdr::func_code, ccb::nvmeio, ccb_hdr::path, ccb_scsiio::resid, ccb_ataio::resid, cam_eb::sim, ccb_hdr::status, ccb_scsiio::tag_action, ccb_hdr::timeout, xpt_action(), XPT_ATA_IO, XPT_NVME_IO, xpt_path_assert, xpt_poll_setup(), xpt_pollwait(), and XPT_SCSI_IO.
Referenced by adaclose(), adadump(), adaflush(), adaspindown(), cdrunccb(), chexchange(), chgetelemstatus(), chgetparams(), chielem(), chmove(), chposition(), chsetvoltag(), daclose(), dadump(), daprevent(), dashutdown(), enc_fsm_step(), enc_runcmd(), mmc_exec_app_cmd(), mmc_sd_switch(), mmc_select_card(), mmc_send_ext_csd(), mmc_switch(), ndaclose(), ndadump(), ndaflush(), ndaioctl(), passsendccb(), saerase(), sagetparams(), sagetpos(), saloadunload(), samount(), saprevent(), sardpos(), sareservereleaseunit(), saretension(), sarewind(), sasetparams(), sasetpos(), sasetprot(), saspace(), sawritefilemarks(), sddadump(), ses_set_timed_completion(), sgsendccb(), and xptdoioctl().
void cam_periph_unhold | ( | struct cam_periph * | periph | ) |
Definition at line 519 of file cam_periph.c.
References cam_periph_assert, CAM_PERIPH_LOCK_WANTED, cam_periph_release_locked(), and cam_periph::flags.
Referenced by adaclose(), adaopen(), adaprobedone(), cdclose(), cddone(), cdioctl(), cdopen(), chdone(), chopen(), ndaclose(), ndaopen(), ndaregister(), saclose(), saioctl(), saopen(), sdda_add_part(), sdda_start_init(), sdda_start_init_task(), and sddaopen().
void cam_periph_unmapmem | ( | union ccb * | ccb, |
struct cam_periph_map_info * | mapinfo | ||
) |
Definition at line 1005 of file cam_periph.c.
References ccb::ataio, cam_periph_map_info::bp, ccb_dev_advinfo::buf, ccb_dev_advinfo::bufsiz, CAM_DIR_IN, CAM_DIR_MASK, CAM_DIR_OUT, CAM_PERIPH_MAXMAPS, ccb::ccb_h, ccb::cdai, ccb::cdm, ccb_mmcio::cmd, ccb::csio, ccb_scsiio::data_ptr, ccb_ataio::data_ptr, ccb_nvmeio::data_ptr, ccb_scsiio::dxfer_len, ccb_ataio::dxfer_len, ccb_nvmeio::dxfer_len, ccb_hdr::flags, ccb_hdr::func_code, ccb_dev_match::match_buf_len, ccb_dev_match::matches, ccb::mmcio, cam_periph_map_info::num_bufs_used, ccb::nvmeio, cam_periph_map_info::orig, ccb_dev_match::pattern_buf_len, ccb_dev_match::patterns, ccb_smpio::smp_request, ccb_smpio::smp_request_len, ccb_smpio::smp_response, ccb_smpio::smp_response_len, ccb::smpio, XPT_ATA_IO, XPT_CONT_TARGET_IO, XPT_DEV_ADVINFO, XPT_DEV_MATCH, XPT_MMC_IO, XPT_NVME_ADMIN, XPT_NVME_IO, XPT_SCSI_IO, and XPT_SMP_IO.
Referenced by cam_compat_handle_0x19(), cam_compat_translate_dev_match_0x18(), ndaioctl(), passsendccb(), sgsendccb(), targreturnccb(), and xptdoioctl().
u_int32_t cam_release_devq | ( | struct cam_path * | path, |
u_int32_t | relsim_flags, | ||
u_int32_t | opening_reduction, | ||
u_int32_t | arg, | ||
int | getcount_only | ||
) |
Definition at line 1342 of file cam_periph.c.
References CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DEV_QFREEZE, CAM_PRIORITY_NORMAL, ccb_relsim::ccb_h, ccb_hdr::flags, ccb_hdr::func_code, ccb_relsim::openings, ccb_relsim::qfrozen_cnt, ccb_relsim::release_flags, ccb_relsim::release_timeout, xpt_action(), XPT_REL_SIMQ, and xpt_setup_ccb().
Referenced by adadone(), adaresume(), aprobedone(), cam_periph_error(), cam_periph_freeze_after_event(), cam_periph_runccb(), camperiphdone(), cd6byteworkaround(), cddone(), chdone(), cmd6workaround(), ctlfedone(), ctlferegister(), dadone(), dadone_probeata(), dadone_probeataiddir(), dadone_probeatalogdir(), dadone_probeatasup(), dadone_probeatazone(), dadone_probebdc(), dadone_probeblklimits(), dadone_probelbp(), dadone_proberc(), dadone_probewp(), dadone_probezone(), dadone_tur(), dasetgeom(), mmcprobe_done(), ndadone(), nvme_probe_done(), pmpdone(), pmprelease(), probedone(), ptdone(), sadone(), saregister(), scsi_dev_async(), sddadone(), ses_set_physpath(), ses_setphyspath_callback(), targbhdone(), targbhstart(), and xpt_getattr().
void periphdriver_init | ( | int | level | ) |
Definition at line 184 of file cam_periph.c.
References CAM_PERIPH_DRV_EARLY, periph_driver::flags, periph_driver::init, initialized, and periph_drivers.
Referenced by xpt_config(), and xpt_finishconfig_task().
void periphdriver_register | ( | void * | data | ) |
Definition at line 115 of file cam_periph.c.
References CAM_PERIPH_DRV_EARLY, periph_driver::flags, periph_driver::init, initialized, nperiph_drivers, periph_drivers, xpt_lock_buses(), and xpt_unlock_buses().
Referenced by ctlfeinitialize().
int periphdriver_unregister | ( | void * | data | ) |
Definition at line 152 of file cam_periph.c.
References CAM_PERIPH_DRV_EARLY, periph_driver::deinit, periph_driver::driver_name, periph_driver::flags, initialized, nperiph_drivers, periph_drivers, xpt_lock_buses(), and xpt_unlock_buses().
Referenced by ctlfeshutdown().
|
extern |
Definition at line 99 of file cam_periph.c.
Referenced by cam_periph_alloc(), cam_periph_find(), cam_periph_list(), camperiphfree(), periphdriver_init(), periphdriver_register(), periphdriver_unregister(), xptdoioctl(), xptpdrvtraverse(), and xptplistperiphfunc().
|
extern |
Definition at line 188 of file cam_xpt.c.
Referenced by xpt_async_process(), xptdoioctl(), and xptregister().