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()
1245 ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb) in ahc_platform_freeze_devq() argument
1247 ahc_platform_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb), in ahc_platform_freeze_devq()
1248 SCB_GET_CHANNEL(ahc, scb), in ahc_platform_freeze_devq()
1249 SCB_GET_LUN(scb), SCB_LIST_NULL, in ahc_platform_freeze_devq()
1406 struct scb *scb; in ahc_linux_run_command() local
1446 scb = ahc_get_scb(ahc); in ahc_linux_run_command()
1447 if (!scb) { in ahc_linux_run_command()
1452 scb->io_ctx = cmd; in ahc_linux_run_command()
1453 scb->platform_data->dev = dev; in ahc_linux_run_command()
1454 hscb = scb->hscb; in ahc_linux_run_command()
1455 cmd->host_scribble = (char *)scb; in ahc_linux_run_command()
1463 mask = SCB_GET_TARGET_MASK(ahc, scb); in ahc_linux_run_command()
1464 tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb), in ahc_linux_run_command()
1465 SCB_GET_OUR_ID(scb), in ahc_linux_run_command()
1466 SCB_GET_TARGET(ahc, scb), &tstate); in ahc_linux_run_command()
1476 scb->flags |= SCB_AUTO_NEGOTIATE; in ahc_linux_run_command()
1477 scb->hscb->control |= MK_MESSAGE; in ahc_linux_run_command()
1495 scb->flags |= SCB_CDB32_PTR; in ahc_linux_run_command()
1498 scb->platform_data->xfer_len = 0; in ahc_linux_run_command()
1499 ahc_set_residual(scb, 0); in ahc_linux_run_command()
1500 ahc_set_sense_residual(scb, 0); in ahc_linux_run_command()
1501 scb->sg_count = 0; in ahc_linux_run_command()
1509 sg = scb->sg_list; in ahc_linux_run_command()
1521 consumed = ahc_linux_map_seg(ahc, scb, in ahc_linux_run_command()
1524 scb->sg_count += consumed; in ahc_linux_run_command()
1532 scb->hscb->sgptr = in ahc_linux_run_command()
1533 ahc_htole32(scb->sg_list_phys | SG_FULL_RESID); in ahc_linux_run_command()
1539 scb->hscb->dataptr = scb->sg_list->addr; in ahc_linux_run_command()
1540 scb->hscb->datacnt = scb->sg_list->len; in ahc_linux_run_command()
1542 scb->hscb->sgptr = ahc_htole32(SG_LIST_NULL); in ahc_linux_run_command()
1543 scb->hscb->dataptr = 0; in ahc_linux_run_command()
1544 scb->hscb->datacnt = 0; in ahc_linux_run_command()
1545 scb->sg_count = 0; in ahc_linux_run_command()
1548 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links); in ahc_linux_run_command()
1555 scb->flags |= SCB_ACTIVE; in ahc_linux_run_command()
1557 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe); in ahc_linux_run_command()
1558 scb->flags |= SCB_UNTAGGEDQ; in ahc_linux_run_command()
1560 ahc_queue_scb(ahc, scb); in ahc_linux_run_command()
1672 ahc_done(struct ahc_softc *ahc, struct scb *scb) in ahc_done() argument
1677 LIST_REMOVE(scb, pending_links); in ahc_done()
1678 if ((scb->flags & SCB_UNTAGGEDQ) != 0) { in ahc_done()
1682 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb); in ahc_done()
1684 TAILQ_REMOVE(untagged_q, scb, links.tqe); in ahc_done()
1686 } else if ((scb->flags & SCB_ACTIVE) == 0) { in ahc_done()
1692 printk("SCB %d done'd twice\n", scb->hscb->tag); in ahc_done()
1696 cmd = scb->io_ctx; in ahc_done()
1697 dev = scb->platform_data->dev; in ahc_done()
1704 ahc_linux_unmap_scb(ahc, scb); in ahc_done()
1713 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) { in ahc_done()
1718 ahc_get_transfer_length(scb) - ahc_get_residual(scb); in ahc_done()
1720 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { in ahc_done()
1723 ahc_print_path(ahc, scb); in ahc_done()
1727 ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); in ahc_done()
1738 } else if (amount_xferred < scb->io_ctx->underflow) { in ahc_done()
1741 ahc_print_path(ahc, scb); in ahc_done()
1743 for (i = 0; i < scb->io_ctx->cmd_len; i++) in ahc_done()
1744 printk(" 0x%x", scb->io_ctx->cmnd[i]); in ahc_done()
1746 ahc_print_path(ahc, scb); in ahc_done()
1749 ahc_get_residual(scb), in ahc_done()
1750 ahc_get_transfer_length(scb)); in ahc_done()
1751 ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR); in ahc_done()
1754 ahc_set_transaction_status(scb, CAM_REQ_CMP); in ahc_done()
1756 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) { in ahc_done()
1757 ahc_linux_handle_scsi_status(ahc, cmd->device, scb); in ahc_done()
1761 && ahc_get_transaction_status(scb) == CAM_REQ_CMP in ahc_done()
1762 && ahc_get_scsi_status(scb) != SCSI_STATUS_QUEUE_FULL) in ahc_done()
1779 if ((scb->flags & SCB_RECOVERY_SCB) != 0) { in ahc_done()
1781 if (ahc_get_transaction_status(scb) == CAM_BDR_SENT in ahc_done()
1782 || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) in ahc_done()
1783 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); in ahc_done()
1789 ahc_free_scb(ahc, scb); in ahc_done()
1795 struct scsi_device *sdev, struct scb *scb) in ahc_linux_handle_scsi_status() argument
1816 switch (ahc_get_scsi_status(scb)) { in ahc_linux_handle_scsi_status()
1828 cmd = scb->io_ctx; in ahc_linux_handle_scsi_status()
1829 if (scb->flags & SCB_SENSE) { in ahc_linux_handle_scsi_status()
1833 - ahc_get_sense_residual(scb), in ahc_linux_handle_scsi_status()
1836 ahc_get_sense_buf(ahc, scb), sense_size); in ahc_linux_handle_scsi_status()
1893 ahc_print_path(ahc, scb); in ahc_linux_handle_scsi_status()
1901 ahc_set_transaction_status(scb, CAM_REQUEUE_REQ); in ahc_linux_handle_scsi_status()
1902 ahc_set_scsi_status(scb, SCSI_STATUS_OK); in ahc_linux_handle_scsi_status()
1913 ahc_set_scsi_status(scb, SCSI_STATUS_BUSY); in ahc_linux_handle_scsi_status()
2038 struct scb *pending_scb; in ahc_linux_queue_recovery_cmd()
2174 struct scb *bus_scb; in ahc_linux_queue_recovery_cmd()