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> |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 8 | #include <linux/dma-debug.h> |
| 9 | #include <linux/io.h> |
| 10 | |
| 11 | #define DMA_ERROR_CODE (~(dma_addr_t) 0x0) |
| 12 | |
Bart Van Assche | 5299709 | 2017-01-20 13:04:01 -0800 | [diff] [blame] | 13 | extern const struct dma_map_ops s390_pci_dma_ops; |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 14 | |
Bart Van Assche | 815dd18 | 2017-01-20 13:04:04 -0800 | [diff] [blame^] | 15 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 16 | { |
Christian Borntraeger | e82becfc | 2016-02-02 21:46:34 -0800 | [diff] [blame] | 17 | return &dma_noop_ops; |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 18 | } |
| 19 | |
Heiko Carstens | e978948 | 2013-01-30 14:16:02 +0100 | [diff] [blame] | 20 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
| 21 | enum dma_data_direction direction) |
| 22 | { |
| 23 | } |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 24 | |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 25 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
| 26 | { |
| 27 | if (!dev->dma_mask) |
Joe Perches | 1c6e4b1 | 2015-03-30 16:46:05 -0700 | [diff] [blame] | 28 | return false; |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 29 | return addr + size - 1 <= *dev->dma_mask; |
| 30 | } |
| 31 | |
Jan Glauber | 828b35f | 2012-11-29 14:33:30 +0100 | [diff] [blame] | 32 | #endif /* _ASM_S390_DMA_MAPPING_H */ |