1ATA_SCSI_TRANSLATE(9) libata SCSI translation/emulat ATA_SCSI_TRANSLATE(9)
2
3
4
6 ata_scsi_translate - Translate then issue SCSI command to ATA device
7
9 int ata_scsi_translate(struct ata_device * dev, struct scsi_cmnd * cmd,
10 ata_xlat_func_t xlat_func);
11
13 dev
14 ATA device to which the command is addressed
15
16 cmd
17 SCSI command to execute
18
19 xlat_func
20 Actor which translates cmd to an ATA taskfile
21
23 Our ->queuecommand function has decided that the SCSI command issued
24 can be directly translated into an ATA command, rather than handled
25 internally.
26
27 This function sets up an ata_queued_cmd structure for the SCSI command,
28 and sends that ata_queued_cmd to the hardware.
29
30 The xlat_func argument (actor) returns 0 if ready to execute ATA
31 command, else 1 to finish translation. If 1 is returned then
32 cmd->result (and possibly cmd->sense_buffer) are assumed to be set
33 reflecting an error condition or clean (early) termination.
34
36 spin_lock_irqsave(host lock)
37
39 0 on success, SCSI_ML_QUEUE_DEVICE_BUSY if the command needs to be
40 deferred.
41
43 Jeff Garzik
44 Author.
45
47Kernel Hackers Manual 3.10 June 2019 ATA_SCSI_TRANSLATE(9)