ata_scsi_translate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Okay bestie, welcome to the ata_scsi_translate(9) page from the Kernel API Manual. πŸ’… This is where a SCSI command gets translated and sent on its way to an ATA device β€” but in a very structured, kernel-approved way. ✨

✨ 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 , struct ata_port *ap );

That's the whole signature, no cap. 🫢

πŸ’¬ ARGUMENTS πŸ’¬

  • dev β€” the ATA device to which the command is addressed πŸ’–
  • cmd β€” the SCSI command to execute ⭐
  • xlat_func β€” the actor which translates cmd to an ATA taskfile πŸ¦‹
  • ap β€” the ATA port of interest 🌸

🌈 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 or SCSI_MLQUEUE_HOST_BUSY if the command needs to be deferred. That's the whole return vibe check. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./drivers/ata/libata-scsi.c β€” go peek, bestie. 🫢

Cute sign-off: source/version ./drivers/ata, dated October 2026. πŸŽ€πŸ’–

πŸ“¦ where this page comes from