Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_cd.c
Context not available. | |||||
{ | { | ||||
struct cd_softc *softc; | struct cd_softc *softc; | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
/* | /* | ||||
Context not available. | |||||
printf("cdasync: Unable to attach new device " | printf("cdasync: Unable to attach new device " | ||||
"due to status 0x%x\n", status); | "due to status 0x%x\n", status); | ||||
break; | return; | ||||
} | } | ||||
case AC_UNIT_ATTENTION: | case AC_UNIT_ATTENTION: | ||||
{ | { | ||||
Context not available. | |||||
if (asc == 0x28 && ascq == 0x00) | if (asc == 0x28 && ascq == 0x00) | ||||
disk_media_changed(softc->disk, M_NOWAIT); | disk_media_changed(softc->disk, M_NOWAIT); | ||||
} | } | ||||
cam_periph_async(periph, code, path, arg); | |||||
break; | break; | ||||
} | } | ||||
case AC_SCSI_AEN: | case AC_SCSI_AEN: | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
if (softc->state == CD_STATE_NORMAL && !softc->tur) { | if (softc->state == CD_STATE_NORMAL && !softc->tur) { | ||||
if (cam_periph_acquire(periph) == 0) { | if (cam_periph_acquire(periph) == 0) { | ||||
Context not available. | |||||
{ | { | ||||
struct ccb_hdr *ccbh; | struct ccb_hdr *ccbh; | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
/* | /* | ||||
* Don't fail on the expected unit attention | * Don't fail on the expected unit attention | ||||
Context not available. | |||||
softc->flags |= CD_FLAG_RETRY_UA; | softc->flags |= CD_FLAG_RETRY_UA; | ||||
LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) | LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) | ||||
ccbh->ccb_state |= CD_CCB_RETRY_UA; | ccbh->ccb_state |= CD_CCB_RETRY_UA; | ||||
/* FALLTHROUGH */ | break; | ||||
} | } | ||||
default: | default: | ||||
cam_periph_async(periph, code, path, arg); | |||||
break; | break; | ||||
} | } | ||||
cam_periph_async(periph, code, path, arg); | |||||
} | } | ||||
static void | static void | ||||
Context not available. | |||||
snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); | snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); | ||||
sysctl_ctx_init(&softc->sysctl_ctx); | sysctl_ctx_init(&softc->sysctl_ctx); | ||||
cam_periph_lock(periph); | |||||
softc->flags |= CD_FLAG_SCTX_INIT; | softc->flags |= CD_FLAG_SCTX_INIT; | ||||
cam_periph_unlock(periph); | |||||
softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, | softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, | ||||
SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO, | SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO, | ||||
tmpstr2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, | tmpstr2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, | ||||
Context not available. | |||||
struct bio *bp; | struct bio *bp; | ||||
struct ccb_scsiio *csio; | struct ccb_scsiio *csio; | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstart\n")); | CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstart\n")); | ||||
Context not available. | |||||
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cddone\n")); | CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cddone\n")); | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
csio = &done_ccb->csio; | csio = &done_ccb->csio; | ||||
Context not available. | |||||
CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdprevent\n")); | CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdprevent\n")); | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
if (((action == PR_ALLOW) | if (((action == PR_ALLOW) | ||||
Context not available. | |||||
{ | { | ||||
struct cd_softc *softc; | struct cd_softc *softc; | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
softc->flags &= ~CD_FLAG_MEDIA_SCAN_ACT; | softc->flags &= ~CD_FLAG_MEDIA_SCAN_ACT; | ||||
Context not available. | |||||
struct cd_softc *softc; | struct cd_softc *softc; | ||||
int error; | int error; | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
error = 0; | error = 0; | ||||
Context not available. | |||||
periph = xpt_path_periph(ccb->ccb_h.path); | periph = xpt_path_periph(ccb->ccb_h.path); | ||||
softc = (struct cd_softc *)periph->softc; | softc = (struct cd_softc *)periph->softc; | ||||
cam_periph_assert(periph, MA_OWNED); | |||||
error = 0; | error = 0; | ||||
/* | /* | ||||
Context not available. |