diff options
author | Tejun Heo <tj@kernel.org> | 2010-05-10 15:41:41 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-05-19 13:38:54 -0400 |
commit | f60d70113fa04e32aee2dedbf304a48469c9c45c (patch) | |
tree | 6e74f483773dfae0adda0faa8754b5ce6129d8f7 /drivers/ata/sata_promise.c | |
parent | f47451c45fe0032ef491aaf3e0623fa0154e156d (diff) |
libata-sff: prd is BMDMA specific
struct ata_prd and ap->prd are BMDMA specific. Add bmdma_ prefix to
them and move them inside CONFIG_ATA_SFF.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_promise.c')
-rw-r--r-- | drivers/ata/sata_promise.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index 09a6179f5de3..f03ad48273ff 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c | |||
@@ -500,7 +500,7 @@ static int pdc_sata_scr_write(struct ata_link *link, | |||
500 | static void pdc_atapi_pkt(struct ata_queued_cmd *qc) | 500 | static void pdc_atapi_pkt(struct ata_queued_cmd *qc) |
501 | { | 501 | { |
502 | struct ata_port *ap = qc->ap; | 502 | struct ata_port *ap = qc->ap; |
503 | dma_addr_t sg_table = ap->prd_dma; | 503 | dma_addr_t sg_table = ap->bmdma_prd_dma; |
504 | unsigned int cdb_len = qc->dev->cdb_len; | 504 | unsigned int cdb_len = qc->dev->cdb_len; |
505 | u8 *cdb = qc->cdb; | 505 | u8 *cdb = qc->cdb; |
506 | struct pdc_port_priv *pp = ap->private_data; | 506 | struct pdc_port_priv *pp = ap->private_data; |
@@ -588,6 +588,7 @@ static void pdc_atapi_pkt(struct ata_queued_cmd *qc) | |||
588 | static void pdc_fill_sg(struct ata_queued_cmd *qc) | 588 | static void pdc_fill_sg(struct ata_queued_cmd *qc) |
589 | { | 589 | { |
590 | struct ata_port *ap = qc->ap; | 590 | struct ata_port *ap = qc->ap; |
591 | struct ata_bmdma_prd *prd = ap->bmdma_prd; | ||
591 | struct scatterlist *sg; | 592 | struct scatterlist *sg; |
592 | const u32 SG_COUNT_ASIC_BUG = 41*4; | 593 | const u32 SG_COUNT_ASIC_BUG = 41*4; |
593 | unsigned int si, idx; | 594 | unsigned int si, idx; |
@@ -614,8 +615,8 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc) | |||
614 | if ((offset + sg_len) > 0x10000) | 615 | if ((offset + sg_len) > 0x10000) |
615 | len = 0x10000 - offset; | 616 | len = 0x10000 - offset; |
616 | 617 | ||
617 | ap->prd[idx].addr = cpu_to_le32(addr); | 618 | prd[idx].addr = cpu_to_le32(addr); |
618 | ap->prd[idx].flags_len = cpu_to_le32(len & 0xffff); | 619 | prd[idx].flags_len = cpu_to_le32(len & 0xffff); |
619 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len); | 620 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len); |
620 | 621 | ||
621 | idx++; | 622 | idx++; |
@@ -624,27 +625,27 @@ static void pdc_fill_sg(struct ata_queued_cmd *qc) | |||
624 | } | 625 | } |
625 | } | 626 | } |
626 | 627 | ||
627 | len = le32_to_cpu(ap->prd[idx - 1].flags_len); | 628 | len = le32_to_cpu(prd[idx - 1].flags_len); |
628 | 629 | ||
629 | if (len > SG_COUNT_ASIC_BUG) { | 630 | if (len > SG_COUNT_ASIC_BUG) { |
630 | u32 addr; | 631 | u32 addr; |
631 | 632 | ||
632 | VPRINTK("Splitting last PRD.\n"); | 633 | VPRINTK("Splitting last PRD.\n"); |
633 | 634 | ||
634 | addr = le32_to_cpu(ap->prd[idx - 1].addr); | 635 | addr = le32_to_cpu(prd[idx - 1].addr); |
635 | ap->prd[idx - 1].flags_len = cpu_to_le32(len - SG_COUNT_ASIC_BUG); | 636 | prd[idx - 1].flags_len = cpu_to_le32(len - SG_COUNT_ASIC_BUG); |
636 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx - 1, addr, SG_COUNT_ASIC_BUG); | 637 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx - 1, addr, SG_COUNT_ASIC_BUG); |
637 | 638 | ||
638 | addr = addr + len - SG_COUNT_ASIC_BUG; | 639 | addr = addr + len - SG_COUNT_ASIC_BUG; |
639 | len = SG_COUNT_ASIC_BUG; | 640 | len = SG_COUNT_ASIC_BUG; |
640 | ap->prd[idx].addr = cpu_to_le32(addr); | 641 | prd[idx].addr = cpu_to_le32(addr); |
641 | ap->prd[idx].flags_len = cpu_to_le32(len); | 642 | prd[idx].flags_len = cpu_to_le32(len); |
642 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len); | 643 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", idx, addr, len); |
643 | 644 | ||
644 | idx++; | 645 | idx++; |
645 | } | 646 | } |
646 | 647 | ||
647 | ap->prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); | 648 | prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); |
648 | } | 649 | } |
649 | 650 | ||
650 | static void pdc_qc_prep(struct ata_queued_cmd *qc) | 651 | static void pdc_qc_prep(struct ata_queued_cmd *qc) |
@@ -659,7 +660,7 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc) | |||
659 | pdc_fill_sg(qc); | 660 | pdc_fill_sg(qc); |
660 | /*FALLTHROUGH*/ | 661 | /*FALLTHROUGH*/ |
661 | case ATA_PROT_NODATA: | 662 | case ATA_PROT_NODATA: |
662 | i = pdc_pkt_header(&qc->tf, qc->ap->prd_dma, | 663 | i = pdc_pkt_header(&qc->tf, qc->ap->bmdma_prd_dma, |
663 | qc->dev->devno, pp->pkt); | 664 | qc->dev->devno, pp->pkt); |
664 | if (qc->tf.flags & ATA_TFLAG_LBA48) | 665 | if (qc->tf.flags & ATA_TFLAG_LBA48) |
665 | i = pdc_prep_lba48(&qc->tf, pp->pkt, i); | 666 | i = pdc_prep_lba48(&qc->tf, pp->pkt, i); |