Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61998
b: refs/heads/master
c: 9977126
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jul 20, 2007
1 parent 84e7cfa commit 15bd8ba
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe36cb53cfd82f3c0796a0826e1c9caf198c8f97
refs/heads/master: 9977126c4b65c1396b665f7a0eeb8c7dede336f9
10 changes: 4 additions & 6 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
cmd_fis_len | AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY);

tf.ctl |= ATA_SRST;
ata_tf_to_fis(&tf, fis, 0);
fis[1] &= ~(1 << 7); /* turn off Command FIS bit */
ata_tf_to_fis(&tf, 0, 0, fis);

writel(1, port_mmio + PORT_CMD_ISSUE);

Expand All @@ -1039,8 +1038,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
ahci_fill_cmd_slot(pp, 0, cmd_fis_len);

tf.ctl &= ~ATA_SRST;
ata_tf_to_fis(&tf, fis, 0);
fis[1] &= ~(1 << 7); /* turn off Command FIS bit */
ata_tf_to_fis(&tf, 0, 0, fis);

writel(1, port_mmio + PORT_CMD_ISSUE);
readl(port_mmio + PORT_CMD_ISSUE); /* flush */
Expand Down Expand Up @@ -1088,7 +1086,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class,
/* clear D2H reception area to properly wait for D2H FIS */
ata_tf_init(ap->device, &tf);
tf.command = 0x80;
ata_tf_to_fis(&tf, d2h_fis, 0);
ata_tf_to_fis(&tf, 0, 0, d2h_fis);

rc = sata_std_hardreset(ap, class, deadline);

Expand Down Expand Up @@ -1205,7 +1203,7 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
*/
cmd_tbl = pp->cmd_tbl + qc->tag * AHCI_CMD_TBL_SZ;

ata_tf_to_fis(&qc->tf, cmd_tbl, 0);
ata_tf_to_fis(&qc->tf, 0, 1, cmd_tbl);
if (is_atapi) {
memset(cmd_tbl + AHCI_CMD_TBL_CDB, 0, 32);
memcpy(cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, qc->dev->cdb_len);
Expand Down
14 changes: 8 additions & 6 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,23 @@ 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).
*
* 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;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/sata_qstor.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static void qs_qc_prep(struct ata_queued_cmd *qc)
buf[28] = dflags;

/* frame information structure (FIS) */
ata_tf_to_fis(&qc->tf, &buf[32], 0);
ata_tf_to_fis(&qc->tf, 0, 1, &buf[32]);
}

static inline void qs_packet_start(struct ata_queued_cmd *qc)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
}

prb->ctrl = cpu_to_le16(ctrl);
ata_tf_to_fis(&qc->tf, prb->fis, 0);
ata_tf_to_fis(&qc->tf, 0, 1, prb->fis);

if (qc->flags & ATA_QCFLAG_DMAMAP)
sil24_fill_sg(qc, sge);
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *);
*/
extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp);
extern void ata_tf_to_fis(const struct ata_taskfile *tf,
u8 pmp, int is_cmd, u8 *fis);
extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
Expand Down

0 comments on commit 15bd8ba

Please sign in to comment.