Please pass this along to interested parties. All this info is public and non-NDA.
I am the person implementing most of the Serial ATA driver support in Linux. Seven or eight controllers are already supported, and I am adding the SATA2 controllers soon (AHCI, Marvell, Silicon Image 3124, ...).
My driver currently uses SCSI-to-ATA translation for all SATA disk devices (ATA), making my driver development much easier in the short term. Almost any Linux user using SATA is using SCSI-to-ATA translation, at the moment. As with all Linux code, what I describe is available right now for public review.
Here are rough notes on how my SCSI->ATA translator works, in comparison T10/04-136r0.
WARNING: This is a short term situation. Long term, I am moving my SATA drivers _away_ from translation to direct usage as first-class ATA devices.
scsi INQUIRY ------------- CmdDt bit set -> check condition, invalid field in cdb
EVPD bit clear -> claims SPC-3, SAM-3, SBC-2, SPC-3
vendor is "ATA "
model is the first 16 bytes of ATA model nameEVPD pages supported: 0x00, 0x80, 0x83
page 80 -- lists ATA serial number
page 83 -- returns "Linux ATA-SCSI simulator"
scsi MODE SELECT 6, 10 ------------------------ check condition, invalid field in cdb (for all permutations)
scsi MODE SENSE 6, 10 ---------------------- caching page, vaguely close to T10's suggestions:
u8 page[7] = { 0xf, 0, 0x10, 0, 0x8, 0xa, 0 };
if (dev->flags & ATA_DFLAG_WCACHE)
page[6] = 0x4;control mode page, a constant:
const u8 page[] = {0xa, 0xa, 2, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 30};
scsi TEST UNIT READY scsi FORMAT UNIT scsi SEND DIAGNOSTIC --------------------- completes command with success (no op)
scsi READ CAPACITY scsi READ CAPACITY 16 --------------------- supported via emulation, in the obvious manner
scsi REPORT LUNS
----------------
supported via emulation, exactly as T10/04-136r0 describes (by coincedence). One LUN, LUN 0, 8 bytes long.
I am considering changing this for SATA port multipliers, though.
scsi READ 6, 10, 16
scsi WRITE 6, 10, 16
---------------------
Translated to ATA read/write command, dependent on ATA protocol (legacy TCQ, NCQ, DMA, PIO, PIO multi-DRQ)
In contrast, the T10 document limits translation to only certain protocols (DMA or NCQ).
scsi SYNCHRONIZE CACHE ----------------------- Translated to FLUSH CACHE or FLUSH CACHE EXT.
In contrast, T10 document does not mention FLUSH CACHE EXT (doh!).
scsi-to-ATA passthru
--------------------
Using a vendor-reserved SCSI opcode, users may encapsulate an ATA taskfile inside a SCSI cdb. information provided:
* ATA taskfile (command FIS)
* protocol (pio, pio mult, dma, tcq, ncq, etc.)
* a few flags, to indicate lba48, data direction, ...
T10 document does not mention anything of this nature, IIRC.
