aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-07-16 01:29:38 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-20 08:02:10 -0400
commit9977126c4b65c1396b665f7a0eeb8c7dede336f9 (patch)
tree91901f1356a57ba311bc5c95c4825504642f7d04 /drivers/ata/libata-core.c
parentfe36cb53cfd82f3c0796a0826e1c9caf198c8f97 (diff)
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>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e2ecb7a4628e..39a8e986a4ea 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -111,8 +111,9 @@ MODULE_VERSION(DRV_VERSION);
111/** 111/**
112 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 112 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
113 * @tf: Taskfile to convert 113 * @tf: Taskfile to convert
114 * @fis: Buffer into which data will output
115 * @pmp: Port multiplier port 114 * @pmp: Port multiplier port
115 * @is_cmd: This FIS is for command
116 * @fis: Buffer into which data will output
116 * 117 *
117 * Converts a standard ATA taskfile to a Serial ATA 118 * Converts a standard ATA taskfile to a Serial ATA
118 * FIS structure (Register - Host to Device). 119 * FIS structure (Register - Host to Device).
@@ -120,12 +121,13 @@ MODULE_VERSION(DRV_VERSION);
120 * LOCKING: 121 * LOCKING:
121 * Inherited from caller. 122 * Inherited from caller.
122 */ 123 */
123 124void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis)
124void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp)
125{ 125{
126 fis[0] = 0x27; /* Register - Host to Device FIS */ 126 fis[0] = 0x27; /* Register - Host to Device FIS */
127 fis[1] = (pmp & 0xf) | (1 << 7); /* Port multiplier number, 127 fis[1] = pmp & 0xf; /* Port multiplier number*/
128 bit 7 indicates Command FIS */ 128 if (is_cmd)
129 fis[1] |= (1 << 7); /* bit 7 indicates Command FIS */
130
129 fis[2] = tf->command; 131 fis[2] = tf->command;
130 fis[3] = tf->feature; 132 fis[3] = tf->feature;
131 133