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()
1265 ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb) in ahc_platform_freeze_devq() argument
1267 ahc_platform_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb), in ahc_platform_freeze_devq()
1268 SCB_GET_CHANNEL(ahc, scb), in ahc_platform_freeze_devq()
1269 SCB_GET_LUN(scb), SCB_LIST_NULL, in ahc_platform_freeze_devq()
1426 struct scb *scb; in ahc_linux_run_command() local
1466 scb = ahc_get_scb(ahc); in ahc_linux_run_command()
1467 if (!scb) { in ahc_linux_run_command()
1472 scb->io_ctx = cmd; in ahc_linux_run_command()
1473 scb->platform_data->dev = dev; in ahc_linux_run_command()
1474 hscb = scb->hscb; in ahc_linux_run_command()
1475 cmd->host_scribble = (char *)scb; in ahc_linux_run_command()
1483 mask = SCB_GET_TARGET_MASK(ahc, scb); in ahc_linux_run_command()
1484 tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb), in ahc_linux_run_command()
1485 SCB_GET_OUR_ID(scb), in ahc_linux_run_command()
1486 SCB_GET_TARGET(ahc, scb), &tstate); in ahc_linux_run_command()
1496 scb->flags |= SCB_AUTO_NEGOTIATE; in ahc_linux_run_command()
1497 scb->hscb->control |= MK_MESSAGE; in ahc_linux_run_command()
1515 scb->flags |= SCB_CDB32_PTR; in ahc_linux_run_command()
1518 scb->platform_data->xfer_len = 0; in ahc_linux_run_command()
1519 ahc_set_residual(scb, 0); in ahc_linux_run_command()
1520 ahc_set_sense_residual(scb, 0); in ahc_linux_run_command()
1521 scb->sg_count = 0; in ahc_linux_run_command()
1529 sg = scb->sg_list; in ahc_linux_run_command()
1541 consumed = ahc_linux_map_seg(ahc, scb, in ahc_linux_run_command()
1544 scb->sg_count += consumed; in ahc_linux_run_command()
1552 scb->hscb->sgptr = in ahc_linux_run_command()
1553 ahc_htole32(scb->sg_list_phys | SG_FULL_RESID); in ahc_linux_run_command()
1559 scb->hscb->dataptr = scb->sg_list->addr; in ahc_linux_run_command()
1560 scb->hscb->datacnt = scb->sg_list->len; in ahc_linux_run_command()
1562 scb->hscb->sgptr = ahc_htole32(SG_LIST_NULL); in ahc_linux_run_command()
1563 scb->hscb->dataptr = 0; in ahc_linux_run_command()
1564 scb->hscb->datacnt = 0; in ahc_linux_run_command()
1565 scb->sg_count = 0; in ahc_linux_run_command()
1568 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links); in ahc_linux_run_command()
1575 scb->flags |= SCB_ACTIVE; in ahc_linux_run_command()
1577 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe); in ahc_linux_run_command()
1578 scb->flags |= SCB_UNTAGGEDQ; in ahc_linux_run_command()
1580 ahc_queue_scb(ahc, scb); in ahc_linux_run_command()
1694 ahc_done(struct ahc_softc *ahc, struct scb *scb) in ahc_done() argument
1699 LIST_REMOVE(scb, pending_links); in ahc_done()
1700 if ((scb->flags & SCB_UNTAGGEDQ) != 0) { in ahc_done()
1704 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb); in ahc_done()
1706 TAILQ_REMOVE(untagged_q, scb, links.tqe); in ahc_done()
1708 } else if ((scb->flags & SCB_ACTIVE) == 0) { in ahc_done()
1714 printk("SCB %d done'd twice\n", scb->hscb->tag); in ahc_done()
1718 cmd = scb->io_ctx; in ahc_done()
1719 dev = scb->platform_data->dev; in ahc_done()
1726 ahc_linux_unmap_scb(ahc, scb); in ahc_done()
1735 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) { in ahc_done()
1739 ahc_get_transfer_length(scb) - ahc_get_residual(scb); in ahc_done()
1740 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { in ahc_done()
1743 ahc_print_path(ahc, scb); in ahc_done()
1747 ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); in ahc_done()
1758 } else if (amount_xferred < scb->io_ctx->underflow) { in ahc_done()
1761 ahc_print_path(ahc, scb); in ahc_done()
1763 for (i = 0; i < scb->io_ctx->cmd_len; i++) in ahc_done()
1764 printk(" 0x%x", scb->io_ctx->cmnd[i]); in ahc_done()
1766 ahc_print_path(ahc, scb); in ahc_done()
1769 ahc_get_residual(scb), in ahc_done()
1770 ahc_get_transfer_length(scb)); in ahc_done()
1771 ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR); in ahc_done()
1774 ahc_set_transaction_status(scb, CAM_REQ_CMP); in ahc_done()
1776 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) { in ahc_done()
1777 ahc_linux_handle_scsi_status(ahc, cmd->device, scb); in ahc_done()
1781 && ahc_get_transaction_status(scb) == CAM_REQ_CMP in ahc_done()
1782 && ahc_get_scsi_status(scb) != SCSI_STATUS_QUEUE_FULL) in ahc_done()
1799 if ((scb->flags & SCB_RECOVERY_SCB) != 0) { in ahc_done()
1801 if (ahc_get_transaction_status(scb) == CAM_BDR_SENT in ahc_done()
1802 || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) in ahc_done()
1803 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); in ahc_done()
1809 ahc_free_scb(ahc, scb); in ahc_done()
1815 struct scsi_device *sdev, struct scb *scb) in ahc_linux_handle_scsi_status() argument
1836 switch (ahc_get_scsi_status(scb)) { in ahc_linux_handle_scsi_status()
1848 cmd = scb->io_ctx; in ahc_linux_handle_scsi_status()
1849 if (scb->flags & SCB_SENSE) { in ahc_linux_handle_scsi_status()
1853 - ahc_get_sense_residual(scb), in ahc_linux_handle_scsi_status()
1856 ahc_get_sense_buf(ahc, scb), sense_size); in ahc_linux_handle_scsi_status()
1913 ahc_print_path(ahc, scb); in ahc_linux_handle_scsi_status()
1921 ahc_set_transaction_status(scb, CAM_REQUEUE_REQ); in ahc_linux_handle_scsi_status()
1922 ahc_set_scsi_status(scb, SCSI_STATUS_OK); in ahc_linux_handle_scsi_status()
1933 ahc_set_scsi_status(scb, SCSI_STATUS_BUSY); in ahc_linux_handle_scsi_status()
2058 struct scb *pending_scb; in ahc_linux_queue_recovery_cmd()
2194 struct scb *bus_scb; in ahc_linux_queue_recovery_cmd()