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/libata-sff.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/libata-sff.c')
-rw-r--r-- | drivers/ata/libata-sff.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index a58693bdde9d..6f52b598b8d2 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -2650,6 +2650,7 @@ EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops); | |||
2650 | static void ata_bmdma_fill_sg(struct ata_queued_cmd *qc) | 2650 | static void ata_bmdma_fill_sg(struct ata_queued_cmd *qc) |
2651 | { | 2651 | { |
2652 | struct ata_port *ap = qc->ap; | 2652 | struct ata_port *ap = qc->ap; |
2653 | struct ata_bmdma_prd *prd = ap->bmdma_prd; | ||
2653 | struct scatterlist *sg; | 2654 | struct scatterlist *sg; |
2654 | unsigned int si, pi; | 2655 | unsigned int si, pi; |
2655 | 2656 | ||
@@ -2671,8 +2672,8 @@ static void ata_bmdma_fill_sg(struct ata_queued_cmd *qc) | |||
2671 | if ((offset + sg_len) > 0x10000) | 2672 | if ((offset + sg_len) > 0x10000) |
2672 | len = 0x10000 - offset; | 2673 | len = 0x10000 - offset; |
2673 | 2674 | ||
2674 | ap->prd[pi].addr = cpu_to_le32(addr); | 2675 | prd[pi].addr = cpu_to_le32(addr); |
2675 | ap->prd[pi].flags_len = cpu_to_le32(len & 0xffff); | 2676 | prd[pi].flags_len = cpu_to_le32(len & 0xffff); |
2676 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, len); | 2677 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, len); |
2677 | 2678 | ||
2678 | pi++; | 2679 | pi++; |
@@ -2681,7 +2682,7 @@ static void ata_bmdma_fill_sg(struct ata_queued_cmd *qc) | |||
2681 | } | 2682 | } |
2682 | } | 2683 | } |
2683 | 2684 | ||
2684 | ap->prd[pi - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); | 2685 | prd[pi - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); |
2685 | } | 2686 | } |
2686 | 2687 | ||
2687 | /** | 2688 | /** |
@@ -2700,6 +2701,7 @@ static void ata_bmdma_fill_sg(struct ata_queued_cmd *qc) | |||
2700 | static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc) | 2701 | static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc) |
2701 | { | 2702 | { |
2702 | struct ata_port *ap = qc->ap; | 2703 | struct ata_port *ap = qc->ap; |
2704 | struct ata_bmdma_prd *prd = ap->bmdma_prd; | ||
2703 | struct scatterlist *sg; | 2705 | struct scatterlist *sg; |
2704 | unsigned int si, pi; | 2706 | unsigned int si, pi; |
2705 | 2707 | ||
@@ -2722,16 +2724,16 @@ static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc) | |||
2722 | len = 0x10000 - offset; | 2724 | len = 0x10000 - offset; |
2723 | 2725 | ||
2724 | blen = len & 0xffff; | 2726 | blen = len & 0xffff; |
2725 | ap->prd[pi].addr = cpu_to_le32(addr); | 2727 | prd[pi].addr = cpu_to_le32(addr); |
2726 | if (blen == 0) { | 2728 | if (blen == 0) { |
2727 | /* Some PATA chipsets like the CS5530 can't | 2729 | /* Some PATA chipsets like the CS5530 can't |
2728 | cope with 0x0000 meaning 64K as the spec | 2730 | cope with 0x0000 meaning 64K as the spec |
2729 | says */ | 2731 | says */ |
2730 | ap->prd[pi].flags_len = cpu_to_le32(0x8000); | 2732 | prd[pi].flags_len = cpu_to_le32(0x8000); |
2731 | blen = 0x8000; | 2733 | blen = 0x8000; |
2732 | ap->prd[++pi].addr = cpu_to_le32(addr + 0x8000); | 2734 | prd[++pi].addr = cpu_to_le32(addr + 0x8000); |
2733 | } | 2735 | } |
2734 | ap->prd[pi].flags_len = cpu_to_le32(blen); | 2736 | prd[pi].flags_len = cpu_to_le32(blen); |
2735 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, len); | 2737 | VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, len); |
2736 | 2738 | ||
2737 | pi++; | 2739 | pi++; |
@@ -2740,7 +2742,7 @@ static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc) | |||
2740 | } | 2742 | } |
2741 | } | 2743 | } |
2742 | 2744 | ||
2743 | ap->prd[pi - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); | 2745 | prd[pi - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT); |
2744 | } | 2746 | } |
2745 | 2747 | ||
2746 | /** | 2748 | /** |
@@ -2872,7 +2874,7 @@ void ata_bmdma_setup(struct ata_queued_cmd *qc) | |||
2872 | 2874 | ||
2873 | /* load PRD table addr. */ | 2875 | /* load PRD table addr. */ |
2874 | mb(); /* make sure PRD table writes are visible to controller */ | 2876 | mb(); /* make sure PRD table writes are visible to controller */ |
2875 | iowrite32(ap->prd_dma, ap->ioaddr.bmdma_addr + ATA_DMA_TABLE_OFS); | 2877 | iowrite32(ap->bmdma_prd_dma, ap->ioaddr.bmdma_addr + ATA_DMA_TABLE_OFS); |
2876 | 2878 | ||
2877 | /* specify data direction, triple-check start bit is clear */ | 2879 | /* specify data direction, triple-check start bit is clear */ |
2878 | dmactl = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD); | 2880 | dmactl = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD); |
@@ -2977,9 +2979,10 @@ EXPORT_SYMBOL_GPL(ata_bmdma_status); | |||
2977 | int ata_bmdma_port_start(struct ata_port *ap) | 2979 | int ata_bmdma_port_start(struct ata_port *ap) |
2978 | { | 2980 | { |
2979 | if (ap->mwdma_mask || ap->udma_mask) { | 2981 | if (ap->mwdma_mask || ap->udma_mask) { |
2980 | ap->prd = dmam_alloc_coherent(ap->host->dev, ATA_PRD_TBL_SZ, | 2982 | ap->bmdma_prd = |
2981 | &ap->prd_dma, GFP_KERNEL); | 2983 | dmam_alloc_coherent(ap->host->dev, ATA_PRD_TBL_SZ, |
2982 | if (!ap->prd) | 2984 | &ap->bmdma_prd_dma, GFP_KERNEL); |
2985 | if (!ap->bmdma_prd) | ||
2983 | return -ENOMEM; | 2986 | return -ENOMEM; |
2984 | } | 2987 | } |
2985 | 2988 | ||