Lines Matching refs:scb

161 					struct scb *scb);
165 struct scb *scb);
202 struct scb *scb);
210 struct scb *prev_scb,
211 struct scb *scb);
267 static void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb);
272 struct scb *scb);
372 ahc_sg_bus_to_virt(struct scb *scb, uint32_t sg_busaddr) in ahc_sg_bus_to_virt() argument
376 sg_index = (sg_busaddr - scb->sg_list_phys)/sizeof(struct ahc_dma_seg); in ahc_sg_bus_to_virt()
380 return (&scb->sg_list[sg_index]); in ahc_sg_bus_to_virt()
384 ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg) in ahc_sg_virt_to_bus() argument
389 sg_index = sg - &scb->sg_list[1]; in ahc_sg_virt_to_bus()
391 return (scb->sg_list_phys + (sg_index * sizeof(*scb->sg_list))); in ahc_sg_virt_to_bus()
402 ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op) in ahc_sync_scb() argument
406 /*offset*/(scb->hscb - ahc->hscbs) * sizeof(*scb->hscb), in ahc_sync_scb()
407 /*len*/sizeof(*scb->hscb), op); in ahc_sync_scb()
411 ahc_sync_sglist(struct ahc_softc *ahc, struct scb *scb, int op) in ahc_sync_sglist() argument
413 if (scb->sg_count == 0) in ahc_sync_sglist()
416 ahc_dmamap_sync(ahc, ahc->scb_data->sg_dmat, scb->sg_map->sg_dmamap, in ahc_sync_sglist()
417 /*offset*/(scb->sg_list - scb->sg_map->sg_vaddr) in ahc_sync_sglist()
419 /*len*/sizeof(struct ahc_dma_seg) * scb->sg_count, op); in ahc_sync_sglist()
436 ahc_update_residual(struct ahc_softc *ahc, struct scb *scb) in ahc_update_residual() argument
440 sgptr = ahc_le32toh(scb->hscb->sgptr); in ahc_update_residual()
442 ahc_calc_residual(ahc, scb); in ahc_update_residual()
526 struct scb *
529 struct scb *scb; in ahc_get_scb() local
531 if ((scb = SLIST_FIRST(&ahc->scb_data->free_scbs)) == NULL) { in ahc_get_scb()
533 scb = SLIST_FIRST(&ahc->scb_data->free_scbs); in ahc_get_scb()
534 if (scb == NULL) in ahc_get_scb()
538 return (scb); in ahc_get_scb()
545 ahc_free_scb(struct ahc_softc *ahc, struct scb *scb) in ahc_free_scb() argument
549 hscb = scb->hscb; in ahc_free_scb()
552 scb->flags = SCB_FREE; in ahc_free_scb()
555 SLIST_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links.sle); in ahc_free_scb()
558 ahc_platform_scb_free(ahc, scb); in ahc_free_scb()
561 struct scb *
564 struct scb* scb; in ahc_lookup_scb() local
566 scb = ahc->scb_data->scbindex[tag]; in ahc_lookup_scb()
567 if (scb != NULL) in ahc_lookup_scb()
568 ahc_sync_scb(ahc, scb, in ahc_lookup_scb()
570 return (scb); in ahc_lookup_scb()
574 ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb) in ahc_swap_with_next_hscb() argument
593 memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb)); in ahc_swap_with_next_hscb()
594 if ((scb->flags & SCB_CDB32_PTR) != 0) { in ahc_swap_with_next_hscb()
600 q_hscb->next = scb->hscb->tag; in ahc_swap_with_next_hscb()
603 ahc->next_queued_scb->hscb = scb->hscb; in ahc_swap_with_next_hscb()
604 scb->hscb = q_hscb; in ahc_swap_with_next_hscb()
607 ahc->scb_data->scbindex[scb->hscb->tag] = scb; in ahc_swap_with_next_hscb()
614 ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb) in ahc_queue_scb() argument
616 ahc_swap_with_next_hscb(ahc, scb); in ahc_queue_scb()
618 if (scb->hscb->tag == SCB_LIST_NULL in ahc_queue_scb()
619 || scb->hscb->next == SCB_LIST_NULL) in ahc_queue_scb()
621 scb->hscb->tag, scb->hscb->next); in ahc_queue_scb()
626 scb->hscb->lun &= LID; in ahc_queue_scb()
627 if (ahc_get_transfer_length(scb) & 0x1) in ahc_queue_scb()
628 scb->hscb->lun |= SCB_XFERLEN_ODD; in ahc_queue_scb()
633 ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag; in ahc_queue_scb()
639 ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); in ahc_queue_scb()
654 ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb) in ahc_get_sense_buf() argument
658 offset = scb - ahc->scb_data->scbarray; in ahc_get_sense_buf()
663 ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb) in ahc_get_sense_bufaddr() argument
667 offset = scb - ahc->scb_data->scbarray; in ahc_get_sense_bufaddr()
885 struct scb *scb; in ahc_run_qoutfifo() local
911 scb = ahc_lookup_scb(ahc, scb_index); in ahc_run_qoutfifo()
912 if (scb == NULL) { in ahc_run_qoutfifo()
924 ahc_update_residual(ahc, scb); in ahc_run_qoutfifo()
925 ahc_done(ahc, scb); in ahc_run_qoutfifo()
941 struct scb *scb; in ahc_run_untagged_queue() local
946 if ((scb = TAILQ_FIRST(queue)) != NULL in ahc_run_untagged_queue()
947 && (scb->flags & SCB_ACTIVE) == 0) { in ahc_run_untagged_queue()
948 scb->flags |= SCB_ACTIVE; in ahc_run_untagged_queue()
949 ahc_queue_scb(ahc, scb); in ahc_run_untagged_queue()
986 struct scb *scb; in ahc_handle_seqint() local
1021 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_seqint()
1022 if (scb == NULL) { in ahc_handle_seqint()
1032 hscb = scb->hscb; in ahc_handle_seqint()
1035 if ((scb->flags & SCB_SENSE) != 0) { in ahc_handle_seqint()
1041 scb->flags &= ~SCB_SENSE; in ahc_handle_seqint()
1042 ahc_set_transaction_status(scb, CAM_AUTOSENSE_FAIL); in ahc_handle_seqint()
1045 ahc_set_transaction_status(scb, CAM_SCSI_STATUS_ERROR); in ahc_handle_seqint()
1047 ahc_freeze_devq(ahc, scb); in ahc_handle_seqint()
1048 ahc_freeze_scb(scb); in ahc_handle_seqint()
1049 ahc_set_scsi_status(scb, hscb->shared_data.status.scsi_status); in ahc_handle_seqint()
1065 ahc_print_path(ahc, scb); in ahc_handle_seqint()
1067 scb->hscb->tag); in ahc_handle_seqint()
1071 if (ahc_perform_autosense(scb) == 0) in ahc_handle_seqint()
1080 sg = scb->sg_list; in ahc_handle_seqint()
1085 ahc_update_residual(ahc, scb); in ahc_handle_seqint()
1088 ahc_print_path(ahc, scb); in ahc_handle_seqint()
1092 sg->addr = ahc_get_sense_bufaddr(ahc, scb); in ahc_handle_seqint()
1093 sg->len = ahc_get_sense_bufsize(ahc, scb); in ahc_handle_seqint()
1103 && SCB_GET_LUN(scb) < 8) in ahc_handle_seqint()
1104 sc->byte2 = SCB_GET_LUN(scb) << 5; in ahc_handle_seqint()
1127 if (ahc_get_residual(scb) in ahc_handle_seqint()
1128 == ahc_get_transfer_length(scb)) { in ahc_handle_seqint()
1135 scb->flags &= ~SCB_NEGOTIATE; in ahc_handle_seqint()
1136 scb->flags |= SCB_AUTO_NEGOTIATE; in ahc_handle_seqint()
1141 hscb->sgptr = scb->sg_list_phys | SG_FULL_RESID; in ahc_handle_seqint()
1143 scb->sg_count = 1; in ahc_handle_seqint()
1144 scb->flags |= SCB_SENSE; in ahc_handle_seqint()
1145 ahc_qinfifo_requeue_tail(ahc, scb); in ahc_handle_seqint()
1151 ahc_scb_timer_reset(scb, 5 * 1000000); in ahc_handle_seqint()
1253 struct scb *scb; in ahc_handle_seqint() local
1273 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_seqint()
1276 if (scb == NULL) in ahc_handle_seqint()
1283 scb); in ahc_handle_seqint()
1300 scb); in ahc_handle_seqint()
1358 struct scb *scb; in ahc_handle_seqint() local
1365 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_seqint()
1366 if (scb != NULL) in ahc_handle_seqint()
1367 ahc_set_transaction_status(scb, in ahc_handle_seqint()
1392 scb = ahc_lookup_scb(ahc, scbindex); in ahc_handle_seqint()
1397 ahc_print_path(ahc, scb); in ahc_handle_seqint()
1401 scb->hscb->tag); in ahc_handle_seqint()
1402 ahc_print_path(ahc, scb); in ahc_handle_seqint()
1405 ahc_get_transfer_length(scb), scb->sg_count); in ahc_handle_seqint()
1406 if (scb->sg_count > 0) { in ahc_handle_seqint()
1407 for (i = 0; i < scb->sg_count; i++) { in ahc_handle_seqint()
1411 (ahc_le32toh(scb->sg_list[i].len) >> 24 in ahc_handle_seqint()
1413 ahc_le32toh(scb->sg_list[i].addr), in ahc_handle_seqint()
1414 ahc_le32toh(scb->sg_list[i].len) in ahc_handle_seqint()
1422 ahc_freeze_devq(ahc, scb); in ahc_handle_seqint()
1423 if ((scb->flags & SCB_SENSE) == 0) { in ahc_handle_seqint()
1424 ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR); in ahc_handle_seqint()
1426 scb->flags &= ~SCB_SENSE; in ahc_handle_seqint()
1427 ahc_set_transaction_status(scb, CAM_AUTOSENSE_FAIL); in ahc_handle_seqint()
1429 ahc_freeze_scb(scb); in ahc_handle_seqint()
1460 scb = ahc_lookup_scb(ahc, scbindex); in ahc_handle_seqint()
1461 if (scb != NULL in ahc_handle_seqint()
1462 && (scb->flags & SCB_RECOVERY_SCB) != 0) in ahc_handle_seqint()
1467 ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb), in ahc_handle_seqint()
1468 SCB_GET_CHANNEL(ahc, scb), in ahc_handle_seqint()
1469 SCB_GET_LUN(scb), scb->hscb->tag, in ahc_handle_seqint()
1540 struct scb *scb; in ahc_handle_scsiint() local
1576 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_scsiint()
1577 if (scb != NULL in ahc_handle_scsiint()
1579 scb = NULL; in ahc_handle_scsiint()
1655 if (scb != NULL) { in ahc_handle_scsiint()
1656 if (SCB_IS_SILENT(scb)) in ahc_handle_scsiint()
1659 ahc_print_path(ahc, scb); in ahc_handle_scsiint()
1660 scb->flags |= SCB_TRANSMISSION_ERROR; in ahc_handle_scsiint()
1747 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_scsiint()
1748 if (scb == NULL) { in ahc_handle_scsiint()
1757 ahc_print_path(ahc, scb); in ahc_handle_scsiint()
1762 ahc_scb_devinfo(ahc, &devinfo, scb); in ahc_handle_scsiint()
1763 ahc_set_transaction_status(scb, CAM_SEL_TIMEOUT); in ahc_handle_scsiint()
1764 ahc_freeze_devq(ahc, scb); in ahc_handle_scsiint()
1832 tag = scb->hscb->tag; in ahc_handle_scsiint()
1833 ahc_print_path(ahc, scb); in ahc_handle_scsiint()
1835 scb->hscb->tag, tag == SCB_LIST_NULL ? in ahc_handle_scsiint()
1850 if (scb != NULL in ahc_handle_scsiint()
1851 && scb->io_ctx->ccb_h.func_code== XPT_RESET_DEV in ahc_handle_scsiint()
1852 && ahc_match_scb(ahc, scb, target, channel, in ahc_handle_scsiint()
1856 ahc_set_transaction_status(scb, CAM_REQ_CMP); in ahc_handle_scsiint()
1887 ahc_qinfifo_requeue_tail(ahc, scb); in ahc_handle_scsiint()
1899 ahc_qinfifo_requeue_tail(ahc, scb); in ahc_handle_scsiint()
1913 ahc_qinfifo_requeue_tail(ahc, scb); in ahc_handle_scsiint()
1920 if (scb != NULL) { in ahc_handle_scsiint()
1923 if ((scb->hscb->control & TAG_ENB) != 0) in ahc_handle_scsiint()
1924 tag = scb->hscb->tag; in ahc_handle_scsiint()
1927 ahc_print_path(ahc, scb); in ahc_handle_scsiint()
1929 SCB_GET_LUN(scb), tag, in ahc_handle_scsiint()
2101 ahc_print_scb(struct scb *scb)
2105 struct hardware_scb *hscb = scb->hscb;
2108 (void *)scb,
2121 if (scb->sg_count > 0) {
2122 for (i = 0; i < scb->sg_count; i++) {
2125 (ahc_le32toh(scb->sg_list[i].len) >> 24
2127 ahc_le32toh(scb->sg_list[i].addr),
2128 ahc_le32toh(scb->sg_list[i].len));
2694 struct scb *pending_scb; in ahc_update_pending_scbs()
2843 struct scb *scb) in ahc_scb_devinfo() argument
2848 our_id = SCSIID_OUR_ID(scb->hscb->scsiid); in ahc_scb_devinfo()
2850 if ((scb->flags & SCB_TARGET_SCB) != 0) in ahc_scb_devinfo()
2852 ahc_compile_devinfo(devinfo, our_id, SCB_GET_TARGET(ahc, scb), in ahc_scb_devinfo()
2853 SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahc, scb), role); in ahc_scb_devinfo()
2877 struct scb *scb) in ahc_setup_initiator_msgout() argument
2887 if ((scb->flags & SCB_DEVICE_RESET) == 0 in ahc_setup_initiator_msgout()
2891 identify_msg = MSG_IDENTIFYFLAG | SCB_GET_LUN(scb); in ahc_setup_initiator_msgout()
2892 if ((scb->hscb->control & DISCENB) != 0) in ahc_setup_initiator_msgout()
2897 if ((scb->hscb->control & TAG_ENB) != 0) { in ahc_setup_initiator_msgout()
2899 scb->hscb->control & (TAG_ENB|SCB_TAG_TYPE); in ahc_setup_initiator_msgout()
2900 ahc->msgout_buf[ahc->msgout_index++] = scb->hscb->tag; in ahc_setup_initiator_msgout()
2905 if (scb->flags & SCB_DEVICE_RESET) { in ahc_setup_initiator_msgout()
2908 ahc_print_path(ahc, scb); in ahc_setup_initiator_msgout()
2918 } else if ((scb->flags & SCB_ABORT) != 0) { in ahc_setup_initiator_msgout()
2919 if ((scb->hscb->control & TAG_ENB) != 0) in ahc_setup_initiator_msgout()
2924 ahc_print_path(ahc, scb); in ahc_setup_initiator_msgout()
2926 (scb->hscb->control & TAG_ENB) != 0 ? " Tag" : ""); in ahc_setup_initiator_msgout()
2935 } else if ((scb->flags & (SCB_AUTO_NEGOTIATE|SCB_NEGOTIATE)) != 0) { in ahc_setup_initiator_msgout()
2940 printk("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid, in ahc_setup_initiator_msgout()
2943 "SCB flags = %x", scb->hscb->tag, scb->hscb->control, in ahc_setup_initiator_msgout()
2944 ahc_inb(ahc, MSG_OUT), scb->flags); in ahc_setup_initiator_msgout()
2952 scb->hscb->control &= ~MK_MESSAGE; in ahc_setup_initiator_msgout()
3141 struct scb *scb; in ahc_handle_proto_violation() local
3150 scb = ahc_lookup_scb(ahc, scbid); in ahc_handle_proto_violation()
3164 scb = NULL; in ahc_handle_proto_violation()
3165 } else if (scb == NULL) { in ahc_handle_proto_violation()
3174 ahc_set_transaction_status(scb, CAM_SEQUENCE_FAIL); in ahc_handle_proto_violation()
3176 ahc_print_path(ahc, scb); in ahc_handle_proto_violation()
3186 ahc_print_path(ahc, scb); in ahc_handle_proto_violation()
3189 ahc_print_path(ahc, scb); in ahc_handle_proto_violation()
3216 if (scb == NULL) { in ahc_handle_proto_violation()
3223 ahc_print_path(ahc, scb); in ahc_handle_proto_violation()
3224 scb->flags |= SCB_ABORT; in ahc_handle_proto_violation()
4014 struct scb *scb; in ahc_handle_msg_reject() local
4022 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_msg_reject()
4083 } else if ((scb->hscb->control & MSG_SIMPLE_TASK) != 0) { in ahc_handle_msg_reject()
4087 tag_type = (scb->hscb->control & MSG_SIMPLE_TASK); in ahc_handle_msg_reject()
4093 ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_NONE); in ahc_handle_msg_reject()
4101 ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_BASIC); in ahc_handle_msg_reject()
4111 scb->hscb->control &= mask; in ahc_handle_msg_reject()
4112 ahc_set_transaction_tag(scb, /*enabled*/FALSE, in ahc_handle_msg_reject()
4126 TAILQ_INSERT_HEAD(untagged_q, scb, links.tqe); in ahc_handle_msg_reject()
4127 scb->flags |= SCB_UNTAGGEDQ; in ahc_handle_msg_reject()
4129 ahc_busy_tcl(ahc, BUILD_TCL(scb->hscb->scsiid, devinfo->lun), in ahc_handle_msg_reject()
4130 scb->hscb->tag); in ahc_handle_msg_reject()
4137 ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb), in ahc_handle_msg_reject()
4138 SCB_GET_CHANNEL(ahc, scb), in ahc_handle_msg_reject()
4139 SCB_GET_LUN(scb), /*tag*/SCB_LIST_NULL, in ahc_handle_msg_reject()
4160 struct scb *scb; in ahc_handle_ign_wide_residue() local
4163 scb = ahc_lookup_scb(ahc, scb_index); in ahc_handle_ign_wide_residue()
4169 || ahc_get_transfer_dir(scb) != CAM_DIR_IN) { in ahc_handle_ign_wide_residue()
4218 sg = ahc_sg_bus_to_virt(scb, sgptr); in ahc_handle_ign_wide_residue()
4226 if (sg != scb->sg_list in ahc_handle_ign_wide_residue()
4244 sgptr = ahc_sg_virt_to_bus(scb, sg); in ahc_handle_ign_wide_residue()
4268 struct scb *scb; in ahc_reinitialize_dataptrs() local
4276 scb = ahc_lookup_scb(ahc, scb_index); in ahc_reinitialize_dataptrs()
4283 sg = ahc_sg_bus_to_virt(scb, sgptr); in ahc_reinitialize_dataptrs()
4378 struct scb *scb) in ahc_setup_target_msgin() argument
4389 if (scb != NULL && (scb->flags & SCB_AUTO_NEGOTIATE) != 0) in ahc_setup_target_msgin()
4782 scb_data->scbarray = kzalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, in ahc_init_scbdata()
4968 struct scb *next_scb; in ahc_alloc_scbs()
5440 (u_int)sizeof(struct scb), in ahc_init()
5755 ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, int target, in ahc_match_scb() argument
5758 int targ = SCB_GET_TARGET(ahc, scb); in ahc_match_scb()
5759 char chan = SCB_GET_CHANNEL(ahc, scb); in ahc_match_scb()
5760 int slun = SCB_GET_LUN(scb); in ahc_match_scb()
5772 group = XPT_FC_GROUP(scb->io_ctx->ccb_h.func_code); in ahc_match_scb()
5775 && ((tag == scb->hscb->tag) in ahc_match_scb()
5779 && ((tag == scb->io_ctx->csio.tag_id) in ahc_match_scb()
5783 match = ((tag == scb->hscb->tag) || (tag == SCB_LIST_NULL)); in ahc_match_scb()
5791 ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb) in ahc_freeze_devq() argument
5797 target = SCB_GET_TARGET(ahc, scb); in ahc_freeze_devq()
5798 lun = SCB_GET_LUN(scb); in ahc_freeze_devq()
5799 channel = SCB_GET_CHANNEL(ahc, scb); in ahc_freeze_devq()
5805 ahc_platform_freeze_devq(ahc, scb); in ahc_freeze_devq()
5809 ahc_qinfifo_requeue_tail(struct ahc_softc *ahc, struct scb *scb) in ahc_qinfifo_requeue_tail() argument
5811 struct scb *prev_scb; in ahc_qinfifo_requeue_tail()
5822 ahc_qinfifo_requeue(ahc, prev_scb, scb); in ahc_qinfifo_requeue_tail()
5831 ahc_qinfifo_requeue(struct ahc_softc *ahc, struct scb *prev_scb, in ahc_qinfifo_requeue()
5832 struct scb *scb) in ahc_qinfifo_requeue() argument
5835 ahc_outb(ahc, NEXT_QUEUED_SCB, scb->hscb->tag); in ahc_qinfifo_requeue()
5837 prev_scb->hscb->next = scb->hscb->tag; in ahc_qinfifo_requeue()
5841 ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag; in ahc_qinfifo_requeue()
5842 scb->hscb->next = ahc->next_queued_scb->hscb->tag; in ahc_qinfifo_requeue()
5843 ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); in ahc_qinfifo_requeue()
5866 struct scb *scb; in ahc_search_qinfifo() local
5867 struct scb *prev_scb; in ahc_search_qinfifo()
5904 scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinpos]); in ahc_search_qinfifo()
5905 if (scb == NULL) { in ahc_search_qinfifo()
5911 if (ahc_match_scb(ahc, scb, target, channel, lun, tag, role)) { in ahc_search_qinfifo()
5922 ostat = ahc_get_transaction_status(scb); in ahc_search_qinfifo()
5924 ahc_set_transaction_status(scb, status); in ahc_search_qinfifo()
5925 cstat = ahc_get_transaction_status(scb); in ahc_search_qinfifo()
5927 ahc_freeze_scb(scb); in ahc_search_qinfifo()
5928 if ((scb->flags & SCB_ACTIVE) == 0) in ahc_search_qinfifo()
5930 ahc_done(ahc, scb); in ahc_search_qinfifo()
5937 ahc_qinfifo_requeue(ahc, prev_scb, scb); in ahc_search_qinfifo()
5938 prev_scb = scb; in ahc_search_qinfifo()
5942 ahc_qinfifo_requeue(ahc, prev_scb, scb); in ahc_search_qinfifo()
5943 prev_scb = scb; in ahc_search_qinfifo()
5969 scb = ahc_lookup_scb(ahc, ahc->qinfifo[qinstart]); in ahc_search_qinfifo()
5971 if (scb == NULL) { in ahc_search_qinfifo()
5982 next = scb->hscb->next; in ahc_search_qinfifo()
5983 ahc->scb_data->scbindex[scb->hscb->tag] = NULL; in ahc_search_qinfifo()
5984 ahc_swap_with_next_hscb(ahc, scb); in ahc_search_qinfifo()
5985 scb->hscb->next = next; in ahc_search_qinfifo()
5986 ahc->qinfifo[qinstart] = scb->hscb->tag; in ahc_search_qinfifo()
5989 ahc_outb(ahc, NEXT_QUEUED_SCB, scb->hscb->tag); in ahc_search_qinfifo()
5993 scb = ahc_lookup_scb(ahc, ahc->qinfifo[qintail]); in ahc_search_qinfifo()
5994 scb->hscb->next = ahc->next_queued_scb->hscb->tag; in ahc_search_qinfifo()
6016 scb = ahc_lookup_scb(ahc, scb_index); in ahc_search_qinfifo()
6017 if (scb == NULL) { in ahc_search_qinfifo()
6022 if (ahc_match_scb(ahc, scb, target, channel, in ahc_search_qinfifo()
6034 ostat = ahc_get_transaction_status(scb); in ahc_search_qinfifo()
6036 ahc_set_transaction_status(scb, in ahc_search_qinfifo()
6038 cstat = ahc_get_transaction_status(scb); in ahc_search_qinfifo()
6040 ahc_freeze_scb(scb); in ahc_search_qinfifo()
6041 if ((scb->flags & SCB_ACTIVE) == 0) in ahc_search_qinfifo()
6043 ahc_done(ahc, scb); in ahc_search_qinfifo()
6075 struct scb *scb; in ahc_search_untagged_queues() local
6106 struct scb *next_scb; in ahc_search_untagged_queues()
6112 scb = next_scb; in ahc_search_untagged_queues()
6113 next_scb = TAILQ_NEXT(scb, links.tqe); in ahc_search_untagged_queues()
6124 if ((scb->flags & SCB_ACTIVE) != 0) in ahc_search_untagged_queues()
6127 if (ahc_match_scb(ahc, scb, target, channel, lun, in ahc_search_untagged_queues()
6129 || (ctx != NULL && ctx != scb->io_ctx)) in ahc_search_untagged_queues()
6142 ostat = ahc_get_transaction_status(scb); in ahc_search_untagged_queues()
6144 ahc_set_transaction_status(scb, status); in ahc_search_untagged_queues()
6145 cstat = ahc_get_transaction_status(scb); in ahc_search_untagged_queues()
6147 ahc_freeze_scb(scb); in ahc_search_untagged_queues()
6148 if ((scb->flags & SCB_ACTIVE) == 0) in ahc_search_untagged_queues()
6150 ahc_done(ahc, scb); in ahc_search_untagged_queues()
6154 scb->flags &= ~SCB_UNTAGGEDQ; in ahc_search_untagged_queues()
6155 TAILQ_REMOVE(untagged_q, scb, links.tqe); in ahc_search_untagged_queues()
6173 struct scb *scbp; in ahc_search_disc_list()
6335 struct scb *scbp; in ahc_abort_scbs()
6336 struct scb *scbp_next; in ahc_abort_scbs()
6654 ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb) in ahc_calc_residual() argument
6678 hscb = scb->hscb; in ahc_calc_residual()
6693 resid = ahc_get_transfer_length(scb); in ahc_calc_residual()
6707 sg = ahc_sg_bus_to_virt(scb, resid_sgptr & SG_PTR_MASK); in ahc_calc_residual()
6722 if ((scb->flags & SCB_SENSE) == 0) in ahc_calc_residual()
6723 ahc_set_residual(scb, resid); in ahc_calc_residual()
6725 ahc_set_sense_residual(scb, resid); in ahc_calc_residual()
6729 ahc_print_path(ahc, scb); in ahc_calc_residual()
6731 (scb->flags & SCB_SENSE) ? "Sense " : "", resid); in ahc_calc_residual()
7170 struct scb *scb; in ahc_dump_card_state() local
7301 LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) { in ahc_dump_card_state()
7304 cur_col = printk("\n%3d ", scb->hscb->tag); in ahc_dump_card_state()
7305 ahc_scb_control_print(scb->hscb->control, &cur_col, 60); in ahc_dump_card_state()
7306 ahc_scb_scsiid_print(scb->hscb->scsiid, &cur_col, 60); in ahc_dump_card_state()
7307 ahc_scb_lun_print(scb->hscb->lun, &cur_col, 60); in ahc_dump_card_state()
7309 ahc_outb(ahc, SCBPTR, scb->hscb->tag); in ahc_dump_card_state()
7321 SLIST_FOREACH(scb, &ahc->scb_data->free_scbs, links.sle) { in ahc_dump_card_state()
7324 printk("%d ", scb->hscb->tag); in ahc_dump_card_state()
7335 TAILQ_FOREACH(scb, untagged_q, links.tqe) { in ahc_dump_card_state()
7338 printk("%d ", scb->hscb->tag); in ahc_dump_card_state()
7651 struct scb *scb; in ahc_handle_en_lun() local
7662 LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) { in ahc_handle_en_lun()
7665 ccbh = &scb->io_ctx->ccb_h; in ahc_handle_en_lun()