diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/st.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 203f22e816c0..11341b717bba 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -533,6 +533,28 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd | |||
533 | return SRpnt; | 533 | return SRpnt; |
534 | } | 534 | } |
535 | 535 | ||
536 | static int st_scsi_kern_execute(struct st_request *streq, | ||
537 | const unsigned char *cmd, int data_direction, | ||
538 | void *buffer, unsigned bufflen, int timeout, | ||
539 | int retries) | ||
540 | { | ||
541 | struct scsi_tape *stp = streq->stp; | ||
542 | int ret, resid; | ||
543 | |||
544 | stp->buffer->cmdstat.have_sense = 0; | ||
545 | memcpy(streq->cmd, cmd, sizeof(streq->cmd)); | ||
546 | |||
547 | ret = scsi_execute(stp->device, cmd, data_direction, buffer, bufflen, | ||
548 | streq->sense, timeout, retries, 0, &resid); | ||
549 | if (driver_byte(ret) & DRIVER_ERROR) | ||
550 | return -EBUSY; | ||
551 | |||
552 | stp->buffer->cmdstat.midlevel_result = streq->result = ret; | ||
553 | stp->buffer->cmdstat.residual = resid; | ||
554 | stp->buffer->syscall_result = st_chk_result(stp, streq); | ||
555 | |||
556 | return 0; | ||
557 | } | ||
536 | 558 | ||
537 | /* Handle the write-behind checking (waits for completion). Returns -ENOSPC if | 559 | /* Handle the write-behind checking (waits for completion). Returns -ENOSPC if |
538 | write has been correct but EOM early warning reached, -EIO if write ended in | 560 | write has been correct but EOM early warning reached, -EIO if write ended in |