---
name: "scsi_eh_prep_cmnd"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/scsi_eh_prep_cmnd"
---

# scsi\_eh\_prep\_cmnd(9)

Save a scsi command info as part of error recovery

## NAME

scsi\_eh\_prep\_cmnd - Save a scsi command info as part of error recovery

## SYNOPSIS

**void scsi\_eh\_prep\_cmnd(struct scsi\_cmnd \*** *scmd***, struct scsi\_eh\_save \*** *ses***, unsigned char \*** *cmnd***, int** *cmnd\_size***, unsigned** *sense\_bytes***);**

## ARGUMENTS

*scmd*

SCSI command structure to hijack

*ses*

structure to save restore information

*cmnd*

CDB to send. Can be NULL if no new cmnd is needed

*cmnd\_size*

size in bytes of *cmnd* (must be \<= BLK\_MAX\_CDB)

*sense\_bytes*

size of sense data to copy. or 0 (if != 0 *cmnd* is ignored)

## DESCRIPTION

This function is used to save a scsi command information before re-execution as part of the error recovery process. If *sense\_bytes* is 0 the command sent must be one that does not transfer any data. If *sense\_bytes* != 0 *cmnd* is ignored and this functions sets up a REQUEST\_SENSE command and cmnd buffers to read *sense\_bytes* into *scmd*-\>sense\_buffer.

## AUTHORS

**James Bottomley** \<James.Bottomley@hansenpartnership.com\>

Author.

**Rob Landley** \<rob@landley.net\>

Author.

## COPYRIGHT
