diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2010-05-26 17:44:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:55 -0400 |
commit | 7676679f659ac0112cad02789eb5560da2814e56 (patch) | |
tree | e4a5e618b6a2c105e38f89dc445c5ac7b332ccc2 /arch/mn10300 | |
parent | 3e6e3da8d5eafb5f849a14272ed725f85bed5dc8 (diff) |
mn10300: use asm-generic/scatterlist.h
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/include/asm/scatterlist.h | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/arch/mn10300/include/asm/scatterlist.h b/arch/mn10300/include/asm/scatterlist.h index 67535901b9ff..7bd00b9e030d 100644 --- a/arch/mn10300/include/asm/scatterlist.h +++ b/arch/mn10300/include/asm/scatterlist.h | |||
@@ -11,45 +11,8 @@ | |||
11 | #ifndef _ASM_SCATTERLIST_H | 11 | #ifndef _ASM_SCATTERLIST_H |
12 | #define _ASM_SCATTERLIST_H | 12 | #define _ASM_SCATTERLIST_H |
13 | 13 | ||
14 | #include <asm/types.h> | 14 | #include <asm-generic/scatterlist.h> |
15 | |||
16 | /* | ||
17 | * Drivers must set either ->address or (preferred) page and ->offset | ||
18 | * to indicate where data must be transferred to/from. | ||
19 | * | ||
20 | * Using page is recommended since it handles highmem data as well as | ||
21 | * low mem. ->address is restricted to data which has a virtual mapping, and | ||
22 | * it will go away in the future. Updating to page can be automated very | ||
23 | * easily -- something like | ||
24 | * | ||
25 | * sg->address = some_ptr; | ||
26 | * | ||
27 | * can be rewritten as | ||
28 | * | ||
29 | * sg_set_page(virt_to_page(some_ptr)); | ||
30 | * sg->offset = (unsigned long) some_ptr & ~PAGE_MASK; | ||
31 | * | ||
32 | * and that's it. There's no excuse for not highmem enabling YOUR driver. /jens | ||
33 | */ | ||
34 | struct scatterlist { | ||
35 | #ifdef CONFIG_DEBUG_SG | ||
36 | unsigned long sg_magic; | ||
37 | #endif | ||
38 | unsigned long page_link; | ||
39 | unsigned int offset; /* for highmem, page offset */ | ||
40 | dma_addr_t dma_address; | ||
41 | unsigned int length; | ||
42 | }; | ||
43 | 15 | ||
44 | #define ISA_DMA_THRESHOLD (0x00ffffff) | 16 | #define ISA_DMA_THRESHOLD (0x00ffffff) |
45 | 17 | ||
46 | /* | ||
47 | * These macros should be used after a pci_map_sg call has been done | ||
48 | * to get bus addresses of each of the SG entries and their lengths. | ||
49 | * You should only work with the number of sg entries pci_map_sg | ||
50 | * returns. | ||
51 | */ | ||
52 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
53 | #define sg_dma_len(sg) ((sg)->length) | ||
54 | |||
55 | #endif /* _ASM_SCATTERLIST_H */ | 18 | #endif /* _ASM_SCATTERLIST_H */ |