blob: 3108b8dbe266a52c145f7b03fd5ad9ece5bb83b2 [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>
Jan Glauber828b35f2012-11-29 14:33:30 +01008#include <linux/dma-debug.h>
9#include <linux/io.h>
10
11#define DMA_ERROR_CODE (~(dma_addr_t) 0x0)
12
Bart Van Assche52997092017-01-20 13:04:01 -080013extern const struct dma_map_ops s390_pci_dma_ops;
Jan Glauber828b35f2012-11-29 14:33:30 +010014
Bart Van Assche815dd182017-01-20 13:04:04 -080015static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
Jan Glauber828b35f2012-11-29 14:33:30 +010016{
Christian Borntraegere82becfc2016-02-02 21:46:34 -080017 return &dma_noop_ops;
Jan Glauber828b35f2012-11-29 14:33:30 +010018}
19
Heiko Carstense9789482013-01-30 14:16:02 +010020static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
21 enum dma_data_direction direction)
22{
23}
Jan Glauber828b35f2012-11-29 14:33:30 +010024
Jan Glauber828b35f2012-11-29 14:33:30 +010025static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
26{
27 if (!dev->dma_mask)
Joe Perches1c6e4b12015-03-30 16:46:05 -070028 return false;
Jan Glauber828b35f2012-11-29 14:33:30 +010029 return addr + size - 1 <= *dev->dma_mask;
30}
31
Jan Glauber828b35f2012-11-29 14:33:30 +010032#endif /* _ASM_S390_DMA_MAPPING_H */