aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sil24.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-11 09:32:19 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-11 13:31:37 -0400
commitbad28a37f5e4ab1db5c5f01b77664597b02b257f (patch)
treea8821f7d5b48f639b054a0f17d03bc89d0c7b95f /drivers/scsi/sata_sil24.c
parenta5b4c47a2731f1dd685f28b79464e4442f3682ec (diff)
[PATCH] sata_sil24: fix on-memory structure byteorder
Data structures residing on memory and fetched by the controller should have LE ordering. Fix it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r--drivers/scsi/sata_sil24.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index a8328a88e8c9..8ef51d0dcda7 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -481,7 +481,7 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)
481 } 481 }
482 482
483 /* do SRST */ 483 /* do SRST */
484 prb->ctrl = PRB_CTRL_SRST; 484 prb->ctrl = cpu_to_le16(PRB_CTRL_SRST);
485 prb->fis[1] = 0; /* no PM yet */ 485 prb->fis[1] = 0; /* no PM yet */
486 486
487 writel((u32)paddr, port + PORT_CMD_ACTIVATE); 487 writel((u32)paddr, port + PORT_CMD_ACTIVATE);
@@ -597,6 +597,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
597 union sil24_cmd_block *cb = pp->cmd_block + qc->tag; 597 union sil24_cmd_block *cb = pp->cmd_block + qc->tag;
598 struct sil24_prb *prb; 598 struct sil24_prb *prb;
599 struct sil24_sge *sge; 599 struct sil24_sge *sge;
600 u16 ctrl = 0;
600 601
601 switch (qc->tf.protocol) { 602 switch (qc->tf.protocol) {
602 case ATA_PROT_PIO: 603 case ATA_PROT_PIO:
@@ -604,7 +605,6 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
604 case ATA_PROT_NODATA: 605 case ATA_PROT_NODATA:
605 prb = &cb->ata.prb; 606 prb = &cb->ata.prb;
606 sge = cb->ata.sge; 607 sge = cb->ata.sge;
607 prb->ctrl = 0;
608 break; 608 break;
609 609
610 case ATA_PROT_ATAPI: 610 case ATA_PROT_ATAPI:
@@ -617,12 +617,10 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
617 617
618 if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { 618 if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) {
619 if (qc->tf.flags & ATA_TFLAG_WRITE) 619 if (qc->tf.flags & ATA_TFLAG_WRITE)
620 prb->ctrl = PRB_CTRL_PACKET_WRITE; 620 ctrl = PRB_CTRL_PACKET_WRITE;
621 else 621 else
622 prb->ctrl = PRB_CTRL_PACKET_READ; 622 ctrl = PRB_CTRL_PACKET_READ;
623 } else 623 }
624 prb->ctrl = 0;
625
626 break; 624 break;
627 625
628 default: 626 default:
@@ -631,6 +629,7 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
631 BUG(); 629 BUG();
632 } 630 }
633 631
632 prb->ctrl = cpu_to_le16(ctrl);
634 ata_tf_to_fis(&qc->tf, prb->fis, 0); 633 ata_tf_to_fis(&qc->tf, prb->fis, 0);
635 634
636 if (qc->flags & ATA_QCFLAG_DMAMAP) 635 if (qc->flags & ATA_QCFLAG_DMAMAP)