Lines Matching refs:scb

254 ahc_print_path(struct ahc_softc *ahc, struct scb *scb)
258 scb != NULL ? SCB_GET_CHANNEL(ahc, scb) : 'X',
259 scb != NULL ? SCB_GET_TARGET(ahc, scb) : -1,
260 scb != NULL ? SCB_GET_LUN(scb) : -1);
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)
465 cmd = scb->io_ctx;
466 ahc_sync_sglist(ahc, scb, BUS_DMASYNC_POSTWRITE);
472 ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
477 if ((scb->sg_count + 1) > AHC_NSEG)
483 scb->platform_data->xfer_len += len;
1252 ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb)
1254 ahc_platform_abort_scbs(ahc, SCB_GET_TARGET(ahc, scb),
1255 SCB_GET_CHANNEL(ahc, scb),
1256 SCB_GET_LUN(scb), SCB_LIST_NULL,
1413 struct scb *scb;
1451 * Get an scb to use.
1453 scb = ahc_get_scb(ahc);
1454 if (!scb) {
1459 scb->io_ctx = cmd;
1460 scb->platform_data->dev = dev;
1461 hscb = scb->hscb;
1462 cmd->host_scribble = (char *)scb;
1470 mask = SCB_GET_TARGET_MASK(ahc, scb);
1471 tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb),
1472 SCB_GET_OUR_ID(scb),
1473 SCB_GET_TARGET(ahc, scb), &tstate);
1483 scb->flags |= SCB_AUTO_NEGOTIATE;
1484 scb->hscb->control |= MK_MESSAGE;
1502 scb->flags |= SCB_CDB32_PTR;
1505 scb->platform_data->xfer_len = 0;
1506 ahc_set_residual(scb, 0);
1507 ahc_set_sense_residual(scb, 0);
1508 scb->sg_count = 0;
1516 sg = scb->sg_list;
1528 consumed = ahc_linux_map_seg(ahc, scb,
1531 scb->sg_count += consumed;
1539 scb->hscb->sgptr =
1540 ahc_htole32(scb->sg_list_phys | SG_FULL_RESID);
1546 scb->hscb->dataptr = scb->sg_list->addr;
1547 scb->hscb->datacnt = scb->sg_list->len;
1549 scb->hscb->sgptr = ahc_htole32(SG_LIST_NULL);
1550 scb->hscb->dataptr = 0;
1551 scb->hscb->datacnt = 0;
1552 scb->sg_count = 0;
1555 LIST_INSERT_HEAD(&ahc->pending_scbs, scb, pending_links);
1562 scb->flags |= SCB_ACTIVE;
1564 TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe);
1565 scb->flags |= SCB_UNTAGGEDQ;
1567 ahc_queue_scb(ahc, scb);
1676 * Calls the higher level scsi done function and frees the scb.
1679 ahc_done(struct ahc_softc *ahc, struct scb *scb)
1684 LIST_REMOVE(scb, pending_links);
1685 if ((scb->flags & SCB_UNTAGGEDQ) != 0) {
1689 target_offset = SCB_GET_TARGET_OFFSET(ahc, scb);
1691 TAILQ_REMOVE(untagged_q, scb, links.tqe);
1693 } else if ((scb->flags & SCB_ACTIVE) == 0) {
1699 printk("SCB %d done'd twice\n", scb->hscb->tag);
1703 cmd = scb->io_ctx;
1704 dev = scb->platform_data->dev;
1711 ahc_linux_unmap_scb(ahc, scb);
1720 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) {
1725 ahc_get_transfer_length(scb) - ahc_get_residual(scb);
1727 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) {
1730 ahc_print_path(ahc, scb);
1734 ahc_set_transaction_status(scb, CAM_UNCOR_PARITY);
1745 } else if (amount_xferred < scb->io_ctx->underflow) {
1748 ahc_print_path(ahc, scb);
1750 for (i = 0; i < scb->io_ctx->cmd_len; i++)
1751 printk(" 0x%x", scb->io_ctx->cmnd[i]);
1753 ahc_print_path(ahc, scb);
1756 ahc_get_residual(scb),
1757 ahc_get_transfer_length(scb));
1758 ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR);
1761 ahc_set_transaction_status(scb, CAM_REQ_CMP);
1763 } else if (ahc_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) {
1764 ahc_linux_handle_scsi_status(ahc, cmd->device, scb);
1768 && ahc_get_transaction_status(scb) == CAM_REQ_CMP
1769 && ahc_get_scsi_status(scb) != SAM_STAT_TASK_SET_FULL)
1786 if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
1788 if (ahc_get_transaction_status(scb) == CAM_BDR_SENT
1789 || ahc_get_transaction_status(scb) == CAM_REQ_ABORTED)
1790 ahc_set_transaction_status(scb, CAM_CMD_TIMEOUT);
1796 ahc_free_scb(ahc, scb);
1802 struct scsi_device *sdev, struct scb *scb)
1823 switch (ahc_get_scsi_status(scb)) {
1835 cmd = scb->io_ctx;
1836 if (scb->flags & SCB_SENSE) {
1840 - ahc_get_sense_residual(scb),
1843 ahc_get_sense_buf(ahc, scb), sense_size);
1882 ahc_print_path(ahc, scb);
1899 ahc_print_path(ahc, scb);
1907 ahc_set_transaction_status(scb, CAM_REQUEUE_REQ);
1908 ahc_set_scsi_status(scb, SAM_STAT_GOOD);
1919 ahc_set_scsi_status(scb, SAM_STAT_BUSY);
2045 struct scb *pending_scb = NULL, *scb;
2110 LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) {
2111 if (scb->io_ctx == cmd) {
2112 pending_scb = scb;
2118 LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) {
2119 if (ahc_match_scb(ahc, scb, sdev->id,
2123 pending_scb = scb;
2184 struct scb *bus_scb;
2196 * At this point, pending_scb is the scb associated with the