Lines Matching defs:sdev
143 struct sbp_dev *sdev;
335 sbp_show_sdev_info(struct sbp_dev *sdev)
339 fwdev = sdev->target->fwdev;
340 device_printf(sdev->target->sbp->fd.dev,
344 sdev->bustgtlun,
345 (sdev->type & 0x40) >> 6,
346 (sdev->type & 0x1f),
353 device_printf(sdev->target->sbp->fd.dev,
356 sdev->bustgtlun,
357 sdev->vendor,
358 sdev->product,
359 sdev->revision);
419 struct sbp_dev *sdev, **newluns;
449 sdev = target->luns[lun];
450 if (sdev == NULL)
452 sdev->flags &= ~VALID_LUN;
455 sbp_cam_detach_sdev(sdev);
456 sbp_free_sdev(sdev);
499 sdev = target->luns[lun];
500 if (sdev == NULL) {
501 sdev = malloc(sizeof(struct sbp_dev),
503 if (sdev == NULL) {
507 target->luns[lun] = sdev;
508 sdev->lun_id = lun;
509 sdev->target = target;
510 STAILQ_INIT(&sdev->ocbs);
511 callout_init_mtx(&sdev->login_callout, &sbp->mtx, 0);
512 sdev->status = SBP_DEV_RESET;
514 snprintf(sdev->bustgtlun, 32, "%s:%d:%d",
515 device_get_nameunit(sdev->target->sbp->fd.dev),
516 sdev->target->target_id,
517 sdev->lun_id);
519 sdev->flags |= VALID_LUN;
520 sdev->type = (reg->val & 0xff0000) >> 16;
527 SBP_DMA_SIZE, &sdev->dma, BUS_DMA_NOWAIT |
529 if (sdev->dma.v_addr == NULL) {
532 free(sdev, M_SBP);
536 sdev->login = (struct sbp_login_res *) sdev->dma.v_addr;
537 sdev->ocb = (struct sbp_ocb *)
538 ((char *)sdev->dma.v_addr + SBP_LOGIN_SIZE);
539 bzero((char *)sdev->ocb,
542 STAILQ_INIT(&sdev->free_ocbs);
545 ocb = &sdev->ocb[i];
546 ocb->bus_addr = sdev->dma.bus_addr
557 sbp_free_ocb(sdev, ocb);
565 sdev = target->luns[lun];
566 if (sdev != NULL && (sdev->flags & VALID_LUN) == 0) {
567 sbp_cam_detach_sdev(sdev);
568 sbp_free_sdev(sdev);
621 sbp_probe_lun(struct sbp_dev *sdev)
627 bzero(sdev->vendor, sizeof(sdev->vendor));
628 bzero(sdev->product, sizeof(sdev->product));
630 fwdev = sdev->target->fwdev;
635 crom_parse_text(cc, sdev->vendor, sizeof(sdev->vendor));
645 snprintf(sdev->revision, sizeof(sdev->revision),
650 crom_parse_text(cc, sdev->product, sizeof(sdev->product));
656 struct sbp_dev *sdev = (struct sbp_dev *)arg;
657 SBP_LOCK_ASSERT(sdev->target->sbp);
658 sbp_mgm_orb(sdev, ORB_FUN_LGI, NULL);
662 sbp_login(struct sbp_dev *sdev)
669 timevalsub(&delta, &sdev->target->sbp->last_busreset);
679 callout_reset(&sdev->login_callout, ticks,
680 sbp_login_callout, (void *)(sdev));
690 struct sbp_dev *sdev;
704 sdev = target->luns[i];
705 if (sdev == NULL)
707 if (alive && (sdev->status != SBP_DEV_DEAD)) {
708 if (sdev->path != NULL) {
709 xpt_freeze_devq(sdev->path, 1);
710 sdev->freeze++;
712 sbp_probe_lun(sdev);
713 sbp_show_sdev_info(sdev);
716 sbp_abort_all_ocbs(sdev, CAM_SCSI_BUS_RESET);
718 switch (sdev->status) {
722 sbp_login(sdev);
729 sbp_mgm_orb(sdev, ORB_FUN_RCN, NULL);
733 switch (sdev->status) {
740 if (sdev->path) {
741 xpt_freeze_devq(sdev->path, 1);
742 sdev->freeze++;
744 sdev->status = SBP_DEV_RETRY;
745 sbp_cam_detach_sdev(sdev);
746 sbp_free_sdev(sdev);
751 sdev->status = SBP_DEV_RESET;
867 struct sbp_dev *sdev;
868 sdev = (struct sbp_dev *)xfer->sc;
870 device_printf(sdev->target->sbp->fd.dev,"%s\n", __func__);
873 SBP_LOCK(sdev->target->sbp);
874 STAILQ_INSERT_TAIL(&sdev->target->sbp->fwb.xferlist, xfer, link);
875 SBP_UNLOCK(sdev->target->sbp);
883 struct sbp_dev *sdev;
885 sdev = (struct sbp_dev *)xfer->sc;
887 SBP_LOCK_ASSERT(sdev->target->sbp);
888 STAILQ_INSERT_TAIL(&sdev->target->xferlist, xfer, link);
894 struct sbp_dev *tsdev, *sdev = (struct sbp_dev *)xfer->sc;
895 struct sbp_target *target = sdev->target;
899 device_printf(sdev->target->sbp->fd.dev,
900 "%s: %s failed: resp=%d\n", __func__, sdev->bustgtlun, xfer->resp);
913 sbp_reset_start(struct sbp_dev *sdev)
919 device_printf(sdev->target->sbp->fd.dev,
920 "%s:%s\n", __func__,sdev->bustgtlun);
923 xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0);
935 struct sbp_dev *sdev;
937 sdev = (struct sbp_dev *)xfer->sc;
940 device_printf(sdev->target->sbp->fd.dev,
941 "%s:%s\n", __func__, sdev->bustgtlun);
943 SBP_LOCK(sdev->target->sbp);
945 SBP_UNLOCK(sdev->target->sbp);
967 struct sbp_dev *sdev;
969 sdev = (struct sbp_dev *) ccb->ccb_h.ccb_sdev_ptr;
970 target = sdev->target;
975 "%s:%s\n", __func__, sdev->bustgtlun);
978 sdev->status = SBP_DEV_ATTACHED;
981 "%s:%s failed\n", __func__, sdev->bustgtlun);
983 sdev = sbp_next_dev(target, sdev->lun_id + 1);
984 if (sdev == NULL) {
990 xpt_setup_ccb(&ccb->ccb_h, sdev->path, SCAN_PRI);
991 ccb->ccb_h.ccb_sdev_ptr = sdev;
996 xpt_release_devq(sdev->path, sdev->freeze, TRUE);
997 sdev->freeze = 1;
1004 struct sbp_dev *sdev;
1008 sdev = sbp_next_dev(target, 0);
1009 if (sdev == NULL) {
1015 device_printf(sdev->target->sbp->fd.dev,
1016 "%s:%s\n", __func__, sdev->bustgtlun);
1025 xpt_setup_ccb(&ccb->ccb_h, sdev->path, SCAN_PRI);
1030 ccb->ccb_h.ccb_sdev_ptr = sdev;
1036 xpt_release_devq(sdev->path, sdev->freeze, TRUE);
1037 sdev->freeze = 1;
1041 sbp_scan_dev(struct sbp_dev *sdev)
1043 sdev->status = SBP_DEV_PROBE;
1044 callout_reset_sbt(&sdev->target->scan_callout, SBT_1MS * scan_delay, 0,
1045 sbp_cam_scan_target, (void *)sdev->target, 0);
1051 struct sbp_dev *sdev;
1055 sdev = (struct sbp_dev *)xfer->sc;
1056 target = sdev->target;
1060 device_printf(sdev->target->sbp->fd.dev,
1061 "%s:%s\n", __func__, sdev->bustgtlun);
1065 if (sdev->path == NULL)
1066 xpt_create_path(&sdev->path, NULL,
1068 target->target_id, sdev->lun_id);
1076 sdev->status = SBP_DEV_ATTACHED;
1081 sbp_scan_dev(sdev);
1088 struct sbp_dev *sdev;
1090 sdev = (struct sbp_dev *)xfer->sc;
1092 device_printf(sdev->target->sbp->fd.dev,
1093 "%s:%s\n", __func__, sdev->bustgtlun);
1096 device_printf(sdev->target->sbp->fd.dev,
1097 "%s:%s resp=%d\n", __func__, sdev->bustgtlun, xfer->resp);
1100 SBP_LOCK(sdev->target->sbp);
1102 if (sdev->path) {
1103 xpt_release_devq(sdev->path, sdev->freeze, TRUE);
1104 sdev->freeze = 0;
1106 SBP_UNLOCK(sdev->target->sbp);
1110 sbp_agent_reset(struct sbp_dev *sdev)
1115 SBP_LOCK_ASSERT(sdev->target->sbp);
1117 device_printf(sdev->target->sbp->fd.dev,
1118 "%s:%s\n", __func__, sdev->bustgtlun);
1120 xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0x04);
1123 if (sdev->status == SBP_DEV_ATTACHED || sdev->status == SBP_DEV_PROBE)
1130 sbp_abort_all_ocbs(sdev, CAM_BDR_SENT);
1136 struct sbp_dev *sdev;
1138 sdev = (struct sbp_dev *)xfer->sc;
1140 device_printf(sdev->target->sbp->fd.dev,
1141 "%s:%s\n", __func__, sdev->bustgtlun);
1143 SBP_LOCK(sdev->target->sbp);
1145 sbp_agent_reset(sdev);
1146 SBP_UNLOCK(sdev->target->sbp);
1150 sbp_busy_timeout(struct sbp_dev *sdev)
1155 device_printf(sdev->target->sbp->fd.dev,
1156 "%s:%s\n", __func__, sdev->bustgtlun);
1158 xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0);
1171 struct sbp_dev *sdev;
1172 sdev = (struct sbp_dev *)xfer->sc;
1175 device_printf(sdev->target->sbp->fd.dev,
1176 "%s:%s\n", __func__, sdev->bustgtlun);
1182 SBP_LOCK(sdev->target->sbp);
1185 sdev->flags &= ~ORB_POINTER_ACTIVE;
1187 if ((sdev->flags & ORB_POINTER_NEED) != 0) {
1190 sdev->flags &= ~ORB_POINTER_NEED;
1191 ocb = STAILQ_FIRST(&sdev->ocbs);
1193 sbp_orb_pointer(sdev, ocb);
1195 SBP_UNLOCK(sdev->target->sbp);
1200 sbp_orb_pointer(struct sbp_dev *sdev, struct sbp_ocb *ocb)
1205 device_printf(sdev->target->sbp->fd.dev,
1207 __func__, sdev->bustgtlun,
1211 SBP_LOCK_ASSERT(sdev->target->sbp);
1213 if ((sdev->flags & ORB_POINTER_ACTIVE) != 0) {
1217 sdev->flags |= ORB_POINTER_NEED;
1221 sdev->flags |= ORB_POINTER_ACTIVE;
1222 xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0x08);
1231 htonl(((sdev->target->sbp->fd.fc->nodeid | FWLOCALBUS) << 16));
1244 struct sbp_dev *sdev;
1245 sdev = (struct sbp_dev *)xfer->sc;
1248 device_printf(sdev->target->sbp->fd.dev,
1249 "%s:%s\n", __func__, sdev->bustgtlun);
1253 device_printf(sdev->target->sbp->fd.dev,
1256 SBP_LOCK(sdev->target->sbp);
1258 sdev->flags &= ~ORB_DOORBELL_ACTIVE;
1259 if ((sdev->flags & ORB_DOORBELL_NEED) != 0) {
1260 sdev->flags &= ~ORB_DOORBELL_NEED;
1261 sbp_doorbell(sdev);
1263 SBP_UNLOCK(sdev->target->sbp);
1267 sbp_doorbell(struct sbp_dev *sdev)
1272 device_printf(sdev->target->sbp->fd.dev,
1273 "%s:%s\n", __func__, sdev->bustgtlun);
1276 if ((sdev->flags & ORB_DOORBELL_ACTIVE) != 0) {
1277 sdev->flags |= ORB_DOORBELL_NEED;
1280 sdev->flags |= ORB_DOORBELL_ACTIVE;
1281 xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0x10);
1291 sbp_write_cmd(struct sbp_dev *sdev, int tcode, int offset)
1298 SBP_LOCK_ASSERT(sdev->target->sbp);
1300 target = sdev->target;
1322 xfer->send.spd = min(sdev->target->fwdev->speed, max_speed);
1323 xfer->fc = sdev->target->sbp->fd.fc;
1331 xfer->sc = (caddr_t)sdev;
1333 fp->mode.wreqq.dest_hi = sdev->login->cmd_hi;
1334 fp->mode.wreqq.dest_lo = sdev->login->cmd_lo + offset;
1338 fp->mode.wreqq.dst = FWLOCALBUS | sdev->target->fwdev->dst;
1344 sbp_mgm_orb(struct sbp_dev *sdev, int func, struct sbp_ocb *aocb)
1352 target = sdev->target;
1364 if ((ocb = sbp_get_ocb(sdev)) == NULL) {
1369 ocb->sdev = sdev;
1373 ocb->orb[7] = htonl(SBP_DEV2ADDR(target->target_id, sdev->lun_id));
1376 device_printf(sdev->target->sbp->fd.dev,
1378 __func__,sdev->bustgtlun,
1385 ocb->orb[3] = htonl(sdev->dma.bus_addr);
1386 ocb->orb[4] = htonl(ORB_NOTIFY | sdev->lun_id);
1390 fwdma_sync(&sdev->dma, BUS_DMASYNC_PREREAD);
1401 ocb->orb[4] = htonl(ORB_NOTIFY | func | sdev->login->id);
1407 STAILQ_INSERT_TAIL(&sdev->target->mgm_ocb_queue, ocb, ocb);
1415 xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0);
1422 fp->mode.wreqb.dest_hi = sdev->target->mgm_hi;
1423 fp->mode.wreqb.dest_lo = sdev->target->mgm_lo;
1442 device_get_nameunit(ocb->sdev->target->sbp->fd.dev),
1473 ocb->sdev->bustgtlun,
1540 device_printf(ocb->sdev->target->sbp->fd.dev,
1542 __func__, ocb->sdev->bustgtlun,
1551 struct sbp_dev *sdev;
1555 sdev = ocb->sdev;
1560 device_printf(sdev->target->sbp->fd.dev,
1561 "%s:%s\n", __func__, sdev->bustgtlun);
1581 bcopy(sdev->vendor, inq->vendor, sizeof(inq->vendor));
1582 bcopy(sdev->product, inq->product, sizeof(inq->product));
1583 bcopy(sdev->revision + 2, inq->revision, sizeof(inq->revision));
1606 struct sbp_dev *sdev;
1654 sdev = target->luns[l];
1669 ocb = sbp_dequeue_ocb(sdev, sbp_status);
1671 device_printf(sdev->target->sbp->fd.dev,
1673 __func__,sdev->bustgtlun,
1679 device_printf(sdev->target->sbp->fd.dev,
1681 __func__, sdev->bustgtlun);
1684 device_printf(sdev->target->sbp->fd.dev,
1686 __func__, sdev->bustgtlun);
1697 device_printf(sdev->target->sbp->fd.dev,
1700 __func__, sdev->bustgtlun,
1705 device_printf(sdev->target->sbp->fd.dev,
1706 "%s\n", sdev->bustgtlun);
1733 if (sdev->path) {
1734 xpt_freeze_devq(sdev->path, 1);
1735 sdev->freeze++;
1755 fwdma_sync(&sdev->dma, BUS_DMASYNC_POSTREAD);
1756 login_res = sdev->login;
1763 device_printf(sdev->target->sbp->fd.dev,
1765 __func__, sdev->bustgtlun,
1770 sbp_busy_timeout(sdev);
1773 device_printf(sdev->target->sbp->fd.dev,
1775 __func__, sdev->bustgtlun);
1776 sdev->status = SBP_DEV_RESET;
1780 login_res = sdev->login;
1783 device_printf(sdev->target->sbp->fd.dev,
1785 __func__, sdev->bustgtlun,
1789 if (sdev->status == SBP_DEV_ATTACHED)
1790 sbp_scan_dev(sdev);
1792 sbp_agent_reset(sdev);
1796 device_printf(sdev->target->sbp->fd.dev,
1798 __func__, sdev->bustgtlun);
1800 sbp_login(sdev);
1804 sdev->status = SBP_DEV_RESET;
1807 sbp_busy_timeout(sdev);
1812 sbp_agent_reset(sdev);
1815 device_printf(sdev->target->sbp->fd.dev,
1817 __func__, sdev->bustgtlun, orb_fun);
1820 sbp_mgm_orb(sdev, ORB_FUN_RUNQUEUE, NULL);
1823 sdev->timeout = 0;
1849 sbp_free_ocb(sdev, ocb);
1852 sbp_agent_reset(sdev);
1868 xfer->spd = min(sdev->target->fwdev->speed, max_speed);
2011 struct sbp_dev *sdev;
2023 sdev = target->luns[j];
2024 if (sdev == NULL)
2026 callout_stop(&sdev->login_callout);
2027 if (sdev->status >= SBP_DEV_TOATTACH &&
2028 sdev->status <= SBP_DEV_ATTACHED)
2029 sbp_mgm_orb(sdev, ORB_FUN_LGO, NULL);
2048 sbp_free_sdev(struct sbp_dev *sdev)
2053 if (sdev == NULL)
2055 sbp = sdev->target->sbp;
2057 callout_drain(&sdev->login_callout);
2059 callout_drain(&sdev->ocb[i].timer);
2060 bus_dmamap_destroy(sbp->dmat, sdev->ocb[i].dmamap);
2062 fwdma_free(sbp->fd.fc, &sdev->dma);
2063 free(sdev, M_SBP);
2136 sbp_cam_detach_sdev(struct sbp_dev *sdev)
2138 if (sdev == NULL)
2140 if (sdev->status == SBP_DEV_DEAD)
2142 if (sdev->status == SBP_DEV_RESET)
2144 SBP_LOCK_ASSERT(sdev->target->sbp);
2145 sbp_abort_all_ocbs(sdev, CAM_DEV_NOT_THERE);
2146 if (sdev->path) {
2147 xpt_release_devq(sdev->path,
2148 sdev->freeze, TRUE);
2149 sdev->freeze = 0;
2150 xpt_async(AC_LOST_DEVICE, sdev->path, NULL);
2151 xpt_free_path(sdev->path);
2152 sdev->path = NULL;
2173 sbp_target_reset(struct sbp_dev *sdev, int method)
2176 struct sbp_target *target = sdev->target;
2197 sbp_mgm_orb(sdev, ORB_FUN_RST, NULL);
2201 sbp_reset_start(sdev);
2211 struct sbp_dev *sdev = ocb->sdev;
2212 struct sbp_target *target = sdev->target;
2215 device_printf(sdev->target->sbp->fd.dev,
2217 __func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr);
2219 sbp_free_ocb(sdev, ocb);
2223 sbp_mgm_orb(sdev, ORB_FUN_RUNQUEUE, NULL);
2225 device_printf(sdev->target->sbp->fd.dev,
2227 __func__, sdev->bustgtlun);
2228 sbp_reset_start(sdev);
2235 struct sbp_dev *sdev = ocb->sdev;
2237 device_printf(sdev->target->sbp->fd.dev,
2239 __func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr);
2241 SBP_LOCK_ASSERT(sdev->target->sbp);
2242 sdev->timeout++;
2243 switch (sdev->timeout) {
2246 xpt_freeze_devq(sdev->path, 1);
2247 sdev->freeze++;
2248 sbp_abort_all_ocbs(sdev, CAM_CMD_TIMEOUT);
2249 sbp_agent_reset(sdev);
2253 sbp_target_reset(sdev, sdev->timeout - 1);
2274 struct sbp_dev *sdev = NULL;
2278 /* target:lun -> sdev mapping */
2286 sdev = target->luns[ccb->ccb_h.target_lun];
2287 if (sdev != NULL && sdev->status != SBP_DEV_ATTACHED &&
2288 sdev->status != SBP_DEV_PROBE)
2289 sdev = NULL;
2294 if (sdev == NULL)
2305 if (sdev == NULL) {
2378 if (sdev == NULL) {
2390 if (sdev->status == SBP_DEV_PROBE) {
2401 if ((ocb = sbp_get_ocb(sdev)) == NULL) {
2403 if (sdev->freeze == 0) {
2404 xpt_freeze_devq(sdev->path, 1);
2405 sdev->freeze++;
2412 ocb->sdev = sdev;
2414 ccb->ccb_h.ccb_sdev_ptr = sdev;
2605 bus_dmamap_sync(ocb->sdev->target->sbp->dmat, ocb->dmamap,
2608 prev = sbp_enqueue_ocb(ocb->sdev, ocb);
2609 fwdma_sync(&ocb->sdev->dma, BUS_DMASYNC_PREWRITE);
2612 if (ocb->sdev->last_ocb != NULL)
2613 sbp_doorbell(ocb->sdev);
2615 sbp_orb_pointer(ocb->sdev, ocb);
2618 if (prev == NULL || (ocb->sdev->flags & ORB_LINK_DEAD) != 0) {
2619 ocb->sdev->flags &= ~ORB_LINK_DEAD;
2620 sbp_orb_pointer(ocb->sdev, ocb);
2640 sbp_dequeue_ocb(struct sbp_dev *sdev, struct sbp_status *sbp_status)
2647 device_printf(sdev->target->sbp->fd.dev,
2649 __func__, sdev->bustgtlun, ntohl(sbp_status->orb_lo), sbp_status->src);
2651 SBP_LOCK_ASSERT(sdev->target->sbp);
2652 STAILQ_FOREACH_SAFE(ocb, &sdev->ocbs, ocb, next) {
2655 STAILQ_REMOVE(&sdev->ocbs, ocb, sbp_ocb, ocb);
2659 bus_dmamap_sync(sdev->target->sbp->dmat,
2664 bus_dmamap_unload(sdev->target->sbp->dmat,
2670 sbp_orb_pointer(sdev, next);
2677 sdev->flags |= ORB_LINK_DEAD;
2685 if (sdev->last_ocb != NULL) {
2686 sbp_free_ocb(sdev, sdev->last_ocb);
2688 sdev->last_ocb = ocb;
2691 sbp_doorbell(sdev);
2699 device_printf(sdev->target->sbp->fd.dev,
2701 __func__, sdev->bustgtlun, order);
2708 sbp_enqueue_ocb(struct sbp_dev *sdev, struct sbp_ocb *ocb)
2712 SBP_LOCK_ASSERT(sdev->target->sbp);
2714 device_printf(sdev->target->sbp->fd.dev,
2715 "%s:%s 0x%08jx\n", __func__, sdev->bustgtlun, (uintmax_t)ocb->bus_addr);
2717 prev2 = prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb);
2718 STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb);
2727 prev2 = sdev->last_ocb;
2729 if (prev2 != NULL && (ocb->sdev->flags & ORB_LINK_DEAD) == 0) {
2747 sbp_get_ocb(struct sbp_dev *sdev)
2751 SBP_LOCK_ASSERT(sdev->target->sbp);
2752 ocb = STAILQ_FIRST(&sdev->free_ocbs);
2754 sdev->flags |= ORB_SHORTAGE;
2758 STAILQ_REMOVE_HEAD(&sdev->free_ocbs, ocb);
2764 sbp_free_ocb(struct sbp_dev *sdev, struct sbp_ocb *ocb)
2769 SBP_LOCK_ASSERT(sdev->target->sbp);
2770 STAILQ_INSERT_TAIL(&sdev->free_ocbs, ocb, ocb);
2771 if ((sdev->flags & ORB_SHORTAGE) != 0) {
2774 sdev->flags &= ~ORB_SHORTAGE;
2775 count = sdev->freeze;
2776 sdev->freeze = 0;
2777 xpt_release_devq(sdev->path, count, TRUE);
2784 struct sbp_dev *sdev;
2786 sdev = ocb->sdev;
2787 SBP_LOCK_ASSERT(sdev->target->sbp);
2789 device_printf(sdev->target->sbp->fd.dev,
2790 "%s:%s 0x%jx\n", __func__, sdev->bustgtlun, (uintmax_t)ocb->bus_addr);
2797 bus_dmamap_sync(sdev->target->sbp->dmat, ocb->dmamap,
2800 bus_dmamap_unload(sdev->target->sbp->dmat, ocb->dmamap);
2807 sbp_free_ocb(sdev, ocb);
2811 sbp_abort_all_ocbs(struct sbp_dev *sdev, int status)
2817 SBP_LOCK_ASSERT(sdev->target->sbp);
2818 STAILQ_CONCAT(&temp, &sdev->ocbs);
2819 STAILQ_INIT(&sdev->ocbs);
2824 if (sdev->last_ocb != NULL) {
2825 sbp_free_ocb(sdev, sdev->last_ocb);
2826 sdev->last_ocb = NULL;