diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 08:53:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 08:53:41 -0700 |
commit | ba1c28a94322865457ad59f80474615156065123 (patch) | |
tree | a1de9e1b7aba07583e49ff1c3f1c495cf148475a /include | |
parent | 101e4d91f5e8c78d64970c03323d942d6706320f (diff) | |
parent | cb92ae81509eb5ddaea53884b60437502c837405 (diff) | |
download | kernel_samsung_espresso10-ba1c28a94322865457ad59f80474615156065123.tar.gz kernel_samsung_espresso10-ba1c28a94322865457ad59f80474615156065123.tar.bz2 kernel_samsung_espresso10-ba1c28a94322865457ad59f80474615156065123.zip |
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block:
sparc64: zero out dma_length
fvr32: fixup dma-mapping for new sg layout
sh/sh64: fixup dma-mapping for new sg layout
Fix sctp compile
m68knommu: remove sg_address()
frv: update comment in scatterlist to reflect new setup
blackfin: remove sg_address()
arm: sg fallout
mips: sg_page() fallout
alpha: sg_virt() fallout
intel-iommu: fix sg_page()
parisc: fix sg_page() fallout
ide: build fix
net: fix xfrm build - missing scatterlist.h include
[BLOCK] blk_rq_map_sg: force clear termination bit
[BLOCK] Don't clear sg_dma_len/addr() in blk_rq_map_sg()
s390 zfcp: sg fixups
powerpc: Fix fallout from sg_page() changes
IB/ehca: Fix sg_page() fallout
arm: build fix
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-arm/dma-mapping.h | 10 | ||||
-rw-r--r-- | include/asm-avr32/dma-mapping.h | 7 | ||||
-rw-r--r-- | include/asm-blackfin/scatterlist.h | 1 | ||||
-rw-r--r-- | include/asm-frv/scatterlist.h | 8 | ||||
-rw-r--r-- | include/asm-m68knommu/scatterlist.h | 1 | ||||
-rw-r--r-- | include/asm-parisc/scatterlist.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/dma-mapping.h | 10 | ||||
-rw-r--r-- | include/asm-sh/dma-mapping.h | 12 | ||||
-rw-r--r-- | include/asm-sh64/dma-mapping.h | 12 |
9 files changed, 28 insertions, 35 deletions
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index 1eb8aac4322..e99406a7bec 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h @@ -5,7 +5,7 @@ #include <linux/mm.h> /* need struct page */ -#include <asm/scatterlist.h> +#include <linux/scatterlist.h> /* * DMA-consistent mapping functions. These allocate/free a region of @@ -274,8 +274,8 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, for (i = 0; i < nents; i++, sg++) { char *virt; - sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; - virt = page_address(sg->page) + sg->offset; + sg->dma_address = page_to_dma(dev, sg_page(sg)) + sg->offset; + virt = sg_virt(sg); if (!arch_is_coherent()) dma_cache_maint(virt, sg->length, dir); @@ -371,7 +371,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, int i; for (i = 0; i < nents; i++, sg++) { - char *virt = page_address(sg->page) + sg->offset; + char *virt = sg_virt(sg); if (!arch_is_coherent()) dma_cache_maint(virt, sg->length, dir); } @@ -384,7 +384,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, int i; for (i = 0; i < nents; i++, sg++) { - char *virt = page_address(sg->page) + sg->offset; + char *virt = sg_virt(sg); if (!arch_is_coherent()) dma_cache_maint(virt, sg->length, dir); } diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h index 81e342636ac..a7131630c05 100644 --- a/include/asm-avr32/dma-mapping.h +++ b/include/asm-avr32/dma-mapping.h @@ -217,8 +217,8 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, for (i = 0; i < nents; i++) { char *virt; - sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; - virt = page_address(sg[i].page) + sg[i].offset; + sg[i].dma_address = page_to_bus(sg_page(&sg[i])) + sg[i].offset; + virt = sg_virt(&sg[i]); dma_cache_sync(dev, virt, sg[i].length, direction); } @@ -327,8 +327,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int i; for (i = 0; i < nents; i++) { - dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, - sg[i].length, direction); + dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, direction); } } diff --git a/include/asm-blackfin/scatterlist.h b/include/asm-blackfin/scatterlist.h index 32128d53469..04f448711cd 100644 --- a/include/asm-blackfin/scatterlist.h +++ b/include/asm-blackfin/scatterlist.h @@ -20,7 +20,6 @@ struct scatterlist { * returns, or alternatively stop on the first sg_dma_len(sg) which * is 0. */ -#define sg_address(sg) (page_address((sg)->page) + (sg)->offset) #define sg_dma_address(sg) ((sg)->dma_address) #define sg_dma_len(sg) ((sg)->length) diff --git a/include/asm-frv/scatterlist.h b/include/asm-frv/scatterlist.h index f7da007b763..99ba76edc42 100644 --- a/include/asm-frv/scatterlist.h +++ b/include/asm-frv/scatterlist.h @@ -4,19 +4,19 @@ #include <asm/types.h> /* - * Drivers must set either ->address or (preferred) ->page and ->offset + * Drivers must set either ->address or (preferred) page and ->offset * to indicate where data must be transferred to/from. * - * Using ->page is recommended since it handles highmem data as well as + * Using page is recommended since it handles highmem data as well as * low mem. ->address is restricted to data which has a virtual mapping, and - * it will go away in the future. Updating to ->page can be automated very + * it will go away in the future. Updating to page can be automated very * easily -- something like * * sg->address = some_ptr; * * can be rewritten as * - * sg->page = virt_to_page(some_ptr); + * sg_set_page(virt_to_page(some_ptr)); * sg->offset = (unsigned long) some_ptr & ~PAGE_MASK; * * and that's it. There's no excuse for not highmem enabling YOUR driver. /jens diff --git a/include/asm-m68knommu/scatterlist.h b/include/asm-m68knommu/scatterlist.h index 10942840e88..afc4788b0d2 100644 --- a/include/asm-m68knommu/scatterlist.h +++ b/include/asm-m68knommu/scatterlist.h @@ -14,7 +14,6 @@ struct scatterlist { unsigned int length; }; -#define sg_address(sg) (page_address((sg)->page) + (sg)->offset) #define sg_dma_address(sg) ((sg)->dma_address) #define sg_dma_len(sg) ((sg)->length) diff --git a/include/asm-parisc/scatterlist.h b/include/asm-parisc/scatterlist.h index cd3cfdf8228..62269b31ebf 100644 --- a/include/asm-parisc/scatterlist.h +++ b/include/asm-parisc/scatterlist.h @@ -18,7 +18,7 @@ struct scatterlist { __u32 iova_length; /* bytes mapped */ }; -#define sg_virt_addr(sg) ((unsigned long)(page_address(sg->page) + sg->offset)) +#define sg_virt_addr(sg) ((unsigned long)sg_virt(sg)) #define sg_dma_address(sg) ((sg)->iova) #define sg_dma_len(sg) ((sg)->iova_length) diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h index 65be95dd03a..ff52013c0e2 100644 --- a/include/asm-powerpc/dma-mapping.h +++ b/include/asm-powerpc/dma-mapping.h @@ -285,9 +285,9 @@ dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, BUG_ON(direction == DMA_NONE); for_each_sg(sgl, sg, nents, i) { - BUG_ON(!sg->page); - __dma_sync_page(sg->page, sg->offset, sg->length, direction); - sg->dma_address = page_to_bus(sg->page) + sg->offset; + BUG_ON(!sg_page(sg)); + __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); + sg->dma_address = page_to_bus(sg_page(sg)) + sg->offset; } return nents; @@ -328,7 +328,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, BUG_ON(direction == DMA_NONE); for_each_sg(sgl, sg, nents, i) - __dma_sync_page(sg->page, sg->offset, sg->length, direction); + __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); } static inline void dma_sync_sg_for_device(struct device *dev, @@ -341,7 +341,7 @@ static inline void dma_sync_sg_for_device(struct device *dev, BUG_ON(direction == DMA_NONE); for_each_sg(sgl, sg, nents, i) - __dma_sync_page(sg->page, sg->offset, sg->length, direction); + __dma_sync_page(sg_page(sg), sg->offset, sg->length, direction); } static inline int dma_mapping_error(dma_addr_t dma_addr) diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index 84fefdaa01a..fcea067f7a9 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h @@ -2,7 +2,7 @@ #define __ASM_SH_DMA_MAPPING_H #include <linux/mm.h> -#include <asm/scatterlist.h> +#include <linux/scatterlist.h> #include <asm/cacheflush.h> #include <asm/io.h> @@ -85,10 +85,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, for (i = 0; i < nents; i++) { #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) - dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, - sg[i].length, dir); + dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); #endif - sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; + sg[i].dma_address = sg_phys(&sg[i]); } return nents; @@ -138,10 +137,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, for (i = 0; i < nelems; i++) { #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) - dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, - sg[i].length, dir); + dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); #endif - sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; + sg[i].dma_address = sg_phys(&sg[i]); } } diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index e661857f98d..1438b763a5e 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h @@ -2,7 +2,7 @@ #define __ASM_SH_DMA_MAPPING_H #include <linux/mm.h> -#include <asm/scatterlist.h> +#include <linux/scatterlist.h> #include <asm/io.h> struct pci_dev; @@ -71,10 +71,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, for (i = 0; i < nents; i++) { #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) - dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, - sg[i].length, dir); + dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); #endif - sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; + sg[i].dma_address = sg_phys(&sg[i]); } return nents; @@ -124,10 +123,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, for (i = 0; i < nelems; i++) { #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) - dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, - sg[i].length, dir); + dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); #endif - sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; + sg[i].dma_address = sg_phys(&sg[i]); } } |