Lines Matching defs:scb

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