Lines Matching refs:scb

86 static void inia100_scb_handler(struct orc_host *host, struct orc_scb *scb);
274 * @scb: SCB to queue for execution
277 static void orc_exec_scb(struct orc_host * host, struct orc_scb * scb)
279 scb->status = ORCSCB_POST;
280 outb(scb->scbidx, host->base + ORC_PQUEUE);
444 struct orc_scb *scb;
457 scb = host->scb_virt;
462 scb->sg_addr = cpu_to_le32((u32) escb_phys);
463 scb->sense_addr = cpu_to_le32((u32) escb_phys);
464 scb->escb = escb;
465 scb->scbidx = i;
466 scb++;
597 struct orc_scb *scb;
604 scb = (struct orc_scb *) NULL;
614 /* Find the scb corresponding to the command */
629 if ((scb = __orc_alloc_scb(host)) == NULL) {
637 scb->opcode = ORC_BUSDEVRST;
638 scb->target = target;
639 scb->hastat = 0;
640 scb->tastat = 0;
641 scb->status = 0x0;
642 scb->link = 0xFF;
643 scb->reserved0 = 0;
644 scb->reserved1 = 0;
645 scb->xferlen = cpu_to_le32(0);
646 scb->sg_len = cpu_to_le32(0);
650 orc_exec_scb(host, scb); /* Start execute SCB */
698 struct orc_scb *scb;
702 scb = __orc_alloc_scb(host);
704 return scb;
710 * @scb: SCB that is now free
716 static void orc_release_scb(struct orc_host *host, struct orc_scb *scb)
723 index = scb->scbidx;
738 static int orchid_abort_scb(struct orc_host * host, struct orc_scb * scb)
747 outb(scb->scbidx, host->base + ORC_HDATA); /* Write address */
765 struct orc_scb *scb;
771 scb = host->scb_virt;
777 for (i = 0; i < ORC_MAXQUEUE; i++, scb++) {
778 escb = scb->escb;
779 if (scb->status && escb->srb == cmd) {
780 if (scb->tag_msg == 0) {
784 if (orchid_abort_scb(host, scb)) {
804 * scb's for processing we pull them off the controller, turn the
805 * index into a host address pointer to the scb and call the scb
814 struct orc_scb *scb;
825 scb = (struct orc_scb *) ((unsigned long) host->scb_virt + (unsigned long) (sizeof(struct orc_scb) * scb_index));
826 scb->status = 0x0;
828 inia100_scb_handler(host, scb);
836 * @scb: control block to use
842 static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struct scsi_cmnd * cmd)
849 /* Links between the escb, scb and Linux scsi midlayer cmd */
850 escb = scb->escb;
855 scb->opcode = ORC_EXECSCSI;
856 scb->flags = SCF_NO_DCHK; /* Clear done bit */
857 scb->target = cmd->device->id;
858 scb->lun = cmd->device->lun;
859 scb->reserved0 = 0;
860 scb->reserved1 = 0;
861 scb->sg_len = cpu_to_le32(0);
863 scb->xferlen = cpu_to_le32((u32) scsi_bufflen(cmd));
873 scb->sg_len = cpu_to_le32((u32) (count_sg * 8));
880 scb->sg_len = cpu_to_le32(0);
884 scb->sg_addr = (u32) scb->sense_addr; /* sense_addr is already little endian */
885 scb->hastat = 0;
886 scb->tastat = 0;
887 scb->link = 0xFF;
888 scb->sense_len = SENSE_SIZE;
889 scb->cdb_len = cmd->cmd_len;
890 if (scb->cdb_len >= IMAX_CDB) {
892 scb->cdb_len = IMAX_CDB;
894 scb->ident = (u8)(cmd->device->lun & 0xff) | DISC_ALLOW;
896 scb->tag_msg = SIMPLE_QUEUE_TAG; /* Do simple tag only */
898 scb->tag_msg = 0; /* No tag support */
900 memcpy(scb->cdb, cmd->cmnd, scb->cdb_len);
909 * block, build the host specific scb structures and if there is room
914 struct orc_scb *scb;
919 if ((scb = orc_alloc_scb(host)) == NULL)
922 if (inia100_build_scb(host, scb, cmd)) {
923 orc_release_scb(host, scb);
926 orc_exec_scb(host, scb); /* Start execute SCB */
981 * @scb: SCB the controller returned as needing processing
985 * the complete with the midlayer and recycle the scb.
988 static void inia100_scb_handler(struct orc_host *host, struct orc_scb *scb)
993 escb = scb->escb;
996 orc_release_scb(host, scb); /* Release SCB for current channel */
1001 switch (scb->hastat) {
1005 scb->hastat = 0;
1010 scb->hastat = DID_TIME_OUT;
1017 scb->hastat = DID_RESET;
1021 scb->hastat = DID_ABORT;
1031 printk(KERN_DEBUG "inia100: %x %x\n", scb->hastat, scb->tastat);
1032 scb->hastat = DID_ERROR; /* Couldn't find any better */
1036 if (scb->tastat == 2) { /* Check condition */
1040 cmd->result = scb->tastat | (scb->hastat << 16);
1043 orc_release_scb(host, scb); /* Release SCB for current channel */