Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/cam_periph.c
Show First 20 Lines • Show All 764 Lines • ▼ Show 20 Lines | camperiphfree(struct cam_periph *periph) | ||||
xpt_unlock_buses(); | xpt_unlock_buses(); | ||||
if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) | if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) | ||||
xpt_print(periph->path, "Periph destroyed\n"); | xpt_print(periph->path, "Periph destroyed\n"); | ||||
else | else | ||||
CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); | CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n")); | ||||
if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { | if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) { | ||||
union ccb ccb; | union ccb ccb; | ||||
int arglen; | |||||
void *arg; | void *arg; | ||||
memset(&ccb, 0, sizeof(ccb)); | memset(&ccb, 0, sizeof(ccb)); | ||||
switch (periph->deferred_ac) { | switch (periph->deferred_ac) { | ||||
case AC_FOUND_DEVICE: | case AC_FOUND_DEVICE: | ||||
ccb.ccb_h.func_code = XPT_GDEV_TYPE; | ccb.ccb_h.func_code = XPT_GDEV_TYPE; | ||||
xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); | ||||
xpt_action(&ccb); | xpt_action(&ccb); | ||||
arg = &ccb; | arg = &ccb; | ||||
arglen = sizeof(ccb.cgd); | |||||
break; | break; | ||||
case AC_PATH_REGISTERED: | case AC_PATH_REGISTERED: | ||||
xpt_path_inq(&ccb.cpi, periph->path); | xpt_path_inq(&ccb.cpi, periph->path); | ||||
arg = &ccb; | arg = &ccb; | ||||
arglen = sizeof(ccb.cpi); | |||||
break; | break; | ||||
default: | default: | ||||
arg = NULL; | arg = NULL; | ||||
arglen = 0; | |||||
break; | break; | ||||
} | } | ||||
periph->deferred_callback(NULL, periph->deferred_ac, | xpt_deferred_callback(periph->deferred_callback, | ||||
periph->path, arg); | periph->deferred_ac, periph->path, arg, arglen); | ||||
} | } | ||||
xpt_free_path(periph->path); | xpt_free_path(periph->path); | ||||
free(periph, M_CAMPERIPH); | free(periph, M_CAMPERIPH); | ||||
xpt_lock_buses(); | xpt_lock_buses(); | ||||
} | } | ||||
/* | /* | ||||
* Map user virtual pointers into kernel virtual address space, so we can | * Map user virtual pointers into kernel virtual address space, so we can | ||||
▲ Show 20 Lines • Show All 1,408 Lines • Show Last 20 Lines |