Lines Matching refs:cmd

147 static void esp_send_dma_cmd(struct esp *esp, int len, int max_len, int cmd)  in esp_send_dma_cmd()  argument
155 scsi_esp_cmd(esp, cmd); in esp_send_dma_cmd()
159 cmd |= ESP_CMD_DMA; in esp_send_dma_cmd()
161 len, max_len, 0, cmd); in esp_send_dma_cmd()
372 static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd) in esp_map_dma() argument
374 struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd); in esp_map_dma()
375 struct scatterlist *sg = scsi_sglist(cmd); in esp_map_dma()
379 if (cmd->sc_data_direction == DMA_NONE) in esp_map_dma()
387 spriv->num_sg = scsi_sg_count(cmd); in esp_map_dma()
389 scsi_for_each_sg(cmd, s, spriv->num_sg, i) { in esp_map_dma()
394 spriv->num_sg = scsi_dma_map(cmd); in esp_map_dma()
395 scsi_for_each_sg(cmd, s, spriv->num_sg, i) in esp_map_dma()
405 struct scsi_cmnd *cmd) in esp_cur_dma_addr() argument
407 struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd); in esp_cur_dma_addr()
411 (ent->sense_ptr - cmd->sense_buffer); in esp_cur_dma_addr()
420 struct scsi_cmnd *cmd) in esp_cur_dma_len() argument
422 struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd); in esp_cur_dma_len()
426 (ent->sense_ptr - cmd->sense_buffer); in esp_cur_dma_len()
432 struct scsi_cmnd *cmd, unsigned int len) in esp_advance_dma() argument
434 struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd); in esp_advance_dma()
459 static void esp_unmap_dma(struct esp *esp, struct scsi_cmnd *cmd) in esp_unmap_dma() argument
462 scsi_dma_unmap(cmd); in esp_unmap_dma()
467 struct scsi_cmnd *cmd = ent->cmd; in esp_save_pointers() local
468 struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd); in esp_save_pointers()
482 struct scsi_cmnd *cmd = ent->cmd; in esp_restore_pointers() local
483 struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd); in esp_restore_pointers()
632 ent->sense_ptr = ent->cmd->sense_buffer; in esp_map_sense()
659 struct scsi_cmnd *cmd = ent->cmd; in esp_autosense() local
660 struct scsi_device *dev = cmd->device; in esp_autosense()
709 struct scsi_cmnd *cmd = ent->cmd; in find_and_prep_issuable_command() local
710 struct scsi_device *dev = cmd->device; in find_and_prep_issuable_command()
719 if (!spi_populate_tag_msg(&ent->tag[0], cmd)) { in find_and_prep_issuable_command()
739 struct scsi_cmnd *cmd; in esp_maybe_execute_command() local
759 cmd = ent->cmd; in esp_maybe_execute_command()
760 dev = cmd->device; in esp_maybe_execute_command()
769 esp_map_dma(esp, cmd); in esp_maybe_execute_command()
772 if (!(cmd->cmd_len == 6 || cmd->cmd_len == 10 || cmd->cmd_len == 12)) in esp_maybe_execute_command()
830 esp->cmd_bytes_left = cmd->cmd_len; in esp_maybe_execute_command()
831 esp->cmd_bytes_ptr = &cmd->cmnd[0]; in esp_maybe_execute_command()
853 for (i = 0; i < cmd->cmd_len; i++) in esp_maybe_execute_command()
854 *p++ = cmd->cmnd[i]; in esp_maybe_execute_command()
870 for (i = 0; i < cmd->cmd_len; i++) in esp_maybe_execute_command()
871 printk("%02x ", cmd->cmnd[i]); in esp_maybe_execute_command()
899 struct scsi_cmnd *cmd, unsigned char host_byte) in esp_cmd_is_done() argument
901 struct scsi_device *dev = cmd->device; in esp_cmd_is_done()
906 esp_unmap_dma(esp, cmd); in esp_cmd_is_done()
908 cmd->result = 0; in esp_cmd_is_done()
909 set_host_byte(cmd, host_byte); in esp_cmd_is_done()
911 set_status_byte(cmd, ent->status); in esp_cmd_is_done()
925 cmd->result = SAM_STAT_CHECK_CONDITION; in esp_cmd_is_done()
934 printk("%02x ", cmd->sense_buffer[i]); in esp_cmd_is_done()
939 scsi_done(cmd); in esp_cmd_is_done()
949 struct scsi_device *dev = ent->cmd->device; in esp_event_queue_full()
955 static int esp_queuecommand_lck(struct scsi_cmnd *cmd) in esp_queuecommand_lck() argument
957 struct scsi_device *dev = cmd->device; in esp_queuecommand_lck()
966 ent->cmd = cmd; in esp_queuecommand_lck()
968 spriv = ESP_CMD_PRIV(cmd); in esp_queuecommand_lck()
1225 struct scsi_cmnd *cmd; in esp_finish_select() local
1232 cmd = ent->cmd; in esp_finish_select()
1239 esp_cmd_is_done(esp, ent, cmd, DID_ERROR); in esp_finish_select()
1246 struct esp_target_data *tp = &esp->target[cmd->device->id]; in esp_finish_select()
1253 esp_unmap_dma(esp, cmd); in esp_finish_select()
1254 esp_free_lun_tag(ent, cmd->device->hostdata); in esp_finish_select()
1275 struct scsi_device *dev = cmd->device; in esp_finish_select()
1284 esp_cmd_is_done(esp, ent, cmd, DID_BAD_TARGET); in esp_finish_select()
1317 struct scsi_cmnd *cmd) in esp_data_bytes_sent() argument
1355 struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd); in esp_data_bytes_sent()
1452 struct scsi_cmnd *cmd = ent->cmd; in esp_msgin_reject() local
1456 tgt = cmd->device->id; in esp_msgin_reject()
1592 struct scsi_cmnd *cmd = ent->cmd; in esp_msgin_extended() local
1594 int tgt = cmd->device->id; in esp_msgin_extended()
1648 spriv = ESP_CMD_PRIV(ent->cmd); in esp_msgin_process()
1740 struct scsi_cmnd *cmd = ent->cmd; in esp_process_event() local
1741 dma_addr_t dma_addr = esp_cur_dma_addr(ent, cmd); in esp_process_event()
1742 unsigned int dma_len = esp_cur_dma_len(ent, cmd); in esp_process_event()
1765 (unsigned long long)esp_cur_dma_addr(ent, cmd), in esp_process_event()
1766 esp_cur_dma_len(ent, cmd)); in esp_process_event()
1781 struct scsi_cmnd *cmd = ent->cmd; in esp_process_event() local
1808 bytes_sent = esp_data_bytes_sent(esp, ent, cmd); in esp_process_event()
1819 esp_advance_dma(esp, ent, cmd, bytes_sent); in esp_process_event()
1852 struct scsi_cmnd *cmd = ent->cmd; in esp_process_event() local
1869 esp_cmd_is_done(esp, ent, cmd, DID_OK); in esp_process_event()
1873 cmd->device->id, in esp_process_event()
2030 struct scsi_cmnd *cmd = ent->cmd; in esp_reset_cleanup_one() local
2032 esp_unmap_dma(esp, cmd); in esp_reset_cleanup_one()
2033 esp_free_lun_tag(ent, cmd->device->hostdata); in esp_reset_cleanup_one()
2034 cmd->result = DID_RESET << 16; in esp_reset_cleanup_one()
2039 scsi_done(cmd); in esp_reset_cleanup_one()
2058 struct scsi_cmnd *cmd = ent->cmd; in esp_reset_cleanup() local
2061 cmd->result = DID_RESET << 16; in esp_reset_cleanup()
2062 scsi_done(cmd); in esp_reset_cleanup()
2490 static int esp_eh_abort_handler(struct scsi_cmnd *cmd) in esp_eh_abort_handler() argument
2492 struct esp *esp = shost_priv(cmd->device->host); in esp_eh_abort_handler()
2502 cmd, cmd->cmnd[0]); in esp_eh_abort_handler()
2507 ent->cmd, ent->cmd->cmnd[0]); in esp_eh_abort_handler()
2510 ent->cmd, ent->cmd->cmnd[0]); in esp_eh_abort_handler()
2514 ent->cmd, ent->cmd->cmnd[0]); in esp_eh_abort_handler()
2523 if (tmp->cmd == cmd) { in esp_eh_abort_handler()
2535 cmd->result = DID_ABORT << 16; in esp_eh_abort_handler()
2536 scsi_done(cmd); in esp_eh_abort_handler()
2546 if (ent && ent->cmd == cmd) { in esp_eh_abort_handler()
2607 static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd) in esp_eh_bus_reset_handler() argument
2609 struct esp *esp = shost_priv(cmd->device->host); in esp_eh_bus_reset_handler()
2643 static int esp_eh_host_reset_handler(struct scsi_cmnd *cmd) in esp_eh_host_reset_handler() argument
2645 struct esp *esp = shost_priv(cmd->device->host); in esp_eh_host_reset_handler()
2822 u32 dma_count, int write, u8 cmd) in esp_send_pio_cmd() argument
2826 cmd &= ~ESP_CMD_DMA; in esp_send_pio_cmd()
2833 scsi_esp_cmd(esp, cmd); in esp_send_pio_cmd()
2876 scsi_esp_cmd(esp, cmd); in esp_send_pio_cmd()