'\" t .\" Title: ata_scsi_translate .\" Author: .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: libata SCSI translation/emulation .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "ATA_SCSI_TRANSLATE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "libata SCSI translation/emulat" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ata_scsi_translate \- Translate then issue SCSI command to ATA device .SH "SYNOPSIS" .HP \w'int\ ata_scsi_translate('u .BI "int ata_scsi_translate(struct\ ata_device\ *\ " "dev" ", struct\ scsi_cmnd\ *\ " "cmd" ", ata_xlat_func_t\ " "xlat_func" ");" .SH "ARGUMENTS" .PP \fIdev\fR .RS 4 ATA device to which the command is addressed .RE .PP \fIcmd\fR .RS 4 SCSI command to execute .RE .PP \fIxlat_func\fR .RS 4 Actor which translates \fIcmd\fR to an ATA taskfile .RE .SH "DESCRIPTION" .PP Our \->\fBqueuecommand\fR function has decided that the SCSI command issued can be directly translated into an ATA command, rather than handled internally\&. .PP This function sets up an ata_queued_cmd structure for the SCSI command, and sends that ata_queued_cmd to the hardware\&. .PP The xlat_func argument (actor) returns 0 if ready to execute ATA command, else 1 to finish translation\&. If 1 is returned then cmd\->result (and possibly cmd\->sense_buffer) are assumed to be set reflecting an error condition or clean (early) termination\&. .PP LOCKING: spin_lock_irqsave(host lock) .SH "RETURN" .PP 0 on success, SCSI_ML_QUEUE_DEVICE_BUSY if the command needs to be deferred\&. .SH "AUTHOR" .PP \fBJeff Garzik\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br