Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/cam_xpt.c
Show First 20 Lines • Show All 493 Lines • ▼ Show 20 Lines | #endif | ||||
case XPT_DEBUG: { | case XPT_DEBUG: { | ||||
union ccb ccb; | union ccb ccb; | ||||
/* | /* | ||||
* This is an immediate CCB, so it's okay to | * This is an immediate CCB, so it's okay to | ||||
* allocate it on the stack. | * allocate it on the stack. | ||||
*/ | */ | ||||
memset(&ccb, 0, sizeof(ccb)); | |||||
/* | /* | ||||
* Create a path using the bus, target, and lun the | * Create a path using the bus, target, and lun the | ||||
* user passed in. | * user passed in. | ||||
*/ | */ | ||||
if (xpt_create_path(&ccb.ccb_h.path, NULL, | if (xpt_create_path(&ccb.ccb_h.path, NULL, | ||||
inccb->ccb_h.path_id, | inccb->ccb_h.path_id, | ||||
inccb->ccb_h.target_id, | inccb->ccb_h.target_id, | ||||
▲ Show 20 Lines • Show All 2,080 Lines • ▼ Show 20 Lines | xptsetasyncfunc(struct cam_ed *device, void *arg) | ||||
* Don't report unconfigured devices (Wildcard devs, | * Don't report unconfigured devices (Wildcard devs, | ||||
* devices only for target mode, device instances | * devices only for target mode, device instances | ||||
* that have been invalidated but are waiting for | * that have been invalidated but are waiting for | ||||
* their last reference count to be released). | * their last reference count to be released). | ||||
*/ | */ | ||||
if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) | if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) | ||||
return (1); | return (1); | ||||
memset(&cgd, 0, sizeof(cgd)); | |||||
xpt_compile_path(&path, | xpt_compile_path(&path, | ||||
NULL, | NULL, | ||||
device->target->bus->path_id, | device->target->bus->path_id, | ||||
device->target->target_id, | device->target->target_id, | ||||
device->lun_id); | device->lun_id); | ||||
xpt_setup_ccb(&cgd.ccb_h, &path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&cgd.ccb_h, &path, CAM_PRIORITY_NORMAL); | ||||
cgd.ccb_h.func_code = XPT_GDEV_TYPE; | cgd.ccb_h.func_code = XPT_GDEV_TYPE; | ||||
xpt_action((union ccb *)&cgd); | xpt_action((union ccb *)&cgd); | ||||
▲ Show 20 Lines • Show All 2,467 Lines • ▼ Show 20 Lines | xpt_start_tags(struct cam_path *path) | ||||
device->inq_flags |= SID_CmdQue; | device->inq_flags |= SID_CmdQue; | ||||
if (device->tag_saved_openings != 0) | if (device->tag_saved_openings != 0) | ||||
newopenings = device->tag_saved_openings; | newopenings = device->tag_saved_openings; | ||||
else | else | ||||
newopenings = min(device->maxtags, | newopenings = min(device->maxtags, | ||||
sim->max_tagged_dev_openings); | sim->max_tagged_dev_openings); | ||||
xpt_dev_ccbq_resize(path, newopenings); | xpt_dev_ccbq_resize(path, newopenings); | ||||
xpt_async(AC_GETDEV_CHANGED, path, NULL); | xpt_async(AC_GETDEV_CHANGED, path, NULL); | ||||
memset(&crs, 0, sizeof(crs)); | |||||
xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); | ||||
crs.ccb_h.func_code = XPT_REL_SIMQ; | crs.ccb_h.func_code = XPT_REL_SIMQ; | ||||
crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; | crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; | ||||
crs.openings | crs.openings | ||||
= crs.release_timeout | = crs.release_timeout | ||||
= crs.qfrozen_cnt | = crs.qfrozen_cnt | ||||
= 0; | = 0; | ||||
xpt_action((union ccb *)&crs); | xpt_action((union ccb *)&crs); | ||||
Show All 9 Lines | xpt_stop_tags(struct cam_path *path) | ||||
device = path->device; | device = path->device; | ||||
sim = path->bus->sim; | sim = path->bus->sim; | ||||
device->flags &= ~CAM_DEV_TAG_AFTER_COUNT; | device->flags &= ~CAM_DEV_TAG_AFTER_COUNT; | ||||
device->tag_delay_count = 0; | device->tag_delay_count = 0; | ||||
xpt_freeze_devq(path, /*count*/1); | xpt_freeze_devq(path, /*count*/1); | ||||
device->inq_flags &= ~SID_CmdQue; | device->inq_flags &= ~SID_CmdQue; | ||||
xpt_dev_ccbq_resize(path, sim->max_dev_openings); | xpt_dev_ccbq_resize(path, sim->max_dev_openings); | ||||
xpt_async(AC_GETDEV_CHANGED, path, NULL); | xpt_async(AC_GETDEV_CHANGED, path, NULL); | ||||
memset(&crs, 0, sizeof(crs)); | |||||
xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); | ||||
crs.ccb_h.func_code = XPT_REL_SIMQ; | crs.ccb_h.func_code = XPT_REL_SIMQ; | ||||
crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; | crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; | ||||
crs.openings | crs.openings | ||||
= crs.release_timeout | = crs.release_timeout | ||||
= crs.qfrozen_cnt | = crs.qfrozen_cnt | ||||
= 0; | = 0; | ||||
xpt_action((union ccb *)&crs); | xpt_action((union ccb *)&crs); | ||||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | if (path == NULL) { | ||||
status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID, | status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID, | ||||
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); | CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); | ||||
if (status != CAM_REQ_CMP) | if (status != CAM_REQ_CMP) | ||||
return (status); | return (status); | ||||
xpt_path_lock(path); | xpt_path_lock(path); | ||||
xptpath = 1; | xptpath = 1; | ||||
} | } | ||||
memset(&csa, 0, sizeof(csa)); | |||||
xpt_setup_ccb(&csa.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&csa.ccb_h, path, CAM_PRIORITY_NORMAL); | ||||
csa.ccb_h.func_code = XPT_SASYNC_CB; | csa.ccb_h.func_code = XPT_SASYNC_CB; | ||||
csa.event_enable = event; | csa.event_enable = event; | ||||
csa.callback = cbfunc; | csa.callback = cbfunc; | ||||
csa.callback_arg = cbarg; | csa.callback_arg = cbarg; | ||||
xpt_action((union ccb *)&csa); | xpt_action((union ccb *)&csa); | ||||
status = csa.ccb_h.status; | status = csa.ccb_h.status; | ||||
▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines |