Lines Matching defs:cmd

70 static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
75 if (cmd->sc_data_direction == DMA_TO_DEVICE) {
77 printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd);
78 for (i = 0; i < cmd->cmd_len; ++i)
79 printk(KERN_CONT " %.2x", cmd->cmnd[i]);
82 scsi_sg_count(cmd), scsi_bufflen(cmd), scsi_sglist(cmd));
86 cmd->scsi_done = done;
87 cmd->host_scribble = NULL;
89 state = (struct fsc_state *) cmd->device->host->hostdata;
92 state->request_q = cmd;
94 state->request_qtail->host_scribble = (void *) cmd;
95 state->request_qtail = cmd;
105 static int mac53c94_host_reset(struct scsi_cmnd *cmd)
107 struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata;
112 spin_lock_irqsave(cmd->device->host->host_lock, flags);
122 spin_unlock_irqrestore(cmd->device->host->host_lock, flags);
149 struct scsi_cmnd *cmd;
157 state->current_req = cmd = state->request_q;
158 state->request_q = (struct scsi_cmnd *) cmd->host_scribble;
168 writeb(cmd->device->id, &regs->dest_id);
173 for (i = 0; i < cmd->cmd_len; ++i)
174 writeb(cmd->cmnd[i], &regs->fifo);
180 set_dma_cmds(state, cmd);
199 struct scsi_cmnd *cmd = state->current_req;
225 printk(KERN_ERR "53c94: invalid cmd, intr=%x stat=%x seq=%x phase=%d\n",
239 if (cmd == 0) {
268 && (scsi_sg_count(cmd) > 0 || scsi_bufflen(cmd))) {
269 nb = cmd->SCp.this_residual;
272 cmd->SCp.this_residual -= nb;
286 printk(KERN_DEBUG "in unexpected phase %x after cmd\n",
299 if (cmd->SCp.this_residual != 0
302 nb = cmd->SCp.this_residual;
305 cmd->SCp.this_residual -= nb;
316 scsi_dma_unmap(cmd);
327 cmd->SCp.Status = readb(&regs->fifo);
328 cmd->SCp.Message = readb(&regs->fifo);
329 cmd->result = CMD_ACCEPT_MSG;
337 cmd_done(state, (DID_OK << 16) + (cmd->SCp.Message << 8)
338 + cmd->SCp.Status);
347 struct scsi_cmnd *cmd;
349 cmd = state->current_req;
350 if (cmd != 0) {
351 cmd->result = result;
352 (*cmd->scsi_done)(cmd);
362 static void set_dma_cmds(struct fsc_state *state, struct scsi_cmnd *cmd)
370 nseg = scsi_dma_map(cmd);
375 dma_cmd = cmd->sc_data_direction == DMA_TO_DEVICE ?
380 scsi_for_each_sg(cmd, scl, nseg, i) {
396 cmd->SCp.this_residual = total;