Lines Matching refs:scb

224 ahd_print_path(struct ahd_softc *ahd, struct scb *scb)
228 scb != NULL ? SCB_GET_CHANNEL(ahd, scb) : 'X',
229 scb != NULL ? SCB_GET_TARGET(ahd, scb) : -1,
230 scb != NULL ? SCB_GET_LUN(scb) : -1);
354 struct scb *);
531 static void ahd_linux_unmap_scb(struct ahd_softc*, struct scb*);
534 ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
538 cmd = scb->io_ctx;
540 ahd_sync_sglist(ahd, scb, BUS_DMASYNC_POSTWRITE);
774 struct scb *reset_scb;
1378 ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
1380 ahd_platform_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb),
1381 SCB_GET_CHANNEL(ahd, scb),
1382 SCB_GET_LUN(scb), SCB_LIST_NULL,
1542 struct scb *scb;
1558 * Get an scb to use.
1569 if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
1576 scb->io_ctx = cmd;
1577 scb->platform_data->dev = dev;
1578 hscb = scb->hscb;
1579 cmd->host_scribble = (char *)scb;
1587 scb->hscb->task_management = 0;
1588 mask = SCB_GET_TARGET_MASK(ahd, scb);
1594 scb->flags |= SCB_PACKETIZED;
1597 scb->flags |= SCB_AUTO_NEGOTIATE;
1598 scb->hscb->control |= MK_MESSAGE;
1614 scb->platform_data->xfer_len = 0;
1615 ahd_set_residual(scb, 0);
1616 ahd_set_sense_residual(scb, 0);
1617 scb->sg_count = 0;
1620 void *sg = scb->sg_list;
1624 scb->platform_data->xfer_len = 0;
1632 scb->platform_data->xfer_len += len;
1633 sg = ahd_sg_setup(ahd, scb, sg, addr, len,
1638 LIST_INSERT_HEAD(&ahd->pending_scbs, scb, pending_links);
1645 scb->flags |= SCB_ACTIVE;
1646 ahd_queue_scb(ahd, scb);
1756 * Calls the higher level scsi done function and frees the scb.
1759 ahd_done(struct ahd_softc *ahd, struct scb *scb)
1764 if ((scb->flags & SCB_ACTIVE) == 0) {
1765 printk("SCB %d done'd twice\n", SCB_GET_TAG(scb));
1769 LIST_REMOVE(scb, pending_links);
1770 cmd = scb->io_ctx;
1771 dev = scb->platform_data->dev;
1779 } else if (scb->flags & SCB_DEVICE_RESET) {
1782 ahd_free_scb(ahd, scb);
1785 ahd_linux_unmap_scb(ahd, scb);
1794 if (ahd_get_transaction_status(scb) == CAM_REQ_INPROG) {
1799 ahd_get_transfer_length(scb) - ahd_get_residual(scb);
1801 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) {
1804 ahd_print_path(ahd, scb);
1808 ahd_set_transaction_status(scb, CAM_UNCOR_PARITY);
1819 } else if (amount_xferred < scb->io_ctx->underflow) {
1822 ahd_print_path(ahd, scb);
1824 for (i = 0; i < scb->io_ctx->cmd_len; i++)
1825 printk(" 0x%x", scb->io_ctx->cmnd[i]);
1827 ahd_print_path(ahd, scb);
1830 ahd_get_residual(scb),
1831 ahd_get_transfer_length(scb));
1832 ahd_set_transaction_status(scb, CAM_DATA_RUN_ERR);
1835 ahd_set_transaction_status(scb, CAM_REQ_CMP);
1838 ahd_get_transaction_status(scb) == CAM_SCSI_STATUS_ERROR) {
1839 ahd_linux_handle_scsi_status(ahd, cmd->device, scb);
1843 && ahd_get_transaction_status(scb) == CAM_REQ_CMP
1844 && ahd_get_scsi_status(scb) != SAM_STAT_TASK_SET_FULL)
1861 if ((scb->flags & SCB_RECOVERY_SCB) != 0) {
1863 if (ahd_get_transaction_status(scb) == CAM_BDR_SENT
1864 || ahd_get_transaction_status(scb) == CAM_REQ_ABORTED)
1865 ahd_set_transaction_status(scb, CAM_CMD_TIMEOUT);
1871 ahd_free_scb(ahd, scb);
1878 struct scsi_device *sdev, struct scb *scb)
1899 switch (ahd_get_scsi_status(scb)) {
1911 cmd = scb->io_ctx;
1912 if ((scb->flags & (SCB_SENSE|SCB_PKT_SENSE)) != 0) {
1917 if (scb->flags & SCB_SENSE) {
1919 - ahd_get_sense_residual(scb),
1928 scb->sense_data;
1937 ahd_get_sense_buf(ahd, scb)
1976 ahd_print_path(ahd, scb);
1995 ahd_print_path(ahd, scb);
2003 ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);
2004 ahd_set_scsi_status(scb, SAM_STAT_GOOD);
2018 ahd_set_scsi_status(scb, SAM_STAT_BUSY);
2142 struct scb *pending_scb;
2247 struct scb *bus_scb;
2255 * At this point, pending_scb is the scb associated with the