---
name: "ata_scsi_translate"
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/ata_scsi_translate"
---

# ata\_scsi\_translate(9)

Translate then issue SCSI command to ATA device

## NAME

ata\_scsi\_translate - Translate then issue SCSI command to ATA device

## SYNOPSIS

**int ata\_scsi\_translate(struct ata\_device \*** *dev***, struct scsi\_cmnd \*** *cmd***, ata\_xlat\_func\_t** *xlat\_func***);**

## ARGUMENTS

*dev*

ATA device to which the command is addressed

*cmd*

SCSI command to execute

*xlat\_func*

Actor which translates *cmd* to an ATA taskfile

## DESCRIPTION

Our -\>**queuecommand** function has decided that the SCSI command issued can be directly translated into an ATA command, rather than handled internally.

This function sets up an ata\_queued\_cmd structure for the SCSI command, and sends that ata\_queued\_cmd to the hardware.

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.

LOCKING: spin\_lock\_irqsave(host lock)

## RETURN

0 on success, SCSI\_ML\_QUEUE\_DEVICE\_BUSY if the command needs to be deferred.

## AUTHOR

**Jeff Garzik**

Author.

## COPYRIGHT
