Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/aic/aic.c
Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | if (ccb->ccb_h.status != CAM_REQ_INPROG) { | ||||
xpt_done(ccb); | xpt_done(ccb); | ||||
return; | return; | ||||
} | } | ||||
scb->flags |= SCB_ACTIVE; | scb->flags |= SCB_ACTIVE; | ||||
ccb->ccb_h.status |= CAM_SIM_QUEUED; | ccb->ccb_h.status |= CAM_SIM_QUEUED; | ||||
TAILQ_INSERT_TAIL(&aic->pending_ccbs, &ccb->ccb_h, sim_links.tqe); | TAILQ_INSERT_TAIL(&aic->pending_ccbs, &ccb->ccb_h, sim_links.tqe); | ||||
callout_reset(&scb->timer, (ccb->ccb_h.timeout * hz) / 1000, | callout_reset_sbt(&scb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, | ||||
aic_timeout, scb); | aic_timeout, scb, 0); | ||||
aic_start(aic); | aic_start(aic); | ||||
} | } | ||||
/* | /* | ||||
* Start another command if the controller is not busy. | * Start another command if the controller is not busy. | ||||
*/ | */ | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 738 Lines • ▼ Show 20 Lines | while (ccb_h != NULL) { | ||||
pending_scb = (struct aic_scb *)ccb_h->ccb_scb_ptr; | pending_scb = (struct aic_scb *)ccb_h->ccb_scb_ptr; | ||||
if (ccb_h->target_id == scb->target) { | if (ccb_h->target_id == scb->target) { | ||||
ccb_h->status |= CAM_BDR_SENT; | ccb_h->status |= CAM_BDR_SENT; | ||||
ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ||||
TAILQ_REMOVE(&aic->pending_ccbs, | TAILQ_REMOVE(&aic->pending_ccbs, | ||||
&pending_scb->ccb->ccb_h, sim_links.tqe); | &pending_scb->ccb->ccb_h, sim_links.tqe); | ||||
aic_done(aic, pending_scb); | aic_done(aic, pending_scb); | ||||
} else { | } else { | ||||
callout_reset(&pending_scb->timer, | callout_reset_sbt(&pending_scb->timer, | ||||
(ccb_h->timeout * hz) / 1000, aic_timeout, | SBT_1MS * ccb_h->timeout, 0, aic_timeout, | ||||
pending_scb); | pending_scb, 0); | ||||
ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ||||
} | } | ||||
} | } | ||||
ccb_h = TAILQ_FIRST(&aic->nexus_ccbs); | ccb_h = TAILQ_FIRST(&aic->nexus_ccbs); | ||||
while (ccb_h != NULL) { | while (ccb_h != NULL) { | ||||
struct aic_scb *nexus_scb; | struct aic_scb *nexus_scb; | ||||
nexus_scb = (struct aic_scb *)ccb_h->ccb_scb_ptr; | nexus_scb = (struct aic_scb *)ccb_h->ccb_scb_ptr; | ||||
if (ccb_h->target_id == scb->target) { | if (ccb_h->target_id == scb->target) { | ||||
ccb_h->status |= CAM_BDR_SENT; | ccb_h->status |= CAM_BDR_SENT; | ||||
ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ||||
TAILQ_REMOVE(&aic->nexus_ccbs, | TAILQ_REMOVE(&aic->nexus_ccbs, | ||||
&nexus_scb->ccb->ccb_h, sim_links.tqe); | &nexus_scb->ccb->ccb_h, sim_links.tqe); | ||||
aic_done(aic, nexus_scb); | aic_done(aic, nexus_scb); | ||||
} else { | } else { | ||||
callout_reset(&nexus_scb->timer, | callout_reset_sbt(&nexus_scb->timer, | ||||
(ccb_h->timeout * hz) / 1000, aic_timeout, | SBT_1MS * ccb_h->timeout, 0, aic_timeout, | ||||
nexus_scb); | nexus_scb, 0); | ||||
ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (aic->nexus == scb || scb->flags & SCB_DISCONNECTED) | if (aic->nexus == scb || scb->flags & SCB_DISCONNECTED) | ||||
aic->tinfo[scb->target].lubusy &= ~(1 << scb->lun); | aic->tinfo[scb->target].lubusy &= ~(1 << scb->lun); | ||||
▲ Show 20 Lines • Show All 491 Lines • Show Last 20 Lines |