Lines Matching refs:cmd

98 void scsi_log_send(struct scsi_cmnd *cmd)  in scsi_log_send()  argument
117 scmd_printk(KERN_INFO, cmd, in scsi_log_send()
118 "Send: scmd 0x%p\n", cmd); in scsi_log_send()
119 scsi_print_command(cmd); in scsi_log_send()
124 void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) in scsi_log_completion() argument
143 if (((level > 0) && (cmd->result || disposition != SUCCESS)) || in scsi_log_completion()
145 scsi_print_result(cmd, "Done", disposition); in scsi_log_completion()
146 scsi_print_command(cmd); in scsi_log_completion()
147 if (status_byte(cmd->result) == CHECK_CONDITION) in scsi_log_completion()
148 scsi_print_sense(cmd); in scsi_log_completion()
150 scmd_printk(KERN_INFO, cmd, in scsi_log_completion()
152 scsi_host_busy(cmd->device->host), in scsi_log_completion()
153 cmd->device->host->host_failed); in scsi_log_completion()
167 void scsi_finish_command(struct scsi_cmnd *cmd) in scsi_finish_command() argument
169 struct scsi_device *sdev = cmd->device; in scsi_finish_command()
175 scsi_device_unbusy(sdev, cmd); in scsi_finish_command()
192 if (SCSI_SENSE_VALID(cmd)) in scsi_finish_command()
193 cmd->result |= (DRIVER_SENSE << 24); in scsi_finish_command()
197 "(result %x)\n", cmd->result)); in scsi_finish_command()
199 good_bytes = scsi_bufflen(cmd); in scsi_finish_command()
200 if (!blk_rq_is_passthrough(cmd->request)) { in scsi_finish_command()
202 drv = scsi_cmd_to_driver(cmd); in scsi_finish_command()
204 good_bytes = drv->done(cmd); in scsi_finish_command()
212 good_bytes -= scsi_get_resid(cmd); in scsi_finish_command()
214 scsi_io_completion(cmd, good_bytes); in scsi_finish_command()
299 unsigned char cmd[16]; in scsi_vpd_inquiry() local
304 cmd[0] = INQUIRY; in scsi_vpd_inquiry()
305 cmd[1] = 1; /* EVPD */ in scsi_vpd_inquiry()
306 cmd[2] = page; in scsi_vpd_inquiry()
307 cmd[3] = len >> 8; in scsi_vpd_inquiry()
308 cmd[4] = len & 0xff; in scsi_vpd_inquiry()
309 cmd[5] = 0; /* Control byte */ in scsi_vpd_inquiry()
315 result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, in scsi_vpd_inquiry()
480 unsigned char cmd[16]; in scsi_report_opcode() local
487 memset(cmd, 0, 16); in scsi_report_opcode()
488 cmd[0] = MAINTENANCE_IN; in scsi_report_opcode()
489 cmd[1] = MI_REPORT_SUPPORTED_OPERATION_CODES; in scsi_report_opcode()
490 cmd[2] = 1; /* One command format */ in scsi_report_opcode()
491 cmd[3] = opcode; in scsi_report_opcode()
492 put_unaligned_be32(len, &cmd[6]); in scsi_report_opcode()
495 result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len, in scsi_report_opcode()