Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 1 | #ifndef _ASM_S390_DMA_MAPPING_H |
| 2 | #define _ASM_S390_DMA_MAPPING_H |
| 3 | |
| 4 | #include <linux/kernel.h> |
| 5 | #include <linux/types.h> |
| 6 | #include <linux/mm.h> |
| 7 | #include <linux/scatterlist.h> |
| 8 | #include <linux/dma-attrs.h> |
| 9 | #include <linux/dma-debug.h> |
| 10 | #include <linux/io.h> |
| 11 | |
| 12 | #define DMA_ERROR_CODE (~(dma_addr_t) 0x0) |
| 13 | |
| 14 | extern struct dma_map_ops s390_dma_ops; |
| 15 | |
| 16 | static inline struct dma_map_ops *get_dma_ops(struct device *dev) |
| 17 | { |
| 18 | return &s390_dma_ops; |
| 19 | } |
| 20 | |
Heiko Carstens | e978948 | 2013-01-30 14:16:02 +0100 | [diff] [blame] | 21 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
| 22 | enum dma_data_direction direction) |
| 23 | { |
| 24 | } |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 25 | |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 26 | #include <asm-generic/dma-mapping-common.h> |
| 27 | |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 28 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
| 29 | { |
| 30 | if (!dev->dma_mask) |
Joe Perches | 1c6e4b1 | 2015-03-30 16:46:05 -0700 | [diff] [blame] | 31 | return false; |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 32 | return addr + size - 1 <= *dev->dma_mask; |
| 33 | } |
| 34 | |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 35 | #endif /* _ASM_S390_DMA_MAPPING_H */ |