From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Marc C <marc.ceeeee@gmail.com>
Cc: tj@kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH v3 1/3] libata: Populate host-to-device FIS "auxiliary" field
Date: Fri, 09 Aug 2013 18:29:48 +0400 [thread overview]
Message-ID: <5204FCDC.2080304@cogentembedded.com> (raw)
In-Reply-To: <5204FA16.5000103@cogentembedded.com>
On 08/09/2013 06:17 PM, Sergei Shtylyov wrote:
>> From: Marc Carino <marc.ceeeee@gmail.com>
>> SATA 3.1 added an "auxiliary" field to the host-to-device FIS.
>> Since there is no analog between the new field and the ATA
>> taskfile, a new element was added to 'struct ata_queued_cmd."
>> Signed-off-by: Marc Carino <marc.ceeeee@gmail.com>
> [...]
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index c24354d..9d02c47 100644
>> --- a/drivers/ata/libata-core.c
>> +++ b/drivers/ata/libata-core.c
>> @@ -532,6 +532,34 @@ int atapi_cmd_type(u8 opcode)
>> }
>>
>> /**
>> + * ata_qc_to_fis - Convert struct ata_queued_cmd to SATA FIS structure
>> + * @qc: struct ata_queued_cmd to convert
>> + * @pmp: Port multiplier port
>> + * @is_cmd: This FIS is for command
>> + * @fis: Buffer into which data will output
>> + *
>> + * Converts a struct ata_queued_cmd to a Serial ATA
>> + * FIS structure (Register - Host to Device).
>> + *
>> + * Beginning with SATA 3.1, the ATA taskfile does not completely describe
>> + * all of the fields in a host-to-device FIS. More specifically, the
>> + * 'auxiliary' field has no ATA taskfile analog, and thus requires us
>> + * to populate the FIS via the ata_queued_cmd structure.
>> + *
>> + * LOCKING:
>> + * Inherited from caller.
>> + */
>> +void ata_qc_to_fis(const struct ata_queued_cmd *qc, u8 pmp, int is_cmd, u8
>> *fis)
>> +{
>> + ata_tf_to_fis(&qc->tf, pmp, is_cmd, fis);
>> +
>> + fis[16] = qc->auxiliary & 0xff;
>> + fis[17] = (qc->auxiliary >> 8) & 0xff;
>> + fis[18] = (qc->auxiliary >> 16) & 0xff;
>> + fis[19] = (qc->auxiliary >> 24) & 0xff;
>> +}
>> +
>> +/**
>> * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
>> * @tf: Taskfile to convert
>> * @pmp: Port multiplier port
>> @@ -6877,6 +6905,7 @@ EXPORT_SYMBOL_GPL(ata_sg_init);
>> EXPORT_SYMBOL_GPL(ata_qc_complete);
>> EXPORT_SYMBOL_GPL(ata_qc_complete_multiple);
>> EXPORT_SYMBOL_GPL(atapi_cmd_type);
>> +EXPORT_SYMBOL_GPL(ata_qc_to_fis);
>> EXPORT_SYMBOL_GPL(ata_tf_to_fis);
> I think we should now unexport this function and make it static since it
> would be no longer valid to call it from the drivers...
I was somewhat rash in this conclusion: drivers use this function not only
to issue commands but also to fake D2H FIS and not only that...
WBR, Sergei
next prev parent reply other threads:[~2013-08-09 14:29 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 4:49 [PATCH v3 0/3] Introduce new SATA queued commands Marc C
2013-08-09 4:49 ` [PATCH v3 1/3] libata: Populate host-to-device FIS "auxiliary" field Marc C
2013-08-09 14:03 ` Tejun Heo
2013-08-09 14:36 ` Sergei Shtylyov
2013-08-09 14:53 ` Tejun Heo
2013-08-09 21:39 ` Sergei Shtylyov
2013-08-09 21:51 ` Tejun Heo
2013-08-09 22:17 ` Sergei Shtylyov
2013-08-09 22:26 ` Tejun Heo
2013-08-10 21:59 ` Sergei Shtylyov
2013-08-12 13:58 ` Tejun Heo
2013-08-09 21:24 ` Sergei Shtylyov
2013-08-09 14:17 ` Sergei Shtylyov
2013-08-09 14:29 ` Sergei Shtylyov [this message]
2013-08-09 14:26 ` Sergei Shtylyov
2013-08-09 4:49 ` [PATCH v3 2/3] libata: Add support for SEND/RECEIVE FPDMA QUEUED Marc C
2013-08-09 14:05 ` Tejun Heo
2013-08-10 2:10 ` Marc C
2013-08-09 4:49 ` [PATCH v3 3/3] libata: Add support for queued DSM TRIM Marc C
2013-08-09 14:07 ` Sergei Shtylyov
2013-08-09 14:08 ` Tejun Heo
2013-08-10 2:14 ` Marc C
2013-08-10 15:11 ` Tejun Heo
[not found] <52059FBF.7050303@gmail.com>
2013-08-10 2:06 ` [PATCH v3 1/3] libata: Populate host-to-device FIS "auxiliary" field Marc C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5204FCDC.2080304@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-ide@vger.kernel.org \
--cc=marc.ceeeee@gmail.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.