libata: add @is_cmd to ata_tf_to_fis()
Add @is_cmd to ata_tf_to_fis(). This controls bit 7 of the second byte which tells the device whether this H2D FIS is for a command or not. This cleans up ahci a bit and will be used by PMP. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
@ -111,8 +111,9 @@ MODULE_VERSION(DRV_VERSION);
|
||||
/**
|
||||
* ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
|
||||
* @tf: Taskfile to convert
|
||||
* @fis: Buffer into which data will output
|
||||
* @pmp: Port multiplier port
|
||||
* @is_cmd: This FIS is for command
|
||||
* @fis: Buffer into which data will output
|
||||
*
|
||||
* Converts a standard ATA taskfile to a Serial ATA
|
||||
* FIS structure (Register - Host to Device).
|
||||
@ -120,12 +121,13 @@ MODULE_VERSION(DRV_VERSION);
|
||||
* LOCKING:
|
||||
* Inherited from caller.
|
||||
*/
|
||||
|
||||
void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp)
|
||||
void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
|
||||
{
|
||||
fis[0] = 0x27; /* Register - Host to Device FIS */
|
||||
fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number,
|
||||
bit 7 indicates Command FIS */
|
||||
fis[0] = 0x27; /* Register - Host to Device FIS */
|
||||
fis[1] = pmp & 0xf; /* Port multiplier number*/
|
||||
if (is_cmd)
|
||||
fis[1] |= (1 << 7); /* bit 7 indicates Command FIS */
|
||||
|
||||
fis[2] = tf->command;
|
||||
fis[3] = tf->feature;
|
||||
|
||||
|
Reference in New Issue
Block a user