--- src/sys/bus/cam/scsi/scsi_ch.c 2004/05/19 22:52:38 1.10 +++ src/sys/bus/cam/scsi/scsi_ch.c 2005/06/02 20:40:31 1.11 @@ -82,6 +82,7 @@ #include #include #include +#include #include "../cam.h" #include "../cam_ccb.h" @@ -426,7 +427,6 @@ chopen(dev_t dev, int flags, int fmt, st struct cam_periph *periph; struct ch_softc *softc; int unit, error; - int s; unit = CHUNIT(dev); periph = cam_extend_get(chperiphs, unit); @@ -436,18 +436,18 @@ chopen(dev_t dev, int flags, int fmt, st softc = (struct ch_softc *)periph->softc; - s = splsoftcam(); + crit_enter(); if (softc->flags & CH_FLAG_INVALID) { - splx(s); + crit_exit(); return(ENXIO); } if ((error = cam_periph_lock(periph, PCATCH)) != 0) { - splx(s); + crit_exit(); return (error); } - splx(s); + crit_exit(); if ((softc->flags & CH_FLAG_OPEN) == 0) { if (cam_periph_acquire(periph) != CAM_REQ_CMP) @@ -501,24 +501,22 @@ static void chstart(struct cam_periph *periph, union ccb *start_ccb) { struct ch_softc *softc; - int s; softc = (struct ch_softc *)periph->softc; switch (softc->state) { case CH_STATE_NORMAL: { - s = splbio(); + crit_enter(); if (periph->immediate_priority <= periph->pinfo.priority){ start_ccb->ccb_h.ccb_state = CH_CCB_WAITING; SLIST_INSERT_HEAD(&periph->ccb_list, &start_ccb->ccb_h, periph_links.sle); periph->immediate_priority = CAM_PRIORITY_NONE; - splx(s); wakeup(&periph->ccb_list); - } else - splx(s); + } + crit_exit(); break; } case CH_STATE_PROBE: