/* * Start the next command for a 53C94. * Should be called with interrupts disabled. */ static void mac53c94_start(struct fsc_state *state) { struct scsi_cmnd *cmd; struct mac53c94_regs __iomem *regs = state->regs; int i; if (state->phase != idle || state->current_req != NULL) panic("inappropriate mac53c94_start (state=%p)", state); if (state->request_q == NULL) return; state->current_req = cmd = state->request_q; state->request_q = (struct scsi_cmnd *) cmd->host_scribble; /* Off we go */ writeb(0, ®s->count_lo); writeb(0, ®s->count_mid); writeb(0, ®s->count_hi); writeb(CMD_NOP + CMD_DMA_MODE, ®s->command); udelay(1); writeb(CMD_FLUSH, ®s->command); udelay(1); writeb(cmd->device->id, ®s->dest_id); writeb(0, ®s->sync_period); writeb(0, ®s->sync_offset); /* load the command into the FIFO */ for (i = 0; i < cmd->cmd_len; ++i) writeb(cmd->cmnd[i], ®s->fifo); /* do select without ATN XXX */ writeb(CMD_SELECT, ®s->command); state->phase = selecting; set_dma_cmds(state, cmd); }
/* * Start the next command for a 53C94. * Should be called with interrupts disabled. */ static void mac53c94_start(struct fsc_state *state) { Scsi_Cmnd *cmd; volatile struct mac53c94_regs *regs = state->regs; int i; if (state->phase != idle || state->current_req != NULL) panic("inappropriate mac53c94_start (state=%p)", state); if (state->request_q == NULL) return; state->current_req = cmd = state->request_q; state->request_q = (Scsi_Cmnd *) cmd->host_scribble; /* Off we go */ regs->count_lo = 0; regs->count_mid = 0; regs->count_hi = 0; eieio(); regs->command = CMD_NOP + CMD_DMA_MODE; udelay(1); eieio(); regs->command = CMD_FLUSH; udelay(1); eieio(); regs->dest_id = cmd->device->id; regs->sync_period = 0; regs->sync_offset = 0; eieio(); /* load the command into the FIFO */ for (i = 0; i < cmd->cmd_len; ++i) { regs->fifo = cmd->cmnd[i]; eieio(); } /* do select without ATN XXX */ regs->command = CMD_SELECT; state->phase = selecting; if (cmd->use_sg > 0 || cmd->request_bufflen != 0) set_dma_cmds(state, cmd); }