Lines Matching refs:scb
253 ahc_print_path(struct ahc_softc *ahc, struct scb *scb) in ahc_print_path() argument
257 scb != NULL ? SCB_GET_CHANNEL(ahc, scb) : 'X', in ahc_print_path()
258 scb != NULL ? SCB_GET_TARGET(ahc, scb) : -1, in ahc_print_path()
259 scb != NULL ? SCB_GET_LUN(scb) : -1); in ahc_print_path()
363 struct scb *);
452 static void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*);
454 static int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
459 ahc_linux_unmap_scb(struct ahc_softc *ahc, struct scb *scb) in ahc_linux_unmap_scb() argument
463 cmd = scb->io_ctx; in ahc_linux_unmap_scb()
464 ahc_sync_sglist(ahc, scb, BUS_DMASYNC_POSTWRITE); in ahc_linux_unmap_scb()
470 ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, in ahc_linux_map_seg() argument
475 if ((scb->sg_count + 1) > AHC_NSEG) in ahc_linux_map_seg()
481 scb->platform_data->xfer_len += len; in ahc_linux_map_seg()
1264 ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb) in ahc_platform_freeze_devq() argument
1266 ahc_platform_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb), in ahc_platform_freeze_devq()
1267 SCB_GET_CHANNEL(ahc, scb), in ahc_platform_freeze_devq()
1268 SCB_GET_LUN(scb), SCB_LIST_NULL, in ahc_platform_freeze_devq()
1425 struct scb *scb; in ahc_linux_run_command() local
1465 scb = ahc_get_scb(ahc); in ahc_linux_run_command()
1466 if (!scb) { in ahc_linux_run_command()
1471 scb->io_ctx = cmd; in ahc_linux_run_command()
1472 scb->platform_data->dev = dev; in ahc_linux_run_command()
1473 hscb = scb->hscb; in ahc_linux_run_command()
1474 cmd->host_scribble = (char *)scb; in ahc_linux_run_command()
1482 mask = SCB_GET_TARGET_MASK(ahc, scb); in ahc_linux_run_command()
1483 tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb), in ahc_linux_run_command()
1484 SCB_GET_OUR_ID(scb), in ahc_linux_run_command()
1485 SCB_GET_TARGET(ahc, scb), &tstate); in ahc_linux_run_command()
1495 scb->flags |= SCB_AUTO_NEGOTIATE; in ahc_linux_run_command()
1496 scb->hscb->control |= MK_MESSAGE; in ahc_linux_run_command()
1514 scb->flags |= SCB_CDB32_PTR; in ahc_linux_run_command()
1517 scb->platform_data->xfer_len = 0; in ahc_linux_run_command()
1518 ahc_set_residual(scb, 0); in ahc_linux_run_command()
1519 ahc_set_sense_residual(scb, 0); in ahc_linux_run_command()
1520 scb->sg_count = 0; in ahc_linux_run_command()
1528 sg = scb->sg_list; in ahc_linux_run_command()
1540 consumed = ahc_linux_map_seg(ahc, scb, in ahc_linux_run_command()
1543 scb->sg_count += consumed; in ahc_linux_run_command()
1551 scb->hscb->sgptr = in ahc_linux_run_command()
1552 ahc_htole32(scb->sg_list_phys | SG_FULL_RESID); in ahc_linux_run_command()
1558 scb->hscb->dataptr = scb->sg_list->addr; in ahc_linux_run_command()
1559 scb->hscb->datacnt = scb->sg_list->len; in ahc_linux_run_command()
1561 scb->hscb->sgptr = ahc_htole32(SG_LIST_NULL); in ahc_linux_run_command()
1562 scb->hscb->dataptr = 0; in ahc_linux_run_command()
1563 scb->hscb->datacnt = 0; in ahc_linux_run_command()
1564 scb->sg_count = 0; in ahc_linux_run_command()
1567 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links); in ahc_linux_run_command()
1574 scb->flags |= SCB_ACTIVE; in ahc_linux_run_command()
1576 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe); in ahc_linux_run_command()
1577 scb->flags |= SCB_UNTAGGEDQ; in ahc_linux_run_command()
1579 ahc_queue_scb(ahc, scb); in ahc_linux_run_command()
1693 ahc_done(struct ahc_softc *ahc, struct scb *scb) in ahc_done() argument
1698 LIST_REMOVE(scb, pending_links); in ahc_done()
1699 if ((scb->flags & SCB_UNTAGGEDQ) != 0) { in ahc_done()
1703 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb); in ahc_done()
1705 TAILQ_REMOVE(untagged_q, scb, links.tqe); in ahc_done()
1707 } else if ((scb->flags & SCB_ACTIVE) == 0) { in ahc_done()
1713 printk("SCB %d done'd twice\n", scb->hscb->tag); in ahc_done()
1717 cmd = scb->io_ctx; in ahc_done()
1718 dev = scb->platform_data->dev; in ahc_done()
1725 ahc_linux_unmap_scb(ahc, scb); in ahc_done()
1734 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) { in ahc_done()
1738 ahc_get_transfer_length(scb) - ahc_get_residual(scb); in ahc_done()
1739 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { in ahc_done()
1742 ahc_print_path(ahc, scb); in ahc_done()
1746 ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); in ahc_done()
1757 } else if (amount_xferred < scb->io_ctx->underflow) { in ahc_done()
1760 ahc_print_path(ahc, scb); in ahc_done()
1762 for (i = 0; i < scb->io_ctx->cmd_len; i++) in ahc_done()
1763 printk(" 0x%x", scb->io_ctx->cmnd[i]); in ahc_done()
1765 ahc_print_path(ahc, scb); in ahc_done()
1768 ahc_get_residual(scb), in ahc_done()
1769 ahc_get_transfer_length(scb)); in ahc_done()
1770 ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR); in ahc_done()
1773 ahc_set_transaction_status(scb, CAM_REQ_CMP); in ahc_done()
1775 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) { in ahc_done()
1776 ahc_linux_handle_scsi_status(ahc, cmd->device, scb); in ahc_done()
1780 && ahc_get_transaction_status(scb) == CAM_REQ_CMP in ahc_done()
1781 && ahc_get_scsi_status(scb) != SCSI_STATUS_QUEUE_FULL) in ahc_done()
1798 if ((scb->flags & SCB_RECOVERY_SCB) != 0) { in ahc_done()
1800 if (ahc_get_transaction_status(scb) == CAM_BDR_SENT in ahc_done()
1801 || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) in ahc_done()
1802 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); in ahc_done()
1808 ahc_free_scb(ahc, scb); in ahc_done()
1814 struct scsi_device *sdev, struct scb *scb) in ahc_linux_handle_scsi_status() argument
1835 switch (ahc_get_scsi_status(scb)) { in ahc_linux_handle_scsi_status()
1847 cmd = scb->io_ctx; in ahc_linux_handle_scsi_status()
1848 if (scb->flags & SCB_SENSE) { in ahc_linux_handle_scsi_status()
1852 - ahc_get_sense_residual(scb), in ahc_linux_handle_scsi_status()
1855 ahc_get_sense_buf(ahc, scb), sense_size); in ahc_linux_handle_scsi_status()
1912 ahc_print_path(ahc, scb); in ahc_linux_handle_scsi_status()
1920 ahc_set_transaction_status(scb, CAM_REQUEUE_REQ); in ahc_linux_handle_scsi_status()
1921 ahc_set_scsi_status(scb, SCSI_STATUS_OK); in ahc_linux_handle_scsi_status()
1932 ahc_set_scsi_status(scb, SCSI_STATUS_BUSY); in ahc_linux_handle_scsi_status()
2057 struct scb *pending_scb; in ahc_linux_queue_recovery_cmd()
2193 struct scb *bus_scb; in ahc_linux_queue_recovery_cmd()