diff options
author | Christoph Hellwig <hch@lst.de> | 2015-05-01 06:46:15 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-05-05 15:35:39 -0400 |
commit | 84be456f883c4685680fba8e5154b5f72e92957e (patch) | |
tree | 1b83cb63af91f9e0ab42739cff9819591e089eac | |
parent | d9cee5d4f66ef36f69b0108dedbad7f7009bb6a8 (diff) |
remove <asm/scatterlist.h>
We don't have any arch specific scatterlist now that parisc switched over
to the generic one.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
26 files changed, 56 insertions, 66 deletions
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h index f7f680f7457d..bf7d97dce9e8 100644 --- a/arch/alpha/include/asm/pci.h +++ b/arch/alpha/include/asm/pci.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/dma-mapping.h> | 7 | #include <linux/dma-mapping.h> |
8 | #include <asm/scatterlist.h> | 8 | #include <linux/scatterlist.h> |
9 | #include <asm/machvec.h> | 9 | #include <asm/machvec.h> |
10 | #include <asm-generic/pci-bridge.h> | 10 | #include <asm-generic/pci-bridge.h> |
11 | 11 | ||
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h index 99084431d6ae..bb4fa67da541 100644 --- a/arch/arm/include/asm/dma.h +++ b/arch/arm/include/asm/dma.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * It should not be re-used except for that purpose. | 19 | * It should not be re-used except for that purpose. |
20 | */ | 20 | */ |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <asm/scatterlist.h> | 22 | #include <linux/scatterlist.h> |
23 | 23 | ||
24 | #include <mach/isa-dma.h> | 24 | #include <mach/isa-dma.h> |
25 | 25 | ||
diff --git a/arch/arm/mach-footbridge/dma.c b/arch/arm/mach-footbridge/dma.c index e2e0df8bcee2..22536b85a81d 100644 --- a/arch/arm/mach-footbridge/dma.c +++ b/arch/arm/mach-footbridge/dma.c | |||
@@ -13,9 +13,9 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/scatterlist.h> | ||
16 | 17 | ||
17 | #include <asm/dma.h> | 18 | #include <asm/dma.h> |
18 | #include <asm/scatterlist.h> | ||
19 | 19 | ||
20 | #include <asm/mach/dma.h> | 20 | #include <asm/mach/dma.h> |
21 | #include <asm/hardware/dec21285.h> | 21 | #include <asm/hardware/dec21285.h> |
diff --git a/arch/blackfin/include/asm/pci.h b/arch/blackfin/include/asm/pci.h index c737909fba47..14efc0db1ade 100644 --- a/arch/blackfin/include/asm/pci.h +++ b/arch/blackfin/include/asm/pci.h | |||
@@ -3,7 +3,7 @@ | |||
3 | #ifndef _ASM_BFIN_PCI_H | 3 | #ifndef _ASM_BFIN_PCI_H |
4 | #define _ASM_BFIN_PCI_H | 4 | #define _ASM_BFIN_PCI_H |
5 | 5 | ||
6 | #include <asm/scatterlist.h> | 6 | #include <linux/scatterlist.h> |
7 | #include <asm-generic/pci-dma-compat.h> | 7 | #include <asm-generic/pci-dma-compat.h> |
8 | #include <asm-generic/pci.h> | 8 | #include <asm-generic/pci.h> |
9 | 9 | ||
diff --git a/arch/cris/include/asm/dma-mapping.h b/arch/cris/include/asm/dma-mapping.h index 2f0f654f1b44..57f794ee6039 100644 --- a/arch/cris/include/asm/dma-mapping.h +++ b/arch/cris/include/asm/dma-mapping.h | |||
@@ -5,10 +5,10 @@ | |||
5 | 5 | ||
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/scatterlist.h> | ||
8 | 9 | ||
9 | #include <asm/cache.h> | 10 | #include <asm/cache.h> |
10 | #include <asm/io.h> | 11 | #include <asm/io.h> |
11 | #include <asm/scatterlist.h> | ||
12 | 12 | ||
13 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 13 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
14 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 14 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h index cc2399c175e9..c15b4b4baafa 100644 --- a/arch/cris/include/asm/pci.h +++ b/arch/cris/include/asm/pci.h | |||
@@ -29,7 +29,7 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | |||
29 | 29 | ||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <asm/scatterlist.h> | 32 | #include <linux/scatterlist.h> |
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <asm/io.h> | 34 | #include <asm/io.h> |
35 | 35 | ||
diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h index 1746a2b8e6e7..2840adcd6d92 100644 --- a/arch/frv/include/asm/dma-mapping.h +++ b/arch/frv/include/asm/dma-mapping.h | |||
@@ -2,9 +2,9 @@ | |||
2 | #define _ASM_DMA_MAPPING_H | 2 | #define _ASM_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/scatterlist.h> | ||
5 | #include <asm/cache.h> | 6 | #include <asm/cache.h> |
6 | #include <asm/cacheflush.h> | 7 | #include <asm/cacheflush.h> |
7 | #include <asm/scatterlist.h> | ||
8 | #include <asm/io.h> | 8 | #include <asm/io.h> |
9 | 9 | ||
10 | /* | 10 | /* |
diff --git a/arch/frv/include/asm/pci.h b/arch/frv/include/asm/pci.h index 2035a4d3f9b9..43d224685144 100644 --- a/arch/frv/include/asm/pci.h +++ b/arch/frv/include/asm/pci.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #define _ASM_FRV_PCI_H | 14 | #define _ASM_FRV_PCI_H |
15 | 15 | ||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <asm/scatterlist.h> | 17 | #include <linux/scatterlist.h> |
18 | #include <asm-generic/pci-dma-compat.h> | 18 | #include <asm-generic/pci-dma-compat.h> |
19 | #include <asm-generic/pci.h> | 19 | #include <asm-generic/pci.h> |
20 | 20 | ||
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 52af5ed9f60b..0c0e25d6427a 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h | |||
@@ -6,9 +6,9 @@ | |||
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/string.h> | 7 | #include <linux/string.h> |
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/scatterlist.h> | ||
9 | 10 | ||
10 | #include <asm/io.h> | 11 | #include <asm/io.h> |
11 | #include <asm/scatterlist.h> | ||
12 | #include <asm/hw_irq.h> | 12 | #include <asm/hw_irq.h> |
13 | 13 | ||
14 | struct pci_vector_struct { | 14 | struct pci_vector_struct { |
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 468aca8cec0d..81f27aef979c 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h | |||
@@ -16,8 +16,8 @@ | |||
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/scatterlist.h> | ||
19 | 20 | ||
20 | #include <asm/scatterlist.h> | ||
21 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | #include <asm/prom.h> | 22 | #include <asm/prom.h> |
23 | #include <asm/pci-bridge.h> | 23 | #include <asm/pci-bridge.h> |
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index fd1b4a150759..360b3387182a 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _ASM_DMA_MAPPING_H | 1 | #ifndef _ASM_DMA_MAPPING_H |
2 | #define _ASM_DMA_MAPPING_H | 2 | #define _ASM_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <asm/scatterlist.h> | 4 | #include <linux/scatterlist.h> |
5 | #include <asm/dma-coherence.h> | 5 | #include <asm/dma-coherence.h> |
6 | #include <asm/cache.h> | 6 | #include <asm/cache.h> |
7 | #include <asm-generic/dma-coherent.h> | 7 | #include <asm-generic/dma-coherent.h> |
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index d9692993fc83..3413b10d833b 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
@@ -99,7 +99,7 @@ static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, | |||
99 | 99 | ||
100 | #include <linux/types.h> | 100 | #include <linux/types.h> |
101 | #include <linux/slab.h> | 101 | #include <linux/slab.h> |
102 | #include <asm/scatterlist.h> | 102 | #include <linux/scatterlist.h> |
103 | #include <linux/string.h> | 103 | #include <linux/string.h> |
104 | #include <asm/io.h> | 104 | #include <asm/io.h> |
105 | #include <asm-generic/pci-bridge.h> | 105 | #include <asm-generic/pci-bridge.h> |
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h index 5f70af25c7d0..393b51d38f36 100644 --- a/arch/mn10300/include/asm/pci.h +++ b/arch/mn10300/include/asm/pci.h | |||
@@ -55,7 +55,7 @@ void pcibios_set_master(struct pci_dev *dev); | |||
55 | 55 | ||
56 | #include <linux/types.h> | 56 | #include <linux/types.h> |
57 | #include <linux/slab.h> | 57 | #include <linux/slab.h> |
58 | #include <asm/scatterlist.h> | 58 | #include <linux/scatterlist.h> |
59 | #include <linux/string.h> | 59 | #include <linux/string.h> |
60 | #include <asm/io.h> | 60 | #include <asm/io.h> |
61 | 61 | ||
diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h index d0eae5f2bd87..d8d60a57183f 100644 --- a/arch/parisc/include/asm/dma-mapping.h +++ b/arch/parisc/include/asm/dma-mapping.h | |||
@@ -2,8 +2,8 @@ | |||
2 | #define _PARISC_DMA_MAPPING_H | 2 | #define _PARISC_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <linux/scatterlist.h> | ||
5 | #include <asm/cacheflush.h> | 6 | #include <asm/cacheflush.h> |
6 | #include <asm/scatterlist.h> | ||
7 | 7 | ||
8 | /* See Documentation/DMA-API-HOWTO.txt */ | 8 | /* See Documentation/DMA-API-HOWTO.txt */ |
9 | struct hppa_dma_ops { | 9 | struct hppa_dma_ops { |
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index 20df2b04fc09..794d8820db5d 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ASM_PARISC_PCI_H | 1 | #ifndef __ASM_PARISC_PCI_H |
2 | #define __ASM_PARISC_PCI_H | 2 | #define __ASM_PARISC_PCI_H |
3 | 3 | ||
4 | #include <asm/scatterlist.h> | 4 | #include <linux/scatterlist.h> |
5 | 5 | ||
6 | 6 | ||
7 | 7 | ||
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index 4aef8d660999..3be43ab63181 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h | |||
@@ -13,9 +13,9 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
16 | #include <linux/scatterlist.h> | ||
16 | 17 | ||
17 | #include <asm/machdep.h> | 18 | #include <asm/machdep.h> |
18 | #include <asm/scatterlist.h> | ||
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | #include <asm/prom.h> | 20 | #include <asm/prom.h> |
21 | #include <asm/pci-bridge.h> | 21 | #include <asm/pci-bridge.h> |
diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h index 4f9b7ca0710f..84286ec77b12 100644 --- a/arch/powerpc/include/asm/vio.h +++ b/arch/powerpc/include/asm/vio.h | |||
@@ -19,9 +19,9 @@ | |||
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
21 | #include <linux/mod_devicetable.h> | 21 | #include <linux/mod_devicetable.h> |
22 | #include <linux/scatterlist.h> | ||
22 | 23 | ||
23 | #include <asm/hvcall.h> | 24 | #include <asm/hvcall.h> |
24 | #include <asm/scatterlist.h> | ||
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Architecture-specific constants for drivers to | 27 | * Architecture-specific constants for drivers to |
diff --git a/arch/sparc/kernel/iommu_common.h b/arch/sparc/kernel/iommu_common.h index f4be0d724fc6..b40cec252905 100644 --- a/arch/sparc/kernel/iommu_common.h +++ b/arch/sparc/kernel/iommu_common.h | |||
@@ -13,9 +13,9 @@ | |||
13 | #include <linux/scatterlist.h> | 13 | #include <linux/scatterlist.h> |
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/iommu-helper.h> | 15 | #include <linux/iommu-helper.h> |
16 | #include <linux/scatterlist.h> | ||
16 | 17 | ||
17 | #include <asm/iommu.h> | 18 | #include <asm/iommu.h> |
18 | #include <asm/scatterlist.h> | ||
19 | 19 | ||
20 | /* | 20 | /* |
21 | * These give mapping size of each iommu pte/tlb. | 21 | * These give mapping size of each iommu pte/tlb. |
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4e370a5d8117..81da003df21b 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/slab.h> | 6 | #include <linux/slab.h> |
7 | #include <linux/string.h> | 7 | #include <linux/string.h> |
8 | #include <asm/scatterlist.h> | 8 | #include <linux/scatterlist.h> |
9 | #include <asm/io.h> | 9 | #include <asm/io.h> |
10 | #include <asm/x86_init.h> | 10 | #include <asm/x86_init.h> |
11 | 11 | ||
diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h index 5d52dc43dfe7..e438a00fbd63 100644 --- a/arch/xtensa/include/asm/pci.h +++ b/arch/xtensa/include/asm/pci.h | |||
@@ -33,7 +33,7 @@ extern struct pci_controller* pcibios_alloc_controller(void); | |||
33 | 33 | ||
34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
36 | #include <asm/scatterlist.h> | 36 | #include <linux/scatterlist.h> |
37 | #include <linux/string.h> | 37 | #include <linux/string.h> |
38 | #include <asm/io.h> | 38 | #include <asm/io.h> |
39 | 39 | ||
diff --git a/drivers/mmc/host/android-goldfish.c b/drivers/mmc/host/android-goldfish.c index 8b4e20a3f16c..b1eac719a4cc 100644 --- a/drivers/mmc/host/android-goldfish.c +++ b/drivers/mmc/host/android-goldfish.c | |||
@@ -42,10 +42,10 @@ | |||
42 | #include <linux/spinlock.h> | 42 | #include <linux/spinlock.h> |
43 | #include <linux/timer.h> | 43 | #include <linux/timer.h> |
44 | #include <linux/clk.h> | 44 | #include <linux/clk.h> |
45 | #include <linux/scatterlist.h> | ||
45 | 46 | ||
46 | #include <asm/io.h> | 47 | #include <asm/io.h> |
47 | #include <asm/irq.h> | 48 | #include <asm/irq.h> |
48 | #include <asm/scatterlist.h> | ||
49 | 49 | ||
50 | #include <asm/types.h> | 50 | #include <asm/types.h> |
51 | #include <asm/io.h> | 51 | #include <asm/io.h> |
diff --git a/include/asm-generic/scatterlist.h b/include/asm-generic/scatterlist.h deleted file mode 100644 index 5de07355fad4..000000000000 --- a/include/asm-generic/scatterlist.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | #ifndef __ASM_GENERIC_SCATTERLIST_H | ||
2 | #define __ASM_GENERIC_SCATTERLIST_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct scatterlist { | ||
7 | #ifdef CONFIG_DEBUG_SG | ||
8 | unsigned long sg_magic; | ||
9 | #endif | ||
10 | unsigned long page_link; | ||
11 | unsigned int offset; | ||
12 | unsigned int length; | ||
13 | dma_addr_t dma_address; | ||
14 | #ifdef CONFIG_NEED_SG_DMA_LENGTH | ||
15 | unsigned int dma_length; | ||
16 | #endif | ||
17 | }; | ||
18 | |||
19 | /* | ||
20 | * These macros should be used after a dma_map_sg call has been done | ||
21 | * to get bus addresses of each of the SG entries and their lengths. | ||
22 | * You should only work with the number of sg entries pci_map_sg | ||
23 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
24 | * is 0. | ||
25 | */ | ||
26 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
27 | |||
28 | #ifdef CONFIG_NEED_SG_DMA_LENGTH | ||
29 | #define sg_dma_len(sg) ((sg)->dma_length) | ||
30 | #else | ||
31 | #define sg_dma_len(sg) ((sg)->length) | ||
32 | #endif | ||
33 | |||
34 | #endif /* __ASM_GENERIC_SCATTERLIST_H */ | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7f9a516f24de..504af1e65ce1 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -22,8 +22,7 @@ | |||
22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
23 | #include <linux/rcupdate.h> | 23 | #include <linux/rcupdate.h> |
24 | #include <linux/percpu-refcount.h> | 24 | #include <linux/percpu-refcount.h> |
25 | 25 | #include <linux/scatterlist.h> | |
26 | #include <asm/scatterlist.h> | ||
27 | 26 | ||
28 | struct module; | 27 | struct module; |
29 | struct scsi_ioctl_command; | 28 | struct scsi_ioctl_command; |
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h index 52456aa566a0..e1043f79122f 100644 --- a/include/linux/dmapool.h +++ b/include/linux/dmapool.h | |||
@@ -11,8 +11,8 @@ | |||
11 | #ifndef LINUX_DMAPOOL_H | 11 | #ifndef LINUX_DMAPOOL_H |
12 | #define LINUX_DMAPOOL_H | 12 | #define LINUX_DMAPOOL_H |
13 | 13 | ||
14 | #include <linux/scatterlist.h> | ||
14 | #include <asm/io.h> | 15 | #include <asm/io.h> |
15 | #include <asm/scatterlist.h> | ||
16 | 16 | ||
17 | struct device; | 17 | struct device; |
18 | 18 | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index ed8f9e70df9b..eca1ec93775c 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -2,13 +2,39 @@ | |||
2 | #define _LINUX_SCATTERLIST_H | 2 | #define _LINUX_SCATTERLIST_H |
3 | 3 | ||
4 | #include <linux/string.h> | 4 | #include <linux/string.h> |
5 | #include <linux/types.h> | ||
5 | #include <linux/bug.h> | 6 | #include <linux/bug.h> |
6 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
7 | |||
8 | #include <asm/types.h> | ||
9 | #include <asm/scatterlist.h> | ||
10 | #include <asm/io.h> | 8 | #include <asm/io.h> |
11 | 9 | ||
10 | struct scatterlist { | ||
11 | #ifdef CONFIG_DEBUG_SG | ||
12 | unsigned long sg_magic; | ||
13 | #endif | ||
14 | unsigned long page_link; | ||
15 | unsigned int offset; | ||
16 | unsigned int length; | ||
17 | dma_addr_t dma_address; | ||
18 | #ifdef CONFIG_NEED_SG_DMA_LENGTH | ||
19 | unsigned int dma_length; | ||
20 | #endif | ||
21 | }; | ||
22 | |||
23 | /* | ||
24 | * These macros should be used after a dma_map_sg call has been done | ||
25 | * to get bus addresses of each of the SG entries and their lengths. | ||
26 | * You should only work with the number of sg entries dma_map_sg | ||
27 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
28 | * is 0. | ||
29 | */ | ||
30 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
31 | |||
32 | #ifdef CONFIG_NEED_SG_DMA_LENGTH | ||
33 | #define sg_dma_len(sg) ((sg)->dma_length) | ||
34 | #else | ||
35 | #define sg_dma_len(sg) ((sg)->length) | ||
36 | #endif | ||
37 | |||
12 | struct sg_table { | 38 | struct sg_table { |
13 | struct scatterlist *sgl; /* the list */ | 39 | struct scatterlist *sgl; /* the list */ |
14 | unsigned int nents; /* number of mapped entries */ | 40 | unsigned int nents; /* number of mapped entries */ |
@@ -18,10 +44,9 @@ struct sg_table { | |||
18 | /* | 44 | /* |
19 | * Notes on SG table design. | 45 | * Notes on SG table design. |
20 | * | 46 | * |
21 | * Architectures must provide an unsigned long page_link field in the | 47 | * We use the unsigned long page_link field in the scatterlist struct to place |
22 | * scatterlist struct. We use that to place the page pointer AND encode | 48 | * the page pointer AND encode information about the sg table as well. The two |
23 | * information about the sg table as well. The two lower bits are reserved | 49 | * lower bits are reserved for this information. |
24 | * for this information. | ||
25 | * | 50 | * |
26 | * If bit 0 is set, then the page_link contains a pointer to the next sg | 51 | * If bit 0 is set, then the page_link contains a pointer to the next sg |
27 | * table list. Otherwise the next entry is at sg + 1. | 52 | * table list. Otherwise the next entry is at sg + 1. |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 4abda074ea45..341268841b31 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -29,10 +29,10 @@ | |||
29 | #include <linux/ctype.h> | 29 | #include <linux/ctype.h> |
30 | #include <linux/highmem.h> | 30 | #include <linux/highmem.h> |
31 | #include <linux/gfp.h> | 31 | #include <linux/gfp.h> |
32 | #include <linux/scatterlist.h> | ||
32 | 33 | ||
33 | #include <asm/io.h> | 34 | #include <asm/io.h> |
34 | #include <asm/dma.h> | 35 | #include <asm/dma.h> |
35 | #include <asm/scatterlist.h> | ||
36 | 36 | ||
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/bootmem.h> | 38 | #include <linux/bootmem.h> |