Lines Matching refs:scb

86 static void inia100_scb_handler(struct orc_host *host, struct orc_scb *scb);
277 static void orc_exec_scb(struct orc_host * host, struct orc_scb * scb) in orc_exec_scb() argument
279 scb->status = ORCSCB_POST; in orc_exec_scb()
280 outb(scb->scbidx, host->base + ORC_PQUEUE); in orc_exec_scb()
444 struct orc_scb *scb; in setup_SCBs() local
457 scb = host->scb_virt; in setup_SCBs()
462 scb->sg_addr = cpu_to_le32((u32) escb_phys); in setup_SCBs()
463 scb->sense_addr = cpu_to_le32((u32) escb_phys); in setup_SCBs()
464 scb->escb = escb; in setup_SCBs()
465 scb->scbidx = i; in setup_SCBs()
466 scb++; in setup_SCBs()
597 struct orc_scb *scb; in orc_device_reset() local
604 scb = (struct orc_scb *) NULL; in orc_device_reset()
629 if ((scb = __orc_alloc_scb(host)) == NULL) { in orc_device_reset()
637 scb->opcode = ORC_BUSDEVRST; in orc_device_reset()
638 scb->target = target; in orc_device_reset()
639 scb->hastat = 0; in orc_device_reset()
640 scb->tastat = 0; in orc_device_reset()
641 scb->status = 0x0; in orc_device_reset()
642 scb->link = 0xFF; in orc_device_reset()
643 scb->reserved0 = 0; in orc_device_reset()
644 scb->reserved1 = 0; in orc_device_reset()
645 scb->xferlen = cpu_to_le32(0); in orc_device_reset()
646 scb->sg_len = cpu_to_le32(0); in orc_device_reset()
650 orc_exec_scb(host, scb); /* Start execute SCB */ in orc_device_reset()
698 struct orc_scb *scb; in orc_alloc_scb() local
702 scb = __orc_alloc_scb(host); in orc_alloc_scb()
704 return scb; in orc_alloc_scb()
716 static void orc_release_scb(struct orc_host *host, struct orc_scb *scb) in orc_release_scb() argument
723 index = scb->scbidx; in orc_release_scb()
738 static int orchid_abort_scb(struct orc_host * host, struct orc_scb * scb) in orchid_abort_scb() argument
747 outb(scb->scbidx, host->base + ORC_HDATA); /* Write address */ in orchid_abort_scb()
765 struct orc_scb *scb; in inia100_abort_cmd() local
771 scb = host->scb_virt; in inia100_abort_cmd()
777 for (i = 0; i < ORC_MAXQUEUE; i++, scb++) { in inia100_abort_cmd()
778 escb = scb->escb; in inia100_abort_cmd()
779 if (scb->status && escb->srb == cmd) { in inia100_abort_cmd()
780 if (scb->tag_msg == 0) { in inia100_abort_cmd()
784 if (orchid_abort_scb(host, scb)) { in inia100_abort_cmd()
814 struct orc_scb *scb; in orc_interrupt() local
825scb = (struct orc_scb *) ((unsigned long) host->scb_virt + (unsigned long) (sizeof(struct orc_scb)… in orc_interrupt()
826 scb->status = 0x0; in orc_interrupt()
828 inia100_scb_handler(host, scb); in orc_interrupt()
842 static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struct scsi_cmnd * cmd) in inia100_build_scb() argument
850 escb = scb->escb; in inia100_build_scb()
855 scb->opcode = ORC_EXECSCSI; in inia100_build_scb()
856 scb->flags = SCF_NO_DCHK; /* Clear done bit */ in inia100_build_scb()
857 scb->target = cmd->device->id; in inia100_build_scb()
858 scb->lun = cmd->device->lun; in inia100_build_scb()
859 scb->reserved0 = 0; in inia100_build_scb()
860 scb->reserved1 = 0; in inia100_build_scb()
861 scb->sg_len = cpu_to_le32(0); in inia100_build_scb()
863 scb->xferlen = cpu_to_le32((u32) scsi_bufflen(cmd)); in inia100_build_scb()
873 scb->sg_len = cpu_to_le32((u32) (count_sg * 8)); in inia100_build_scb()
880 scb->sg_len = cpu_to_le32(0); in inia100_build_scb()
884 scb->sg_addr = (u32) scb->sense_addr; /* sense_addr is already little endian */ in inia100_build_scb()
885 scb->hastat = 0; in inia100_build_scb()
886 scb->tastat = 0; in inia100_build_scb()
887 scb->link = 0xFF; in inia100_build_scb()
888 scb->sense_len = SENSE_SIZE; in inia100_build_scb()
889 scb->cdb_len = cmd->cmd_len; in inia100_build_scb()
890 if (scb->cdb_len >= IMAX_CDB) { in inia100_build_scb()
892 scb->cdb_len = IMAX_CDB; in inia100_build_scb()
894 scb->ident = (u8)(cmd->device->lun & 0xff) | DISC_ALLOW; in inia100_build_scb()
896 scb->tag_msg = SIMPLE_QUEUE_TAG; /* Do simple tag only */ in inia100_build_scb()
898 scb->tag_msg = 0; /* No tag support */ in inia100_build_scb()
900 memcpy(scb->cdb, cmd->cmnd, scb->cdb_len); in inia100_build_scb()
914 struct orc_scb *scb; in inia100_queue_lck() local
919 if ((scb = orc_alloc_scb(host)) == NULL) in inia100_queue_lck()
922 if (inia100_build_scb(host, scb, cmd)) { in inia100_queue_lck()
923 orc_release_scb(host, scb); in inia100_queue_lck()
926 orc_exec_scb(host, scb); /* Start execute SCB */ in inia100_queue_lck()
988 static void inia100_scb_handler(struct orc_host *host, struct orc_scb *scb) in inia100_scb_handler() argument
993 escb = scb->escb; in inia100_scb_handler()
996 orc_release_scb(host, scb); /* Release SCB for current channel */ in inia100_scb_handler()
1001 switch (scb->hastat) { in inia100_scb_handler()
1005 scb->hastat = 0; in inia100_scb_handler()
1010 scb->hastat = DID_TIME_OUT; in inia100_scb_handler()
1017 scb->hastat = DID_RESET; in inia100_scb_handler()
1021 scb->hastat = DID_ABORT; in inia100_scb_handler()
1031 printk(KERN_DEBUG "inia100: %x %x\n", scb->hastat, scb->tastat); in inia100_scb_handler()
1032 scb->hastat = DID_ERROR; /* Couldn't find any better */ in inia100_scb_handler()
1036 if (scb->tastat == 2) { /* Check condition */ in inia100_scb_handler()
1040 cmd->result = scb->tastat | (scb->hastat << 16); in inia100_scb_handler()
1043 orc_release_scb(host, scb); /* Release SCB for current channel */ in inia100_scb_handler()