FreeBSD kernel CAM code
cam_xpt.c File Reference
#include "opt_printf.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/bio.h>
#include <sys/bus.h>
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/time.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/proc.h>
#include <sys/sbuf.h>
#include <sys/smp.h>
#include <sys/taskqueue.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <sys/kthread.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_iosched.h>
#include <cam/cam_periph.h>
#include <cam/cam_queue.h>
#include <cam/cam_sim.h>
#include <cam/cam_xpt.h>
#include <cam/cam_xpt_sim.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_xpt_internal.h>
#include <cam/cam_debug.h>
#include <cam/cam_compat.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>
#include <machine/stdarg.h>
#include "opt_cam.h"
Include dependency graph for cam_xpt.c:

Go to the source code of this file.

Data Structures

struct  xpt_softc
 
struct  xpt_traverse_config
 
struct  cam_doneq
 
struct  kv
 

Macros

#define XPT_PRINT_MAXLEN   512
 
#define XPT_PRINT_LEN   128
 
#define CAM_MAX_HIGHPOWER   4
 

Typedefs

typedef int xpt_busfunc_t(struct cam_eb *bus, void *arg)
 
typedef int xpt_targetfunc_t(struct cam_et *target, void *arg)
 
typedef int xpt_devicefunc_t(struct cam_ed *device, void *arg)
 
typedef int xpt_periphfunc_t(struct cam_periph *periph, void *arg)
 
typedef int xpt_pdrvfunc_t(struct periph_driver **pdrv, void *arg)
 

Enumerations

enum  dev_match_ret {
  DM_RET_COPY = 0x01 , DM_RET_FLAG_MASK = 0x0f , DM_RET_NONE = 0x00 , DM_RET_STOP = 0x10 ,
  DM_RET_DESCEND = 0x20 , DM_RET_ERROR = 0x30 , DM_RET_ACTION_MASK = 0xf0
}
 
enum  xpt_traverse_depth { XPT_DEPTH_BUS , XPT_DEPTH_TARGET , XPT_DEPTH_DEVICE , XPT_DEPTH_PERIPH }
 

Functions

 __FBSDID ("$FreeBSD$")
 
 _Static_assert (XPT_PRINT_LEN<=XPT_PRINT_MAXLEN, "XPT_PRINT_LEN is too large")
 
 MALLOC_DEFINE (M_CAMXPT, "CAM XPT", "CAM XPT buffers")
 
 MALLOC_DEFINE (M_CAMDEV, "CAM DEV", "CAM devices")
 
 MALLOC_DEFINE (M_CAMCCB, "CAM CCB", "CAM CCBs")
 
 MALLOC_DEFINE (M_CAMPATH, "CAM path", "CAM paths")
 
 MTX_SYSINIT (xpt_topo_init, &xsoftc.xpt_topo_lock, "XPT topology lock", MTX_DEF)
 
 SYSCTL_INT (_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time")
 
 SYSCTL_UINT (_kern_cam, OID_AUTO, xpt_generation, CTLFLAG_RD, &xsoftc.xpt_generation, 0, "CAM peripheral generation count")
 
 SYSCTL_INT (_kern_cam, OID_AUTO, announce_nosbuf, CTLFLAG_RWTUN, &xsoftc.announce_nosbuf, 0, "Don't use sbuf for announcements")
 
 SYSCTL_INT (_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN, &cam_num_doneqs, 0, "Number of completion queues/threads")
 
 PERIPHDRIVER_DECLARE (xpt, xpt_driver)
 
 SYSCTL_UINT (_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN, &cam_dflags, 0, "Enabled debug flags")
 
 SYSCTL_UINT (_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RWTUN, &cam_debug_delay, 0, "Delay in us after each debug message")
 
static int cam_module_event_handler (module_t, int, void *)
 
static int xpt_init (void *)
 
 DECLARE_MODULE (cam, cam_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND)
 
 MODULE_VERSION (cam, 1)
 
static void xpt_async_bcast (struct async_list *async_head, u_int32_t async_code, struct cam_path *path, void *async_arg)
 
static path_id_t xptnextfreepathid (void)
 
static path_id_t xptpathid (const char *sim_name, int sim_unit, int sim_bus)
 
static union ccbxpt_get_ccb (struct cam_periph *periph)
 
static union ccbxpt_get_ccb_nowait (struct cam_periph *periph)
 
static void xpt_run_allocq (struct cam_periph *periph, int sleep)
 
static void xpt_run_allocq_task (void *context, int pending)
 
static void xpt_run_devq (struct cam_devq *devq)
 
static void xpt_acquire_bus (struct cam_eb *bus)
 
static void xpt_release_bus (struct cam_eb *bus)
 
static uint32_t xpt_freeze_devq_device (struct cam_ed *dev, u_int count)
 
static int xpt_release_devq_device (struct cam_ed *dev, u_int count, int run_queue)
 
static struct cam_etxpt_alloc_target (struct cam_eb *bus, target_id_t target_id)
 
static void xpt_acquire_target (struct cam_et *target)
 
static void xpt_release_target (struct cam_et *target)
 
static struct cam_ebxpt_find_bus (path_id_t path_id)
 
static struct cam_etxpt_find_target (struct cam_eb *bus, target_id_t target_id)
 
static struct cam_edxpt_find_device (struct cam_et *target, lun_id_t lun_id)
 
static void xpt_config (void *arg)
 
static void xpt_hold_boot_locked (void)
 
static int xpt_schedule_dev (struct camq *queue, cam_pinfo *dev_pinfo, u_int32_t new_priority)
 
static void xptaction (struct cam_sim *sim, union ccb *work_ccb)
 
static void xptpoll (struct cam_sim *sim)
 
static void camisr_runqueue (void)
 
static void xpt_done_process (struct ccb_hdr *ccb_h)
 
static void xpt_done_td (void *)
 
static void xpt_async_td (void *)
 
static dev_match_ret xptbusmatch (struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus)
 
static dev_match_ret xptdevicematch (struct dev_match_pattern *patterns, u_int num_patterns, struct cam_ed *device)
 
static dev_match_ret xptperiphmatch (struct dev_match_pattern *patterns, u_int num_patterns, struct cam_periph *periph)
 
static int xptedtmatch (struct ccb_dev_match *cdm)
 
static int xptperiphlistmatch (struct ccb_dev_match *cdm)
 
static int xptbustraverse (struct cam_eb *start_bus, xpt_busfunc_t *tr_func, void *arg)
 
static int xpttargettraverse (struct cam_eb *bus, struct cam_et *start_target, xpt_targetfunc_t *tr_func, void *arg)
 
static int xptdevicetraverse (struct cam_et *target, struct cam_ed *start_device, xpt_devicefunc_t *tr_func, void *arg)
 
static int xptperiphtraverse (struct cam_ed *device, struct cam_periph *start_periph, xpt_periphfunc_t *tr_func, void *arg)
 
static int xptpdrvtraverse (struct periph_driver **start_pdrv, xpt_pdrvfunc_t *tr_func, void *arg)
 
static int xptpdperiphtraverse (struct periph_driver **pdrv, struct cam_periph *start_periph, xpt_periphfunc_t *tr_func, void *arg)
 
static void xpt_finishconfig_task (void *context, int pending)
 
static void xpt_dev_async_default (u_int32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, void *async_arg)
 
static struct cam_edxpt_alloc_device_default (struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
 
static cam_status xptregister (struct cam_periph *periph, void *arg)
 
static __inline int xpt_schedule_devq (struct cam_devq *devq, struct cam_ed *dev)
 
static __inline int device_is_queued (struct cam_ed *device)
 
static int xptopen (struct cdev *dev, int flags, int fmt, struct thread *td)
 
static int xptclose (struct cdev *dev, int flag, int fmt, struct thread *td)
 
static int xptioctl (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
 
static int xptdoioctl (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
 
static struct xpt_protoxpt_proto_find (cam_proto proto)
 
static void xpt_rescan_done (struct cam_periph *periph, union ccb *done_ccb)
 
static void xpt_scanner_thread (void *dummy)
 
void xpt_rescan (union ccb *ccb)
 
int32_t xpt_add_periph (struct cam_periph *periph)
 
void xpt_remove_periph (struct cam_periph *periph)
 
void xpt_announce_periph (struct cam_periph *periph, char *announce_string)
 
void xpt_announce_periph_sbuf (struct cam_periph *periph, struct sbuf *sb, char *announce_string)
 
void xpt_announce_quirks (struct cam_periph *periph, int quirks, char *bit_string)
 
void xpt_announce_quirks_sbuf (struct cam_periph *periph, struct sbuf *sb, int quirks, char *bit_string)
 
void xpt_denounce_periph (struct cam_periph *periph)
 
void xpt_denounce_periph_sbuf (struct cam_periph *periph, struct sbuf *sb)
 
int xpt_getattr (char *buf, size_t len, const char *attr, struct cam_path *path)
 
static int xptedtbusfunc (struct cam_eb *bus, void *arg)
 
static int xptedttargetfunc (struct cam_et *target, void *arg)
 
static int xptedtdevicefunc (struct cam_ed *device, void *arg)
 
static int xptedtperiphfunc (struct cam_periph *periph, void *arg)
 
static int xptplistpdrvfunc (struct periph_driver **pdrv, void *arg)
 
static int xptplistperiphfunc (struct cam_periph *periph, void *arg)
 
static int xptdefbusfunc (struct cam_eb *bus, void *arg)
 
static int xptdeftargetfunc (struct cam_et *target, void *arg)
 
static int xptdefdevicefunc (struct cam_ed *device, void *arg)
 
static int xptdefperiphfunc (struct cam_periph *periph, void *arg)
 
static int xpt_for_all_busses (xpt_busfunc_t *tr_func, void *arg)
 
static int xpt_for_all_devices (xpt_devicefunc_t *tr_func, void *arg)
 
static int xptsetasyncfunc (struct cam_ed *device, void *arg)
 
static int xptsetasyncbusfunc (struct cam_eb *bus, void *arg)
 
void xpt_action (union ccb *start_ccb)
 
void xpt_action_default (union ccb *start_ccb)
 
void xpt_sim_poll (struct cam_sim *sim)
 
uint32_t xpt_poll_setup (union ccb *start_ccb)
 
void xpt_pollwait (union ccb *start_ccb, uint32_t timeout)
 
void xpt_schedule (struct cam_periph *periph, u_int32_t new_priority)
 
void xpt_merge_ccb (union ccb *dst_ccb, union ccb *src_ccb)
 
void xpt_setup_ccb_flags (struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority, u_int32_t flags)
 
void xpt_setup_ccb (struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority)
 
cam_status xpt_create_path (struct cam_path **new_path_ptr, struct cam_periph *perph, path_id_t path_id, target_id_t target_id, lun_id_t lun_id)
 
cam_status xpt_create_path_unlocked (struct cam_path **new_path_ptr, struct cam_periph *periph, path_id_t path_id, target_id_t target_id, lun_id_t lun_id)
 
cam_status xpt_compile_path (struct cam_path *new_path, struct cam_periph *perph, path_id_t path_id, target_id_t target_id, lun_id_t lun_id)
 
int xpt_clone_path (struct cam_path **new_path_ptr, struct cam_path *path)
 
void xpt_release_path (struct cam_path *path)
 
void xpt_free_path (struct cam_path *path)
 
void xpt_path_counts (struct cam_path *path, uint32_t *bus_ref, uint32_t *periph_ref, uint32_t *target_ref, uint32_t *device_ref)
 
int xpt_path_comp (struct cam_path *path1, struct cam_path *path2)
 
int xpt_path_comp_dev (struct cam_path *path, struct cam_ed *dev)
 
void xpt_print_path (struct cam_path *path)
 
void xpt_print_device (struct cam_ed *device)
 
void xpt_print (struct cam_path *path, const char *fmt,...)
 
int xpt_path_string (struct cam_path *path, char *str, size_t str_len)
 
int xpt_path_sbuf (struct cam_path *path, struct sbuf *sb)
 
path_id_t xpt_path_path_id (struct cam_path *path)
 
target_id_t xpt_path_target_id (struct cam_path *path)
 
lun_id_t xpt_path_lun_id (struct cam_path *path)
 
struct cam_simxpt_path_sim (struct cam_path *path)
 
struct cam_periphxpt_path_periph (struct cam_path *path)
 
void xpt_release_ccb (union ccb *free_ccb)
 
 CAM_XPT_XPORT (xport_default)
 
int xpt_bus_register (struct cam_sim *sim, device_t parent, uint32_t bus)
 
int xpt_bus_deregister (path_id_t pathid)
 
static const char * xpt_async_string (u_int32_t async_code)
 
static int xpt_async_size (u_int32_t async_code)
 
static int xpt_async_process_dev (struct cam_ed *device, void *arg)
 
static int xpt_async_process_tgt (struct cam_et *target, void *arg)
 
static void xpt_async_process (struct cam_periph *periph, union ccb *ccb)
 
void xpt_async (u_int32_t async_code, struct cam_path *path, void *async_arg)
 
u_int32_t xpt_freeze_devq (struct cam_path *path, u_int count)
 
u_int32_t xpt_freeze_simq (struct cam_sim *sim, u_int count)
 
static void xpt_release_devq_timeout (void *arg)
 
void xpt_release_devq (struct cam_path *path, u_int count, int run_queue)
 
void xpt_release_simq (struct cam_sim *sim, int run_queue)
 
void xpt_done (union ccb *done_ccb)
 
void xpt_done_direct (union ccb *done_ccb)
 
union ccbxpt_alloc_ccb (void)
 
union ccbxpt_alloc_ccb_nowait (void)
 
void xpt_free_ccb (union ccb *free_ccb)
 
union ccbcam_periph_getccb (struct cam_periph *periph, u_int32_t priority)
 
static void xpt_destroy_device (void *context, int pending)
 
struct cam_edxpt_alloc_device (struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
 
void xpt_acquire_device (struct cam_ed *device)
 
void xpt_release_device (struct cam_ed *device)
 
u_int32_t xpt_dev_ccbq_resize (struct cam_path *path, int newopenings)
 
void xpt_start_tags (struct cam_path *path)
 
void xpt_stop_tags (struct cam_path *path)
 
static void xpt_boot_delay (void *arg)
 
static void xpt_ch_done (void *arg)
 
 SYSINIT (xpt_hw_delay, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, xpt_ch_done, NULL)
 
void xpt_hold_boot (void)
 
void xpt_release_boot (void)
 
static int xptpassannouncefunc (struct cam_ed *device, void *arg)
 
cam_status xpt_register_async (int event, ac_callback_t *cbfunc, void *cbarg, struct cam_path *path)
 
void xpt_lock_buses (void)
 
void xpt_unlock_buses (void)
 
struct mtx * xpt_path_mtx (struct cam_path *path)
 
device_t xpt_path_sim_device (const struct cam_path *path)
 Return the device_t associated with the path. More...
 
const char * xpt_action_name (uint32_t action)
 

Variables

static struct xpt_softc xsoftc
 
static struct cam_doneq cam_doneqs [MAXCPU]
 
static u_int __read_mostly cam_num_doneqs
 
static struct proc * cam_proc
 
static struct cam_doneq cam_async
 
struct cam_periphxpt_periph
 
static periph_init_t xpt_periph_init
 
static struct periph_driver xpt_driver
 
static d_open_t xptopen
 
static d_close_t xptclose
 
static d_ioctl_t xptioctl
 
static d_ioctl_t xptdoioctl
 
static struct cdevsw xpt_cdevsw
 
struct cam_pathcam_dpath
 
u_int32_t __read_mostly cam_dflags = CAM_DEBUG_FLAGS
 
u_int32_t cam_debug_delay = CAM_DEBUG_DELAY
 
static moduledata_t cam_moduledata
 
static callout_func_t xpt_release_devq_timeout
 
static xpt_devicefunc_t xptpassannouncefunc
 
static xpt_busfunc_t xptedtbusfunc
 
static xpt_targetfunc_t xptedttargetfunc
 
static xpt_devicefunc_t xptedtdevicefunc
 
static xpt_periphfunc_t xptedtperiphfunc
 
static xpt_pdrvfunc_t xptplistpdrvfunc
 
static xpt_periphfunc_t xptplistperiphfunc
 
static xpt_busfunc_t xptdefbusfunc
 
static xpt_targetfunc_t xptdeftargetfunc
 
static xpt_devicefunc_t xptdefdevicefunc
 
static xpt_periphfunc_t xptdefperiphfunc
 
static xpt_devicefunc_t xptsetasyncfunc
 
static xpt_busfunc_t xptsetasyncbusfunc
 
static struct xpt_xport_ops xport_default_ops
 
static struct xpt_xport xport_default
 
static struct kv map []
 

Macro Definition Documentation

◆ CAM_MAX_HIGHPOWER

#define CAM_MAX_HIGHPOWER   4

Definition at line 92 of file cam_xpt.c.

◆ XPT_PRINT_LEN

#define XPT_PRINT_LEN   128

Definition at line 83 of file cam_xpt.c.

◆ XPT_PRINT_MAXLEN

#define XPT_PRINT_MAXLEN   512

Definition at line 79 of file cam_xpt.c.

Typedef Documentation

◆ xpt_busfunc_t

typedef int xpt_busfunc_t(struct cam_eb *bus, void *arg)

Definition at line 156 of file cam_xpt.c.

◆ xpt_devicefunc_t

typedef int xpt_devicefunc_t(struct cam_ed *device, void *arg)

Definition at line 158 of file cam_xpt.c.

◆ xpt_pdrvfunc_t

typedef int xpt_pdrvfunc_t(struct periph_driver **pdrv, void *arg)

Definition at line 160 of file cam_xpt.c.

◆ xpt_periphfunc_t

typedef int xpt_periphfunc_t(struct cam_periph *periph, void *arg)

Definition at line 159 of file cam_xpt.c.

◆ xpt_targetfunc_t

typedef int xpt_targetfunc_t(struct cam_et *target, void *arg)

Definition at line 157 of file cam_xpt.c.

Enumeration Type Documentation

◆ dev_match_ret

Enumerator
DM_RET_COPY 
DM_RET_FLAG_MASK 
DM_RET_NONE 
DM_RET_STOP 
DM_RET_DESCEND 
DM_RET_ERROR 
DM_RET_ACTION_MASK 

Definition at line 133 of file cam_xpt.c.

◆ xpt_traverse_depth

Enumerator
XPT_DEPTH_BUS 
XPT_DEPTH_TARGET 
XPT_DEPTH_DEVICE 
XPT_DEPTH_PERIPH 

Definition at line 143 of file cam_xpt.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ _Static_assert()

_Static_assert ( XPT_PRINT_LEN<=  XPT_PRINT_MAXLEN,
"XPT_PRINT_LEN is too large"   
)

◆ cam_module_event_handler()

static int cam_module_event_handler ( module_t  mod,
int  what,
void *  arg 
)
static

Definition at line 754 of file cam_xpt.c.

References xpt_init().

Here is the call graph for this function:

◆ cam_periph_getccb()

◆ CAM_XPT_XPORT()

CAM_XPT_XPORT ( xport_default  )

◆ camisr_runqueue()

static void camisr_runqueue ( void  )
static

Definition at line 5520 of file cam_xpt.c.

References cam_doneq::cam_doneq_mtx, cam_doneqs, cam_num_doneqs, and xpt_done_process().

Referenced by xpt_sim_poll().

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

◆ DECLARE_MODULE()

DECLARE_MODULE ( cam  ,
cam_moduledata  ,
SI_SUB_CONFIGURE  ,
SI_ORDER_SECOND   
)

◆ device_is_queued()

static __inline int device_is_queued ( struct cam_ed device)
static

Definition at line 352 of file cam_xpt.c.

References CAM_UNQUEUED_INDEX, cam_ed::devq_entry, and cam_pinfo::index.

Referenced by xpt_done_process(), and xpt_freeze_devq_device().

Here is the caller graph for this function:

◆ MALLOC_DEFINE() [1/4]

MALLOC_DEFINE ( M_CAMCCB  ,
"CAM CCB"  ,
"CAM CCBs"   
)

◆ MALLOC_DEFINE() [2/4]

MALLOC_DEFINE ( M_CAMDEV  ,
"CAM DEV"  ,
"CAM devices"   
)

◆ MALLOC_DEFINE() [3/4]

MALLOC_DEFINE ( M_CAMPATH  ,
"CAM path"  ,
"CAM paths"   
)

◆ MALLOC_DEFINE() [4/4]

MALLOC_DEFINE ( M_CAMXPT  ,
"CAM XPT"  ,
"CAM XPT buffers"   
)

◆ MODULE_VERSION()

MODULE_VERSION ( cam  ,
 
)

◆ MTX_SYSINIT()

MTX_SYSINIT ( xpt_topo_init  ,
&xsoftc.  xpt_topo_lock,
"XPT topology lock"  ,
MTX_DEF   
)

◆ PERIPHDRIVER_DECLARE()

PERIPHDRIVER_DECLARE ( xpt  ,
xpt_driver   
)

◆ SYSCTL_INT() [1/3]

SYSCTL_INT ( _kern_cam  ,
OID_AUTO  ,
announce_nosbuf  ,
CTLFLAG_RWTUN  ,
&xsoftc.  announce_nosbuf,
,
"Don't use sbuf for announcements"   
)

◆ SYSCTL_INT() [2/3]

SYSCTL_INT ( _kern_cam  ,
OID_AUTO  ,
boot_delay  ,
CTLFLAG_RDTUN  ,
&xsoftc.  boot_delay,
,
"Bus registration wait time"   
)

◆ SYSCTL_INT() [3/3]

SYSCTL_INT ( _kern_cam  ,
OID_AUTO  ,
num_doneqs  ,
CTLFLAG_RDTUN  ,
cam_num_doneqs,
,
"Number of completion queues/threads"   
)

◆ SYSCTL_UINT() [1/3]

SYSCTL_UINT ( _kern_cam  ,
OID_AUTO  ,
debug_delay  ,
CTLFLAG_RWTUN  ,
cam_debug_delay,
,
"Delay in us after each debug message"   
)

◆ SYSCTL_UINT() [2/3]

SYSCTL_UINT ( _kern_cam  ,
OID_AUTO  ,
dflags  ,
CTLFLAG_RWTUN  ,
cam_dflags,
,
"Enabled debug flags"   
)

◆ SYSCTL_UINT() [3/3]

SYSCTL_UINT ( _kern_cam  ,
OID_AUTO  ,
xpt_generation  ,
CTLFLAG_RD  ,
&xsoftc.  xpt_generation,
,
"CAM peripheral generation count"   
)

◆ SYSINIT()

SYSINIT ( xpt_hw_delay  ,
SI_SUB_INT_CONFIG_HOOKS  ,
SI_ORDER_ANY  ,
xpt_ch_done  ,
NULL   
)

◆ xpt_acquire_bus()

static void xpt_acquire_bus ( struct cam_eb bus)
static

Definition at line 4715 of file cam_xpt.c.

References cam_eb::refcount, xpt_lock_buses(), and xpt_unlock_buses().

Referenced by xpt_clone_path().

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

◆ xpt_acquire_device()

void xpt_acquire_device ( struct cam_ed device)

◆ xpt_acquire_target()

static void xpt_acquire_target ( struct cam_et target)
static

Definition at line 4783 of file cam_xpt.c.

References cam_et::bus, cam_eb::eb_mtx, and cam_et::refcount.

Referenced by xpt_clone_path().

Here is the caller graph for this function:

◆ xpt_action()

void xpt_action ( union ccb start_ccb)

Definition at line 2601 of file cam_xpt.c.

References xpt_xport_ops::action, cam_path::bus, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_REQ_INPROG, ccb::ccb_h, ccb_hdr::func_code, xpt_xport::ops, ccb_hdr::path, ccb_hdr::status, cam_eb::xport, and xpt_action_name().

Referenced by _ata_announce_periph(), _scsi_announce_periph(), abort_all_pending(), adaasync(), adastart(), aprobedone(), aproberequestdefaultnegotiation(), aprobestart(), ata_device_transport(), ata_scan_bus(), cam_freeze_devq(), cam_periph_bus_settle(), cam_periph_devctl_notify(), cam_periph_error(), cam_periph_ioctl(), cam_periph_runccb(), cam_release_devq(), camperiphdone(), camperiphfree(), camperiphscsisenseerror(), camperiphscsistatuserror(), cd6byteworkaround(), cddone(), cdstart(), chdone(), chscsiversion(), chstart(), cmd6workaround(), ctlfe_done(), ctlfe_dump_queue(), ctlfe_onoffline(), ctlfe_requeue_ccb(), ctlfedone(), ctlfeoninvalidate(), ctlferegister(), ctlfestart(), dadone_proberc(), dasetgeom(), dastart(), dasysctlinit(), mmc_announce_periph(), mmc_set_timing(), mmcprobe_done(), mmcprobe_start(), ndastart(), nvme_announce_periph(), nvme_device_transport(), nvme_probe_done(), nvme_probe_start(), passdoioctl(), passstart(), pmpdone(), pmpstart(), probedone(), proberequestbackoff(), proberequestdefaultnegotiation(), probestart(), ptstart(), saextget(), saregister(), sastart(), scsi_command_string(), scsi_devise_transport(), scsi_scan_bus(), scsi_scan_lun(), scsi_sense_sbuf(), scsi_set_transfer_settings(), sdda_add_part(), sdda_get_host_caps(), sdda_get_max_data(), sdda_init_switch_part(), sdda_set_bus_width(), sdda_start_init(), sddaasync(), sddastart(), ses_path_iter_devid_callback(), ses_paths_iter(), ses_set_physpath(), ses_setphyspath_callback(), sgsendrdwr(), targbhdislun(), targbhdone(), targbhenlun(), targbhstart(), targendislun(), targioctl(), targsendccb(), targwrite(), xpt_async(), xpt_getattr(), xpt_path_inq(), xpt_register_async(), xpt_scanner_thread(), xpt_start_tags(), xpt_stop_tags(), xptdoioctl(), and xptsetasyncfunc().

Here is the call graph for this function:

◆ xpt_action_default()

void xpt_action_default ( union ccb start_ccb)

Definition at line 2613 of file cam_xpt.c.

References ccb_abort::abort_ccb, AC_INQ_CHANGED, ccb_getdevstats::allocated, cam_ccbq::allocated, cam_ed::asyncs, ccb::ataio, ccb_calc_geometry::block_size, cam_path::bus, ccb::cab, ccb_setasync::callback, async_node::callback, ccb_setasync::callback_arg, async_node::callback_arg, cam_ed::callout, cam_async, CAM_ASYNC_INDEX, cam_ccbq_insert_ccb(), cam_ccbq_pending_ccb_count(), cam_ccbq_remove_ccb(), CAM_CDB_POINTER, CAM_DEBUG, CAM_DEBUG_COMPILE, CAM_DEBUG_NONE, CAM_DEBUG_TRACE, CAM_DEV_MATCH_ERROR, CAM_DEV_NOT_THERE, CAM_DEV_POS_EDT, CAM_DEV_POS_NONE, CAM_DEV_POS_PDRV, CAM_DEV_POS_TYPEMASK, CAM_DEV_QFREEZE, CAM_DEV_QFRZN, CAM_DEV_REL_ON_COMPLETE, CAM_DEV_REL_ON_QUEUE_EMPTY, CAM_DEV_REL_TIMEOUT_PENDING, CAM_DEV_UNCONFIGURED, cam_dflags, CAM_DONEQ_INDEX, cam_doneq::cam_doneq_mtx, cam_dpath, CAM_FUNC_NOTAVAIL, CAM_GDEVLIST_ERROR, CAM_GDEVLIST_LAST_DEVICE, CAM_GDEVLIST_LIST_CHANGED, CAM_GDEVLIST_MORE_DEVS, CAM_PROVIDE_FAIL, CAM_REQ_ABORTED, CAM_REQ_CMP, CAM_REQ_CMP_ERR, CAM_RESRC_UNAVAIL, CAM_SIM_QUEUED, CAM_UA_ABORT, CAM_UNQUEUED_INDEX, ccb_getdev::ccb_h, ccb_getdevstats::ccb_h, ccb_getdevlist::ccb_h, ccb_relsim::ccb_h, ccb_setasync::ccb_h, ccb::ccb_h, cam_ed::ccbq, ccb::ccg, cdb_t::cdb_bytes, ccb_scsiio::cdb_io, ccb::cdbg, ccb::cdm, ccb::cgd, ccb::cgdl, ccb::cgds, ccb::cpis, ccb::crs, ccb::csa, ccb::csio, ccb_calc_geometry::cylinders, ccb_getdevstats::dev_active, cam_ccbq::dev_active, DEV_MATCH_BUS, DEV_MATCH_DEVICE, ccb_getdevstats::dev_openings, cam_ccbq::dev_openings, cam_path::device, cam_sim::devq, ccb_setasync::event_enable, async_node::event_enable, async_node::event_lock, ccb_hdr::flags, ccb_debug::flags, cam_ed::flags, ccb_hdr::func_code, ccb_getdevlist::generation, cam_ed::generation, ccb_calc_geometry::heads, ccb_getdevstats::held, ccb_getdev::ident_data, cam_ed::ident_data, cam_pinfo::index, ccb_getdevlist::index, ccb_getdev::inq_data, cam_ed::inq_data, ccb_getdev::inq_flags, cam_ed::inq_flags, ccb_getdevstats::last_reset, ccb_pathstats::last_reset, cam_et::last_reset, cam_eb::last_reset, ccb_getdevstats::maxtags, cam_ed::maxtags, ccb_getdevstats::mintags, cam_ed::mintags, cam_sim::mtx, ccb_dev_match::num_patterns, ccb_relsim::openings, ccb_hdr::path, ccb_hdr::path_id, ccb_dev_match::patterns, ccb_getdevlist::periph_name, cam_periph::periph_name, cam_ed::periphs, ccb_hdr::pinfo, ccb_dev_match::pos, ccb_dev_position::position_type, ccb_getdev::protocol, cam_ed::protocol, cam_ed::protocol_version, ccb_relsim::qfrozen_cnt, camq::qfrozen_cnt, cam_ccbq::queue, ccb_getdevstats::queued, ccb_relsim::release_flags, ccb_relsim::release_timeout, RELSIM_ADJUST_OPENINGS, RELSIM_RELEASE_AFTER_CMDCMPLT, RELSIM_RELEASE_AFTER_QEMPTY, RELSIM_RELEASE_AFTER_TIMEOUT, ccb_scsiio::resid, ccb_ataio::resid, SCSI_REV_2, ccb_scsiio::scsi_status, SCSI_STATUS_OK, ccb_calc_geometry::secs_per_track, cam_devq::send_mtx, ccb_scsiio::sense_resid, ccb_getdev::serial_num, cam_ed::serial_num, ccb_getdev::serial_num_len, cam_ed::serial_num_len, cam_ed::sim, cam_eb::sim, cam_sim::sim_action, ccb_hdr::status, ccb_getdevlist::status, ccb_dev_match::status, cam_path::target, ccb_hdr::target_id, ccb_hdr::target_lun, dev_match_pattern::type, ccb_getdevlist::unit_number, cam_periph::unit_number, ccb_calc_geometry::volume_size, XPT_ABORT, XPT_ACCEPT_TARGET_IO, xpt_acquire_device(), xpt_action_name(), XPT_ASYNC, xpt_async(), XPT_ATA_IO, XPT_CALC_GEOMETRY, XPT_CONT_TARGET_IO, xpt_create_path(), XPT_DEBUG, xpt_dev_ccbq_resize(), XPT_DEV_MATCH, xpt_done(), XPT_EN_LUN, XPT_ENG_EXEC, XPT_ENG_INQ, XPT_FC_DEV_QUEUED, XPT_FC_IS_DEV_QUEUED, XPT_FC_IS_QUEUED, xpt_free_path(), xpt_freeze_devq(), xpt_freeze_devq_device(), XPT_GDEV_STATS, XPT_GDEV_TYPE, XPT_GDEVLIST, XPT_GET_SIM_KNOB, XPT_GET_SIM_KNOB_OLD, XPT_GET_TRAN_SETTINGS, XPT_IMMED_NOTIFY, XPT_IMMEDIATE_NOTIFY, XPT_MMC_GET_TRAN_SETTINGS, XPT_MMC_IO, XPT_MMC_SET_TRAN_SETTINGS, XPT_NOOP, XPT_NOTIFY_ACK, XPT_NOTIFY_ACKNOWLEDGE, XPT_NVME_ADMIN, XPT_NVME_IO, XPT_PATH_INQ, XPT_PATH_STATS, xpt_print(), XPT_REL_SIMQ, xpt_release_device(), xpt_release_devq(), xpt_release_devq_timeout, XPT_REPROBE_LUN, XPT_RESET_BUS, XPT_RESET_DEV, xpt_run_devq(), XPT_SASYNC_CB, xpt_schedule_devq(), XPT_SCSI_IO, XPT_SDEV_TYPE, XPT_SET_SIM_KNOB, XPT_SET_TRAN_SETTINGS, XPT_SMP_IO, XPT_TARGET_IO, XPT_TERM_IO, xptedtmatch(), and xptperiphlistmatch().

Referenced by ata_action(), ata_get_transfer_settings(), ata_set_transfer_settings(), mmc_action(), nvme_action(), scsi_action(), and scsi_set_transfer_settings().

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

◆ xpt_action_name()

const char * xpt_action_name ( uint32_t  action)

Definition at line 5608 of file cam_xpt.c.

References map, kv::name, and kv::v.

Referenced by mmc_action(), xpt_action(), xpt_action_default(), xpt_async(), xpt_done(), xpt_done_process(), and xpt_rescan().

Here is the caller graph for this function:

◆ xpt_add_periph()

int32_t xpt_add_periph ( struct cam_periph periph)

Definition at line 1014 of file cam_xpt.c.

References cam_et::bus, CAM_REQ_CMP, cam_path::device, cam_eb::eb_mtx, cam_ed::generation, cam_periph::path, cam_periph::periph_run_task, cam_ed::periphs, cam_ed::target, xpt_softc::xpt_generation, xpt_run_allocq_task(), and xsoftc.

Referenced by cam_periph_alloc().

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

◆ xpt_alloc_ccb()

union ccb * xpt_alloc_ccb ( void  )

Definition at line 4612 of file cam_xpt.c.

Referenced by cam_compat_handle_0x17(), cam_compat_handle_0x18(), ctlfe_onoffline(), mmccam_start_discovery(), ndaioctl(), sdda_start_init_task(), sgwrite(), and xptdoioctl().

Here is the caller graph for this function:

◆ xpt_alloc_ccb_nowait()

◆ xpt_alloc_device()

◆ xpt_alloc_device_default()

static struct cam_ed * xpt_alloc_device_default ( struct cam_eb bus,
struct cam_et target,
lun_id_t  lun_id 
)
static

Definition at line 4815 of file cam_xpt.c.

References cam_ed::lun_id, cam_ed::maxtags, cam_ed::mintags, cam_ed::target, and xpt_alloc_device().

Here is the call graph for this function:

◆ xpt_alloc_target()

static struct cam_et * xpt_alloc_target ( struct cam_eb bus,
target_id_t  target_id 
)
static

◆ xpt_announce_periph()

◆ xpt_announce_periph_sbuf()

◆ xpt_announce_quirks()

void xpt_announce_quirks ( struct cam_periph periph,
int  quirks,
char *  bit_string 
)

Definition at line 1151 of file cam_xpt.c.

References cam_periph::periph_name, and cam_periph::unit_number.

Referenced by chdone(), ndaregister(), sadone(), saregister(), sastart(), and xpt_announce_quirks_sbuf().

Here is the caller graph for this function:

◆ xpt_announce_quirks_sbuf()

void xpt_announce_quirks_sbuf ( struct cam_periph periph,
struct sbuf *  sb,
int  quirks,
char *  bit_string 
)

Definition at line 1160 of file cam_xpt.c.

References cam_periph::periph_name, cam_periph::unit_number, xpt_announce_quirks(), and xsoftc.

Referenced by adaregister(), cddone(), and dadone_proberc().

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

◆ xpt_async()

◆ xpt_async_bcast()

static void xpt_async_bcast ( struct async_list *  async_head,
u_int32_t  async_code,
struct cam_path path,
void *  async_arg 
)
static

Definition at line 4318 of file cam_xpt.c.

References async_node::callback, async_node::callback_arg, cam_path::device, async_node::event_enable, async_node::event_lock, cam_sim::mtx, and cam_ed::sim.

Referenced by xpt_async_process_dev().

Here is the caller graph for this function:

◆ xpt_async_process()

◆ xpt_async_process_dev()

◆ xpt_async_process_tgt()

static int xpt_async_process_tgt ( struct cam_et target,
void *  arg 
)
static

Definition at line 4257 of file cam_xpt.c.

References AC_SENT_BDR, ccb_async::async_code, CAM_TARGET_WILDCARD, ccb::casync, ccb::ccb_h, cam_et::last_reset, ccb_hdr::path, cam_path::target, cam_et::target_id, xpt_async_process_dev(), and xptdevicetraverse().

Referenced by xpt_async_process().

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

◆ xpt_async_size()

static int xpt_async_size ( u_int32_t  async_code)
static

◆ xpt_async_string()

static const char * xpt_async_string ( u_int32_t  async_code)
static

◆ xpt_async_td()

static void xpt_async_td ( void *  arg)
static

Definition at line 5465 of file cam_xpt.c.

References cam_doneq::cam_doneq_mtx, ccb_hdr::sim_links, STAILQ_HEAD(), and xpt_done_process().

Referenced by xpt_init().

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

◆ xpt_boot_delay()

static void xpt_boot_delay ( void *  arg)
static

Definition at line 5087 of file cam_xpt.c.

References xpt_release_boot().

Referenced by xpt_ch_done().

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

◆ xpt_bus_deregister()

int xpt_bus_deregister ( path_id_t  pathid)

Definition at line 4065 of file cam_xpt.c.

References AC_LOST_DEVICE, AC_PATH_DEREGISTERED, cam_path::bus, CAM_LUN_WILDCARD, CAM_REQ_CMP, CAM_SUCCESS, CAM_TARGET_WILDCARD, xpt_async(), xpt_compile_path(), xpt_release_bus(), and xpt_release_path().

Referenced by cfcs_init(), cfcs_shutdown(), and mmc_cam_sim_free().

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

◆ xpt_bus_register()

◆ xpt_ch_done()

static void xpt_ch_done ( void *  arg)
static

Definition at line 5098 of file cam_xpt.c.

References xpt_boot_delay(), and xsoftc.

Here is the call graph for this function:

◆ xpt_clone_path()

int xpt_clone_path ( struct cam_path **  new_path_ptr,
struct cam_path path 
)

Definition at line 3635 of file cam_xpt.c.

References cam_path::bus, cam_path::device, cam_path::target, xpt_acquire_bus(), xpt_acquire_device(), and xpt_acquire_target().

Referenced by xpt_async().

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

◆ xpt_compile_path()

◆ xpt_config()

static void xpt_config ( void *  arg)
static

Definition at line 5111 of file cam_xpt.c.

References CAM_DEBUG_BUS, CAM_DEBUG_LUN, CAM_DEBUG_NONE, CAM_DEBUG_TARGET, cam_dflags, cam_dpath, cam_proc, CAM_REQ_CMP, periphdriver_init(), xpt_create_path(), xpt_hold_boot(), xpt_scanner_thread(), and xsoftc.

Referenced by xpt_init().

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

◆ xpt_create_path()

◆ xpt_create_path_unlocked()

cam_status xpt_create_path_unlocked ( struct cam_path **  new_path_ptr,
struct cam_periph periph,
path_id_t  path_id,
target_id_t  target_id,
lun_id_t  lun_id 
)

Definition at line 3549 of file cam_xpt.c.

References cam_path::periph, and xpt_create_path().

Here is the call graph for this function:

◆ xpt_denounce_periph()

◆ xpt_denounce_periph_sbuf()

◆ xpt_destroy_device()

static void xpt_destroy_device ( void *  context,
int  pending 
)
static

Definition at line 4830 of file cam_xpt.c.

References cam_ed::device_mtx.

Referenced by xpt_alloc_device().

Here is the caller graph for this function:

◆ xpt_dev_async_default()

static void xpt_dev_async_default ( u_int32_t  async_code,
struct cam_eb bus,
struct cam_et target,
struct cam_ed device,
void *  async_arg 
)
static

Definition at line 4404 of file cam_xpt.c.

References CAM_LUN_WILDCARD, CAM_TARGET_WILDCARD, cam_ed::lun_id, and cam_et::target_id.

◆ xpt_dev_ccbq_resize()

u_int32_t xpt_dev_ccbq_resize ( struct cam_path path,
int  newopenings 
)

Definition at line 4958 of file cam_xpt.c.

References cam_ccbq_resize(), CAM_DEV_TAG_AFTER_COUNT, cam_ed::ccbq, cam_path::device, cam_sim::devq, cam_ed::flags, cam_ed::inq_flags, cam_devq::send_mtx, SID_CmdQue, cam_ed::sim, and cam_ed::tag_saved_openings.

Referenced by xpt_action_default(), xpt_start_tags(), and xpt_stop_tags().

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

◆ xpt_done()

◆ xpt_done_direct()

void xpt_done_direct ( union ccb done_ccb)

◆ xpt_done_process()

◆ xpt_done_td()

void xpt_done_td ( void *  arg)
static

Definition at line 5490 of file cam_xpt.c.

References cam_doneq::cam_doneq_mtx, ccb_hdr::sim_links, STAILQ_HEAD(), and xpt_done_process().

Referenced by xpt_init().

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

◆ xpt_find_bus()

static struct cam_eb * xpt_find_bus ( path_id_t  path_id)
static

Definition at line 4974 of file cam_xpt.c.

References cam_eb::path_id, cam_eb::refcount, xpt_lock_buses(), xpt_unlock_buses(), and xsoftc.

Referenced by xpt_compile_path(), and xptdoioctl().

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

◆ xpt_find_device()

static struct cam_ed * xpt_find_device ( struct cam_et target,
lun_id_t  lun_id 
)
static

Definition at line 5009 of file cam_xpt.c.

References cam_et::bus, cam_eb::eb_mtx, cam_ed::lun_id, cam_ed::refcount, and cam_ed::target.

Referenced by xpt_compile_path().

Here is the caller graph for this function:

◆ xpt_find_target()

static struct cam_et * xpt_find_target ( struct cam_eb bus,
target_id_t  target_id 
)
static

Definition at line 4992 of file cam_xpt.c.

References cam_et::bus, cam_eb::eb_mtx, cam_et::refcount, and cam_et::target_id.

Referenced by xpt_compile_path().

Here is the caller graph for this function:

◆ xpt_finishconfig_task()

static void xpt_finishconfig_task ( void *  context,
int  pending 
)
static

Definition at line 5197 of file cam_xpt.c.

References periphdriver_init(), xpt_for_all_devices(), xpt_release_boot(), and xptpassannouncefunc.

Referenced by xpt_release_boot().

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

◆ xpt_for_all_busses()

static int xpt_for_all_busses ( xpt_busfunc_t tr_func,
void *  arg 
)
static

Definition at line 2519 of file cam_xpt.c.

References xpt_traverse_config::depth, xpt_traverse_config::tr_arg, xpt_traverse_config::tr_func, XPT_DEPTH_BUS, xptbustraverse(), and xptdefbusfunc.

Referenced by xpt_register_async().

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

◆ xpt_for_all_devices()

static int xpt_for_all_devices ( xpt_devicefunc_t tr_func,
void *  arg 
)
static

Definition at line 2534 of file cam_xpt.c.

References xpt_traverse_config::depth, xpt_traverse_config::tr_arg, xpt_traverse_config::tr_func, XPT_DEPTH_DEVICE, xptbustraverse(), and xptdefbusfunc.

Referenced by xpt_finishconfig_task(), and xpt_register_async().

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

◆ xpt_free_ccb()

◆ xpt_free_path()

◆ xpt_freeze_devq()

u_int32_t xpt_freeze_devq ( struct cam_path path,
u_int  count 
)

Definition at line 4438 of file cam_xpt.c.

References CAM_DEBUG, CAM_DEBUG_TRACE, cam_path::device, cam_sim::devq, cam_devq::send_mtx, cam_ed::sim, and xpt_freeze_devq_device().

Referenced by cfcs_action(), cfcs_done(), xpt_action_default(), xpt_async(), xpt_run_devq(), xpt_start_tags(), and xpt_stop_tags().

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

◆ xpt_freeze_devq_device()

static uint32_t xpt_freeze_devq_device ( struct cam_ed dev,
u_int  count 
)
static

Definition at line 4420 of file cam_xpt.c.

References CAM_DEBUG_DEV, CAM_DEBUG_TRACE, camq_remove(), cam_ed::ccbq, device_is_queued(), cam_sim::devq, cam_ed::devq_entry, cam_pinfo::index, camq::qfrozen_cnt, cam_ccbq::queue, cam_devq::send_mtx, cam_devq::send_queue, and cam_ed::sim.

Referenced by xpt_action_default(), xpt_freeze_devq(), and xpt_run_devq().

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

◆ xpt_freeze_simq()

u_int32_t xpt_freeze_simq ( struct cam_sim sim,
u_int  count 
)

Definition at line 4453 of file cam_xpt.c.

References cam_sim::devq, camq::qfrozen_cnt, cam_devq::send_mtx, and cam_devq::send_queue.

Referenced by xpt_async().

Here is the caller graph for this function:

◆ xpt_get_ccb()

static union ccb * xpt_get_ccb ( struct cam_periph periph)
static

Definition at line 4674 of file cam_xpt.c.

References ccb_hdr::alloc_flags, CAM_CCB_FROM_UMA, cam_ccbq_take_opening(), cam_periph_lock, cam_periph_unlock, ccb::ccb_h, cam_periph::ccb_zone, cam_ed::ccbq, cam_path::device, cam_periph::path, and cam_periph::periph_allocated.

Referenced by xpt_run_allocq().

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

◆ xpt_get_ccb_nowait()

static union ccb * xpt_get_ccb_nowait ( struct cam_periph periph)
static

Definition at line 4653 of file cam_xpt.c.

References ccb_hdr::alloc_flags, CAM_CCB_FROM_UMA, cam_ccbq_take_opening(), ccb::ccb_h, cam_periph::ccb_zone, cam_ed::ccbq, cam_path::device, cam_periph::path, and cam_periph::periph_allocated.

Referenced by xpt_run_allocq().

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

◆ xpt_getattr()

◆ xpt_hold_boot()

void xpt_hold_boot ( void  )

Definition at line 5148 of file cam_xpt.c.

References xpt_hold_boot_locked(), xpt_lock_buses(), and xpt_unlock_buses().

Referenced by pmpasync(), pmpregister(), and xpt_config().

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

◆ xpt_hold_boot_locked()

void xpt_hold_boot_locked ( void  )
static

Definition at line 5140 of file cam_xpt.c.

References xsoftc.

Referenced by xpt_hold_boot(), and xpt_rescan().

Here is the caller graph for this function:

◆ xpt_init()

◆ xpt_lock_buses()

◆ xpt_merge_ccb()

void xpt_merge_ccb ( union ccb dst_ccb,
union ccb src_ccb 
)

Definition at line 3480 of file cam_xpt.c.

References ccb::ccb_h, ccb_hdr::flags, ccb_hdr::func_code, ccb_hdr::retry_count, and ccb_hdr::timeout.

Referenced by passsendccb(), passstart(), and xptdoioctl().

Here is the caller graph for this function:

◆ xpt_path_comp()

int xpt_path_comp ( struct cam_path path1,
struct cam_path path2 
)

◆ xpt_path_comp_dev()

int xpt_path_comp_dev ( struct cam_path path,
struct cam_ed dev 
)

◆ xpt_path_counts()

void xpt_path_counts ( struct cam_path path,
uint32_t *  bus_ref,
uint32_t *  periph_ref,
uint32_t *  target_ref,
uint32_t *  device_ref 
)

◆ xpt_path_lun_id()

lun_id_t xpt_path_lun_id ( struct cam_path path)

Definition at line 3895 of file cam_xpt.c.

References CAM_LUN_WILDCARD, cam_path::device, and cam_ed::lun_id.

Referenced by cam_periph_alloc(), cam_periph_error(), ctlfe_lun_disable(), mmc_scan_lun(), ndaregister(), nvme_probe_start(), nvme_scan_lun(), and sgioctl().

Here is the caller graph for this function:

◆ xpt_path_mtx()

struct mtx * xpt_path_mtx ( struct cam_path path)

Definition at line 5328 of file cam_xpt.c.

References cam_path::device, and cam_ed::device_mtx.

Referenced by ata_scan_bus(), cam_periph_mtx(), scsi_scan_bus(), xpt_done_process(), and xpt_scanner_thread().

Here is the caller graph for this function:

◆ xpt_path_path_id()

path_id_t xpt_path_path_id ( struct cam_path path)

◆ xpt_path_periph()

◆ xpt_path_sbuf()

int xpt_path_sbuf ( struct cam_path path,
struct sbuf *  sb 
)

◆ xpt_path_sim()

struct cam_sim * xpt_path_sim ( struct cam_path path)

Definition at line 3904 of file cam_xpt.c.

References cam_path::bus, and cam_eb::sim.

Referenced by cam_periph_alloc(), ctlfeasync(), and sgioctl().

Here is the caller graph for this function:

◆ xpt_path_sim_device()

device_t xpt_path_sim_device ( const struct cam_path path)

Return the device_t associated with the path.

When a SIM is created, it registers a bus with a NEWBUS device_t. This is stored in the internal cam_eb bus structure. There is no guarnatee any given path will have a device_t associated with it (it's legal to call xpt_bus_register with a NULL device_t.

Parameters
pathPath to return the device_t for.

Definition at line 5551 of file cam_xpt.c.

References cam_path::bus, and cam_eb::parent_dev.

Referenced by mmccam_start_discovery().

Here is the caller graph for this function:

◆ xpt_path_string()

int xpt_path_string ( struct cam_path path,
char *  str,
size_t  str_len 
)

Definition at line 3833 of file cam_xpt.c.

References xpt_path_sbuf().

Referenced by cam_error_string(), scsi_sense_sbuf(), and smp_error_sbuf().

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

◆ xpt_path_target_id()

target_id_t xpt_path_target_id ( struct cam_path path)

Definition at line 3886 of file cam_xpt.c.

References CAM_TARGET_WILDCARD, cam_path::target, and cam_et::target_id.

Referenced by cam_periph_alloc(), cam_periph_error(), ctlfe_lun_disable(), probe_purge_old(), and sgioctl().

Here is the caller graph for this function:

◆ xpt_poll_setup()

uint32_t xpt_poll_setup ( union ccb start_ccb)

Definition at line 3180 of file cam_xpt.c.

References cam_path::bus, cam_sim_pollable(), ccb::ccb_h, cam_ed::ccbq, cam_ccbq::dev_openings, cam_path::device, cam_sim::devq, ccb_hdr::path, cam_devq::send_mtx, cam_devq::send_openings, cam_ed::sim, cam_eb::sim, ccb_hdr::timeout, and xpt_sim_poll().

Referenced by cam_periph_runccb().

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

◆ xpt_pollwait()

void xpt_pollwait ( union ccb start_ccb,
uint32_t  timeout 
)

Definition at line 3214 of file cam_xpt.c.

References cam_path::bus, CAM_CMD_TIMEOUT, CAM_REQ_INPROG, cam_sim_pollable(), CAM_STATUS_MASK, ccb::ccb_h, ccb_hdr::path, cam_eb::sim, ccb_hdr::status, and xpt_sim_poll().

Referenced by cam_periph_runccb().

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

◆ xpt_print()

void xpt_print ( struct cam_path path,
const char *  fmt,
  ... 
)

Definition at line 3814 of file cam_xpt.c.

References xpt_path_sbuf(), and XPT_PRINT_LEN.

Referenced by abort_all_pending(), ada_zone_cmd(), adacleanup(), adaclose(), adadump(), adaflush(), adaregister(), adaresume(), adaspindown(), adastart(), aprobedone(), aprobestart(), ata_scan_lun(), ata_set_transfer_settings(), cam_periph_error(), camperiphfree(), camperiphnextunit(), cd6byteworkaround(), cdcleanup(), cddone(), cdgetmode(), cdregister(), cdreportkey(), cdstart(), chdone(), chgetelemstatus(), chgetparams(), chregister(), cmd6workaround(), ctlfe_dump_queue(), ctlfedone(), ctlfeoninvalidate(), ctlferegister(), da_delete_trim(), da_delete_unmap(), da_delete_ws(), da_zone_cmd(), daasync(), dacleanup(), dadone(), dadone_probebdc(), dadone_proberc(), dadump(), daerror(), daopen(), daregister(), dasetgeom(), dashutdown(), dastart(), enc_ctor(), mmc_scan_lun(), ndacleanup(), ndaclose(), ndadump(), ndaflush(), ndaregister(), nvme_probe_done(), nvme_scan_lun(), passcopysglist(), passcreatezone(), passdoioctl(), passdone(), passmemdone(), passmemsetup(), passopen(), passregister(), pmpcleanup(), probedone(), proberequestbackoff(), probestart(), ptdone(), sacleanup(), saclose(), saerror(), saioctl(), saloadtimeouts(), samount(), saparamsetlist(), saregister(), sasetparams(), sastart(), sastrategy(), scsi_scan_lun(), scsi_set_transfer_settings(), sdda_add_part(), sgregister(), targbhenlun(), targendislun(), targreturnccb(), targstart(), xpt_action_default(), xpt_async(), xpt_bus_register(), and xpt_rescan().

Here is the call graph for this function:

◆ xpt_print_device()

void xpt_print_device ( struct cam_ed device)

◆ xpt_print_path()

void xpt_print_path ( struct cam_path path)

Definition at line 3786 of file cam_xpt.c.

References xpt_path_sbuf(), and XPT_PRINT_LEN.

Referenced by mmc_handle_reply(), sagetparams(), sasetparams(), and sastrategy().

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

◆ xpt_proto_find()

static struct xpt_proto * xpt_proto_find ( cam_proto  proto)
static

Definition at line 773 of file cam_xpt.c.

References xpt_proto::proto.

Referenced by xpt_announce_periph(), xpt_announce_periph_sbuf(), xpt_denounce_periph(), xpt_denounce_periph_sbuf(), and xpt_run_devq().

Here is the caller graph for this function:

◆ xpt_register_async()

◆ xpt_release_boot()

void xpt_release_boot ( void  )

Definition at line 5157 of file cam_xpt.c.

References xpt_finishconfig_task(), xpt_lock_buses(), xpt_unlock_buses(), and xsoftc.

Referenced by pmpasync(), pmpdone(), xpt_boot_delay(), xpt_finishconfig_task(), and xpt_rescan_done().

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

◆ xpt_release_bus()

static void xpt_release_bus ( struct cam_eb bus)
static

Definition at line 4724 of file cam_xpt.c.

References cam_sim_release(), cam_eb::eb_mtx, cam_eb::refcount, cam_eb::sim, xpt_lock_buses(), xpt_unlock_buses(), and xsoftc.

Referenced by xpt_bus_deregister(), xpt_bus_register(), xpt_compile_path(), xpt_release_path(), xpt_release_target(), xptbustraverse(), and xptdoioctl().

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

◆ xpt_release_ccb()

void xpt_release_ccb ( union ccb free_ccb)

Definition at line 3924 of file cam_xpt.c.

References cam_ccbq_release_opening(), CAM_DEBUG_PRINT, CAM_DEBUG_XPT, ccb::ccb_h, cam_ed::ccbq, cam_path::device, ccb_hdr::path, cam_path::periph, cam_periph::periph_allocated, xpt_free_ccb(), xpt_path_assert, and xpt_run_allocq().

Referenced by adaclose(), adadone(), adaflush(), adaprobedone(), adastart(), aprobedone(), cam_periph_ioctl(), cddone(), cdgetmode(), cdpause(), cdplay(), cdplaymsf(), cdplaytracks(), cdprevent(), cdreaddvdstructure(), cdreadsubchannel(), cdreadtoc(), cdreportkey(), cdsendkey(), cdsetmode(), cdsetspeed(), cdstart(), cdstartunit(), cdstopunit(), chdone(), chexchange(), chgetelemstatus(), chgetparams(), chielem(), chmove(), chposition(), chsetvoltag(), chstart(), ctlfedone(), ctlfestart(), daclose(), dadone(), dadone_probeata(), dadone_probeataiddir(), dadone_probeatalogdir(), dadone_probeatasup(), dadone_probebdc(), dadone_probeblklimits(), dadone_probelbp(), dadone_proberc(), dadone_probewp(), dadone_tur(), daprevent(), daprobedone(), dashutdown(), dastart(), enc_fsm_step(), enc_runcmd(), mmcprobe_done(), ndaclose(), ndadone(), ndaflush(), ndaioctl(), ndastart(), nvme_probe_done(), passdoioctl(), passdone(), passstart(), pmpdone(), probedone(), ptdone(), ptstart(), sadone(), saerase(), sagetparams(), sagetpos(), saloadunload(), samount(), saprevent(), sardpos(), sareservereleaseunit(), saretension(), sarewind(), sasetparams(), sasetpos(), sasetprot(), saspace(), sastart(), sawritefilemarks(), sddadone(), sddastart(), ses_set_timed_completion(), sgioctl(), targbhdone(), targbhstart(), targfreeccb(), targstart(), and xpt_run_allocq().

Here is the call graph for this function:

◆ xpt_release_device()

◆ xpt_release_devq()

void xpt_release_devq ( struct cam_path path,
u_int  count,
int  run_queue 
)

Definition at line 4480 of file cam_xpt.c.

References CAM_DEBUG, CAM_DEBUG_TRACE, cam_path::device, cam_sim::devq, cam_devq::send_mtx, cam_ed::sim, xpt_release_devq_device(), and xpt_run_devq().

Referenced by aprobedone(), nvme_probe_done(), probedone(), xpt_action_default(), xpt_async_process(), and xpt_done_process().

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

◆ xpt_release_devq_device()

static int xpt_release_devq_device ( struct cam_ed dev,
u_int  count,
int  run_queue 
)
static

Definition at line 4496 of file cam_xpt.c.

References cam_ed::callout, CAM_DEBUG_DEV, CAM_DEBUG_TRACE, CAM_DEV_REL_TIMEOUT_PENDING, cam_ed::ccbq, cam_sim::devq, cam_ed::flags, camq::qfrozen_cnt, cam_ccbq::queue, cam_devq::send_mtx, cam_ed::sim, and xpt_schedule_devq().

Referenced by xpt_done_process(), xpt_release_devq(), and xpt_release_devq_timeout().

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

◆ xpt_release_devq_timeout()

static void xpt_release_devq_timeout ( void *  arg)
static

Definition at line 4466 of file cam_xpt.c.

References CAM_DEBUG_DEV, CAM_DEBUG_TRACE, cam_sim::devq, cam_devq::send_mtx, cam_ed::sim, xpt_release_devq_device(), and xpt_run_devq().

Here is the call graph for this function:

◆ xpt_release_path()

void xpt_release_path ( struct cam_path path)

Definition at line 3654 of file cam_xpt.c.

References cam_path::bus, CAM_DEBUG, CAM_DEBUG_TRACE, cam_path::device, cam_path::target, xpt_release_bus(), xpt_release_device(), and xpt_release_target().

Referenced by ata_dev_async(), scsi_dev_async(), xpt_bus_deregister(), xpt_free_path(), xptsetasyncbusfunc(), and xptsetasyncfunc().

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

◆ xpt_release_simq()

void xpt_release_simq ( struct cam_sim sim,
int  run_queue 
)

Definition at line 4537 of file cam_xpt.c.

References cam_sim::devq, camq::qfrozen_cnt, cam_devq::send_mtx, cam_devq::send_queue, and xpt_run_devq().

Referenced by xpt_async_process(), and xpt_done_process().

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

◆ xpt_release_target()

static void xpt_release_target ( struct cam_et target)
static

Definition at line 4793 of file cam_xpt.c.

References cam_et::bus, cam_eb::eb_mtx, cam_eb::generation, cam_et::luns, cam_et::luns_mtx, cam_et::refcount, and xpt_release_bus().

Referenced by xpt_compile_path(), xpt_release_device(), xpt_release_path(), and xpttargettraverse().

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

◆ xpt_remove_periph()

void xpt_remove_periph ( struct cam_periph periph)

Definition at line 1034 of file cam_xpt.c.

References cam_et::bus, cam_path::device, cam_eb::eb_mtx, cam_ed::generation, cam_periph::path, cam_ed::periphs, cam_ed::target, xpt_softc::xpt_generation, and xsoftc.

Referenced by cam_periph_alloc(), and camperiphfree().

Here is the caller graph for this function:

◆ xpt_rescan()

◆ xpt_rescan_done()

static void xpt_rescan_done ( struct cam_periph periph,
union ccb done_ccb 
)
static

Definition at line 786 of file cam_xpt.c.

References ccb_hdr::cbfcnp, ccb::ccb_h, ccb_hdr::path, xpt_free_ccb(), xpt_free_path(), and xpt_release_boot().

Referenced by xpt_rescan().

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

◆ xpt_run_allocq()

◆ xpt_run_allocq_task()

static void xpt_run_allocq_task ( void *  context,
int  pending 
)
static

Definition at line 3302 of file cam_xpt.c.

References cam_periph_lock, cam_periph_release(), cam_periph_unlock, cam_periph::flags, and xpt_run_allocq().

Referenced by xpt_add_periph().

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

◆ xpt_run_devq()

◆ xpt_scanner_thread()

static void xpt_scanner_thread ( void *  dummy)
static

Definition at line 801 of file cam_xpt.c.

References ccb, ccb::ccb_h, cam_path::device, ccb_hdr::path, xpt_acquire_device(), xpt_action(), xpt_lock_buses(), xpt_path_mtx(), xpt_release_device(), xpt_unlock_buses(), and xsoftc.

Referenced by xpt_config().

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

◆ xpt_schedule()

◆ xpt_schedule_dev()

static int xpt_schedule_dev ( struct camq queue,
cam_pinfo dev_pinfo,
u_int32_t  new_priority 
)
static

Definition at line 3263 of file cam_xpt.c.

References CAM_DEBUG_PRINT, CAM_DEBUG_XPT, CAM_UNQUEUED_INDEX, camq_change_priority(), camq_insert(), cam_pinfo::generation, camq::generation, cam_pinfo::index, and cam_pinfo::priority.

Referenced by xpt_schedule_devq().

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

◆ xpt_schedule_devq()

static __inline int xpt_schedule_devq ( struct cam_devq devq,
struct cam_ed dev 
)
static

Definition at line 328 of file cam_xpt.c.

References CAMQ_GET_PRIO, cam_ed::ccbq, cam_ccbq::dev_openings, cam_ed::devq_entry, camq::entries, camq::qfrozen_cnt, cam_ccbq::queue, cam_devq::send_mtx, cam_devq::send_queue, and xpt_schedule_dev().

Referenced by xpt_action_default(), xpt_done_process(), xpt_release_devq_device(), and xpt_run_devq().

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

◆ xpt_setup_ccb()

void xpt_setup_ccb ( struct ccb_hdr ccb_h,
struct cam_path path,
u_int32_t  priority 
)

◆ xpt_setup_ccb_flags()

◆ xpt_sim_poll()

void xpt_sim_poll ( struct cam_sim sim)

Definition at line 3165 of file cam_xpt.c.

References cam_sim_pollable(), camisr_runqueue(), cam_sim::mtx, and cam_sim::sim_poll.

Referenced by xpt_poll_setup(), and xpt_pollwait().

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

◆ xpt_start_tags()

◆ xpt_stop_tags()

◆ xpt_unlock_buses()

◆ xptaction()

◆ xptbusmatch()

◆ xptbustraverse()

static int xptbustraverse ( struct cam_eb start_bus,
xpt_busfunc_t tr_func,
void *  arg 
)
static

Definition at line 2214 of file cam_xpt.c.

References cam_eb::refcount, xpt_lock_buses(), xpt_release_bus(), xpt_unlock_buses(), and xsoftc.

Referenced by xpt_for_all_busses(), xpt_for_all_devices(), and xptedtmatch().

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

◆ xptclose()

static int xptclose ( struct cdev *  dev,
int  flag,
int  fmt,
struct thread *  td 
)
static

Definition at line 385 of file cam_xpt.c.

◆ xptdefbusfunc()

static int xptdefbusfunc ( struct cam_eb bus,
void *  arg 
)
static

Definition at line 2447 of file cam_xpt.c.

References xpt_traverse_config::depth, xpt_traverse_config::tr_arg, xpt_traverse_config::tr_func, XPT_DEPTH_BUS, xptdeftargetfunc, and xpttargettraverse().

Here is the call graph for this function:

◆ xptdefdevicefunc()

static int xptdefdevicefunc ( struct cam_ed device,
void *  arg 
)
static

Definition at line 2481 of file cam_xpt.c.

References xpt_traverse_config::depth, xpt_traverse_config::tr_arg, xpt_traverse_config::tr_func, XPT_DEPTH_DEVICE, xptdefperiphfunc, and xptperiphtraverse().

Here is the call graph for this function:

◆ xptdefperiphfunc()

static int xptdefperiphfunc ( struct cam_periph periph,
void *  arg 
)
static

Definition at line 2498 of file cam_xpt.c.

References xpt_traverse_config::tr_arg, and xpt_traverse_config::tr_func.

◆ xptdeftargetfunc()

static int xptdeftargetfunc ( struct cam_et target,
void *  arg 
)
static

Definition at line 2464 of file cam_xpt.c.

References xpt_traverse_config::depth, xpt_traverse_config::tr_arg, xpt_traverse_config::tr_func, XPT_DEPTH_TARGET, xptdefdevicefunc, and xptdevicetraverse().

Here is the call graph for this function:

◆ xptdevicematch()

◆ xptdevicetraverse()

static int xptdevicetraverse ( struct cam_et target,
struct cam_ed start_device,
xpt_devicefunc_t tr_func,
void *  arg 
)
static

Definition at line 2285 of file cam_xpt.c.

References cam_et::bus, cam_ed::device_mtx, cam_eb::eb_mtx, cam_ed::refcount, cam_ed::target, and xpt_release_device().

Referenced by xpt_async_process_tgt(), xptdeftargetfunc(), and xptedttargetfunc().

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

◆ xptdoioctl()

◆ xptedtbusfunc()

◆ xptedtdevicefunc()

static int xptedtdevicefunc ( struct cam_ed device,
void *  arg 
)
static

Definition at line 1804 of file cam_xpt.c.

References ccb_dm_cookie::bus, cam_et::bus, CAM_BUS_GENERATION, CAM_DEV_GENERATION, CAM_DEV_MATCH_ERROR, CAM_DEV_MATCH_LIST_CHANGED, CAM_DEV_MATCH_MORE, CAM_DEV_POS_BUS, CAM_DEV_POS_DEVICE, CAM_DEV_POS_EDT, CAM_DEV_POS_PERIPH, CAM_DEV_POS_TARGET, CAM_DEV_UNCONFIGURED, CAM_PERIPH_GENERATION, CAM_TARGET_GENERATION, ccb_dev_position::cookie, DEV_MATCH_DEVICE, DEV_RESULT_NOFLAG, DEV_RESULT_UNCONFIGURED, ccb_dm_cookie::device, match_result::device_result, DM_RET_ACTION_MASK, DM_RET_COPY, DM_RET_DESCEND, DM_RET_ERROR, DM_RET_STOP, cam_eb::eb_mtx, device_match_result::flags, cam_ed::flags, cam_ed::generation, cam_et::generation, cam_eb::generation, ccb_dev_position::generations, device_match_result::ident_data, cam_ed::ident_data, device_match_result::inq_data, cam_ed::inq_data, cam_ed::lun_id, ccb_dev_match::match_buf_len, ccb_dev_match::matches, ccb_dev_match::num_matches, ccb_dev_match::num_patterns, device_match_result::path_id, cam_eb::path_id, ccb_dev_match::patterns, ccb_dm_cookie::periph, ccb_dev_match::pos, ccb_dev_position::position_type, device_match_result::protocol, cam_ed::protocol, cam_periph::refcount, dev_match_result::result, ccb_dev_match::status, ccb_dm_cookie::target, cam_ed::target, device_match_result::target_id, cam_et::target_id, device_match_result::target_lun, dev_match_result::type, xpt_lock_buses(), xpt_unlock_buses(), xptdevicematch(), xptedtperiphfunc, xptperiphtraverse(), and xsoftc.

Here is the call graph for this function:

◆ xptedtmatch()

◆ xptedtperiphfunc()

◆ xptedttargetfunc()

◆ xptioctl()

static int xptioctl ( struct cdev *  dev,
u_long  cmd,
caddr_t  addr,
int  flag,
struct thread *  td 
)
static

Definition at line 398 of file cam_xpt.c.

References cam_compat_ioctl(), and xptdoioctl.

Here is the call graph for this function:

◆ xptnextfreepathid()

static path_id_t xptnextfreepathid ( void  )
static

Definition at line 4086 of file cam_xpt.c.

References cam_eb::path_id, and xsoftc.

Referenced by xptpathid().

Here is the caller graph for this function:

◆ xptopen()

static int xptopen ( struct cdev *  dev,
int  flags,
int  fmt,
struct thread *  td 
)
static

Definition at line 364 of file cam_xpt.c.

References cam_ed::flags.

◆ xptpassannouncefunc()

static int xptpassannouncefunc ( struct cam_ed device,
void *  arg 
)
static

Definition at line 5180 of file cam_xpt.c.

References cam_periph::periph_name, cam_ed::periphs, and xpt_announce_periph().

Here is the call graph for this function:

◆ xptpathid()

static path_id_t xptpathid ( const char *  sim_name,
int  sim_unit,
int  sim_bus 
)
static

Definition at line 4116 of file cam_xpt.c.

References CAM_XPT_PATH_ID, and xptnextfreepathid().

Referenced by xpt_bus_register().

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

◆ xptpdperiphtraverse()

static int xptpdperiphtraverse ( struct periph_driver **  pdrv,
struct cam_periph start_periph,
xpt_periphfunc_t tr_func,
void *  arg 
)
static

Definition at line 2402 of file cam_xpt.c.

References CAM_PERIPH_FREE, cam_periph_lock, cam_periph_release(), cam_periph_unlock, cam_periph::flags, cam_periph::refcount, xpt_lock_buses(), and xpt_unlock_buses().

Referenced by xptplistpdrvfunc().

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

◆ xptpdrvtraverse()

static int xptpdrvtraverse ( struct periph_driver **  start_pdrv,
xpt_pdrvfunc_t tr_func,
void *  arg 
)
static

Definition at line 2374 of file cam_xpt.c.

References periph_drivers.

Referenced by xptperiphlistmatch().

Here is the caller graph for this function:

◆ xptperiphlistmatch()

static int xptperiphlistmatch ( struct ccb_dev_match cdm)
static

Definition at line 2176 of file cam_xpt.c.

References CAM_DEV_MATCH_LAST, CAM_DEV_POS_PDPTR, ccb_dev_position::cookie, ccb_dev_match::num_matches, ccb_dm_cookie::pdrv, ccb_dev_match::pos, ccb_dev_position::position_type, ccb_dev_match::status, xptpdrvtraverse(), and xptplistpdrvfunc.

Referenced by xpt_action_default().

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

◆ xptperiphmatch()

◆ xptperiphtraverse()

static int xptperiphtraverse ( struct cam_ed device,
struct cam_periph start_periph,
xpt_periphfunc_t tr_func,
void *  arg 
)
static

Definition at line 2325 of file cam_xpt.c.

References cam_et::bus, CAM_PERIPH_FREE, cam_periph_release_locked(), cam_eb::eb_mtx, cam_periph::flags, cam_ed::periphs, cam_periph::refcount, cam_ed::target, xpt_lock_buses(), and xpt_unlock_buses().

Referenced by xptdefdevicefunc(), and xptedtdevicefunc().

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

◆ xptplistpdrvfunc()

◆ xptplistperiphfunc()

◆ xptpoll()

static void xptpoll ( struct cam_sim sim)
static

Definition at line 5311 of file cam_xpt.c.

Referenced by xpt_init().

Here is the caller graph for this function:

◆ xptregister()

static cam_status xptregister ( struct cam_periph periph,
void *  arg 
)
static

Definition at line 996 of file cam_xpt.c.

References CAM_REQ_CMP, CAM_REQ_CMP_ERR, cam_periph::softc, cam_sim::softc, and xpt_periph.

Referenced by xpt_init().

Here is the caller graph for this function:

◆ xptsetasyncbusfunc()

static int xptsetasyncbusfunc ( struct cam_eb bus,
void *  arg 
)
static

◆ xptsetasyncfunc()

◆ xpttargettraverse()

static int xpttargettraverse ( struct cam_eb bus,
struct cam_et start_target,
xpt_targetfunc_t tr_func,
void *  arg 
)
static

Definition at line 2249 of file cam_xpt.c.

References cam_et::bus, cam_eb::eb_mtx, cam_et::refcount, and xpt_release_target().

Referenced by xpt_async_process(), xptdefbusfunc(), and xptedtbusfunc().

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

Variable Documentation

◆ cam_async

struct cam_doneq cam_async
static

Definition at line 183 of file cam_xpt.c.

Referenced by xpt_action_default(), and xpt_init().

◆ cam_debug_delay

u_int32_t cam_debug_delay = CAM_DEBUG_DELAY

Definition at line 220 of file cam_xpt.c.

◆ cam_dflags

u_int32_t __read_mostly cam_dflags = CAM_DEBUG_FLAGS

Definition at line 217 of file cam_xpt.c.

Referenced by xpt_action_default(), and xpt_config().

◆ cam_doneqs

struct cam_doneq cam_doneqs[MAXCPU]
static

Definition at line 180 of file cam_xpt.c.

Referenced by camisr_runqueue(), xpt_done(), and xpt_init().

◆ cam_dpath

struct cam_path* cam_dpath

Definition at line 216 of file cam_xpt.c.

Referenced by xpt_action_default(), and xpt_config().

◆ cam_moduledata

moduledata_t cam_moduledata
static
Initial value:
= {
"cam",
NULL
}
static int cam_module_event_handler(module_t, int, void *)
Definition: cam_xpt.c:754

Definition at line 227 of file cam_xpt.c.

◆ cam_num_doneqs

u_int __read_mostly cam_num_doneqs
static

Definition at line 181 of file cam_xpt.c.

Referenced by camisr_runqueue(), xpt_done(), and xpt_init().

◆ cam_proc

struct proc* cam_proc
static

Definition at line 182 of file cam_xpt.c.

Referenced by xpt_config(), and xpt_init().

◆ map

struct kv map[]
static

Definition at line 5562 of file cam_xpt.c.

Referenced by xpt_action_name().

◆ xport_default

struct xpt_xport xport_default
static
Initial value:
= {
.xport = XPORT_UNKNOWN,
.name = "unknown",
}
@ XPORT_UNKNOWN
Definition: cam_ccb.h:289
static struct xpt_xport_ops xport_default_ops
Definition: cam_xpt.c:3942

Definition at line 3947 of file cam_xpt.c.

Referenced by xpt_bus_register().

◆ xport_default_ops

struct xpt_xport_ops xport_default_ops
static
Initial value:
= {
.alloc_device = xpt_alloc_device_default,
.action = xpt_action_default,
}
static void xpt_dev_async_default(u_int32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, void *async_arg)
Definition: cam_xpt.c:4404
static struct cam_ed * xpt_alloc_device_default(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
Definition: cam_xpt.c:4815
void xpt_action_default(union ccb *start_ccb)
Definition: cam_xpt.c:2613

Definition at line 3942 of file cam_xpt.c.

◆ xpt_cdevsw

struct cdevsw xpt_cdevsw
static
Initial value:
= {
.d_version = D_VERSION,
.d_flags = 0,
.d_open = xptopen,
.d_close = xptclose,
.d_ioctl = xptioctl,
.d_name = "xpt",
}
static d_open_t xptopen
Definition: cam_xpt.c:201
static d_ioctl_t xptioctl
Definition: cam_xpt.c:203
static d_close_t xptclose
Definition: cam_xpt.c:202

Definition at line 206 of file cam_xpt.c.

◆ xpt_driver

struct periph_driver xpt_driver
static
Initial value:
=
{
TAILQ_HEAD_INITIALIZER(xpt_driver.units), 0,
}
#define CAM_PERIPH_DRV_EARLY
Definition: cam_periph.h:99
static periph_init_t xpt_periph_init
Definition: cam_xpt.c:190
static struct periph_driver xpt_driver
Definition: cam_xpt.c:192

Definition at line 192 of file cam_xpt.c.

◆ xpt_periph

struct cam_periph* xpt_periph

Definition at line 188 of file cam_xpt.c.

Referenced by xpt_async_process(), xptdoioctl(), and xptregister().

◆ xpt_periph_init

static void xpt_periph_init ( void  )
static

Definition at line 190 of file cam_xpt.c.

◆ xpt_release_devq_timeout

callout_func_t xpt_release_devq_timeout
static

Definition at line 249 of file cam_xpt.c.

Referenced by xpt_action_default().

◆ xptclose

d_close_t xptclose
static

Definition at line 202 of file cam_xpt.c.

◆ xptdefbusfunc

xpt_busfunc_t xptdefbusfunc
static

Definition at line 309 of file cam_xpt.c.

Referenced by xpt_for_all_busses(), and xpt_for_all_devices().

◆ xptdefdevicefunc

xpt_devicefunc_t xptdefdevicefunc
static

Definition at line 311 of file cam_xpt.c.

Referenced by xptdeftargetfunc().

◆ xptdefperiphfunc

xpt_periphfunc_t xptdefperiphfunc
static

Definition at line 312 of file cam_xpt.c.

Referenced by xptdefdevicefunc().

◆ xptdeftargetfunc

xpt_targetfunc_t xptdeftargetfunc
static

Definition at line 310 of file cam_xpt.c.

Referenced by xptdefbusfunc().

◆ xptdoioctl

d_ioctl_t xptdoioctl
static

Definition at line 204 of file cam_xpt.c.

Referenced by xptioctl().

◆ xptedtbusfunc

xpt_busfunc_t xptedtbusfunc
static

Definition at line 284 of file cam_xpt.c.

Referenced by xptedtmatch().

◆ xptedtdevicefunc

xpt_devicefunc_t xptedtdevicefunc
static

Definition at line 286 of file cam_xpt.c.

Referenced by xptedttargetfunc().

◆ xptedtperiphfunc

xpt_periphfunc_t xptedtperiphfunc
static

Definition at line 287 of file cam_xpt.c.

Referenced by xptedtdevicefunc().

◆ xptedttargetfunc

xpt_targetfunc_t xptedttargetfunc
static

Definition at line 285 of file cam_xpt.c.

Referenced by xptedtbusfunc().

◆ xptioctl

d_ioctl_t xptioctl
static

Definition at line 203 of file cam_xpt.c.

◆ xptopen

d_open_t xptopen
static

Definition at line 201 of file cam_xpt.c.

◆ xptpassannouncefunc

xpt_devicefunc_t xptpassannouncefunc
static

Definition at line 269 of file cam_xpt.c.

Referenced by xpt_finishconfig_task().

◆ xptplistpdrvfunc

xpt_pdrvfunc_t xptplistpdrvfunc
static

Definition at line 288 of file cam_xpt.c.

Referenced by xptperiphlistmatch().

◆ xptplistperiphfunc

xpt_periphfunc_t xptplistperiphfunc
static

Definition at line 289 of file cam_xpt.c.

Referenced by xptplistpdrvfunc().

◆ xptsetasyncbusfunc

xpt_busfunc_t xptsetasyncbusfunc
static

Definition at line 323 of file cam_xpt.c.

Referenced by xpt_register_async().

◆ xptsetasyncfunc

xpt_devicefunc_t xptsetasyncfunc
static

Definition at line 322 of file cam_xpt.c.

Referenced by xpt_register_async().

◆ xsoftc