Lines Matching refs:cmd

121 #define SYM_UCMD_PTR(cmd)  ((struct sym_ucmd *)scsi_cmd_priv(cmd))  argument
122 #define SYM_SOFTC_PTR(cmd) sym_get_hcb(cmd->device->host) argument
127 void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd) in sym_xpt_done() argument
129 struct sym_ucmd *ucmd = SYM_UCMD_PTR(cmd); in sym_xpt_done()
134 scsi_dma_unmap(cmd); in sym_xpt_done()
135 scsi_done(cmd); in sym_xpt_done()
171 struct scsi_cmnd *cmd = cp->cmd; in sym_set_cam_result_error() local
181 sym_print_xerr(cmd, cp->sv_xerr_status); in sym_set_cam_result_error()
190 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); in sym_set_cam_result_error()
191 memcpy(cmd->sense_buffer, cp->sns_bbuf, in sym_set_cam_result_error()
201 p = (u_char *) cmd->sense_data; in sym_set_cam_result_error()
214 sym_reset_scsi_target(np, cmd->device->id); in sym_set_cam_result_error()
225 sym_print_addr(cmd, "COMMAND FAILED (%x %x %x).\n", in sym_set_cam_result_error()
234 scsi_set_resid(cmd, resid); in sym_set_cam_result_error()
235 cmd->result = (cam_status << 16) | scsi_status; in sym_set_cam_result_error()
238 static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd *cmd) in sym_scatter() argument
245 use_sg = scsi_dma_map(cmd); in sym_scatter()
252 scsi_dma_unmap(cmd); in sym_scatter()
258 scsi_for_each_sg(cmd, sg, use_sg, segment) { in sym_scatter()
280 static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd) in sym_queue_command() argument
282 struct scsi_device *sdev = cmd->device; in sym_queue_command()
302 cp = sym_get_ccb(np, cmd, order); in sym_queue_command()
305 sym_queue_scsiio(np, cmd, cp); in sym_queue_command()
312 static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) in sym_setup_cdb() argument
314 memcpy(cp->cdb_buf, cmd->cmnd, cmd->cmd_len); in sym_setup_cdb()
316 cp->phys.cmd.addr = CCB_BA(cp, cdb_buf[0]); in sym_setup_cdb()
317 cp->phys.cmd.size = cpu_to_scr(cmd->cmd_len); in sym_setup_cdb()
325 int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) in sym_setup_data_and_start() argument
333 if (sym_setup_cdb(np, cmd, cp)) in sym_setup_data_and_start()
339 dir = cmd->sc_data_direction; in sym_setup_data_and_start()
341 cp->segments = sym_scatter(np, cp, cmd); in sym_setup_data_and_start()
343 sym_set_cam_status(cmd, DID_ERROR); in sym_setup_data_and_start()
362 scmd_printk(KERN_INFO, cmd, "got DMA_BIDIRECTIONAL command"); in sym_setup_data_and_start()
363 sym_set_cam_status(cmd, DID_ERROR); in sym_setup_data_and_start()
412 sym_xpt_done(np, cmd); in sym_setup_data_and_start()
488 static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd) in sym53c8xx_queue_command_lck() argument
490 struct sym_hcb *np = SYM_SOFTC_PTR(cmd); in sym53c8xx_queue_command_lck()
491 struct sym_ucmd *ucp = SYM_UCMD_PTR(cmd); in sym53c8xx_queue_command_lck()
500 if (np->s.settle_time_valid && scsi_cmd_to_rq(cmd)->timeout) { in sym53c8xx_queue_command_lck()
501 unsigned long tlimit = jiffies + scsi_cmd_to_rq(cmd)->timeout; in sym53c8xx_queue_command_lck()
511 sts = sym_queue_command(np, cmd); in sym53c8xx_queue_command_lck()
569 static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd) in sym_eh_handler() argument
571 struct sym_ucmd *ucmd = SYM_UCMD_PTR(cmd); in sym_eh_handler()
572 struct Scsi_Host *shost = cmd->device->host; in sym_eh_handler()
581 scmd_printk(KERN_WARNING, cmd, "%s operation started\n", opname); in sym_eh_handler()
617 if (cp->cmd == cmd) { in sym_eh_handler()
627 sts = sym_abort_scsiio(np, cmd, 1); in sym_eh_handler()
630 sts = sym_reset_scsi_target(np, cmd->device->id); in sym_eh_handler()
661 dev_warn(&cmd->device->sdev_gendev, "%s operation %s.\n", opname, in sym_eh_handler()
670 static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd) in sym53c8xx_eh_abort_handler() argument
672 return sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd); in sym53c8xx_eh_abort_handler()
675 static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd) in sym53c8xx_eh_device_reset_handler() argument
677 return sym_eh_handler(SYM_EH_DEVICE_RESET, "DEVICE RESET", cmd); in sym53c8xx_eh_device_reset_handler()
680 static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd) in sym53c8xx_eh_bus_reset_handler() argument
682 return sym_eh_handler(SYM_EH_BUS_RESET, "BUS RESET", cmd); in sym53c8xx_eh_bus_reset_handler()
685 static int sym53c8xx_eh_host_reset_handler(struct scsi_cmnd *cmd) in sym53c8xx_eh_host_reset_handler() argument
687 return sym_eh_handler(SYM_EH_HOST_RESET, "HOST RESET", cmd); in sym53c8xx_eh_host_reset_handler()
873 u_long cmd; member
890 switch (uc->cmd) { in sym_exec_user_command()
914 switch (uc->cmd) { in sym_exec_user_command()
1016 struct sym_usrcmd cmd, *uc = &cmd; in sym_user_command() local
1026 uc->cmd = UC_SETSYNC; in sym_user_command()
1028 uc->cmd = UC_SETTAGS; in sym_user_command()
1030 uc->cmd = UC_SETVERBOSE; in sym_user_command()
1032 uc->cmd = UC_SETWIDE; in sym_user_command()
1035 uc->cmd = UC_SETDEBUG; in sym_user_command()
1038 uc->cmd = UC_SETFLAG; in sym_user_command()
1040 uc->cmd = UC_RESETDEV; in sym_user_command()
1042 uc->cmd = UC_CLEARDEV; in sym_user_command()
1047 printk("sym_user_command: arg_len=%d, cmd=%ld\n", arg_len, uc->cmd); in sym_user_command()
1054 switch(uc->cmd) { in sym_user_command()
1075 switch(uc->cmd) { in sym_user_command()