Lines Matching full:scb

39  *  SCB paging, and other rework of the code.
254 ahc_print_path(struct ahc_softc *ahc, struct scb *scb) in ahc_print_path() argument
258 scb != NULL ? SCB_GET_CHANNEL(ahc, scb) : 'X', in ahc_print_path()
259 scb != NULL ? SCB_GET_TARGET(ahc, scb) : -1, in ahc_print_path()
260 scb != NULL ? SCB_GET_LUN(scb) : -1); in ahc_print_path()
364 struct scb *);
454 static void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*);
456 static int ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
461 ahc_linux_unmap_scb(struct ahc_softc *ahc, struct scb *scb) in ahc_linux_unmap_scb() argument
465 cmd = scb->io_ctx; in ahc_linux_unmap_scb()
466 ahc_sync_sglist(ahc, scb, BUS_DMASYNC_POSTWRITE); in ahc_linux_unmap_scb()
472 ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb, in ahc_linux_map_seg() argument
477 if ((scb->sg_count + 1) > AHC_NSEG) in ahc_linux_map_seg()
483 scb->platform_data->xfer_len += len; in ahc_linux_map_seg()
520 * Queue an SCB to the controller.
1252 ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb) in ahc_platform_freeze_devq() argument
1254 ahc_platform_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb), in ahc_platform_freeze_devq()
1255 SCB_GET_CHANNEL(ahc, scb), in ahc_platform_freeze_devq()
1256 SCB_GET_LUN(scb), SCB_LIST_NULL, in ahc_platform_freeze_devq()
1413 struct scb *scb; in ahc_linux_run_command() local
1432 * table in SCB space. in ahc_linux_run_command()
1451 * Get an scb to use. in ahc_linux_run_command()
1453 scb = ahc_get_scb(ahc); in ahc_linux_run_command()
1454 if (!scb) { in ahc_linux_run_command()
1459 scb->io_ctx = cmd; in ahc_linux_run_command()
1460 scb->platform_data->dev = dev; in ahc_linux_run_command()
1461 hscb = scb->hscb; in ahc_linux_run_command()
1462 cmd->host_scribble = (char *)scb; in ahc_linux_run_command()
1470 mask = SCB_GET_TARGET_MASK(ahc, scb); in ahc_linux_run_command()
1471 tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb), in ahc_linux_run_command()
1472 SCB_GET_OUR_ID(scb), in ahc_linux_run_command()
1473 SCB_GET_TARGET(ahc, scb), &tstate); in ahc_linux_run_command()
1483 scb->flags |= SCB_AUTO_NEGOTIATE; in ahc_linux_run_command()
1484 scb->hscb->control |= MK_MESSAGE; in ahc_linux_run_command()
1502 scb->flags |= SCB_CDB32_PTR; in ahc_linux_run_command()
1505 scb->platform_data->xfer_len = 0; in ahc_linux_run_command()
1506 ahc_set_residual(scb, 0); in ahc_linux_run_command()
1507 ahc_set_sense_residual(scb, 0); in ahc_linux_run_command()
1508 scb->sg_count = 0; in ahc_linux_run_command()
1516 sg = scb->sg_list; in ahc_linux_run_command()
1528 consumed = ahc_linux_map_seg(ahc, scb, in ahc_linux_run_command()
1531 scb->sg_count += consumed; in ahc_linux_run_command()
1539 scb->hscb->sgptr = in ahc_linux_run_command()
1540 ahc_htole32(scb->sg_list_phys | SG_FULL_RESID); in ahc_linux_run_command()
1546 scb->hscb->dataptr = scb->sg_list->addr; in ahc_linux_run_command()
1547 scb->hscb->datacnt = scb->sg_list->len; in ahc_linux_run_command()
1549 scb->hscb->sgptr = ahc_htole32(SG_LIST_NULL); in ahc_linux_run_command()
1550 scb->hscb->dataptr = 0; in ahc_linux_run_command()
1551 scb->hscb->datacnt = 0; in ahc_linux_run_command()
1552 scb->sg_count = 0; in ahc_linux_run_command()
1555 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links); in ahc_linux_run_command()
1562 scb->flags |= SCB_ACTIVE; in ahc_linux_run_command()
1564 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe); in ahc_linux_run_command()
1565 scb->flags |= SCB_UNTAGGEDQ; in ahc_linux_run_command()
1567 ahc_queue_scb(ahc, scb); in ahc_linux_run_command()
1676 * Calls the higher level scsi done function and frees the scb.
1679 ahc_done(struct ahc_softc *ahc, struct scb *scb) in ahc_done() argument
1684 LIST_REMOVE(scb, pending_links); in ahc_done()
1685 if ((scb->flags & SCB_UNTAGGEDQ) != 0) { in ahc_done()
1689 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb); in ahc_done()
1691 TAILQ_REMOVE(untagged_q, scb, links.tqe); in ahc_done()
1693 } else if ((scb->flags & SCB_ACTIVE) == 0) { in ahc_done()
1699 printk("SCB %d done'd twice\n", scb->hscb->tag); in ahc_done()
1703 cmd = scb->io_ctx; in ahc_done()
1704 dev = scb->platform_data->dev; in ahc_done()
1711 ahc_linux_unmap_scb(ahc, scb); in ahc_done()
1720 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) { in ahc_done()
1725 ahc_get_transfer_length(scb) - ahc_get_residual(scb); in ahc_done()
1727 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) { in ahc_done()
1730 ahc_print_path(ahc, scb); in ahc_done()
1734 ahc_set_transaction_status(scb, CAM_UNCOR_PARITY); in ahc_done()
1745 } else if (amount_xferred < scb->io_ctx->underflow) { in ahc_done()
1748 ahc_print_path(ahc, scb); in ahc_done()
1750 for (i = 0; i < scb->io_ctx->cmd_len; i++) in ahc_done()
1751 printk(" 0x%x", scb->io_ctx->cmnd[i]); in ahc_done()
1753 ahc_print_path(ahc, scb); in ahc_done()
1756 ahc_get_residual(scb), in ahc_done()
1757 ahc_get_transfer_length(scb)); in ahc_done()
1758 ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR); in ahc_done()
1761 ahc_set_transaction_status(scb, CAM_REQ_CMP); in ahc_done()
1763 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) { in ahc_done()
1764 ahc_linux_handle_scsi_status(ahc, cmd->device, scb); in ahc_done()
1768 && ahc_get_transaction_status(scb) == CAM_REQ_CMP in ahc_done()
1769 && ahc_get_scsi_status(scb) != SAM_STAT_TASK_SET_FULL) in ahc_done()
1786 if ((scb->flags & SCB_RECOVERY_SCB) != 0) { in ahc_done()
1787 printk("Recovery SCB completes\n"); in ahc_done()
1788 if (ahc_get_transaction_status(scb) == CAM_BDR_SENT in ahc_done()
1789 || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED) in ahc_done()
1790 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT); in ahc_done()
1796 ahc_free_scb(ahc, scb); in ahc_done()
1802 struct scsi_device *sdev, struct scb *scb) in ahc_linux_handle_scsi_status() argument
1823 switch (ahc_get_scsi_status(scb)) { in ahc_linux_handle_scsi_status()
1835 cmd = scb->io_ctx; in ahc_linux_handle_scsi_status()
1836 if (scb->flags & SCB_SENSE) { in ahc_linux_handle_scsi_status()
1840 - ahc_get_sense_residual(scb), in ahc_linux_handle_scsi_status()
1843 ahc_get_sense_buf(ahc, scb), sense_size); in ahc_linux_handle_scsi_status()
1882 ahc_print_path(ahc, scb); in ahc_linux_handle_scsi_status()
1899 ahc_print_path(ahc, scb); in ahc_linux_handle_scsi_status()
1907 ahc_set_transaction_status(scb, CAM_REQUEUE_REQ); in ahc_linux_handle_scsi_status()
1908 ahc_set_scsi_status(scb, SAM_STAT_GOOD); in ahc_linux_handle_scsi_status()
1919 ahc_set_scsi_status(scb, SAM_STAT_BUSY); in ahc_linux_handle_scsi_status()
2045 struct scb *pending_scb = NULL, *scb; in ahc_linux_queue_recovery_cmd() local
2110 LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) { in ahc_linux_queue_recovery_cmd()
2111 if (scb->io_ctx == cmd) { in ahc_linux_queue_recovery_cmd()
2112 pending_scb = scb; in ahc_linux_queue_recovery_cmd()
2117 /* Any SCB for this device will do for a target reset */ in ahc_linux_queue_recovery_cmd()
2118 LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) { in ahc_linux_queue_recovery_cmd()
2119 if (ahc_match_scb(ahc, scb, sdev->id, in ahc_linux_queue_recovery_cmd()
2123 pending_scb = scb; in ahc_linux_queue_recovery_cmd()
2136 * We can't queue two recovery actions using the same SCB in ahc_linux_queue_recovery_cmd()
2184 struct scb *bus_scb; in ahc_linux_queue_recovery_cmd()
2196 * At this point, pending_scb is the scb associated with the in ahc_linux_queue_recovery_cmd()
2225 * Actually re-queue this SCB in an attempt in ahc_linux_queue_recovery_cmd()
2235 * that our SCB control byte matches the in ahc_linux_queue_recovery_cmd()
2245 * Remove any cached copy of this SCB in the in ahc_linux_queue_recovery_cmd()
2247 * queuing of our abort SCB. We use the in ahc_linux_queue_recovery_cmd()
2248 * same element in the SCB, SCB_NEXT, for in ahc_linux_queue_recovery_cmd()
2260 * never re-reference the in-core SCB. in ahc_linux_queue_recovery_cmd()
2263 * the card's copy of the SCB. in ahc_linux_queue_recovery_cmd()
2273 * so we are the next SCB for this target in ahc_linux_queue_recovery_cmd()
2284 printk("Device is disconnected, re-queuing SCB\n"); in ahc_linux_queue_recovery_cmd()