Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/cam_xpt.c
Show First 20 Lines • Show All 2,614 Lines • ▼ Show 20 Lines | xptsetasyncbusfunc(struct cam_eb *bus, void *arg) | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
struct ccb_setasync *csa = (struct ccb_setasync *)arg; | struct ccb_setasync *csa = (struct ccb_setasync *)arg; | ||||
xpt_compile_path(&path, /*periph*/NULL, | xpt_compile_path(&path, /*periph*/NULL, | ||||
bus->path_id, | bus->path_id, | ||||
CAM_TARGET_WILDCARD, | CAM_TARGET_WILDCARD, | ||||
CAM_LUN_WILDCARD); | CAM_LUN_WILDCARD); | ||||
xpt_path_lock(&path); | xpt_path_lock(&path); | ||||
xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL); | xpt_path_inq(&cpi, &path, CAM_PRIORITY_NORMAL); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
csa->callback(csa->callback_arg, | csa->callback(csa->callback_arg, | ||||
AC_PATH_REGISTERED, | AC_PATH_REGISTERED, | ||||
&path, &cpi); | &path, &cpi); | ||||
xpt_path_unlock(&path); | xpt_path_unlock(&path); | ||||
xpt_release_path(&path); | xpt_release_path(&path); | ||||
return(1); | return(1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,448 Lines • ▼ Show 20 Lines | xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) | ||||
status = xpt_create_path(&path, /*periph*/NULL, sim->path_id, | status = xpt_create_path(&path, /*periph*/NULL, sim->path_id, | ||||
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); | CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); | ||||
if (status != CAM_REQ_CMP) { | if (status != CAM_REQ_CMP) { | ||||
xpt_release_bus(new_bus); | xpt_release_bus(new_bus); | ||||
return (CAM_RESRC_UNAVAIL); | return (CAM_RESRC_UNAVAIL); | ||||
} | } | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_path_inq(&cpi, path, CAM_PRIORITY_NORMAL); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
if (cpi.ccb_h.status == CAM_REQ_CMP) { | if (cpi.ccb_h.status == CAM_REQ_CMP) { | ||||
struct xpt_xport **xpt; | struct xpt_xport **xpt; | ||||
SET_FOREACH(xpt, cam_xpt_xport_set) { | SET_FOREACH(xpt, cam_xpt_xport_set) { | ||||
if ((*xpt)->xport == cpi.transport) { | if ((*xpt)->xport == cpi.transport) { | ||||
new_bus->xport = *xpt; | new_bus->xport = *xpt; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 1,512 Lines • Show Last 20 Lines |