blob: 1f42489797da2aeffc5eb9152f40b565996cd2cd [file] [log] [blame]
Jan Glauber828b35f2012-11-29 14:33:30 +01001#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
14extern struct dma_map_ops s390_dma_ops;
15
16static inline struct dma_map_ops *get_dma_ops(struct device *dev)
17{
18 return &s390_dma_ops;
19}
20
21extern int dma_set_mask(struct device *dev, u64 mask);
Heiko Carstense9789482013-01-30 14:16:02 +010022
23static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
24 enum dma_data_direction direction)
25{
26}
Jan Glauber828b35f2012-11-29 14:33:30 +010027
Jan Glauber828b35f2012-11-29 14:33:30 +010028#include <asm-generic/dma-mapping-common.h>
29
Jan Glauber828b35f2012-11-29 14:33:30 +010030static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
31{
32 if (!dev->dma_mask)
Joe Perches1c6e4b12015-03-30 16:46:05 -070033 return false;
Jan Glauber828b35f2012-11-29 14:33:30 +010034 return addr + size - 1 <= *dev->dma_mask;
35}
36
Jan Glauber828b35f2012-11-29 14:33:30 +010037#endif /* _ASM_S390_DMA_MAPPING_H */