diff options
| author | Jens Axboe <axboe@burns.home.kernel.dk> | 2002-02-06 16:32:53 +0100 |
|---|---|---|
| committer | Jens Axboe <axboe@burns.home.kernel.dk> | 2002-02-06 16:32:53 +0100 |
| commit | 07916eb45f4a6c63acb93e269c10490e4e623a0c (patch) | |
| tree | a4f8ece00fe7f7863f4cec674bd98d1351d643c3 /include | |
| parent | 770febce31cde0639ad419ab6537876fac547c21 (diff) | |
kill struct scatterlist address member
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-alpha/scatterlist.h | 5 | ||||
| -rw-r--r-- | include/asm-arm/scatterlist.h | 5 | ||||
| -rw-r--r-- | include/asm-i386/floppy.h | 4 | ||||
| -rw-r--r-- | include/asm-i386/io.h | 17 | ||||
| -rw-r--r-- | include/asm-i386/pci.h | 28 | ||||
| -rw-r--r-- | include/asm-i386/scatterlist.h | 11 | ||||
| -rw-r--r-- | include/asm-ia64/scatterlist.h | 2 | ||||
| -rw-r--r-- | include/asm-m68k/scatterlist.h | 3 | ||||
| -rw-r--r-- | include/asm-mips/scatterlist.h | 3 | ||||
| -rw-r--r-- | include/asm-mips64/scatterlist.h | 3 | ||||
| -rw-r--r-- | include/asm-parisc/scatterlist.h | 3 | ||||
| -rw-r--r-- | include/asm-ppc/pci.h | 9 | ||||
| -rw-r--r-- | include/asm-ppc/scatterlist.h | 6 | ||||
| -rw-r--r-- | include/asm-s390/scatterlist.h | 3 | ||||
| -rw-r--r-- | include/asm-s390x/scatterlist.h | 3 | ||||
| -rw-r--r-- | include/asm-sh/pci.h | 4 | ||||
| -rw-r--r-- | include/asm-sh/scatterlist.h | 2 | ||||
| -rw-r--r-- | include/asm-sparc/scatterlist.h | 8 | ||||
| -rw-r--r-- | include/asm-sparc64/scatterlist.h | 18 |
19 files changed, 56 insertions, 81 deletions
diff --git a/include/asm-alpha/scatterlist.h b/include/asm-alpha/scatterlist.h index 9745d69ba389..6afb8bd3aaf9 100644 --- a/include/asm-alpha/scatterlist.h +++ b/include/asm-alpha/scatterlist.h @@ -4,11 +4,6 @@ #include <asm/page.h> struct scatterlist { - /* This will disappear in 2.5.x */ - char *address; - - /* These two are only valid if ADDRESS member of this - struct is NULL. */ struct page *page; unsigned int offset; diff --git a/include/asm-arm/scatterlist.h b/include/asm-arm/scatterlist.h index acf0d18ea46c..d9c056c7784e 100644 --- a/include/asm-arm/scatterlist.h +++ b/include/asm-arm/scatterlist.h @@ -4,9 +4,8 @@ #include <asm/types.h> struct scatterlist { - char *address; /* virtual address */ - struct page *page; /* Location for highmem page, if any */ - unsigned int offset; /* for highmem, page offset */ + struct page *page; /* buffer page */ + unsigned int offset; /* buffer offset */ dma_addr_t dma_address; /* dma address */ unsigned int length; /* length */ char *__address; /* for set_dma_addr */ diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h index 0317b2f8876a..72f791154a42 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-i386/floppy.h @@ -216,7 +216,7 @@ static void _fd_chose_dma_mode(char *addr, unsigned long size) { if(can_use_virtual_dma == 2) { if((unsigned int) addr >= (unsigned int) high_memory || - virt_to_bus(addr) >= 0x1000000 || + isa_virt_to_bus(addr) >= 0x1000000 || _CROSS_64KB(addr, size, 0)) use_virtual_dma = 1; else @@ -252,7 +252,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io) doing_pdma = 0; clear_dma_ff(FLOPPY_DMA); set_dma_mode(FLOPPY_DMA,mode); - set_dma_addr(FLOPPY_DMA,virt_to_bus(addr)); + set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr)); set_dma_count(FLOPPY_DMA,size); enable_dma(FLOPPY_DMA); return 0; diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index a140326a5990..d443efbd91e6 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h @@ -95,11 +95,20 @@ static inline void * ioremap_nocache (unsigned long offset, unsigned long size) extern void iounmap(void *addr); /* - * IO bus memory addresses are also 1:1 with the physical address + * ISA I/O bus memory addresses are 1:1 with the physical address. */ -#define virt_to_bus virt_to_phys -#define bus_to_virt phys_to_virt -#define page_to_bus page_to_phys +#define isa_virt_to_bus virt_to_phys +#define isa_page_to_bus page_to_phys +#define isa_bus_to_virt phys_to_virt + +/* + * However PCI ones are not necessarily 1:1 and therefore these interfaces + * are forbidden in portable PCI drivers. + */ +extern unsigned long virt_to_bus_not_defined_use_pci_map(volatile void *addr); +#define virt_to_bus virt_to_bus_not_defined_use_pci_map +extern unsigned long bus_to_virt_not_defined_use_pci_map(volatile void *addr); +#define bus_to_virt bus_to_virt_not_defined_use_pci_map /* * readX/writeX() are used to access memory mapped devices. On some diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index 8dd935d389b7..10df65b20e4e 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h @@ -75,7 +75,7 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, if (direction == PCI_DMA_NONE) BUG(); flush_write_buffers(); - return virt_to_bus(ptr); + return virt_to_phys(ptr); } /* Unmap a single streaming mode DMA translation. The dma_addr and size @@ -144,22 +144,14 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, if (direction == PCI_DMA_NONE) BUG(); - - /* - * temporary 2.4 hack - */ - for (i = 0; i < nents; i++ ) { - if (sg[i].address && sg[i].page) - BUG(); - else if (!sg[i].address && !sg[i].page) - BUG(); - - if (sg[i].address) - sg[i].dma_address = virt_to_bus(sg[i].address); - else - sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; - } - + + for (i = 0; i < nents; i++ ) { + if (!sg[i].page) + BUG(); + + sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; + } + flush_write_buffers(); return nents; } @@ -233,7 +225,7 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) static __inline__ dma64_addr_t pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction) { - return ((dma64_addr_t) page_to_bus(page) + + return ((dma64_addr_t) page_to_phys(page) + (dma64_addr_t) offset); } diff --git a/include/asm-i386/scatterlist.h b/include/asm-i386/scatterlist.h index 9e2614f232f1..b238c8d0b096 100644 --- a/include/asm-i386/scatterlist.h +++ b/include/asm-i386/scatterlist.h @@ -2,13 +2,10 @@ #define _I386_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to, NULL for - * highmem page */ - struct page * page; /* Location for highmem page, if any */ - unsigned int offset;/* for highmem, page offset */ - - dma_addr_t dma_address; - unsigned int length; + struct page *page; + unsigned int offset; + dma_addr_t dma_address; + unsigned int length; }; #define ISA_DMA_THRESHOLD (0x00ffffff) diff --git a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h index 8ab328670e7a..76e9c5ec8985 100644 --- a/include/asm-ia64/scatterlist.h +++ b/include/asm-ia64/scatterlist.h @@ -7,8 +7,6 @@ */ struct scatterlist { - /* This will disappear in 2.5.x: */ - char *address; /* location data is to be transferred to, NULL for highmem page */ char *orig_address; /* for use by swiotlb */ /* These two are only valid if ADDRESS member of this struct is NULL. */ diff --git a/include/asm-m68k/scatterlist.h b/include/asm-m68k/scatterlist.h index f7eeb77f16d9..2a7bfa44832f 100644 --- a/include/asm-m68k/scatterlist.h +++ b/include/asm-m68k/scatterlist.h @@ -2,7 +2,8 @@ #define _M68K_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + struct page *page; + unsigned int offset; unsigned int length; unsigned long dvma_address; }; diff --git a/include/asm-mips/scatterlist.h b/include/asm-mips/scatterlist.h index ca4ff3032fb6..861c2247f921 100644 --- a/include/asm-mips/scatterlist.h +++ b/include/asm-mips/scatterlist.h @@ -2,7 +2,8 @@ #define __ASM_MIPS_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + struct page *page; + unsigned int offset; unsigned int length; __u32 dvma_address; diff --git a/include/asm-mips64/scatterlist.h b/include/asm-mips64/scatterlist.h index a8dc98fe8bff..67353a180d76 100644 --- a/include/asm-mips64/scatterlist.h +++ b/include/asm-mips64/scatterlist.h @@ -2,7 +2,8 @@ #define __ASM_MIPS64_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + struct page *page; + unsigned int offset; unsigned int length; __u32 dvma_address; diff --git a/include/asm-parisc/scatterlist.h b/include/asm-parisc/scatterlist.h index 9ebf3172b3bd..0d7812764d79 100644 --- a/include/asm-parisc/scatterlist.h +++ b/include/asm-parisc/scatterlist.h @@ -2,7 +2,8 @@ #define _ASM_PARISC_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + struct page *page; + unsigned int offset; unsigned int length; /* an IOVA can be 64-bits on some PA-Risc platforms. */ diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index e73971cb52b1..7a28e8bad5ac 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -157,15 +157,10 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, * temporary 2.4 hack */ for (i = 0; i < nents; i++) { - if (sg[i].address && sg[i].page) - BUG(); - else if (!sg[i].address && !sg[i].page) + if (!sg[i].page) BUG(); - if (sg[i].address) - sg[i].dma_address = virt_to_bus(sg[i].address); - else - sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; + sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; } return nents; diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h index 392e89778e78..80be401b513f 100644 --- a/include/asm-ppc/scatterlist.h +++ b/include/asm-ppc/scatterlist.h @@ -8,10 +8,8 @@ #include <asm/dma.h> struct scatterlist { - char *address; /* Location data is to be transferred to, - * or NULL for highmem page */ - struct page * page; /* Location for highmem page, if any */ - unsigned int offset; /* for highmem, page offset */ + struct page * page; + unsigned int offset; dma_addr_t dma_address; /* phys/bus dma address */ unsigned int length; /* length */ diff --git a/include/asm-s390/scatterlist.h b/include/asm-s390/scatterlist.h index 7d1276c455f9..114ceaf5338f 100644 --- a/include/asm-s390/scatterlist.h +++ b/include/asm-s390/scatterlist.h @@ -2,7 +2,8 @@ #define _ASMS390X_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + struct page *page; + unsigned int offset; unsigned int length; }; diff --git a/include/asm-s390x/scatterlist.h b/include/asm-s390x/scatterlist.h index 7d1276c455f9..114ceaf5338f 100644 --- a/include/asm-s390x/scatterlist.h +++ b/include/asm-s390x/scatterlist.h @@ -2,7 +2,8 @@ #define _ASMS390X_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + struct page *page; + unsigned int offset; unsigned int length; }; diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h index fba443e92df7..d580d57aad0b 100644 --- a/include/asm-sh/pci.h +++ b/include/asm-sh/pci.h @@ -149,7 +149,7 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int i; for (i=0; i<nents; i++) - dma_cache_wback_inv(sg[i].address, sg[i].length); + dma_cache_wback_inv(page_address(sg[i].page) + sg[i].offset, sg[i].length); #endif if (direction == PCI_DMA_NONE) BUG(); @@ -206,7 +206,7 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev, int i; for (i=0; i<nelems; i++) - dma_cache_wback_inv(sg[i].address, sg[i].length); + dma_cache_wback_inv(page_address(sg[i].page) + sg[i].offset, sg[i].length); #endif } diff --git a/include/asm-sh/scatterlist.h b/include/asm-sh/scatterlist.h index d67ab413e33d..7b91df140022 100644 --- a/include/asm-sh/scatterlist.h +++ b/include/asm-sh/scatterlist.h @@ -2,8 +2,6 @@ #define __ASM_SH_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to, NULL for - * highmem page */ struct page * page; /* Location for highmem page, if any */ unsigned int offset;/* for highmem, page offset */ dma_addr_t dma_address; diff --git a/include/asm-sparc/scatterlist.h b/include/asm-sparc/scatterlist.h index 4d737d7c9f5a..a4fcf9ac9649 100644 --- a/include/asm-sparc/scatterlist.h +++ b/include/asm-sparc/scatterlist.h @@ -1,16 +1,10 @@ -/* $Id: scatterlist.h,v 1.7 2001/10/30 04:34:57 davem Exp $ */ +/* $Id: scatterlist.h,v 1.8 2001/12/17 07:05:15 davem Exp $ */ #ifndef _SPARC_SCATTERLIST_H #define _SPARC_SCATTERLIST_H #include <linux/types.h> struct scatterlist { - /* This will disappear in 2.5.x */ - char *address; - - /* These two are only valid if ADDRESS member of this - * struct is NULL. - */ struct page *page; unsigned int offset; diff --git a/include/asm-sparc64/scatterlist.h b/include/asm-sparc64/scatterlist.h index 6c917944e424..ec4f3c63fe98 100644 --- a/include/asm-sparc64/scatterlist.h +++ b/include/asm-sparc64/scatterlist.h @@ -1,23 +1,17 @@ -/* $Id: scatterlist.h,v 1.10 2001/10/09 02:24:35 davem Exp $ */ +/* $Id: scatterlist.h,v 1.11 2001/12/17 07:05:15 davem Exp $ */ #ifndef _SPARC64_SCATTERLIST_H #define _SPARC64_SCATTERLIST_H #include <asm/page.h> struct scatterlist { - /* This will disappear in 2.5.x */ - char *address; + struct page *page; + unsigned int offset; - /* These two are only valid if ADDRESS member of this - * struct is NULL. - */ - struct page *page; - unsigned int offset; + unsigned int length; - unsigned int length; - - dma_addr_t dma_address; - __u32 dma_length; + dma_addr_t dma_address; + __u32 dma_length; }; #define sg_dma_address(sg) ((sg)->dma_address) |
