diff options
author | James Bottomley <James.Bottomley@SteelEye.com> | 2007-10-16 04:23:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:50 -0400 |
commit | 32e8f70230c0c417490787b3f48b6ed6c48e7ec9 (patch) | |
tree | 54ef9f6c8960ab2a9634d0d82d69d6049bc6f3fb /include/linux/dma-mapping.h | |
parent | 64da82efae0d7b5f7c478021840fd329f76d965d (diff) |
introduce DMA_MASK_NONE as a signal for unable to do DMA
Some devices are incapable of DMA and need to be recognised as such.
Introduce a NONE dma mask to facilitate this plus an inline function:
is_device_dma_capable() to check this.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Natalie Protasevich <protasnb@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2dc21cbeb304..0ebfafbd338c 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -24,6 +24,8 @@ enum dma_data_direction { | |||
24 | #define DMA_28BIT_MASK 0x000000000fffffffULL | 24 | #define DMA_28BIT_MASK 0x000000000fffffffULL |
25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL | 25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL |
26 | 26 | ||
27 | #define DMA_MASK_NONE 0x0ULL | ||
28 | |||
27 | static inline int valid_dma_direction(int dma_direction) | 29 | static inline int valid_dma_direction(int dma_direction) |
28 | { | 30 | { |
29 | return ((dma_direction == DMA_BIDIRECTIONAL) || | 31 | return ((dma_direction == DMA_BIDIRECTIONAL) || |
@@ -31,6 +33,11 @@ static inline int valid_dma_direction(int dma_direction) | |||
31 | (dma_direction == DMA_FROM_DEVICE)); | 33 | (dma_direction == DMA_FROM_DEVICE)); |
32 | } | 34 | } |
33 | 35 | ||
36 | static inline int is_device_dma_capable(struct device *dev) | ||
37 | { | ||
38 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; | ||
39 | } | ||
40 | |||
34 | #ifdef CONFIG_HAS_DMA | 41 | #ifdef CONFIG_HAS_DMA |
35 | #include <asm/dma-mapping.h> | 42 | #include <asm/dma-mapping.h> |
36 | #else | 43 | #else |