scsi_execute — insert request and wait for the result


int scsi_execute (struct scsi_device * sdev,
 const unsigned char * cmd,
 int data_direction,
 void * buffer,
 unsigned bufflen,
 unsigned char * sense,
 struct scsi_sense_hdr * sshdr,
 int timeout,
 int retries,
 u64 flags,
 req_flags_t rq_flags,
 int * resid);


struct scsi_device * sdev

scsi device

const unsigned char * cmd

scsi command

int data_direction

data direction

void * buffer

data buffer

unsigned bufflen

len of buffer

unsigned char * sense

optional sense buffer

struct scsi_sense_hdr * sshdr

optional decoded sense header

int timeout

request timeout in seconds

int retries

number of times to retry request

u64 flags

flags for ->cmd_flags

req_flags_t rq_flags

flags for ->rq_flags

int * resid

optional residual length


Returns the scsi_cmnd result field if a command was executed, or a negative Linux error code if we didn't get that far.