sparc: use sparc64 version of scatterlist.h
authorRobert Reif <reif@earthlink.net>
Fri, 12 Dec 2008 04:24:58 +0000 (20:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Dec 2008 04:24:58 +0000 (20:24 -0800)
Use sparc64 version of scatterlist.h.

There are three main differences:
    dma_addr_t replaces __u32
    dma_address replaces dvma_address
    dma_length replaces dvma_length

dma_addr_t is a u32 on sparc32.

Boot tested on sparc32.

Signed-off-by: Robert Reif <reif@earthlink.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/scatterlist.h
arch/sparc/include/asm/scatterlist_32.h [deleted file]
arch/sparc/include/asm/scatterlist_64.h [deleted file]
arch/sparc/kernel/ioport.c
arch/sparc/mm/io-unit.c
arch/sparc/mm/iommu.c
arch/sparc/mm/sun4c.c

index ec21a4517641b16b8414baab15f18a55a4363e27..e580f5581c8863ce60ad9d6638f15c039f31ce30 100644 (file)
@@ -1,8 +1,27 @@
-#ifndef ___ASM_SPARC_SCATTERLIST_H
-#define ___ASM_SPARC_SCATTERLIST_H
-#if defined(__sparc__) && defined(__arch64__)
-#include <asm/scatterlist_64.h>
-#else
-#include <asm/scatterlist_32.h>
-#endif
+#ifndef _SPARC_SCATTERLIST_H
+#define _SPARC_SCATTERLIST_H
+
+#include <asm/page.h>
+#include <asm/types.h>
+
+struct scatterlist {
+#ifdef CONFIG_DEBUG_SG
+       unsigned long   sg_magic;
 #endif
+       unsigned long   page_link;
+       unsigned int    offset;
+
+       unsigned int    length;
+
+       dma_addr_t      dma_address;
+       __u32           dma_length;
+};
+
+#define sg_dma_address(sg)     ((sg)->dma_address)
+#define sg_dma_len(sg)         ((sg)->dma_length)
+
+#define ISA_DMA_THRESHOLD      (~0UL)
+
+#define ARCH_HAS_SG_CHAIN
+
+#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/arch/sparc/include/asm/scatterlist_32.h b/arch/sparc/include/asm/scatterlist_32.h
deleted file mode 100644 (file)
index c82609c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _SPARC_SCATTERLIST_H
-#define _SPARC_SCATTERLIST_H
-
-#include <linux/types.h>
-
-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
-       unsigned long sg_magic;
-#endif
-       unsigned long page_link;
-       unsigned int offset;
-
-       unsigned int length;
-
-       __u32 dvma_address; /* A place to hang host-specific addresses at. */
-       __u32 dvma_length;
-};
-
-#define sg_dma_address(sg) ((sg)->dvma_address)
-#define sg_dma_len(sg)     ((sg)->dvma_length)
-
-#define ISA_DMA_THRESHOLD (~0UL)
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/arch/sparc/include/asm/scatterlist_64.h b/arch/sparc/include/asm/scatterlist_64.h
deleted file mode 100644 (file)
index 81bd058..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _SPARC64_SCATTERLIST_H
-#define _SPARC64_SCATTERLIST_H
-
-#include <asm/page.h>
-#include <asm/types.h>
-
-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
-       unsigned long   sg_magic;
-#endif
-       unsigned long   page_link;
-       unsigned int    offset;
-
-       unsigned int    length;
-
-       dma_addr_t      dma_address;
-       __u32           dma_length;
-};
-
-#define sg_dma_address(sg)     ((sg)->dma_address)
-#define sg_dma_len(sg)         ((sg)->dma_length)
-
-#define ISA_DMA_THRESHOLD      (~0UL)
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* !(_SPARC64_SCATTERLIST_H) */
index 4f025b36934b2e53fb833c5e94f9c071fb4efbda..7ce14f05eb484f2fca5eb51f7dc193025de90cfa 100644 (file)
@@ -552,8 +552,8 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
        /* IIep is write-through, not flushing. */
        for_each_sg(sgl, sg, nents, n) {
                BUG_ON(page_address(sg_page(sg)) == NULL);
-               sg->dvma_address = virt_to_phys(sg_virt(sg));
-               sg->dvma_length = sg->length;
+               sg->dma_address = virt_to_phys(sg_virt(sg));
+               sg->dma_length = sg->length;
        }
        return nents;
 }
index daadf5f88050bb8a11ab728d8a2460233e2914ce..005e758a4db7fe9cb381c3ddd3955137298e4fad 100644 (file)
@@ -156,8 +156,8 @@ static void iounit_get_scsi_sgl(struct device *dev, struct scatterlist *sg, int
        spin_lock_irqsave(&iounit->lock, flags);
        while (sz != 0) {
                --sz;
-               sg->dvma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length);
-               sg->dvma_length = sg->length;
+               sg->dma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length);
+               sg->dma_length = sg->length;
                sg = sg_next(sg);
        }
        spin_unlock_irqrestore(&iounit->lock, flags);
@@ -186,8 +186,8 @@ static void iounit_release_scsi_sgl(struct device *dev, struct scatterlist *sg,
        spin_lock_irqsave(&iounit->lock, flags);
        while (sz != 0) {
                --sz;
-               len = ((sg->dvma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT;
-               vaddr = (sg->dvma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
+               len = ((sg->dma_address & ~PAGE_MASK) + sg->length + (PAGE_SIZE-1)) >> PAGE_SHIFT;
+               vaddr = (sg->dma_address - IOUNIT_DMA_BASE) >> PAGE_SHIFT;
                IOD(("iounit_release %08lx-%08lx\n", (long)vaddr, (long)len+vaddr));
                for (len += vaddr; vaddr < len; vaddr++)
                        clear_bit(vaddr, iounit->bmap);
index e7a499e3aa3caee28e1622024c885369d876a149..b2e6e73888b52e594e0f7de258c4de76a346d8bd 100644 (file)
@@ -245,8 +245,8 @@ static void iommu_get_scsi_sgl_noflush(struct device *dev, struct scatterlist *s
        while (sz != 0) {
                --sz;
                n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
-               sg->dvma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
-               sg->dvma_length = (__u32) sg->length;
+               sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
+               sg->dma_length = sg->length;
                sg = sg_next(sg);
        }
 }
@@ -259,8 +259,8 @@ static void iommu_get_scsi_sgl_gflush(struct device *dev, struct scatterlist *sg
        while (sz != 0) {
                --sz;
                n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
-               sg->dvma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
-               sg->dvma_length = (__u32) sg->length;
+               sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
+               sg->dma_length = sg->length;
                sg = sg_next(sg);
        }
 }
@@ -290,8 +290,8 @@ static void iommu_get_scsi_sgl_pflush(struct device *dev, struct scatterlist *sg
                        }
                }
 
-               sg->dvma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
-               sg->dvma_length = (__u32) sg->length;
+               sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset;
+               sg->dma_length = sg->length;
                sg = sg_next(sg);
        }
 }
@@ -330,8 +330,8 @@ static void iommu_release_scsi_sgl(struct device *dev, struct scatterlist *sg, i
                --sz;
 
                n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
-               iommu_release_one(dev, sg->dvma_address & PAGE_MASK, n);
-               sg->dvma_address = 0x21212121;
+               iommu_release_one(dev, sg->dma_address & PAGE_MASK, n);
+               sg->dma_address = 0x21212121;
                sg = sg_next(sg);
        }
 }
index 6b0c49004ba6eea4e5d2230d52a7469f3ae57843..ad0ce117f352924ee9a9ff559792bfd246f475dc 100644 (file)
@@ -1122,8 +1122,8 @@ static void sun4c_get_scsi_sgl(struct device *dev, struct scatterlist *sg, int s
 {
        while (sz != 0) {
                --sz;
-               sg->dvma_address = (__u32)sun4c_lockarea(sg_virt(sg), sg->length);
-               sg->dvma_length = sg->length;
+               sg->dma_address = (__u32)sun4c_lockarea(sg_virt(sg), sg->length);
+               sg->dma_length = sg->length;
                sg = sg_next(sg);
        }
 }
@@ -1139,7 +1139,7 @@ static void sun4c_release_scsi_sgl(struct device *dev, struct scatterlist *sg, i
 {
        while (sz != 0) {
                --sz;
-               sun4c_unlockarea((char *)sg->dvma_address, sg->length);
+               sun4c_unlockarea((char *)sg->dma_address, sg->length);
                sg = sg_next(sg);
        }
 }