Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/firewire/sbp.c
Show First 20 Lines • Show All 1,022 Lines • ▼ Show 20 Lines | END_DEBUG | ||||
xpt_release_devq(sdev->path, sdev->freeze, TRUE); | xpt_release_devq(sdev->path, sdev->freeze, TRUE); | ||||
sdev->freeze = 1; | sdev->freeze = 1; | ||||
} | } | ||||
static __inline void | static __inline void | ||||
sbp_scan_dev(struct sbp_dev *sdev) | sbp_scan_dev(struct sbp_dev *sdev) | ||||
{ | { | ||||
sdev->status = SBP_DEV_PROBE; | sdev->status = SBP_DEV_PROBE; | ||||
callout_reset(&sdev->target->scan_callout, scan_delay * hz / 1000, | callout_reset_sbt(&sdev->target->scan_callout, SBT_1MS * scan_delay, 0, | ||||
sbp_cam_scan_target, (void *)sdev->target); | sbp_cam_scan_target, (void *)sdev->target, 0); | ||||
} | } | ||||
static void | static void | ||||
sbp_do_attach(struct fw_xfer *xfer) | sbp_do_attach(struct fw_xfer *xfer) | ||||
{ | { | ||||
struct sbp_dev *sdev; | struct sbp_dev *sdev; | ||||
struct sbp_target *target; | struct sbp_target *target; | ||||
struct sbp_softc *sbp; | struct sbp_softc *sbp; | ||||
▲ Show 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | END_DEBUG | ||||
if (target->mgm_ocb_cur != NULL) { | if (target->mgm_ocb_cur != NULL) { | ||||
/* there is a standing ORB */ | /* there is a standing ORB */ | ||||
STAILQ_INSERT_TAIL(&sdev->target->mgm_ocb_queue, ocb, ocb); | STAILQ_INSERT_TAIL(&sdev->target->mgm_ocb_queue, ocb, ocb); | ||||
return; | return; | ||||
} | } | ||||
start: | start: | ||||
target->mgm_ocb_cur = ocb; | target->mgm_ocb_cur = ocb; | ||||
callout_reset(&target->mgm_ocb_timeout, 5*hz, | callout_reset(&target->mgm_ocb_timeout, 5 * hz, | ||||
sbp_mgm_timeout, (caddr_t)ocb); | sbp_mgm_timeout, (caddr_t)ocb); | ||||
xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0); | xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0); | ||||
if (xfer == NULL) { | if (xfer == NULL) { | ||||
return; | return; | ||||
} | } | ||||
xfer->hand = sbp_mgm_callback; | xfer->hand = sbp_mgm_callback; | ||||
fp = &xfer->send.hdr; | fp = &xfer->send.hdr; | ||||
▲ Show 20 Lines • Show All 1,285 Lines • ▼ Show 20 Lines | sbp_enqueue_ocb(struct sbp_dev *sdev, struct sbp_ocb *ocb) | ||||
SBP_LOCK_ASSERT(sdev->target->sbp); | SBP_LOCK_ASSERT(sdev->target->sbp); | ||||
SBP_DEBUG(1) | SBP_DEBUG(1) | ||||
device_printf(sdev->target->sbp->fd.dev, | device_printf(sdev->target->sbp->fd.dev, | ||||
"%s:%s 0x%08jx\n", __func__, sdev->bustgtlun, (uintmax_t)ocb->bus_addr); | "%s:%s 0x%08jx\n", __func__, sdev->bustgtlun, (uintmax_t)ocb->bus_addr); | ||||
END_DEBUG | END_DEBUG | ||||
prev2 = prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb); | prev2 = prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb); | ||||
STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb); | STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb); | ||||
if (ocb->ccb != NULL) | if (ocb->ccb != NULL) { | ||||
callout_reset(&ocb->timer, (ocb->ccb->ccb_h.timeout * hz) / 1000, | callout_reset_sbt(&ocb->timer, | ||||
sbp_timeout, ocb); | SBT_1MS * ocb->ccb->ccb_h.timeout, 0, sbp_timeout, | ||||
ocb, 0); | |||||
} | |||||
if (use_doorbell && prev == NULL) | if (use_doorbell && prev == NULL) | ||||
prev2 = sdev->last_ocb; | prev2 = sdev->last_ocb; | ||||
if (prev2 != NULL && (ocb->sdev->flags & ORB_LINK_DEAD) == 0) { | if (prev2 != NULL && (ocb->sdev->flags & ORB_LINK_DEAD) == 0) { | ||||
SBP_DEBUG(1) | SBP_DEBUG(1) | ||||
printf("linking chain 0x%jx -> 0x%jx\n", | printf("linking chain 0x%jx -> 0x%jx\n", | ||||
(uintmax_t)prev2->bus_addr, (uintmax_t)ocb->bus_addr); | (uintmax_t)prev2->bus_addr, (uintmax_t)ocb->bus_addr); | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |